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 bumper sensor to ROS2 #943

Merged
merged 4 commits into from Jul 16, 2019

Conversation

@shiveshkhaitan
Copy link

commented Jul 2, 2019

Port gazebo_ros_bumper plugin to ROS2.

Example:

<plugin name="plugin_name" filename="libgazebo_ros_bumper.so">
  <ros>
    <namespace>demo</namespace>
    <argument>bumper_states:=bumper_demo</argument>
  </ros>
  <frame_name>frame</frame_name>
</plugin>

Migration guide at ROS 2 Migration: Bumper

@chapulina chapulina added the ros2 label Jul 3, 2019

@chapulina chapulina self-requested a review Jul 3, 2019

@chapulina
Copy link
Contributor

left a comment

Works for me! I just have some small comments.

gazebo_plugins/src/gazebo_ros_bumper.cpp Outdated Show resolved Hide resolved
gazebo_plugins/src/gazebo_ros_bumper.cpp Outdated Show resolved Hide resolved
gazebo_plugins/src/gazebo_ros_bumper.cpp Outdated Show resolved Hide resolved
gazebo_plugins/src/gazebo_ros_bumper.cpp Outdated Show resolved Hide resolved
gazebo_plugins/src/gazebo_ros_bumper.cpp Outdated Show resolved Hide resolved
gazebo_plugins/src/gazebo_ros_bumper.cpp Outdated Show resolved Hide resolved
gazebo_plugins/src/gazebo_ros_bumper.cpp Outdated Show resolved Hide resolved
stream << "Debug: i: (" << i + 1 << "/" << contacts_packet_size <<
") my_geom: [" << state.collision1_name <<
"] other_geom: [" << state.collision2_name <<
"] time: [" << contact.time().sec() << "." << contact.time().nsec() << "]\n";

This comment has been minimized.

Copy link
@chapulina

chapulina Jul 15, 2019

Contributor

Interesting that in.contact(i).time() (printed here) is different from in.time() (put in the header):

header:                                                                                                  
  stamp:                                                                                                 
    sec: 47                                                                                              
    nanosec: 466000000                                                                                   
  frame_id: world                                                                                        
states:                                                                                                  
- info: 'Debug:  i: (1/1)     my_geom: [ball::link::collision]  other_geom: [ground_plane::link::collisio
n]        time: [47.455000000]   

I think each contact has its own specific time, but the ROS message doesn't capture that.

This is just an observation, no action needed.

gazebo_ros/test/test_conversions.cpp Outdated Show resolved Hide resolved
@chapulina
Copy link
Contributor

left a comment

We shouldn't forget to backport to Dashing

@chapulina chapulina merged commit 0b7918e into ros-simulation:ros2 Jul 16, 2019

chapulina added a commit that referenced this pull request Aug 11, 2019
[ros2] Port bumper sensor to ROS2 (#943)
* [ros2] Port bumper sensor to ROS2

* Add author name

* Minor fixes and add contact msg conversion

* Remove unused header includes
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.