Robotics StackExchange | Archived questions

Help with launch of 2 robots

Hi.

I'm new, but getting there...

I'm trying to spawn 2 robots in gazebo using ros

  1. A robot controlled using joystick - package: joy
  2. A "Compass" pointer robot controlled by a I2C compass

All code is available here: Git rep - For easy overview

I use 3 launch files - 1 to start and launch the other 2

Launch command: roslaunch mybot_gazebo start2.launch

I get this error and cannot find the error:

(Complete terminal launch and error output is available in the Readme.md in the git rep)

[ERROR] [1568837262.438582681]: Could not find parameter robot_description on parameter server
[compass/robot_state_publisher1-8] process has died [pid 14585, exit code 255, cmd /opt/ros/melodic/lib/robot_state_publisher/robot_state_publisher /joint_states:=/compass/joint_states __name:=robot_state_publisher1 __log:=/home/thr/.ros/log/9acdfe50-da37-11e9-a0b0-00044b8c64bc/compass-robot_state_publisher1-8.log].
log file: /home/thr/.ros/log/9acdfe50-da37-11e9-a0b0-00044b8c64bc/compass-robot_state_publisher1-8*.log

System:

Main launch file:

 <launch>
  <param name="/use_sim_time" value="true" />

    <include file="$(find gazebo_ros)/launch/empty_world.launch">
                <arg name="world_name" value="$(find mybot_gazebo)/worlds/mybot1.world"/>
                <arg name="gui" value="true"/>
    </include>

  <!-- include our robots -->
  <include file="$(find mybot_gazebo)/launch/mybot_twoPc.launch"/>
  </launch>

Robot/Compass launch file:

<launch>      

<group ns="nanobot">
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find mybot_description)/urdf/mybot.xacro'" />
    <node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen" args="-urdf -param robot_description -model mybot" />
    <include file="$(find mybot_control)/launch/mybot_control.launch" />
</group>
<group ns="compass">
    <param name="compass_description" command="$(find xacro)/xacro.py '$(find mybot_description)/urdf/compass.xacro'" />
    <node name="compass_spawn" pkg="gazebo_ros" type="spawn_model" output="screen" args="-urdf -param compass_description -model compass" />
    <include file="$(find mybot_control)/launch/compass_control.launch" />
</group>

</launch>

Asked by teddy_roskvist on 2019-09-18 15:38:39 UTC

Comments

Could you please update your question to include the relevant files and output? It's actually easier to have everything in the question than to have to navigate through the GitHub repo and find the correct files

Asked by jayess on 2019-09-18 19:07:14 UTC

Thanks with the help of the reformatting of the sourcecode

Asked by teddy_roskvist on 2019-09-19 15:43:38 UTC

Answers

I think the problem is that you did not remap robot_description for the state publisher. In mybot_twoPc.launch you load the URDF inside compass_description, then include the file compass_control.launch (from pkg mybot_control). In there, you load again the URDF in compass_description (it is not necessary, but it does not cause any trouble) and finally start robot_state_publisher1. By default, such node assumes to find the robot description into robot_description. Since you use another name, you should change it to be:

<node name="robot_state_publisher1" pkg="robot_state_publisher" type="robot_state_publisher" respawn="false" output="screen">
  <remap from="robot_description" to="compass_description"/>
  <remap from="/joint_states" to="/compass/joint_states" />
</node>

Hope this solves the issue!

Asked by ffusco on 2019-09-19 00:06:39 UTC

Comments

I have solved the issue. I have done a lot of trail’n error editing, so im not quite sure what solved it, but the remapping seemed to be part of it
Thanks

Asked by teddy_roskvist on 2019-09-19 15:48:36 UTC

Comments