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

How to decrease the speed of my robot?

asked 2021-04-15 03:19:39 -0600

Ranjit Kathiriya gravatar image

updated 2022-04-30 13:24:06 -0600

lucasw gravatar image

Hello there,

I am not able to decrease the speed of my real robot. If I am decreasing the speed from RVIZ by setting Velecoty Scaling and Accel Scaling then it is working fine. If I am giving the robot a trajectory from python code then it very fast does anyone have an idea of how can I be able to solve this issue?

I have tried few things:

  1. By using set_max_velocity_scaling_factor and set_max_acceleration_scaling_factor function as maintained in following post.

    move_group = moveit_commander.MoveGroupCommander(group_name) move_group.set_max_velocity_scaling_factor(0.01) move_group.set_max_acceleration_scaling_factor(0.01)

  2. I have updated default_velocity_scaling_factor and default_acceleration_scaling_factor to 0.01 in joint_limits.yaml file.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-04-15 04:44:28 -0600

crnewton gravatar image

updated 2021-05-31 04:21:23 -0600

in case of computeCartesianPath(..) there is no support for scaling velocities/accelerations. You can control the speed by using retime_trajectory(..):

        waypoints = getMyWaypoints()

        (plan, fraction) = group.compute_cartesian_path(
            waypoints,
            0.01,
            0.0
        )
        plan = group.retime_trajectory(moveit_commander.RobotCommander().get_current_state(), 
                                       plan, 
                                       velocity_scaling_factor)
        group.execute(plan, wait=True)
edit flag offensive delete link more

Comments

Thanks! it works

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2021-04-15 05:04:04 -0600 )edit
1

moveit_robot_state = moveit_commander.RobotCommander().get_current_state()

lorepieri gravatar image lorepieri  ( 2021-05-27 06:46:13 -0600 )edit
1

Also speed is actually the speed scaling factor.

lorepieri gravatar image lorepieri  ( 2021-05-27 06:48:44 -0600 )edit

Updated my answer to be more generic. as @lorepieri commented.

crnewton gravatar image crnewton  ( 2021-05-31 04:22:01 -0600 )edit

Hi, do you know how to implement this in c++? I looked into the MoveGroupInterface class here here but couldn't find a retime_trajectory function

robra gravatar image robra  ( 2023-02-28 05:18:13 -0600 )edit

retime_trajectory is only available in rospy, no corresponding function in cpp

Jiang Zizhen gravatar image Jiang Zizhen  ( 2023-04-18 20:12:51 -0600 )edit

Thanks, but just for reference, time parameterization can be implemented in c++ using the corresponding classes here and therefore the retime_trajectory is not needed in c++

robra gravatar image robra  ( 2023-04-19 03:55:16 -0600 )edit

hi, how to use it, could you please give a template code!

Jiang Zizhen gravatar image Jiang Zizhen  ( 2023-04-19 04:23:51 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2021-04-15 03:19:39 -0600

Seen: 1,106 times

Last updated: May 31 '21