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

Moving a four wheel robot using a controller

asked 2020-03-01 15:20:36 -0600

John999991 gravatar image

I am trying 3 days now to find a solution on making my 4 wheel robot move inside gazebo and RViz. The controller doesn't seem to be willing to launch correctly since I get:

    [ WARN] [1583096170.473160195]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[INFO] [1583096170.810203, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
0x149c4d0 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xa5a470) ): Attempt to set a screen on a child window.
0x149c950 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xa5a470) ): Attempt to set a screen on a child window.
0x149d740 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xa5a470) ): Attempt to set a screen on a child window.
0x14a0410 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xa5a470) ): Attempt to set a screen on a child window.
[WARN] [1583096200.977211, 2508.906000]: Controller Spawner couldn't find the expected controller_manager ROS interface.

My config is: ROS Kinetic Kame with the default gazebo-7 and RViz

URDF:

<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from robot.xacro                    | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="robot" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <!--This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com) 
     Commit Version: 1.5.1-0-g916b5db  Build Version: 1.5.7152.31018
     For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
  <link name="base_link">
    <inertial>
      <origin rpy="0 0 0" xyz="0.00390777224516517 -0.032446267219719 0.184169550820421"/>
      <mass value="4.20121630268732"/>
      <inertia ixx="0.0149000386129946" ixy="-4.66831001352174E-09" ixz="5.23920338795194E-08" iyy="0.0234359493013497" iyz="0.000771538751024883" izz="0.0286744535302635"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/base_link.STL"/>
      </geometry>
      <material name="">
        <color rgba="0.529411764705882 0.549019607843137 0.549019607843137 1"/>
      </material>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/base_link.STL"/>
      </geometry>
    </collision>
  </link>
  <link name="FL">
    <inertial>
      <origin rpy="0 0 0" xyz="-5.55111512312578E-17 9.10729824887824E-18 -6.93889390390723E-18"/>
      <mass value="0.0615219544751675"/>
      <inertia ixx="5.54433425808419E-05" ixy="-1.45453466603006E-20" ixz="-1.00225538664655E-21" iyy="3.00921775305435E-05" iyz="2.309188417276E-21" izz="3.00921775305435E-05"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/FL.STL"/>
      </geometry>
      <material name="">
        <color rgba="0.298039215686275 0.298039215686275 0.298039215686275 1"/>
      </material>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/FL.STL"/>
      </geometry>
    </collision>
  </link>
  <joint name="FLJ" type="continuous">
    <origin rpy="1.5707963267949 0 0" xyz="-0.162088045105054 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-01 22:36:04 -0600

Have you tried doing what the warning message is suggesting?

The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.

edit flag offensive delete link more

Comments

Apart form what @Martin Peris is suggesting in order to comprise with URDF tree structure,

why you are using the diff drive gazebo plugin libgazebo_ros_diff_drive if you already using ROS control? Besides, I think you do not want to load all the controllers, velocity ones for instance, since the controller manager is expecting you to load those 4 controllers in the hardware interface and you have no transmissions associated with them. Can you check those things and also ensuring you are using properly the same ns?

If the thing you want to achieve is controlling the same joint with two different control interfaces I am afraid that is not possible and you will need to provide at least 1 joint for each controller/transmission pair.

With respect the namespace take into account you can launch all your nodes inside a <group ns="/robot"></group> structure.

Weasfas gravatar image Weasfas  ( 2020-03-02 01:56:29 -0600 )edit

Martin, I thought Warnings were not crucial in the execution of a code and to be honest I am not sure what I do have to do; Weasfas, I'll try your suggestions and come back with results. Thank you both !

John999991 gravatar image John999991  ( 2020-03-02 02:14:46 -0600 )edit

OK, just tried both your suggestion but nothing worked... When I run robot_control.launch I got:

[INFO] [1583137731.242393]: Controller Spawner: Waiting for service controller_manager/load_controller
0x16ee960 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xcc4470) ): Attempt to set a screen on a child window.
0x16ff280 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xcc4470) ): Attempt to set a screen on a child window.
0x1700c60 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xcc4470) ): Attempt to set a screen on a child window.
0x1700380 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0xcc4470) ): Attempt to set a screen on a child window.
[WARN] [1583137761.296283]: Controller Spawner couldn't find the expected controller_manager ROS interface.
John999991 gravatar image John999991  ( 2020-03-02 02:31:08 -0600 )edit

Somehow I got a new step forward: I first started the gazebo sim with roslaunch robot gazebo.launch and then the robot_control.launch and I managed to "see" and load my controllers.

John999991 gravatar image John999991  ( 2020-03-02 02:45:33 -0600 )edit

That is the normal behavior since the control interfaces resides on the transmission elements of Gazebo.

Weasfas gravatar image Weasfas  ( 2020-03-02 03:36:11 -0600 )edit

Dear Weasfas, I am now trying to issue position commands to the wheels via the controller but the robot is not moving in RViz. Only in Gazebo, I see a small movement and then nothing else. Even more, if I issue the same command again the robot is not moving in Gazebo for a second time... Should I change for the velocity controllers?

I tried that and got an error :

[ERROR] [1583144504.715888, 7.266000]: Failed to start controllers: joint_state_controller, FRJ_velocity_controller, FLJ_velocity_controller, BLJ_velocity_controller, BRJ_velocity_controller

Any ideas why?

The position command is:

rostopic pub  /robot/FRJ_position_controller/command std_msgs/Float64 "data: 4"
John999991 gravatar image John999991  ( 2020-03-02 04:28:45 -0600 )edit

Hi @John999991,

It will depend on the way you want to control your platform. If you decide you want to use the effort controllers you will need to adjust the PID gains, together with the collision and friction parameters of Gazebo. For me, your current set up has no sense cause you are trying to control the wheels with position. It will be more logic to control by effort or by velocity. In this tutorial you will find all necessary information to follow this solution. Furthermore, you will need to understand friction on Gazebo since you will need to parametrize how the Simulation model this in order to move the model properly in the world.

Weasfas gravatar image Weasfas  ( 2020-03-02 04:45:53 -0600 )edit

Yes I agree. I thought having set up the position controller as the tutorial you posted suggests, would be enough to then transition that knowledge to the control of velocity, but it seems it is not straight-forward. For some reason, changing position to velocity produces unexpected errors...

John999991 gravatar image John999991  ( 2020-03-02 05:11:55 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2020-03-01 15:20:36 -0600

Seen: 1,408 times

Last updated: Mar 01 '20