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_
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
virtual ~GazeboRosElevator()
Destructor.
ROSCPP_DECL bool isInitialized()
ros::CallbackQueue queue_
Custom Callback Queue.
void OnElevator(const std_msgs::String::ConstPtr &_msg)
Receives messages on the elevator's topic.
ros::NodeHandle * rosnode_
ros node handle
ros::Subscriber elevatorSub_
Subscribes to a topic that controls the elevator.
GZ_REGISTER_MODEL_PLUGIN(GazeboRosF3D)
#define ROS_FATAL_STREAM_NAMED(name, args)
ROS implementation of the Elevator plugin.
GazeboRosElevator()
Constructor.
void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf)
Load the plugin.
std::string robotNamespace_
for setting ROS name space
boost::shared_ptr< void > VoidPtr
void QueueThread()
Queu to handle callbacks.