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

redo SDFormat sensor import condition #632

Merged

Conversation

jhanca-robotecai
Copy link
Contributor

In the previous implementation, SDFormat <sensor> tag was triggering the import hook based on the sensor type only and it did not use the <plugin> information at all. Now, the hook is matched based on both. In particular:

  • a default hook is triggered when no <plugin> is implemented for a particular sensor
  • a specific hook is selected based on the <plugin> data if available

This way the user might add their hook with their sensor implementation by using their own plugin name declared in the hook, e.g. it is possible to add a hook for the popular libhector_gazebo_ros_imu plugin.

Tested using three different camera plugins in sdf files, with standard camera plugin:

      <sensor name="camera_test" type="camera">
        <plugin name="camera_plugin" filename="libgazebo_ros_camera.so"/>
        <pose>0 0 0 -1.57 -1.57 0</pose>
        <camera>
          <horizontal_fov>2.0</horizontal_fov>
          <image>
            <width>640</width>
            <height>480</height>
          </image>
          <clip>
            <near>0.05</near>
            <far>15000</far>
          </clip>
        </camera>
        <always_on>1</always_on>
        <update_rate>10</update_rate>
        <visualize>1</visualize>
      </sensor>

without any plugin:

      <sensor name="camera_test" type="camera">
        <pose>0 0 0 -1.57 -1.57 0</pose>
        <camera>
          <horizontal_fov>2.0</horizontal_fov>
          <image>
            <width>640</width>
            <height>480</height>
          </image>
          <clip>
            <near>0.05</near>
            <far>15000</far>
          </clip>
        </camera>
        <always_on>1</always_on>
        <update_rate>10</update_rate>
        <visualize>1</visualize>
      </sensor>

with modified plugin:

      <sensor name="camera_test" type="camera">
        <plugin name="camera_plugin" filename="libgazebo_ros_camera_asdf_super.so"/>
        <pose>0 0 0 -1.57 -1.57 0</pose>
        <camera>
          <horizontal_fov>2.0</horizontal_fov>
          <image>
            <width>640</width>
            <height>480</height>
          </image>
          <clip>
            <near>0.05</near>
            <far>15000</far>
          </clip>
        </camera>
        <always_on>1</always_on>
        <update_rate>10</update_rate>
        <visualize>1</visualize>
      </sensor>

@jhanca-robotecai jhanca-robotecai requested review from a team as code owners December 13, 2023 16:18
@jhanca-robotecai
Copy link
Contributor Author

Switching to draft. This PR will be merged after #609 with some more changes.

@jhanca-robotecai jhanca-robotecai marked this pull request as draft December 20, 2023 13:11
@jhanca-robotecai
Copy link
Contributor Author

Force-pushed on top of the #609, waiting for AR in #609

@jhanca-robotecai
Copy link
Contributor Author

  • rebased on top of development due to conflicts (Ackermann model importer hook was added);
  • bumped version as suggested by @spham-amzn

@michalpelka michalpelka merged commit fb21a3c into o3de:development Jan 25, 2024
2 checks passed
@jhanca-robotecai jhanca-robotecai deleted the jh/redo_sensor_plugins branch January 25, 2024 13:39
adamkrawczyk pushed a commit to RobotecAI/o3de-extras that referenced this pull request Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants