0
$\begingroup$

Rosanswers logo

Hi Ros users: I have a launch file that it has 2 pkg when I run it. Here it is

<!-- these are the arguments you can pass this launch file, for example 
    paused:=true -->
<arg name="paused" default="false" />
<arg name="use_sim_time" default="true" />
<arg name="gui" default="true" />
<arg name="headless" default="false" />
<arg name="debug" default="false" />

<!-- We resume the logic in empty_world.launch, changing only the name of 
    the world to be launched -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find p3dx_gazebo)/ol3_floor/ol3_plano.world" />
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)" />
    <arg name="use_sim_time" value="$(arg use_sim_time)" />
    <arg name="headless" value="$(arg headless)" />
</include>

<!-- Load the URDF into the ROS Parameter Server -->
<param name="robot_description"
    command="$(find xacro)/xacro.py '$(find p3dx_description)/urdf/pioneer3dx.xacro'" />

<!-- Load the second URDF into the ROS Parameter Server -->
<param name="robot_description"
    command="$(find xacro)/xacro.py '$(find p3dx2_description)/urdf/pioneer3dx2.xacro'" />


<!-- Run a python script to the send a service call to gazebo_ros to spawn 
    a URDF robot -->
<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
    respawn="false" output="screen" args="-x 0 -y 0 -z 0 -Y 3.141592654 -urdf -model p3dx -param robot_description" />
<node name="urdf_spawner2" pkg="gazebo_ros" type="spawn_model"
    respawn="false" output="screen" args="-x 1 -y 0 -z 0 -Y 3.141592654 -urdf -model p3dx2 -param robot_description" />

When I run it, everything is ok. But when I type "rostopic list", it just appears the topics from second URDF. does anybody know why?

When I run launch file I can see this:

> [ERROR] [1433927886.731417531,
> 0.532000000]: Tried to advertise a service that is already advertised in
> this node
> [/p3dx2/controller_manager/list_controllers]
> [ERROR] [1433927886.731486254,
> 0.532000000]: Tried to advertise a service that is already advertised in
> this node
> [/p3dx2/controller_manager/list_controller_types]
> [ERROR] [1433927886.731516496,
> 0.532000000]: Tried to advertise a service that is already advertised in
> this node
> [/p3dx2/controller_manager/load_controller]
> [ERROR] [1433927886.731541708,
> 0.532000000]: Tried to advertise a service that is already advertised in
> this node
> [/p3dx2/controller_manager/unload_controller]
> [ERROR] [1433927886.731571112,
> 0.532000000]: Tried to advertise a service that is already advertised in
> this node
> [/p3dx2/controller_manager/switch_controller]
> [ERROR] [1433927886.731596255,
> 0.532000000]: Tried to advertise a service that is already advertised in
> this node
> [/p3dx2/controller_manager/reload_controller_libraries]

Because I want to manage two p3dx independent.

Thanks


Originally posted by Alvaro Salcedo on ROS Answers with karma: 149 on 2015-06-10

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It looks to me like you're overwriting the robot_description parameter, which appears to be where the root namespace string (p3dx2) is coming from.

Edit: more importantly, you're then loading the same robot_description for both robots (in case that wasn't clear).


Originally posted by kramer with karma: 1470 on 2015-06-10

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Alvaro Salcedo on 2015-06-11:
That is the way! thank you so much!

Comment by M_wasiel13 on 2016-04-15:
Hello, I have similar problem but I don;'t know how to solve this problem according to descriptions which are included above "Edit: more importantly, you're then loading the same robot_description for both robots (in case that wasn't clear).". Could please someone give me more informations ?

Comment by kramer on 2016-04-17:
There are two 'param name=robot_description' (same name). The 2nd overwrites the first when it is loaded on the param server.

$\endgroup$

Your Answer

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