ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

move_group.plan() and the MoveJ command are not the same. MoveJ moves directly to the target in joint space (PTP motion), while move_group.plan() submits a planning request to whichever planning plugin is connected to MoveIt. The default planning plugin is sampling-based (RRTConnect in OMPL), but when there are no obstacles, it returns a direct motion in joint space just like MoveJ, which is probably the source of your confusion. If there are obstacles, the result of move_group.plan() can be very different from MoveJ.

If you want to plan motions like MoveJ (linear in joint space/configuration space) and MoveL (linear in cartesian space), you can use the pilz_industrial_motion_planner plugin which was recently merged into MoveIt. It has not been backported to melodic yet, so you would need to build MoveIt from source. I suggest using an underlay workspace (more details) with MoveIt inside to alleviate build time.

If you send a PTP motion planning request to the pilz_industrial_motion_planner plugin and the plan succeeds, then moving your robot with the MoveJ command to the same target should be safe (if you represented your whole scene correctly and did not make mistakes).

In theory you could also çreate your own RobotTrajectory by linearly interpolating the joint poses between your start and goal and then check if the path is valid, but I would use the industrial motion planning plugin as described above, to avoid duplicating work. Using PTP/LIN/CIRC motions in MoveIt should soon become a lot easier.