Moveit!提供一个Python接口用于实现move_group:
import moveit_commander
在moveit_commander这个class中,预留了速度和加速度的设置:
def set_max_velocity_scaling_factor (self, value)
def set_max_velocity_scaling_factor (self, value)
作用分别是 Set a scaling factor for optionally reducing the maximum joint velocity/acceleration. Allowed values are in (0,1]. 这直接对应RVIZ里MotionPlanning–Planning–options中的Velocity Scaling 和Acceleration Scaling。
而最大的速度和加速度设置是在robot_moveit_config/config/joint_limits.yaml文件(应该与实际的顶层设置匹配)中:
joint:
has_position_limits: true
min_position: -1.57
max_position: 1.57
has_velocity_limits: true
max_velocity: 1.5
has_acceleration_limits: false
max_acceleration: 0.0
has_jerk_limits: false
max_jerk: 0
has_effort_limits: true
max_effort: 255
也可以在生成robot_moveit_config之前,在urdf的joint tag中提前设置好:
...
<joint
name="joint_name"
type="revolute">
...
<limit
lower="0"
upper="1.047"
effort="20"
velocity="${velocity_value}" />
</joint>
...
一般来说,urdf的joint tag中设置了的参数会在joint_limits.yaml中显示,否则has_xxx_limits 会显示为false。