Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

[ros2] Port elevator to ROS2#945

Merged
chapulina merged 1 commit intoros-simulation:dashingfrom
shiveshkhaitan:elevator
Jul 11, 2019
Merged

[ros2] Port elevator to ROS2#945
chapulina merged 1 commit intoros-simulation:dashingfrom
shiveshkhaitan:elevator

Conversation

@shiveshkhaitan
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants