How to use MoveIt2 without ros2_control
Hi all! At our company we are trying to use MoveIt2 (MoveGroupInteface
) to plan trajectories for our robots. As of now, we are not using ros2control to communicate with the real hardware, and hence we don't use jointstatebroadcaster to publish joint states. Instead, we are publishing them from our own ros2 node. This seems to break fcl collision check and we often get messages like the following:
```
[moveitcollisiondetectionfcl.collisioncommon]: Found a contact between 'link1' (type 'Robot link') and 'link2' (type 'Robot link'), which constitutes a collision. Contact information is not stored.
``
Even though the srdf disables collisions between these links. This seems to happen only when a planning scene is published. Trying with several options, again, it seems that if the planning scene is published using a publisher of
PlanningScene` message to the /planningscene topic, this error happens. Instead, if PlanningSceneInterface
is used with the method addCollisionObjects
, the planning is successful.
In general, the documentation or the tutorials explain only the case in which ros2control is used to publish joint states. We seem to have understood that this problem has something to do with getting properly the state of the robot. However, it is not entirely clear and we believe it would be interesting to understand how to keep MoveIt2 planning independent from ros2control while publishing joint states on our own. What are the specifications that such a joint state publisher should meet in order to work with MoveIt2?
Our environment
- ROS Distro: Humble
- OS Version: Ubuntu 22.04
- Docker Image: ykrobotics/humble-dev
Steps to reproduce
To reproduce the issue, we have prepared a working demo.
- Clone the repo and open in container.
- In a terminal, run
ros2 launch moveit_debug demo.launch.py
- Then, in a separate terminal
ros2 launch moveit_debug collision.launch.py
Lines 100 or 101 of src/moveit_collision.cpp
can be commented to try publishing planning scene through a classic publisher or PlanningSceneInterface
.
Expected behaviour
The planning produced valid trajectories and are "executed" in RViz.
Actual behaviour
When publishing using a publisher to the /planning_scene
topic, unexpected collisions are found. This is not the case when using planning_scene_interface.addCollisionObjects(collision_objects);
.
We believe this is quite a common and important issue, which is not receiving the deserved interest from the community.
Asked by dhindhimathai on 2023-06-27 04:24:55 UTC
Answers
Hello
The issue you described may be related to how MoveIt2 obtains and maintains the state of the robot. When using your own joint state publisher, there are certain specifications it should meet in order to work effectively with MoveIt2. It's important to ensure that the joint states are published accurately and consistently, reflecting the actual state of the robot. Additionally, you may need to synchronize the timing of the joint state publication with other components of MoveIt2, such as the collision checking algorithm. Further investigation and experimentation may be required to understand and address the specific problem you are encountering.
Asked by gregbowers on 2023-06-27 06:13:54 UTC
Comments
This answer seems to be generated by a Large Language Model... -_- If not, could you please provide more specific explanation and details?
Asked by dhindhimathai on 2023-06-27 08:44:57 UTC
Comments