pymoveit2 icon indicating copy to clipboard operation
pymoveit2 copied to clipboard

Question about cartesian value in ex_pose_goal.py

Open Averykla opened this issue 1 year ago • 4 comments

Hi author, I need to set a pre-grasp point during the robot grasping process, and then let the robot go down vertically with the posture of the pre-grasp point after the robot reaches the pre-grasp point to grasp the object. So I set the value of cartesian in your program to true during the process of the robot moving from the pre-grasp point to the grasping point. But after my test, I found that as long as I set the value of cartesian to true, my robot will move very fast. Is there any value in the program that can constrain the Cartesian path speed?

I tried cartesian_max_step, but the effect was not obvious. In addition, I would like to ask you a question. When my robot reaches the pre-grasp point, if I continue to use the original RRT planning algorithm, the robot will execute a very complex trajectory, sometimes going around in a circle and then going down to grasp the object. What path planning should I choose from the pre-grasp point to the grasping point?

Averykla avatar Nov 22 '24 06:11 Averykla

I read this <Added setting of cartesian speed and acceleration #53>. I'm so Sorry, I don't have a deep understanding of MoveIt, so I still don't understand how to set the speed and acceleration values ​​of the Cartesian path.

Here is my part code of moveit. class GetCartesianPath_Request(metaclass=Metaclass_GetCartesianPath_Request): __slots__ = [ '_header', '_start_state', '_group_name', '_link_name', '_waypoints', '_max_step', '_jump_threshold', '_prismatic_jump_threshold', '_revolute_jump_threshold', '_avoid_collisions', '_path_constraints', ] I noticed that I don't have 'max_velocity_scaling_factor' and 'max_acceleration_scaling_factor'

OMG,I'm sorry I found my ros version is humble.So is there any way to modify the speed of a Cartesian path?

Averykla avatar Nov 22 '24 06:11 Averykla

Hello @Averykla,

You could try manually setting the max_cartesian_speed parameter when sending the action goal (not request). For that, you need to enable action-based execution via MoveIt2(use_move_group_action=True). However, I am not certain it works (PRs are welcome).

https://github.com/AndrejOrsula/pymoveit2/blob/60cc171b3b75be139411542604cdb52a9275239d/pymoveit2/moveit2.py#L2221

As for the ROS distribution (I see you are using Humble), pymoveit2 should automatically handle the naming changes introduced in Iron: https://github.com/moveit/moveit_msgs/pull/130

https://github.com/AndrejOrsula/pymoveit2/blob/60cc171b3b75be139411542604cdb52a9275239d/pymoveit2/moveit2.py#L2217-L2220

Good luck!

AndrejOrsula avatar Nov 25 '24 11:11 AndrejOrsula

Hi @AndrejOrsula , I found that modifying move_action_goal.request.max_cartesian_speed = 0.0 didn't work either. I think it's probably because class GetCartesianPath_Request in ros2 humble doesn't have speed and acceleration attributes. So, I think this may not be an easy problem.

Averykla avatar Nov 26 '24 05:11 Averykla

I checked, and you are correct. I took a quick look, but unfortunately, I didn't figure out the origin of the issue (internal/external). If you find it, please let us know. :slightly_smiling_face:

AndrejOrsula avatar Nov 27 '24 18:11 AndrejOrsula