How to enable braking to a mobile robot? Robot coasts down when placed on a ramp

asked 2020-11-30 20:03:34 -0600

pasindu_sandima gravatar image

I have made a robot model using URDF which consists of a two driving wheels and four caster wheels, which also uses a rocker bogie mechanism. I use velocity control interface on the wheel joints and use the diff drive controller to control those joints. The codes are as follows. The transmission tag.

<transmission name="${wheel_prefix}_wheel_trans" type="SimpleTransmission">
        <type>transmission_interface/SimpleTransmission</type>
        <actuator name="${wheel_prefix}_wheel_motor">
            <mechanicalReduction>1</mechanicalReduction>
            <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
        </actuator>
        <joint name="${wheel_prefix}_wheel">
            <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
        </joint>
    </transmission>

The controller,

velocity_controller:
type        : "diff_drive_controller/DiffDriveController"
left_wheel  : 'left_wheel'
right_wheel : 'right_wheel'
publish_rate: 50.0               # default: 50
pose_covariance_diagonal : [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]

# Wheel separation and diameter. These are both optional.
# diff_drive_controller will attempt to read either one or both from the
# URDF if not specified as a parameter
# wheel_separation : 0.54276
# wheel_radius : 0.062


enable_odom_tf : true


# Wheel separation and radius multipliers
wheel_separation_multiplier: 1.0 # default: 1.0
wheel_radius_multiplier    : 1.0 # default: 1.0

# Velocity commands timeout [s], default 0.5
cmd_vel_timeout: 0.25

# Base frame_id
base_frame_id: base_link #default: base_link

# Velocity and acceleration limits
# Whenever a min_* is unspecified, default to -max_*
linear:
  x:
    has_velocity_limits    : true
    max_velocity           : 1.0  # m/s
    min_velocity           : -0.5 # m/s
    has_acceleration_limits: true
    max_acceleration       : 0.2  # m/s^2
    min_acceleration       : -0.2 # m/s^2
    has_jerk_limits        : true
    max_jerk               : 5.0  # m/s^3
angular:
  z:
    has_velocity_limits    : true
    max_velocity           : 3.0  # rad/s
    has_acceleration_limits: true
    max_acceleration       : 0.5  # rad/s^2
    has_jerk_limits        : true
    max_jerk               : 2.5  # rad/s^3

I tried increasing the joint friction but it didn't seem to work. The gazebo tag and the joint tag are as follows.

<joint name="${wheel_prefix}_wheel" type="continuous">
        <parent link="${parent_link}"/>
        <child link="${wheel_prefix}_wheel_link"/>
        <xacro:insert_block name="joint_pose"/>
        <axis xyz="0 1 0" rpy="0 0 0" />
        <dynamics damping="1.0" friction="100.0" />
    </joint>


    <!-- mu1 - 100 , mu2 - 100 , kp - 600000 kd -1  -->
    <gazebo reference="${wheel_prefix}_wheel_link">
        <mu1 value="${wheel_mu1}"/>         
        <mu2 value="${wheel_mu2}"/>
        <kp>${wheel_kp}</kp>
        <kd>${wheel_kd}</kd>
        <dampingFactor>0.05</dampingFactor>
        <fdir1 value="1 0 0"/>
    </gazebo>

Is there anyway where I can enable braking when the cmd_vel is set to 0 ( Braking system ) ?

edit retag flag offensive close merge delete