Ask Your Question
2

speed up RViz/MoveIt

asked 2016-12-16 09:15:22 -0500

robotfan gravatar image

updated 2017-01-05 02:58:23 -0500

I am working with a KaWaDa nextage robot using rtmros_nextage and Moveit via the moveit_commander python interface like this:

rtmlaunch nextage_ros_bridge nextage_ros_bridge_simulation.launch
roslaunch nextage_moveit_config moveit_planning_execution.launch
ipython -i `rospack find nextage_ros_bridge`/script/nextage.py

Sadly the robot movements are very slow, so I am looking for a way to speed up things. I thought of several possibilities:

  1. I do not necessarily need the visualisation all the time. Can I switch off the rendering somehow while the robot keeps trying things in a mathematical simulation only?
  2. I also came across this solution which essentially tries to scale the velocity fields of RobotTrajectory, but that does not seem to be possible for me, because the velocities (or points) are tuples and thus immutable.

Is there another way to let the robot try different actions faster?

(sorry for the long tag list, I am quite new and don't know whether the solution will be robot-specific, or moveit-specific, or rospy etc... )


edit:

I also found this file containing max_velocity and max_acceleration limits.

Can I dynamically change these via rospy?


edit 2:

The code referred to as 'this solution' in 2. (might actually be a workaround rather than a solution): the following code snippet appears to alter the trajectory speed as desired (here the speed is doubled):

 traj = right_arm.plan()
 new_traj = RobotTrajectory()
 new_traj.joint_trajectory = traj.joint_trajectory
 n_joints = len(traj.joint_trajectory.joint_names)
 n_points = len(traj.joint_trajectory.points)

 spd = 2.0

 for i in range(n_points):
     traj.joint_trajectory.points[i].time_from_start = traj.joint_trajectory.points[i].time_from_start / spd
     for j in range(n_joints):
         new_traj.joint_trajectory.points[i].velocities[j] = traj.joint_trajectory.points[i].velocities[j] * spd
         new_traj.joint_trajectory.points[i].accelerations[j] = traj.joint_trajectory.points[i].accelerations[j] * spd
         new_traj.joint_trajectory.points[i].positions[j] = traj.joint_trajectory.points[i].positions[j]

 self.right_arm.execute(new_traj)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-12-16 11:02:06 -0500

130s gravatar image

updated 2017-01-04 19:24:15 -0500

I do not necessarily need the visualisation all the time. Can I switch off the rendering somehow while the robot keeps trying things in a mathematical simulation only?

I'll take a close look later today (and I'll update this answer once I can), but try running separately the launch files that are started through nextage_moveit_config/launch/moveit_planning_execution.launch; you should be able to run MoveIt! without visualization on RViz.

(sorry for the long tag list, I am quite new and don't know whether the solution will be robot-specific, or moveit-specific, or rospy etc... )

I'd say so far the issues/desires you raised seem to me pretty much robot-agnostic ;)


UPDATE 20170104

I also came across this solution which essentially tries to scale the velocity fields of RobotTrajectory, but that does not seem to be possible for me, because the velocities (or points) are tuples and thus immutable.

The thread you referred to is a bit long for me to track down...Which "solution" did you mean?

I also found this file containing max_velocity and max_acceleration limits. Can I dynamically change these via rospy?

The link to "this file" seems corrupted but I assume joint_limits.yaml. The velocity and acceleration values in that file is meant to be static and not supposed to be configurable during runtime (as Jeremy explained in the same thread you referred to earlier).

With the newest MoveIt! (for Indigo, 0.7.6), you can use scaling factor feature more conveniently than ever before. Using it through RViz is the easiest but in case visualization is not an option for you, you can also modify the topic MotionPlanRequest as explained in the same page (although I haven't figured out how...I haven't found that topic being published using nextage_moveit_config. I asked a question).

edit flag offensive delete link more

Comments

1

Indeed, it seems I can run my code without visualisation this way. Thanks! (if someone has a comment on 2., i.e. on setting velocities, I'm still interested though!)

robotfan gravatar image robotfan  ( 2016-12-19 04:39:36 -0500 )edit

thanks, I ment joint_limits.yaml. Updated the link in my question

robotfan gravatar image robotfan  ( 2017-01-05 02:58:47 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-12-16 09:15:22 -0500

Seen: 1,586 times

Last updated: Jan 05 '17