Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ros2] Spawn <plugin> without <ros> #983

Merged
merged 1 commit into from
Aug 21, 2019
Merged

[ros2] Spawn <plugin> without <ros> #983

merged 1 commit into from
Aug 21, 2019

Conversation

chapulina
Copy link
Contributor

The issue was brought up by @mogumbo here: #948 (comment) .

When traversing SDF elements, we need to add element descriptions for each element, otherwise they're not created. This is usually not an issue because SDF can tell we're dealing with a <plugin> tag, which accepts arbitrary elements. But in this use case, we're dealing with generic SDF elements, so we need to describe the contents.

A manual way of testing this is to create a URDF model like this:

<?xml version="1.0" ?>
<robot name="ball">
<link name="base_link">
<visual>
<geometry>
<sphere radius="1.0"/>
</geometry>
</visual>
<collision>
<geometry>
<sphere radius="1.0"/>
</geometry>
</collision>
<inertial>
<mass value="1"/>
<inertia ixx="1" ixy="0.0" ixz="0.0" iyy="1" iyz="0.0" izz="1"/>
</inertial>
</link>
<gazebo>
    <plugin filename="libgazebo_ros_p3d.so" name="gazebo_ros_p3d">
        <!--ros>
          <argument>odom:=ground_truth</argument>
        </ros-->
        <frame_name>world</frame_name>
        <body_name>base_link</body_name>
        <update_rate>1</update_rate>
    </plugin>
  </gazebo>
</robot>

And spawn it like this:

ros2 run gazebo_ros spawn_entity.py -entity ball -file /path/to/model.urdf

Signed-off-by: Louise Poubel <louise@openrobotics.org>
Copy link
Collaborator

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (with my limited knowledge of gazebo_ros_pkgs 😁)

@chapulina chapulina merged commit f8e663a into dashing Aug 21, 2019
@chapulina chapulina deleted the missing_ros_elem branch August 21, 2019 00:50
jacobperron pushed a commit to jacobperron/gazebo_ros_pkgs that referenced this pull request Sep 10, 2019
Signed-off-by: Louise Poubel <louise@openrobotics.org>
j-rivero pushed a commit that referenced this pull request Oct 3, 2019
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants