Set time step in MoveIt trajectories

asked 2020-04-21 17:39:13 -0500

MatteoL95 gravatar image

Hi to everyone, I'm writing my first script on python to command Franka Emika Panda arm.

Mine configuration is: ROS Melodic, Gazebo 9, Ubuntu 18.04LTS.

I'm starting by move_group_python_interface.py (http://docs.ros.org/kinetic/api/movei...) and I'm using the function "go_to_joint_state()" to move my robot but I'm looking for a solution that can allow me to set a prefixed integration step (time deltas or dt). At the moment I modified the "go_to_joint_state()" function with the following code:

*for i in range(0, 600):
    #move_group.set_planning_time(0.005)      [this function can help me??]
    joint_goal[0] = joint_goal[0] + 0.002618
    move_group.go(joint_goal, wait=True)*

I want to rotate the joint0 of 90 degrees in 3sec with dt=0.005sec=5ms. For this reason I have 600 step (3sec = 3000ms -> 3000ms/5ms = 600 step). The 0.002618(rad) value is the result of 90 degrees = 1.5708 rad -> 1.5708 rad/600 step = 0.002618 rad.

Someone can help me to set the dt value in the correct way? At the moment I can only manage the increments equal to each iteration but I cannot intervene on the time (time deltas) that the system will take to move the joint0.

edit retag flag offensive close merge delete

Comments

I'm not going to say you shouldn't do this, but it seems like a strange thing to do with MoveIt.

MoveIt is not a low-level trajectory generator, but a fully fledged, free-space motion planner (with support for multiple planners) and on-line collision avoidance and motion optimisation functionality built-in. Asking it to generate tiny trajectories of 5ms length each seems like a mismatch with what it normally does and I'm not surprised that would lead you to not be able anything about doing this.

Your use of move_group.go(..) in a for loop reminded me of #q261368. That's not exactly the same situation or use-case, but I believe it touches upon similar points.

I'm looking for a solution that can allow me to set a prefixed integration step

perhaps you can tell us why you want to do this, as this is not normally the responsibility ...(more)

gvdhoorn gravatar image gvdhoorn  ( 2020-04-22 04:17:18 -0500 )edit

I am writing a university thesis project and my professor wants that in the simulation the robot performs a rotation of the joint0 of 90 ° and the simulator must do this in 3 seconds and I must set the new waypoint every 5ms. I must also assign, within the cycle, a position and a speed calculated on the basis of the polynomial function but for now I'm trying a configuration with constant position increase and constant speed. Can you advise me one way to write a code as I am asked? I mean with position and speed assignment based on the polynomial function and setting of time deltas at 5ms. I know that maybe I ask a lot but I'm new to ROS and simulation and online I still haven't been able to find anything interesting besides the tutorial I linked previously.

MatteoL95 gravatar image MatteoL95  ( 2020-04-22 17:05:44 -0500 )edit

I'm sorry, but I don't understand enough of your assignment to recommend anything.

It does sound more like you are doing something which I would associate with Control Engineering. If that is the case, and you're supposed to write a controller which takes a robot joint from current state to a setpoint while running at a certain frequency then MoveIt is not what you want to use.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-23 05:15:01 -0500 )edit