Skip to content

Commit 9789316

Browse files
Add CHOMP Path Planning and xarm_ros Guide articles (#208)
- Added CHOMP Path Planning for xArm in ROS article. - Added xarm_ros Guide for ROS 1 integration. - Fixed navigation and index links. - Standardized filenames, formatting, and notice styles. --------- Co-authored-by: Nevin Valsaraj <nevin.valsaraj32@gmail.com>
1 parent f59484d commit 9789316

5 files changed

Lines changed: 211 additions & 2 deletions

File tree

_data/navigation.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ wiki:
406406
url: /wiki/tools/code-editors-Introduction-to-vs-code-and-vim/
407407
- title: Qtcreator UI development with ROS
408408
url: /wiki/tools/Qtcreator-ros/
409+
- title: xarm_ros Guide
410+
url: /wiki/tools/xarm-ros-guide/
409411
- title: ROS2 Humble Intra-Process Communication Recorder
410412
url: /wiki/tools/ros2-humble-ipc-recorder/
411413
- title: Datasets
@@ -438,6 +440,8 @@ wiki:
438440
url: /wiki/planning/frenet-frame-planning/
439441
- title: Move Base Flex
440442
url: /wiki/planning/move-base-flex/
443+
- title: CHOMP Path Planning
444+
url: /wiki/planning/chomp-planning/
441445
- title: Google Linear Optimization Package (GLOP)
442446
url: /wiki/planning/glop/
443447
- title: Advanced MoveIt usage for Manipulator Motion Planning

wiki/planning/chomp-planning.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
date: 2025-04-30
3+
title: CHOMP Path Planning for xArm in ROS
4+
---
5+
6+
CHOMP (Covariant Hamiltonian Optimization for Motion Planning) is a powerful trajectory optimization algorithm that is well-suited for smooth, continuous path planning in robotic manipulators. In the `xarm_ros` framework, CHOMP serves as a plugin within MoveIt! to optimize planned trajectories for xArm robots. It minimizes a cost function that penalizes collisions and trajectory acceleration, allowing for fluid, human-like movements. This article explains how CHOMP works, how it is used in `xarm_ros`, and the practical dos and don'ts when configuring or deploying it.
7+
8+
This article will help you understand the internals of CHOMP, how to enable and configure it for xArm in a MoveIt! planning context, and how to troubleshoot or tune it for improved performance. It is intended for intermediate ROS users who are integrating motion planning with industrial robotic arms.
9+
10+
## Introduction to CHOMP
11+
12+
CHOMP is a trajectory optimization-based planner introduced as an alternative to sampling-based methods like RRT and PRM. While sampling-based methods are probabilistically complete and effective in high-dimensional configuration spaces, they often yield jerky or suboptimal trajectories. CHOMP addresses this by performing gradient-based optimization over an initial trajectory to minimize a cost function that balances smoothness and obstacle avoidance.
13+
14+
In `xarm_ros`, CHOMP can be selected as the motion planner within the MoveIt! planning pipeline. It operates in continuous space and iteratively refines trajectories by considering velocity and acceleration costs, as well as signed distance fields from the planning scene.
15+
16+
### How CHOMP Works
17+
18+
At its core, CHOMP minimizes a functional:
19+
$$
20+
\mathcal{F}(\xi) = \mathcal{F}_{\text{smooth}}(\xi) + \lambda \mathcal{F}_{\text{obstacle}}(\xi)
21+
$$
22+
Where:
23+
- $\mathcal{F}_{\text{smooth}}$ penalizes high accelerations,
24+
- $\mathcal{F}_{\text{obstacle}}$ penalizes configurations close to obstacles using signed distance fields (SDF),
25+
- $\lambda$ is a weighting parameter that controls the trade-off between smoothness and collision avoidance.
26+
27+
CHOMP uses precomputed gradient information and operates on a discretized version of the trajectory (a sequence of waypoints in time). The optimization iteratively updates the trajectory to reduce total cost using gradient descent.
28+
29+
### Enabling CHOMP in xarm_ros
30+
31+
In MoveIt!, CHOMP is integrated as a planning plugin. To use CHOMP in your xArm robot configuration:
32+
33+
1. Ensure `moveit_chomp_optimizer_adapter` is installed.
34+
2. Update your `chomp_planning.yaml` (usually found in your moveit_config package)
35+
3. Set CHOMP as your default planner in `moveit_config`'s launch files
36+
37+
CHOMP relies on well-defined signed distance fields. Use OctoMap or preprocessed collision geometries for reliable performance.
38+
{: .notice--info}
39+
40+
## Pros and Cons
41+
42+
**Strengths**
43+
- Produces smooth, natural paths.
44+
- Gradient-based and efficient for medium-complexity scenes.
45+
- Deterministic: same result for same input.
46+
47+
**Weaknesses**
48+
- Local optimizer: may get stuck in local minima.
49+
- Requires a good initial guess.
50+
- Computationally heavier than RRT for very high DOF or highly constrained spaces.
51+
52+
## Dos and Don’ts
53+
54+
### ✅ DOs
55+
- **Provide a valid seed trajectory**: Use a straight-line interpolation or a quick sample-based plan.
56+
- **Tune weights**: Balance between obstacle avoidance and smoothness.
57+
- **Use OctoMap or accurate collision models**: CHOMP depends on distance fields.
58+
- **Use for precision tasks**: Ideal when smooth, safe motion is critical.
59+
- **Combine with Rviz visualizations**: Observe the planned trajectory before execution.
60+
61+
### ❌ DON’Ts
62+
- **Don’t use with highly dynamic environments**: CHOMP does not replan quickly in real-time.
63+
- **Avoid poor initial guesses**: CHOMP needs a decent seed to converge well.
64+
- **Don’t ignore planning time**: Large trajectories and high-resolution scenes take time.
65+
- **Don’t expect global optimality**: CHOMP is a local method.
66+
- **Avoid using CHOMP alone for dynamic motion**: It’s not ideal for high-speed, reactive tasks.
67+
68+
## Practical Tips for Using CHOMP with xArm
69+
70+
- **Resolution**: More waypoints yield smoother results but increase compute time.
71+
- **Visualization**: Always simulate in RViz before executing on hardware.
72+
- **Hybrid planning**: Use RRTConnect to find a path, then refine with CHOMP.
73+
- **Benchmark**: Use MoveIt benchmarking tools to compare planners.
74+
- **Constraint tuning**: Avoid overly tight constraints unless absolutely necessary.
75+
76+
## Summary
77+
78+
CHOMP is a highly effective local trajectory optimizer that enhances motion planning for xArm by generating smooth and safe paths. Its deterministic and gradient-based nature makes it ideal for precision applications. However, it must be used with good initial trajectories and accurate environment models to work well. By combining CHOMP with robust environment sensing and hybrid planning strategies, it becomes a valuable tool for both industrial and research robotics.
79+
80+
## See Also:
81+
- [xarm_ros Guide](/wiki/tools/xarm-ros-guide/)
82+
- [MoveIt and HEBI Integration](/wiki/actuation/moveit-and-HEBI-integration/)
83+
- [Pure Pursuit Controller for Skid Steering](/wiki/actuation/Pure-Pursuit-Controller-for-Skid-Steering-Robot/)
84+
85+
## Further Reading
86+
- [CHOMP: Gradient Optimization Techniques for Efficient Motion Planning](https://homes.cs.washington.edu/~joschu/docs/chomp.pdf)
87+
- [MoveIt CHOMP Plugin Documentation](https://moveit.picknik.ai/humble/doc/chomp_planner/chomp_planner_tutorial.html)
88+
- [xArm GitHub Repository](https://github.com/xArm-Developer/xarm_ros)
89+
90+
## References
91+
- M. Kalakrishnan, S. Chitta, E. Theodorou, P. Pastor, and S. Schaal, “STOMP: Stochastic trajectory optimization for motion planning,” *IEEE ICRA*, 2011.
92+
- N. Ratliff, M. Zucker, J. A. Bagnell, and S. Srinivasa, “CHOMP: Gradient optimization techniques for efficient motion planning,” *IEEE ICRA*, 2009.
93+
- MoveIt! Documentation: https://moveit.picknik.ai
94+
- xArm SDK & ROS support: https://github.com/xArm-Developer/xarm_ros

wiki/planning/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ We are actively seeking contributions to expand the resources available in this
2020
- **[Behavior Trees](/wiki/planning/behavior-tree/)**
2121
Comprehensive guide to Behavior Trees for robot decision-making. Covers BT architecture vs FSM/HFSM, node types (Action, Condition, Sequence, Fallback), AirStack implementation, and ROS2 integration with hands-on tutorials.
2222

23+
- **[CHOMP Path Planning](/wiki/planning/chomp-planning/)**
24+
An optimization-based trajectory planner that produces smooth, collision-free paths for manipulators like the xArm.
25+
2326
- **[Coverage Planning Implementation Guide](/wiki/planning/coverage-planning-implementation-guide/)**
2427
Details cellular decomposition-based coverage planning methods for ensuring full area coverage. Applications include drone monitoring and robotic vacuum cleaning.
2528

wiki/tools/index.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22
date: 2017-09-13
33
title: Tools
44
---
5-
**This page is a stub.** You can help us improve it by [editing it](https://github.com/RoboticsKnowledgebase/roboticsknowledgebase.github.io).
6-
{: .notice--warning}
5+
The **Tools** section provides guides and tutorials for various software and hardware tools used in robotics development.
6+
7+
## Key Subsections
8+
9+
- **[xarm_ros Guide](/wiki/tools/xarm-ros-guide/)**
10+
A comprehensive guide for integrating and using the `xarm_ros` package with XArm manipulators in ROS.
11+

wiki/tools/xarm-ros-guide.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
date: 2025-04-30 # YYYY-MM-DD
3+
title: Using xarm_ros with XArm 7 in ROS
4+
---
5+
6+
This article covers the `xarm_ros` package, a valuable tool for controlling xArm robots using ROS 1 or ROS 2. It provides a low-friction setup for motion planning, Cartesian control, and basic manipulations. This entry explains how to integrate the package with your system, key components, and configurations to optimize usage for industrial, academic, or research tasks. Additionally, it discusses common pitfalls and configuration tips for reliable performance.
7+
8+
## Introduction
9+
10+
The `xarm_ros` package offers an easy-to-use interface for controlling the xArm 7 robot within ROS environments. By connecting directly to the hardware or a simulated robot, `xarm_ros` provides essential tools like launch files, URDF/XACRO models, and MoveIt configurations, making it easier to get started with robotics control. The goal is to minimize the complexity of setting up your robot, letting users focus on developing high-level functionalities rather than dealing with hardware details.
11+
12+
## First Steps for Using xarm_ros
13+
14+
To begin using `xarm_ros`, ensure the `xarm_sdk` is properly configured. This SDK is responsible for communicating with the xArm hardware, and proper configuration is essential for smooth operation. The `cxx` folder within the SDK contains important C++ files that must be correctly set up. You can find the files listed on the following [GitHub page](https://github.com/xArm-Developer/xArm-CPLUS-SDK/tree/30640642a40963d93c1cfad417469f6819ff882d).
15+
16+
Once the SDK is set up, you can start integrating it with ROS by installing the `xarm_ros` package.
17+
18+
## xarm_ros Directory Structure
19+
20+
The `xarm_ros` package includes several key directories:
21+
22+
1. **xarm_api**
23+
- **Purpose:** This is the core API module that facilitates communication between ROS and the xArm controller. It wraps the xArm C++ SDK into ROS services and messages.
24+
25+
2. **xarm_controller**
26+
- **Purpose:** Contains custom controllers for the xArm robots within the ROS control framework.
27+
28+
3. **xarm_description**
29+
- **Purpose:** Contains the URDF models for the xArm robots.
30+
31+
4. **xarm_gazebo**
32+
- **Purpose:** Provides Gazebo simulation capabilities for the xArm.
33+
- **Launch Command:**
34+
`roslaunch xarm_gazebo xarm[5/6/7]_gazebo.launch`
35+
36+
5. **xarm_gripper**
37+
- **Purpose:** Adds support for the xArm gripper.
38+
39+
6. **xarm_msgs**
40+
- **Purpose:** Custom ROS message and service definitions specific to xArm.
41+
42+
7. **xarm_planner**
43+
- **Purpose:** Motion planning capabilities for xArm using MoveIt.
44+
- **Launch Command:**
45+
`roslaunch xarm_planner xarm_planner.launch robot:=xarm[5/6/7]`
46+
47+
8. **xarm_vision**
48+
- **Purpose:** Provides support for vision-related functionality with xArm robots.
49+
50+
9. **xarm_moveit_config**
51+
- **Purpose:** MoveIt configuration packages for xArm robots.
52+
- **Launch Command:**
53+
`roslaunch xarm[5/6/7]_moveit_config demo.launch`
54+
55+
10. **xarm_controller**
56+
- **Purpose:** Implements `ros_controllers` for xArm.
57+
58+
## Technical Caveats and Configuration Details
59+
60+
When using the `xarm_ros` package in ROS 1, be aware of several technical caveats that could affect performance, particularly when aiming for reliable, deterministic control or robust trajectory planning.
61+
62+
### SDK and ROS Integration
63+
64+
The `xarm_sdk` serves as the hardware driver layer, and improper configuration can lead to inconsistencies in higher-level nodes like `xarm_api` and `xarm_controller`. Pay special attention to firmware versions to avoid subtle bugs, especially during trajectory streaming. Mismatches may cause the robot to halt or enter protective stop modes unexpectedly.
65+
66+
### Ethernet Configuration
67+
68+
Ensure that the correct Ethernet interface is used during the ROS launch process. Multi-interface machines or virtualized systems can sometimes cause issues, so verify your network settings with `ifconfig` or `ip link`. Ensure that the hardware MAC address aligns with the ROS parameters, and check for firewall issues that might block UDP traffic.
69+
70+
### MoveIt Configuration
71+
72+
It’s crucial to reference the correct manipulator planning group names in the `xarm_planner` and `xarm_moveit_config` packages. If MoveIt throws errors about mismatched planning groups or joint states, double-check your URDF and SRDF definitions, as well as the controller configuration YAML files in `xarm_controller`. Incorrect inertial or collision parameters in XACRO files can mislead the planning pipeline, potentially resulting in self-collisions or infeasible trajectories.
73+
74+
### Debugging and Testing
75+
76+
Test the planning scene in RViz, ensuring that planning request visualization is turned on. Use `tf_monitor` or `rqt_tf_tree` to check for discrepancies in TF frames, as delayed or missing transformations can cause issues in time-critical Cartesian control loops.
77+
78+
Ensure proper sequencing of service calls when using the `xarm_api` service interfaces. Calls to `set_mode` and `set_state` should precede executing joint or Cartesian commands. A common failure is executing `set_mode` without first setting the state to `READY`, which will result in no feedback or errors.
79+
80+
### Gripper Operations
81+
82+
For gripper operations, do not rely solely on joint state publications. The gripper controller uses internal state variables, so it's crucial to initialize the gripper via the corresponding service call to ensure proper operation.
83+
84+
### Controller Spawner Issues
85+
86+
Be cautious of hardcoded parameters in `roslaunch` files, especially in `xarm_moveit_config`. If you are dynamically generating URDFs or modifying controller configurations, ensure that you remap the relevant parameters to avoid node startup crashes or MoveIt planning failures. Additionally, reorder the launch sequence to ensure the `joint_state_publisher` starts before MoveIt to prevent stale joint data.
87+
88+
## Summary
89+
90+
The `xarm_ros` package provides an efficient and straightforward method for controlling xArm robots in ROS, but attention to configuration and sequencing is critical to avoid common pitfalls. Careful setup of the SDK, Ethernet interface, and MoveIt configurations ensures reliable performance and smooth integration.
91+
92+
## See Also:
93+
- [xArm ROS Documentation](https://github.com/xArm-Developer/xArm-ROS)
94+
- [MoveIt Documentation](https://moveit.ros.org/)
95+
96+
## Further Reading
97+
- [xArm C++ SDK GitHub](https://github.com/xArm-Developer/xArm-CPLUS-SDK)
98+
- [ROS Control Tutorials](http://wiki.ros.org/ros_control)
99+
100+
## References
101+
- [XArm ROS Package GitHub](https://github.com/xArm-Developer/xArm-ROS)
102+
- [ROS Wiki](http://wiki.ros.org/)
103+

0 commit comments

Comments
 (0)