ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to Create Elevator in Gazebo with Control ROS Topics ?

asked 2018-07-24 09:57:42 -0500

Onur gravatar image

updated 2018-07-25 03:51:03 -0500

Hello, I want to create scenario in Gazebo with elevator. I can use ElevatorPlugin that is working but I don't control elevator by ros topics. How can i control ros topics that elevator ?

This is elevator.world. and also this is gazebo plugin of elevator.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2018-07-24 23:49:20 -0500

ahendrix gravatar image

I'm not familiar with this code and haven't used it, but I can read through it and explain what it's doing.

The callback type is std_msgs/String : https://github.com/ros-simulation/gaz... , but it calls std::strtoi on the argument, which indicates that the string should be a number.

The topic name is defined by the <topic> XML property: https://github.com/ros-simulation/gaz...

This sets the topic to ~/elevator : https://bitbucket.org/osrf/gazebo/src... . That's relative to the gazebo node name, so probably /gazebo/elevator . Running rostopic list when the elevator simulation and looking for a topic with "elevator" in the name will also help you find the topic name.

Overall, it looks like publishing "1" or "2" (or maybe "0", if floors are 0-indexed) on the /gazeo/elevator topic (or whatever topic it's actually using) will send the elevator to a floor.

edit flag offensive delete link more

Comments

Thanks for advise. While running launch file, I looked to elevator topics but i didn't see. Also i looked rosnode list but i didn't see anything about elevator.

Onur gravatar image Onur  ( 2018-07-25 03:50:24 -0500 )edit

I have the same problem. Did you find the answer?

kevin.kuei.0321@gmail.com gravatar image kevin.kuei.0321@gmail.com  ( 2022-04-10 06:22:54 -0500 )edit
0

answered 2022-04-17 20:58:54 -0500

I meet the same problem, when i follow the doc on Gazebo website to use the elevator plugin, i can not find any topic like /gazebo/elevator in topic list. So i checked the other plugin file names which works in ros,i find other plugin all use these .so file names like libgazebo_ros_camera.so , so i changed the elevator plugin file name to libgazebo_ros_elevator.so and it worked. Also change the topic name from ~/elevator to any other names by yourself. ps: Ubuntu18 + ROS Melodic

edit flag offensive delete link more

Comments

Hi, can you tell me the so filename you did modification before and after?

kevin.kuei.0321@gmail.com gravatar image kevin.kuei.0321@gmail.com  ( 2022-04-25 23:09:20 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-07-24 09:57:42 -0500

Seen: 1,106 times

Last updated: Apr 17 '22