Go to the documentation of this file.
44 if (_sdf->HasElement(
"robotNamespace"))
47 "robotNamespace")->Get<std::string>() +
"/";
54 <<
"unable to load plugin. Load the Gazebo system plugin "
55 <<
"'libgazebo_ros_api_plugin.so' in the gazebo_ros package)");
59 std::string topic =
"elevator";
60 if (_sdf->HasElement(
"topic"))
61 topic = _sdf->Get<std::string>(
"topic");
63 ElevatorPlugin::Load(_parent, _sdf);
68 ros::SubscribeOptions::create<std_msgs::String>(topic, 1,
82 this->MoveToFloor(std::stoi(_msg->data));
88 static const double timeout = 0.01;
boost::thread callbackQueueThread_
ros::NodeHandle * rosnode_
ros node handle
ros::CallbackQueue queue_
Custom Callback Queue.
ros::Subscriber elevatorSub_
Subscribes to a topic that controls the elevator.
void OnElevator(const std_msgs::String::ConstPtr &_msg)
Receives messages on the elevator's topic.
void QueueThread()
Queu to handle callbacks.
#define ROS_FATAL_STREAM_NAMED(name, args)
ROS implementation of the Elevator plugin.
GZ_REGISTER_MODEL_PLUGIN(GazeboRosF3D)
ROSCPP_DECL bool isInitialized()
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf)
Load the plugin.
virtual ~GazeboRosElevator()
Destructor.
std::string robotNamespace_
for setting ROS name space
GazeboRosElevator()
Constructor.
gazebo_plugins
Author(s): John Hsu
autogenerated on Thu Sep 5 2024 02:49:55