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] Port depth camera to ROS2 #932

Merged
merged 6 commits into from Jul 15, 2019

Conversation

@shiveshkhaitan
Copy link

commented Jun 2, 2019

Port gazebo_ros_depth_camera plugin to ROS2.

Example:

<plugin name="camera_controller" filename="libgazebo_ros_depth_camera.so">
  <ros>
    <namespace>demo_cam</namespace>
     <!-- topics need to be prefixed with camera_name for remapping -->
    <argument>mycamera/image_raw:=mycamera/image_demo</argument>
    <argument>mycamera/image_depth:=mycamera/depth_demo</argument>
    <argument>mycamera/camera_info_raw:=mycamera/raw_cam_info_demo</argument>
    <argument>mycamera/camera_info_depth:=mycamera/depth_cam_info_demo</argument>
    <argument>mycamera/points:=mycamera/points_demo</argument>
  </ros>

  <!-- omit camera_name to default to sensor name -->
  <camera_name>mycamera</camera_name>

  <!-- frame_name>omit so it defaults to link name</frameName-->

  <min_depth>0.5</min_depth>
  <max_depth>500</max_depth>
</plugin>

@chapulina chapulina self-assigned this Jun 3, 2019

@chapulina

This comment has been minimized.

Copy link
Contributor

commented Jun 3, 2019

Thanks, @shiveshkhaitan ! Did you take a look at #757? We could include support for openni_kinect and also delete the old files for that plugin. A migration guide for both plugins would also be good.

@shiveshkhaitan

This comment has been minimized.

Copy link
Author

commented Jun 4, 2019

Forgot to mention about #757. Openni Kinect has been already integrated into gazebo_ros_depth_camera.

Migration guide is available at ROS 2 Migration: Camera

@chapulina

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2019

All the 3 messages being published are working for me.

I haven't looked too deeply into the code yet, but I did notice there's a lot of overlap with gazebo_ros_camera. It would be interesting to look into whether we can avoid duplication. Maybe the depth camera can inherit from the normal camera?

I did notice that the camera plugin doesn't have many virtual functions, so I'm not sure how much can be reused without breaking ABI. We could have separate plugins for Dashing, but maybe it would be interesting to consolidate them for Eloquent. What do you think?

@shiveshkhaitan

This comment has been minimized.

Copy link
Author

commented Jun 19, 2019

I tried integrating depth camera into normal camera. Now <sensor_type> has to be specified as depth in the sdf to make gazebo_ros_camera behave as gazebo_ros_depth_camera without the need of an extra plugin. <sensor_type> is set to camera by default, thus there are no breaking changes.

@chapulina

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

@shiveshkhaitan , can you rebase this branch? Thanks!

@shiveshkhaitan shiveshkhaitan force-pushed the shiveshkhaitan:depth_camera branch from e63d1c4 to 6c3d867 Jul 10, 2019

@chapulina
Copy link
Contributor

left a comment

It's working for me, I just have some final comments

gazebo_plugins/src/gazebo_ros_camera.cpp Outdated Show resolved Hide resolved
gazebo_plugins/src/gazebo_ros_camera.cpp Show resolved Hide resolved
gazebo_plugins/src/gazebo_ros_camera.cpp Show resolved Hide resolved

@chapulina chapulina merged commit e2fd5c5 into ros-simulation:ros2 Jul 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.