Robotics StackExchange | Archived questions

robot will explode after adding effort_controllers/JointVelocityController in the transmission

Dear Community ,

I'm using ros kinetic with ubuntu 16.04 with Evarobot URDF file available on https://github.com/inomuh/uplat

I tried to update the model adding transmission tags to control the differential drive for the navigation stack, though I'm confused if i should use (EffortJointInterface or VelocityJointEnterface).

After using effort_controllers/JointVelocityController the robot will explode specially the wheel part.

URDF file with transmission tags:-

    <!-- LEFT WHEEL -->
    <link name="left_wheel_link">
        <collision>
            <origin rpy="1.57075 0 0" xyz="0 0 0"/>
            <geometry>
                <cylinder length="0.035" radius="0.085"/>
            </geometry>
        </collision>
        <visual>
            <origin rpy="0 0 1.57079632679" xyz="0 0 0"/> 
            <geometry>
                 <mesh filename="package://evarobotmodel_description/meshes/rim.dae" scale="1 1 1"/> 
            </geometry>
            <material name="Grey"/>
        </visual>
        <inertial>
            <origin rpy="1.57075 0 0" xyz="0 0 0"/>
            <mass value="0.85"/>
            <inertia
                ixx="0.001" ixy="0" ixz="0"
                iyy="0.001" iyz="0"
                izz="0.001"/>
        </inertial>
    </link>
    <gazebo reference="left_wheel_link">
        <material>Gazebo/Grey</material>
        <mu1>1.0</mu1>
        <mu2>1.0</mu2>
        <kp>1000000.0</kp>
        <kd>100.0</kd>
        <minDepth>0.001</minDepth>
        <maxVel>1.0</maxVel>        
    </gazebo>
    <joint name="left_wheel_joint" type="continuous">
        <axis xyz="0 1 0"/>
        <parent link="base_link"/>
        <child link="left_wheel_link"/>
        <origin rpy="0 0 0" xyz="0 0.16 -0.119"/>
    </joint>
    <link name="left_wheeltire_link">
        <collision>
            <origin rpy="1.57075 0 0" xyz="0 0 0"/>
            <geometry>
                <cylinder length="0.001" radius="0.001"/>
            </geometry>
        </collision>
        <visual>
            <origin rpy="0 0 1.57079632679" xyz="0 0 0"/>
            <geometry>
                <mesh filename="package://evarobotmodel_description/meshes/tire.dae"/> 
            </geometry>
        </visual>
        <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="0.001"/>
            <inertia
                ixx="0.001" ixy="0" ixz="0"
                iyy="0.001" iyz="0"
                izz="0.001"/>
        </inertial>
    </link>
    <gazebo reference="left_wheeltire_link">
        <material>Gazebo/Black</material>
    </gazebo>   
    <joint name="left_wheeltire_joint" type="fixed">
        <axis xyz="0 1 0"/>
        <parent link="left_wheel_link"/>
        <child link="left_wheeltire_link"/>
        <origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
    </joint>     
<!-- RIGHT WHEEL -->
    <link name="right_wheel_link">
        <collision>
            <origin rpy="1.57075 0 0" xyz="0 0 0"/>
            <geometry>
                <cylinder length="0.035" radius="0.085"/>
            </geometry>
        </collision>
        <visual>
            <origin rpy="0 0 1.57079632679" xyz="0 0 0"/> 
            <geometry>
                 <mesh filename="package://evarobotmodel_description/meshes/rim.dae" scale="1 1 1"/> 
            </geometry>
            <material name="Grey"/>
        </visual>
        <inertial>
            <origin rpy="1.57075 0 0" xyz="0 0 0"/>
            <mass value="0.85"/>
            <inertia
                ixx="0.001" ixy="0" ixz="0"
                iyy="0.001" iyz="0"
                izz="0.001"/>
        </inertial>
    </link>
    <gazebo reference="right_wheel_link">
        <material>Gazebo/Grey</material>
        <mu1>1.0</mu1>
        <mu2>1.0</mu2>
        <kp>1000000.0</kp>
        <kd>100.0</kd>
        <minDepth>0.001</minDepth>
        <maxVel>1.0</maxVel>        
    </gazebo>
    <joint name="right_wheel_joint" type="continuous">
        <axis xyz="0 1 0"/>
        <parent link="base_link"/>
        <child link="right_wheel_link"/>
        <origin rpy="0.0 0.0 0.0" xyz="0.0 -0.16 -0.119"/>
    </joint>
    <link name="right_wheeltire_link">
        <collision>
            <origin rpy="1.57075 0 0" xyz="0 0 0"/>
            <geometry>
                <cylinder length="0.001" radius="0.001"/>
            </geometry>
        </collision>
        <visual>
            <origin rpy="0 0 1.57079632679" xyz="0 0 0"/>
            <geometry>
                <mesh filename="package://evarobotmodel_description/meshes/tire.dae" scale="1 1 1"/> 
            </geometry>
            <material name="Black"/>
        </visual>
        <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="0.001"/>
            <inertia
                ixx="0.001" ixy="0" ixz="0"
                iyy="0.001" iyz="0"
                izz="0.001"/>
        </inertial>
    </link>
    <gazebo reference="right_wheeltire_link">
        <material>Gazebo/Black</material>
    </gazebo>   
    <joint name="right_wheeltire_joint" type="fixed">
        <axis xyz="0 1 0"/>
        <parent link="right_wheel_link"/>
        <child link="right_wheeltire_link"/>
        <origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
    </joint>

<!-- Transmission link joints to actuators  -->
    <transmission name="left_wheel_transmission">
        <type>transmission_interface/SimpleTransmission</type>
    <joint name="left_wheel_joint">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>  
    </joint>
    <actuator name="left_wheel_actuator">
        <mechanicalReduction>7</mechanicalReduction>
        <hardwareInterface>EffortJointInterface</hardwareInterface>
    </actuator>
    </transmission>


    <transmission name="right_wheel_transmission">
        <type>transmission_interface/SimpleTransmission</type>
    <joint name="right_wheel_joint">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>  
    </joint>
    <actuator name="right_wheel_actuator">
        <mechanicalReduction>7</mechanicalReduction>
        <hardwareInterface>EffortJointInterface</hardwareInterface>
    </actuator>
    </transmission>

     <gazebo>
        <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
            <alwaysOn>true</alwaysOn>
            <updateRate>10.0</updateRate> 
            <robotBaseFrame>base_footprint</robotBaseFrame>
            <publishWheelTF>true</publishWheelTF>
            <publishWheelJointState>true</publishWheelJointState>
            <wheelAcceleration>1</wheelAcceleration>
            <leftJoint>right_wheel_joint</leftJoint>
            <rightJoint>left_wheel_joint</rightJoint>
            <wheelSeparation>0.33</wheelSeparation>
            <wheelDiameter>0.17</wheelDiameter>
            <wheelTorque>20</wheelTorque>
            <commandTopic>cmd_vel</commandTopic>
            <odometryTopic>odom</odometryTopic>
            <odometryFrame>odom_combined</odometryFrame>
            <robotNamespace>/</robotNamespace>
            <legacyMode>true</legacyMode>
            <publishTf>true</publishTf>
        </plugin>


      </gazebo>
    <gazebo> 
        <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
            <alwaysOn>true</alwaysOn>
                <updateRate>1000.0</updateRate>
            </plugin>
    </gazebo>

    <gazebo>
    <plugin name="joint_state_publisher" filename="libgazebo_ros_joint_state_publisher.so">
        <robotNamespace>/</robotNamespace>
        <jointName>left_wheel_joint,right_wheel_joint,front_caster_base_rotate_joint,rear_caster_base_rotate_joint,front_caster_rotate_wheel_joint,rear_caster_rotate_wheel_joint</jointName>
        <updateRate>10.0</updateRate>
        <alwaysOn>true</alwaysOn>
    </plugin>
    </gazebo>

Yaml config file with effort_controllers/JointVelocityController :-

    # Publish all joint states -----------------------------------
    joint_state_controller:
        ype: joint_state_controller/JointStateController
        publish_rate: 50  

# Velocity Controllers not required for the diff drive pluging
    ight_velocity_controller:
        type: effort_controllers/JointVelocityController
        joint: right_wheel_joint
        pid: {p: 100.0, i: 0.01, d: 10.0}
    left_velocity_controller:
        ype: effort_controllers/JointVelocityController
        joint: left_wheel_joint
        pid: {p: 100.0, i: 0.01, d: 10.0} 

Control Launch file(diff_control1.yaml):-

    <?xml version="1.0"?>
<launch>
<arg name="world_path" default="worlds/empty.world"/>
<arg name="robot_ns" default="/"/>

<include file="$(find eva_cont)/launch/start_gazebo.launch" >
    <arg name="world_path" value="$(arg world_path)"/>
</include>

<!-- To spawn the robot from  evarobotmodel_simulator package (uplat evarobotmodel_simulator)--> 
<include file="$(find eva_cont)/launch/spawn_evarobot.launch">
    <arg name="robot_ns" value="$(arg robot_ns)"/>
</include>

<!-- Upload contoller configuartion file be aware which yamel file you want to uplad 1 or 2 --> 

<rosparam file="$(find eva_cont)/config/diff_control1.yaml" command="load" />

<!-- Contoller Manager : the argument must match the controllers name in yamel file -->   
<node name="xxx_controller" pkg="controller_manager" type="spawner"
    respawn="false" output="screen" ns="/" args="joint_state_controller right_velocity_controller left_velocity_controller" >

</node>


</launch>

Any help would be highly appreciated!

Asked by q8wwe on 2018-12-07 12:32:03 UTC

Comments

I'm no expert but inertias of 0.001 are really rather small.

Asked by gvdhoorn on 2018-12-07 16:40:59 UTC

the robot explode because of the inertias value , how to calculate these values , do you have a link .

Asked by q8wwe on 2018-12-08 12:22:50 UTC

One usually uses this manually or lets some 3D graphics software like SolidWorks do it for them.

Asked by aPonza on 2018-12-10 06:56:06 UTC

thank you , but what is really more suitable for transmission hardware interface is it Effort or velocity . also , what controller should be used : effort_controllers/JointVelocityController or effort_controllers/JointEffortController

Asked by q8wwe on 2018-12-15 09:27:18 UTC

Answers