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 elevator to ROS2 #945

Merged
merged 1 commit into from
Jul 11, 2019

Conversation

shiveshkhaitan
Copy link

Port gazebo_ros_elevator plugin to ROS2.

Example:

 <plugin name="elevator" filename="libgazebo_ros_elevator.so">
  <ros>
    <namespace>demo</namespace>
    <argument>elevator:=elevator_demo</argument>
  </ros>
  <bottom_floor>0</bottom_floor>
  <top_floor>1</top_floor>

  <lift_joint>elevator::lift</lift_joint>
  <door_joint>elevator::door</door_joint>
  <floor_height>3.075</floor_height>

  <!-- Time the elevator door will stay open in seconds -->
  <door_wait_time>10</door_wait_time>
</plugin>

Migration guide at ROS 2 Migration: Elevator

@chapulina chapulina added the ros2 label Jul 8, 2019
@chapulina chapulina self-requested a review July 8, 2019 14:03
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Works for me!

I noticed that the elevator sometimes doesn't respond to commands. I needed to send a command a couple of times before it moved. But the problem seems to be in the Gazebo plugin, because I checked that the MoveToFloor commands are going through.

Merging!

impl_->top_ = _sdf->Get<int>("top_floor", std::numeric_limits<int>::max()).first;
}

void GazeboRosElevator::OnElevator(const std_msgs::msg::String::ConstSharedPtr msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

So strange that the original plugin takes a string when we need an int 🤔 We could easily change this to Int32 for a cleaner implementation.

I wonder if it was done like this because Gazebo's ElevatorPlugin uses a string message. And the reason for that is that gazebo::msgs doesn't have an integer message...

@chapulina chapulina merged commit 22d782e into ros-simulation:dashing Jul 11, 2019
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