0
$\begingroup$

Rosanswers logo

Hello, I'm following ROS_Control tutorial and adapting all the instructions for panda robot. I have generated the Gazebo compatible of URDF of panda from Moveot setup assistance and i'm editing it as per the ROS_Control_tutorial. After getting spawned in Gazebo robot falls down on the floor.

Update:-

After creating the fixed joint between world and the base link robot is bolted to the world frame. but the new problem is now the robot oscillates automatically once it is spawned to gazebo(robot arm moves front and back, then robot arm from link 1 and above falls down on the ground).after creating a fixed joint

I have already tried to adjust the p-i-d controlling gain(initially set them to 0 and then manipulated) but no luck

any suggestions on this??

Below is the URDF file i'm using, I have already tried changing gravity of links and added friction and damping for the joints but no luck.

<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from /opt/ros/kinetic/share/franka_description/robots/panda_arm_hand.urdf.xacro | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="panda" xmlns:xacro="http://www.ros.org/wiki/xacro">
    <!-- Used for fixing robot to Gazebo 'base_link' -->
    <link name="world"/>

    <joint name="fixed" type="fixed">
      <parent link="world"/>
      <child link="panda_link0"/>
    </joint>
    
    <link name="panda_link0">
        <visual>
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/link0.dae" />
            </geometry>
        </visual>
        <collision>
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/link0.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <link name="panda_link1">
        <visual>
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/link1.dae" />
            </geometry>
        </visual>
        <collision>
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/link1.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <joint name="panda_joint1" type="revolute">
        <safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-2.8973" soft_upper_limit="2.8973" />
        <origin rpy="0 0 0" xyz="0 0 0.333" />
        <parent link="panda_link0" />
        <child link="panda_link1" />
        <axis xyz="0 0 1" />
        <dynamics damping="0"/>
        <dynamics friction="0"/>
        <limit effort="87" lower="-2.8973" upper="2.8973" velocity="2.1750" />
    </joint>
    <link name="panda_link2">
        <visual>
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/link2.dae" />
            </geometry>
        </visual>
        <collision>
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/link2.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <joint name="panda_joint2" type="revolute">
        <safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-1.7628" soft_upper_limit="1.7628" />
        <origin rpy="-1.57079632679 0 0" xyz="0 0 0" />
        <parent link="panda_link1" />
        <child link="panda_link2" />
        <axis xyz="0 0 1" />
        <dynamics damping="0"/>
        <dynamics friction="0"/>
        <limit effort="87" lower="-1.7628" upper="1.7628" velocity="2.1750" />
    </joint>
    <link name="panda_link3">
        <visual>
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/link3.dae" />
            </geometry>
        </visual>
        <collision>
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/link3.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <joint name="panda_joint3" type="revolute">
        <safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-2.8973" soft_upper_limit="2.8973" />
        <origin rpy="1.57079632679 0 0" xyz="0 -0.316 0" />
        <parent link="panda_link2" />
        <child link="panda_link3" />
        <axis xyz="0 0 1" />
        <dynamics damping="0"/>
        <dynamics friction="0"/>
        <limit effort="87" lower="-2.8973" upper="2.8973" velocity="2.1750" />
    </joint>
    <link name="panda_link4">
        <visual>
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/link4.dae" />
            </geometry>
        </visual>
        <collision>
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/link4.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <joint name="panda_joint4" type="revolute">
        <safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-3.0718" soft_upper_limit="-0.0698" />
        <origin rpy="1.57079632679 0 0" xyz="0.0825 0 0" />
        <parent link="panda_link3" />
        <child link="panda_link4" />
        <axis xyz="0 0 1" />
        <dynamics damping="0"/>
        <dynamics friction="0"/>
        <limit effort="87" lower="-3.0718" upper="-0.0698" velocity="2.1750" />
    </joint>
    <link name="panda_link5">
        <visual>
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/link5.dae" />
            </geometry>
        </visual>
        <collision>
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/link5.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <joint name="panda_joint5" type="revolute">
        <safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-2.8973" soft_upper_limit="2.8973" />
        <origin rpy="-1.57079632679 0 0" xyz="-0.0825 0.384 0" />
        <parent link="panda_link4" />
        <child link="panda_link5" />
        <axis xyz="0 0 1" />
        <dynamics damping="0"/>
        <dynamics friction="0"/>
        <limit effort="12" lower="-2.8973" upper="2.8973" velocity="2.6100" />
    </joint>
    <link name="panda_link6">
        <visual>
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/link6.dae" />
            </geometry>
        </visual>
        <collision>
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/link6.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <joint name="panda_joint6" type="revolute">
        <safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-0.0175" soft_upper_limit="3.7525" />
        <origin rpy="1.57079632679 0 0" xyz="0 0 0" />
        <parent link="panda_link5" />
        <child link="panda_link6" />
        <axis xyz="0 0 1" />
        <dynamics damping="0"/>
        <dynamics friction="0"/>
        <limit effort="12" lower="-0.0175" upper="3.7525" velocity="2.6100" />
    </joint>
    <link name="panda_link7">
        <visual>
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/link7.dae" />
            </geometry>
        </visual>
        <collision>
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/link7.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <joint name="panda_joint7" type="revolute">
        <safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-2.8973" soft_upper_limit="2.8973" />
        <origin rpy="1.57079632679 0 0" xyz="0.088 0 0" />
        <parent link="panda_link6" />
        <child link="panda_link7" />
        <axis xyz="0 0 1" />
        <dynamics damping="0"/>
        <dynamics friction="0"/>
        <limit effort="12" lower="-2.8973" upper="2.8973" velocity="2.6100" />
    </joint>
    <link name="panda_link8" />
    <joint name="panda_joint8" type="fixed">
        <origin rpy="0 0 0" xyz="0 0 0.107" />
        <parent link="panda_link7" />
        <child link="panda_link8" />
        <axis xyz="0 0 0" />
    </joint>
    <joint name="panda_hand_joint" type="fixed">
        <parent link="panda_link8" />
        <child link="panda_hand" />
        <origin rpy="0 0 -0.785398163397" xyz="0 0 0" />
        <dynamics damping="0"/>
        <dynamics friction="0"/>
    </joint>
    <link name="panda_hand">
        <visual>
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/hand.dae" />
            </geometry>
        </visual>
        <collision>
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/hand.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <link name="panda_leftfinger">
        <visual>
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/finger.dae" />
            </geometry>
        </visual>
        <collision>
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/finger.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <link name="panda_rightfinger">
        <visual>
            <origin rpy="0 0 3.14159265359" xyz="0 0 0" />
            <geometry>
                <mesh filename="package://franka_description/meshes/visual/finger.dae" />
            </geometry>
        </visual>
        <collision>
            <origin rpy="0 0 3.14159265359" xyz="0 0 0" />
            <geometry>
                <mesh filename="package://franka_description/meshes/collision/finger.stl" />
            </geometry>
        </collision>
        
<inertial>
            <mass value="0.1" />
            <inertia ixx="0.03" iyy="0.03" izz="0.03" ixy="0.0" ixz="0.0" iyz="0.0" />
        </inertial>

    </link>
    <joint name="panda_finger_joint1" type="prismatic">
        <parent link="panda_hand" />
        <child link="panda_leftfinger" />
        <origin rpy="0 0 0" xyz="0 0 0.0584" />
        <axis xyz="0 1 0" />
        <dynamics damping="0"/>
        <dynamics friction="0"/>
        <limit effort="20" lower="0.0" upper="0.04" velocity="0.2" />
    </joint>
    <joint name="panda_finger_joint2" type="prismatic">
        <parent link="panda_hand" />
        <child link="panda_rightfinger" />
        <origin rpy="0 0 0" xyz="0 0 0.0584" />
        <axis xyz="0 -1 0" />
        <dynamics damping="0"/>
        <dynamics friction="0"/>
        <limit effort="20" lower="0.0" upper="0.04" velocity="0.2" />
        <mimic joint="panda_finger_joint1" />
    </joint>
<!--
    <gazebo reference="panda_link1">
      <gravity>0</gravity>
    </gazebo>

    <gazebo reference="panda_link2">
      <gravity>0</gravity>
    </gazebo>

    <gazebo reference="panda_link3">
      <gravity>0</gravity>
    </gazebo>

    <gazebo reference="panda_link4">
      <gravity>0</gravity>
    </gazebo>

    <gazebo reference="panda_link5">
      <gravity>0</gravity>
    </gazebo>

    <gazebo reference="panda_link6">
      <gravity>0</gravity>
    </gazebo>

    <gazebo reference="panda_link7">
      <gravity>0</gravity>
    </gazebo>

    <gazebo reference="panda_link8">
      <gravity>0</gravity>
    </gazebo>

    <gazebo reference="panda_hand">
      <gravity>0</gravity>
    </gazebo>

    <gazebo reference="panda_leftfinger">
      <gravity>0</gravity>
    </gazebo>

    <gazebo reference="panda_rightfinger">
      <gravity>0</gravity>
    </gazebo> -->

    <transmission name="trans1">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="panda_joint1">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </joint>
      <actuator name="motor1">
        <mechanicalReduction>50</mechanicalReduction>
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </actuator>
    </transmission>

    <transmission name="trans2">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="panda_joint2">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </joint>
      <actuator name="motor2">
        <mechanicalReduction>50</mechanicalReduction>
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </actuator>
    </transmission>

    <transmission name="trans3">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="panda_joint3">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </joint>
      <actuator name="motor3">
        <mechanicalReduction>50</mechanicalReduction>
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </actuator>
    </transmission>

    <transmission name="trans4">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="panda_joint4">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </joint>
      <actuator name="motor4">
        <mechanicalReduction>50</mechanicalReduction>
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </actuator>
    </transmission>

    <gazebo>
      <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
        <robotNamespace>/panda</robotNamespace>
      </plugin>
    </gazebo>
</robot>

here is the link git repository where i have uploaded all the packages. Summery of packages is:-

panda_gazebo_config-- created from moveit setup assistant by choosing existing URDF file of panda robot
panda_description-- all urdf files and meshes of panda robot
panda_control-- controller configuration and launch file
panda_gazebo-- gazebo world file and its launch file.

Please help me out through this. Thanks for your time.


Originally posted by mvish7 on ROS Answers with karma: 104 on 2018-11-23

Post score: 0


Original comments

Comment by mvish7 on 2018-11-24:
Thank you for your answer. Robot base is now bolted to the world frame. but the new problem is now the robot oscillates automatically once it is spawned to gazebo(robot arm moves front and back, then robot arm from link 1 and above falls down on the ground). any suggestions on this??

Comment by PeteBlackerThe3rd on 2018-11-24:
Glad it's working. But can you please create a new question for the next problem and we'll address it there. This site is a repository of questions and solutions, it doesn't work if the goal posts are moving.

Comment by mvish7 on 2018-11-24:
sure. I'll create a new question and i'll keep this in mind.

Comment by PeteBlackerThe3rd on 2018-11-24:
Thanks. I'll have a look now.

Comment by SunnyKatyara on 2019-06-19:
Hello mvish7, hope you are good. Since, i am working with panda too, and when i launch it in Gazebo with fixed base, its floating like the one shown in your image. Can you please tell me, how did you fix it?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You need to create a fixed joint between world and panda_link0 to 'bolt' your robot to the floor so to speak. Apart from that it looks okay.


Originally posted by PeteBlackerThe3rd with karma: 9529 on 2018-11-23

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by SunnyKatyara on 2019-06-19:
Hello mvish7, hope you are good. Since, i am working with panda too, and when i launch it in Gazebo with fixed base, its floating like the one shown in your image. Can you please tell me, how did you fix it?

Comment by mvish7 on 2019-06-20:
@SunnyKatyara: This is happening most probably due to PID gains. You can follow ROS_Control Gazebo tutorial and find the section tune PID gains. Using Tuned PID gains solved the issue for me.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.