[ros-users] gazebo controller plugins and spawning multiple robots

John Hsu johnhsu at willowgarage.com
Mon Aug 16 22:57:04 UTC 2010


Hi Jeff,
I've answered inline:

On Mon, Aug 16, 2010 at 1:19 PM, <jrousseau at aptima.com> wrote:

> I'm trying to spawn several robots of the same type in gazebo through ros
> and am
> hitting what seems to be a controller namespacing issue.  What I would like
> is
> for each robot to live in its own namespace like:
>
> robot1/odom
> robot1/cmd_vel
> ...
> robot2/odom
> robot2/cmd_vel
> ...
>
> The urdf's I'm currently using (erratic_description/urdf/erratic_base.xacro
> from
> ua-ros-pkg) take in a namespace directly inside the URDF file (example
> below):
>
>            <controller:diffdrive_plugin
> name="differential_drive_controller"
> plugin="libdiffdrive_plugin.so">
>                <alwaysOn>true</alwaysOn>
>                <update>100</update>
>                <updateRate>100.0</updateRate>
>                <leftJoint>base_link_right_wheel_joint</leftJoint>
>                <rightJoint>base_link_left_wheel_joint</rightJoint>
>
>  <wheelSeparation>${caster_wheel_offset_y*2}</wheelSeparation>
>                <wheelDiameter>${wheel_radius*2}</wheelDiameter>
>                <torque>5</torque>
>                <interface:position name="position_iface_0"/>
>                <robotNamespace>robot1</robotNamespace>
>                <topicName>cmd_vel</topicName>
>            </controller:diffdrive_plugin>
>
> So basically the problem is this: Since the controller converts gazebo
> objects
> into ros topics and the controller is inside the definition of a robot, how
> do I
> uniquely specify namespaces for multiple robots based on the same URDF?
>

> I could just make several copies of the erratic_base.xacro and just change
> the
> <robotNamespace> tag in each, but that seems kludgy.  Is there some way to
> pass
> in variables to a URDF from launch file or something?
>

if you look at the robot spawn script in gazebo,

rosrun gazebo spawn_model

there's an option to specify -namespace, it simply adds the <robotNamespace>
tag to all the <controller>'s.  This might be what you need, but double
check and make sure the individual controller plugins parses and uses the
robotNamespace tag.


>
> PS is this even the general method for working with multiple robots with
> ros +
> gazebo (ie spawning several robots under different namespaces?) or am I
> heading
> in the wrong direction...
>

There's been some discussions on multi-robot + ros.  Basically, multiple
robots separately namespaced under one ros core should work in gazebo, but
in reality network load for more than 3 robots might become a significant
burden.  See more discussions here:

https://code.ros.org/gf/project/ros/mailman/?action=ListThreads&mailman_id=20&_forum_action=ForumMessageBrowse&thread_id=27895

John


>
> Jeff
>
>
>
>
> The information transmitted is intended only for the person or entity to
> which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon this information by persons or
> entities other than the intended recipient is prohibited. If you received
> this in error, please contact the sender and delete the material from any
> computer.
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100816/ff933c1c/attachment-0003.html>


More information about the ros-users mailing list