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

Gazebo_ros_control problem

asked 2020-06-05 11:38:44 -0500

doriiber gravatar image

Hello,

I am a beginner using ROS and gazebo, and my goal is to simulate a wheelchair. I have created a simple representation like this one :

image description

I now want to make the whair moving forward by adding a velocity, using the gazebo_ros_control plugin.

I followed this tutorial : https://dvic.devinci.fr/resource/tuto...

I set the inertial values and the mass of each element : seat (+ one person) : 115kg front wheels : 250g back wheels : 1.5kg

I don't know how to set the collisions surfaces parameters (mu1 mu2 kp kd fdir1), so according to some research I put : mu1 = mu2 = 1.0 kp = 1e+8 kd = 1.0 fdir1 = '1 0 0'

I also set the launch and the config files, all the codes are below. However, when I start the simulation I got this :

image description

All the wheels are at 0 0 0 and under the seat. I don't know why. Finally, I don't know how to configure the pid gains in the config files .yaml, I guess this is the problem, with the fact that the masse is at around 120kg.

<?xml version='1.0' ?>

<robot name="wheelchair_test" &gt;<="" p="">

<link name='base_seat_link'>

        <visual>
            <origin xyz='0 0 0.4125' rpy='0 0 0'/>
            <geometry>
                <box size='0.675 0.675 0.675'/>
            </geometry>
            <material name='orange'>
                <color rgba="1 0.5 0 1" />
            </material>
        </visual>

    <collision>
        <origin xyz='0 0 0.4125' rpy='0 0 0'/>
            <geometry>
                <box size='0.675 0.675 0.675'/>
            </geometry>
            <material name='orange'>
                <color rgba="1 0.5 0 1" />
            </material>
    </collision>

        <inertial>
        <!-- masse : complete_seat=15kg + person=100kg -->
            <mass value='115.0'/>
        <!-- full cylinder r=0.5m et h=1.3m --> 
            <inertia ixx='23.3833' iyy='23.3833' izz='14.375' ixy='0' ixz='0' iyz='0'/>
        <origin xyz='0 0 0.4125' rpy='0 0 0' />
        </inertial>    

</link>
<link name='back_seat_link'>

        <visual>
            <origin xyz='0 0 0' rpy='0 0 0'/>
            <geometry>
                <box size='0.675 0.1 0.4'/>
            </geometry>
            <material name='orange'>
                <color rgba="1 0.5 0 1" />
            </material>
        </visual>

    <collision>
        <origin xyz='0 0 0' rpy='0 0 0'/>
            <geometry>
                <box size='0.675 0.1 0.4'/>
            </geometry>
            <material name='orange'>
                <color rgba="1 0.5 0 1" />
            </material>
    </collision>

        <inertial>
            <mass value='0.1'/>
            <inertia ixx='1e-6' iyy='1e-6' izz='1e-6' ixy='0' ixz='0' iyz='0'/>
        <origin xyz='0 -0.2875 0.9500' rpy='0 0 0' />
        </inertial>    

</link>

<joint name='seat_joint' type='fixed'>
        <axis xyz='1 0 0'/>
        <parent link ='base_seat_link'/>
        <child link ='back_seat_link'/>
        <origin xyz='0 -0.2875 0.9500' rpy='0 0 0' />
</joint>
<link name='front_left_wheel'>

    <visual>
        <origin xyz='0 0 0' rpy ...
(more)
edit retag flag offensive close merge delete

Comments

Hi @doriiber,

First of all I recommend you Xacro, it will save you time, effort and a lot of useless code.

Then, usually with newer version of Gazebo you can run your simulation with deafult collision and friction values to study the behaviour of your model and then compute your own values based on experimentation.

Finally, I see that you are using a VelocityJointInterface for wheel control, I recommend you to adjust the PID values because it seems that the gains are too high for your simualtion. Just start with a P=1 and then increase the values to reach your desired stability. Furthemore, pay attention to the derivative gain, my experienced is that higher values increase exponentially the inestability of the simulation.

Hope it helps!

Weasfas gravatar image Weasfas  ( 2020-06-06 05:45:11 -0500 )edit

Thank you very much for your response ! It solved my problem. I also have rebuild my file with xacro, it is quite better. For people who may have the same issue, take into account that you may have the same issue if there is no inertial values on your controlled wheels.

Thanks a lot !

doriiber gravatar image doriiber  ( 2020-06-07 11:18:33 -0500 )edit

Great you solved the problem!. If you do not mind, can you post your solution as an answer aand accept it?

Regards.

Weasfas gravatar image Weasfas  ( 2020-06-08 09:46:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-06-10 11:21:23 -0500

doriiber gravatar image

Thank you very much Weasfas for your help !

Hi @doriiber,

First of all I recommend you Xacro, it will save you time, effort and a lot of useless code.

Then, usually with newer version of Gazebo you can run your simulation with deafult collision and friction values to study the behaviour of your model and then compute your own values based on experimentation.

Finally, I see that you are using a VelocityJointInterface for wheel control, I recommend you to adjust the PID values because it seems that the gains are too high for your simualtion. Just start with a P=1 and then increase the values to reach your desired stability. Furthemore, pay attention to the derivative gain, my experienced is that higher values increase exponentially the inestability of the simulation.

Hope it helps! Weasfas gravatar image Weasfas ( Jun 6 '0 )

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-06-05 11:38:44 -0500

Seen: 7,975 times

Last updated: Jun 10 '20