Moveit servo how to update the scene
Hi all,
I have an arm that has to track continuosly some given poses. What I usually did is to use a PID to generate Cartesian velocities from the target poses and then IK to command the robot joints.
I would like to do this with Moveit (ROS1 Noetic) to exploit its features (mainly obstacle avoidance). I managed to set up my robot from the moveit tutorials and I can use move_group
to plan and execute a collision free trajectory.
Now I was trying to follow the moveit servo tutorial, in particular I saw the pose tracking example which seems the right one for my needs. But I have problems about something:
In the servo tutorial, the
move_group
node is launched, as well the servo_server. Why are they both necessary? Do not they command the sameros_controllers
?I cannot update the arm status within the pose tracking node. In particular, the arm is starting in a homing position, but this node sees all the joints positions to zero, even if the
PlanningSceneMonitor
is active. The node is subscribed correctly to thejoint_states
topic which is filled with the correct joint values.
When I used themove_group
node (without servo) the status was correctly syncronized. How the scene is kept updated in themove_group
node?
Nobody in both cases publishes on theplanning_scene
topic. Should I use this? I saw thatmove_group
internally usesmoveit_cpp
. Should I use it in thepose_tracking
node as well?
Thanks for any help :D
Asked by torydebra on 2023-05-28 06:07:23 UTC
Answers
Disclaimer: I haven't used moveit_server, but I read the links you provided.
Why are they both necessary? Do not they command the same ros_controllers?
moveit
and move_group
are modular pieces of software. If you are careful, you can use some functionality without using other functionality. The demo you link to is not using the trajectory-planning or trajectory-execution portions of move_group, but it is using the planning-scene feature for collision detection.
In this demo, it looks to me like it is some outside code's responsibility to populate the planning-scene with obstacles, and update the obstacles if they move around. You will need to figure out how that happens.
It is your code's responsibility to generate the next cartesian coordinate (target_pose
) that servo needs as input.
I didn't look inside servo code, but I assume that it will frequently ask the planning-scene if the arm is in collision (or close to collision), and stop the motion if the answer is "yes". It's not clear how your code learns that the arm can't reach the target_pose
you specified (maybe you can call some method of servo?) It is then up to your code to provide a different target_pose
to servo. I see no code in this demo that does re-planning for you.
Asked by Mike Scheutzow on 2023-05-28 09:57:16 UTC
Comments