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

Simulating a custom robot going up a ramp in Gazebo [closed]

asked 2011-12-14 18:50:54 -0600

ChickenSoup gravatar image

updated 2016-05-17 02:50:02 -0600

Hi all,

I tried to simulate a custom 4-wheel robot model (URDF) going up a ramp in gazebo but it cannot do so. It can navigate on the ground plane using a custom base controller but when it tries to go up the ramp it gets stuck.

What am I missing in the URDF? Some pointers to implement this is appreciated.

Thank you

CS

Here is my URDF

I still dont have a good grasp of the tags anchor, mechanicalReduction

<robot xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor" xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller" xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" xmlns:xacro="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" name="my_robot">

<include filename="$(find rover_base_controller)/urdf/materials.urdf.xacro" />

<!-- This adds the laser macro, including the scan for gazebo and link name -->
<include filename="$(find pr2_description)/urdf/sensors/hokuyo_lx30_laser.urdf.xacro" />

<xacro:property name="scale" value="1.0"/>
<xacro:property name="base_length" value="0.6"/>
<xacro:property name="base_width" value="0.3"/>
<xacro:property name="base_height" value="0.1"/>
<xacro:property name="wheel_base1_length" value="0.02"/>
<xacro:property name="wheel_base1_width" value="0.02"/>
<xacro:property name="wheel_base1_height" value="0.07"/>
<xacro:property name="wheel_base2_length" value="0.02"/>
<xacro:property name="wheel_base2_width" value="0.05"/>
<xacro:property name="wheel_base2_height" value="0.01"/>
<xacro:property name="wheel_base3_length" value="0.02"/>
<xacro:property name="wheel_base3_width" value="0.02"/>
<xacro:property name="wheel_base3_height" value="0.06"/>
<xacro:property name="wheel_thickness" value="0.06"/>
<xacro:property name="wheel_radius" value="0.053"/>
<xacro:property name="mast_height" value="0.2"/>
<xacro:property name="mast_length" value="0.01"/>
<xacro:property name="mast_width" value="0.01"/>
<xacro:property name="mast_vertical_bar_height" value="0.01"/>
<xacro:property name="mast_vertical_bar_length" value="0.01"/>
<xacro:property name="mast_vertical_bar_width" value="0.2"/>
<xacro:property name="M_PI" value="3.14159265"/>


<xacro:macro name="default_inertial" params="mass">
    <inertial>
        <mass value="${mass}" />
        <inertia ixx="0.01" ixy="0.0" ixz="0.0"
                 iyy="0.01" iyz="0.0"
                 izz="0.01" />
        </inertial>
</xacro:macro>

<!-- base_footprint is a fictitious link(frame) that is on the ground right below base_link origin,
         navigation stack depends on this frame -->
    <link name="base_footprint">
        <inertial>
            <mass value="0.0001" />
            <origin xyz="0 0 0" />
            <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                     iyy="0.0001" iyz="0.0"
                     izz="0.0001" />
        </inertial>

        <visual>
            <origin xyz="0 0 0" rpy="0 0 0" />
            <geometry>
                <box size="0.001 0.001 0.001" />
            </geometry>
                <material name="Green"/>
        </visual>

        <collision>
            <origin xyz="0 0 ${wheel_base1_height + wheel_radius}" rpy="0 0 0" />
            <geometry>
              <box size="0.001 0.001 0.001" />
            </geometry>
        </collision>
    </link>

<link name="base_link">
    <visual>
        <geometry>
            <box size="${base_length*scale} ${base_width*scale} ${base_height*scale}"/>
        </geometry>
        <material name="Blue"/>
    </visual>
    <collision>
        <geometry>
            <box size="${base_length} ${base_width} ${base_height}"/>
        </geometry>
    </collision>
    <xacro:default_inertial mass="50"/>
</link>

<joint name="base_footprint_joint" type="fixed">
    <!-- NB: While you would think this would make it go up, it is oddly reversed.
         This moves the joint to 0,0,0 where we want it ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Martin Günther
close date 2016-05-17 03:24:39.226512

1 Answer

Sort by » oldest newest most voted
0

answered 2011-12-15 00:56:46 -0600

DimitriProsser gravatar image

The way I solved this problem was to drastically increase the effort value in the <limit> tag for the wheel joints. I wrote my controller for those wheels using a PID controller (located in the control_toolbox package). I use this PID controller to control the speed of the wheels. Since the controller subscribes to cmd_vel, the PID will continue to increase the motor power to maintain the desired velocity.

You could also try adding the following inside of your transmission descriptions:

<motorTorqueConstant>200.0</motorTorqueConstant>

You'll have to figure out what value works best for you.

edit flag offensive delete link more

Comments

Thank you very much for your response. Yeah, adjusting those parameters I could get the robot to move; still trying to figure out the best values though.
ChickenSoup gravatar image ChickenSoup  ( 2011-12-18 01:35:21 -0600 )edit
@DimitriProsser I was wondering, however, in the URDF of PR2 base the effort value of <limit> tag is small (100) and there is no <motorTorqueConstant>tag. But it can still go up the ramp while my model cannot. How come it is possible?
ChickenSoup gravatar image ChickenSoup  ( 2011-12-18 16:41:22 -0600 )edit
Perhaps a value of 100 is sufficient with a properly tuned PID controller.
DimitriProsser gravatar image DimitriProsser  ( 2011-12-19 00:21:21 -0600 )edit

Question Tools

Stats

Asked: 2011-12-14 18:50:54 -0600

Seen: 1,623 times

Last updated: May 17 '16