speed up RViz/MoveIt
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:
- 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 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)