27 #include <std_msgs/Header.h> 28 #include <boost/bind.hpp> 33 : WorldPlugin(), gz_node_handle_(0), ros_node_handle_(0) {}
45 sdf::ElementPtr _sdf) {
47 gzdbg << __FUNCTION__ <<
"() called." << std::endl;
114 template <
typename GazeboMsgT>
132 (ptr->*fp)(msg_ptr, ros_publisher);
136 template <
typename GazeboMsgT,
typename RosMsgT>
141 std::string gazeboTopicName, std::string rosTopicName,
142 transport::NodePtr gz_node_handle) {
144 static std::map<std::string, ConnectHelperStorage<GazeboMsgT> > callback_map;
150 auto callback_entry = callback_map.emplace(
155 if (!callback_entry.second)
156 gzerr <<
"Tried to add element to map but the gazebo topic name was " 157 "already present in map." 161 gazebo::transport::SubscriberPtr subscriberPtr;
162 subscriberPtr = gz_node_handle->Subscribe(
164 &callback_entry.first->second);
174 gzdbg << __FUNCTION__ <<
"() called." << std::endl;
177 const std::string gazeboNamespace =
179 const std::string gazeboTopicName =
180 gz_connect_gazebo_to_ros_topic_msg->gazebo_topic();
181 const std::string rosTopicName =
182 gz_connect_gazebo_to_ros_topic_msg->ros_topic();
184 gzdbg <<
"Connecting Gazebo topic \"" << gazeboTopicName
185 <<
"\" to ROS topic \"" << rosTopicName <<
"\"." << std::endl;
187 switch (gz_connect_gazebo_to_ros_topic_msg->msgtype()) {
188 case gz_std_msgs::ConnectGazeboToRosTopic::ACTUATORS:
189 ConnectHelper<gz_sensor_msgs::Actuators, mav_msgs::Actuators>(
193 case gz_std_msgs::ConnectGazeboToRosTopic::FLOAT_32:
194 ConnectHelper<gz_std_msgs::Float32, std_msgs::Float32>(
198 case gz_std_msgs::ConnectGazeboToRosTopic::FLUID_PRESSURE:
199 ConnectHelper<gz_sensor_msgs::FluidPressure, sensor_msgs::FluidPressure>(
203 case gz_std_msgs::ConnectGazeboToRosTopic::IMU:
204 ConnectHelper<gz_sensor_msgs::Imu, sensor_msgs::Imu>(
208 case gz_std_msgs::ConnectGazeboToRosTopic::JOINT_STATE:
209 ConnectHelper<gz_sensor_msgs::JointState, sensor_msgs::JointState>(
213 case gz_std_msgs::ConnectGazeboToRosTopic::MAGNETIC_FIELD:
214 ConnectHelper<gz_sensor_msgs::MagneticField, sensor_msgs::MagneticField>(
218 case gz_std_msgs::ConnectGazeboToRosTopic::NAV_SAT_FIX:
219 ConnectHelper<gz_sensor_msgs::NavSatFix, sensor_msgs::NavSatFix>(
223 case gz_std_msgs::ConnectGazeboToRosTopic::POSE:
224 ConnectHelper<gazebo::msgs::Pose, geometry_msgs::Pose>(
228 case gz_std_msgs::ConnectGazeboToRosTopic::POSE_WITH_COVARIANCE_STAMPED:
230 geometry_msgs::PoseWithCovarianceStamped>(
232 this, gazeboNamespace, gazeboTopicName, rosTopicName,
235 case gz_std_msgs::ConnectGazeboToRosTopic::ODOMETRY:
236 ConnectHelper<gz_geometry_msgs::Odometry, nav_msgs::Odometry>(
240 case gz_std_msgs::ConnectGazeboToRosTopic::TRANSFORM_STAMPED:
242 geometry_msgs::TransformStamped>(
246 case gz_std_msgs::ConnectGazeboToRosTopic::TWIST_STAMPED:
248 geometry_msgs::TwistStamped>(
252 case gz_std_msgs::ConnectGazeboToRosTopic::VECTOR_3D_STAMPED:
254 geometry_msgs::PointStamped>(
258 case gz_std_msgs::ConnectGazeboToRosTopic::WIND_SPEED:
260 rotors_comm::WindSpeed>(
264 case gz_std_msgs::ConnectGazeboToRosTopic::WRENCH_STAMPED:
266 geometry_msgs::WrenchStamped>(
271 gzthrow(
"ConnectGazeboToRosTopic message type with enum val = " 272 << gz_connect_gazebo_to_ros_topic_msg->msgtype()
273 <<
" is not supported by GazeboRosInterfacePlugin.");
276 gzdbg << __FUNCTION__ <<
"() finished." << std::endl;
282 gzdbg << __FUNCTION__ <<
"() called." << std::endl;
285 static std::vector<ros::Subscriber> ros_subscribers;
287 switch (gz_connect_ros_to_gazebo_topic_msg->msgtype()) {
288 case gz_std_msgs::ConnectRosToGazeboTopic::ACTUATORS: {
289 gazebo::transport::PublisherPtr gz_publisher_ptr =
291 gz_connect_ros_to_gazebo_topic_msg->gazebo_topic(), 1);
296 gz_connect_ros_to_gazebo_topic_msg->ros_topic(), 1,
298 this, _1, gz_publisher_ptr));
302 ros_subscribers.push_back(ros_subscriber);
306 case gz_std_msgs::ConnectRosToGazeboTopic::COMMAND_MOTOR_SPEED: {
307 gazebo::transport::PublisherPtr gz_publisher_ptr =
309 gz_connect_ros_to_gazebo_topic_msg->gazebo_topic(), 1);
314 gz_connect_ros_to_gazebo_topic_msg->ros_topic(), 1,
317 this, _1, gz_publisher_ptr));
321 ros_subscribers.push_back(ros_subscriber);
325 case gz_std_msgs::ConnectRosToGazeboTopic::ROLL_PITCH_YAWRATE_THRUST: {
326 gazebo::transport::PublisherPtr gz_publisher_ptr =
328 gz_connect_ros_to_gazebo_topic_msg->gazebo_topic(), 1);
333 gz_connect_ros_to_gazebo_topic_msg->ros_topic(), 1,
337 this, _1, gz_publisher_ptr));
341 ros_subscribers.push_back(ros_subscriber);
345 case gz_std_msgs::ConnectRosToGazeboTopic::WIND_SPEED: {
346 gazebo::transport::PublisherPtr gz_publisher_ptr =
348 gz_connect_ros_to_gazebo_topic_msg->gazebo_topic(), 1);
353 gz_connect_ros_to_gazebo_topic_msg->ros_topic(), 1,
355 this, _1, gz_publisher_ptr));
359 ros_subscribers.push_back(ros_subscriber);
364 gzthrow(
"ConnectRosToGazeboTopic message type with enum val = " 365 << gz_connect_ros_to_gazebo_topic_msg->msgtype()
366 <<
" is not supported by GazeboRosInterfacePlugin.");
376 const gz_std_msgs::Header& gz_header,
378 ros_header->stamp.sec = gz_header.stamp().sec();
379 ros_header->stamp.nsec = gz_header.stamp().nsec();
380 ros_header->frame_id = gz_header.frame_id();
385 gz_std_msgs::Header* gz_header) {
386 gz_header->mutable_stamp()->set_sec(ros_header.stamp.sec);
387 gz_header->mutable_stamp()->set_nsec(ros_header.stamp.nsec);
388 gz_header->set_frame_id(ros_header.frame_id);
403 gz_actuators_msg->angular_velocities_size());
404 for (
int i = 0; i < gz_actuators_msg->angular_velocities_size(); i++) {
406 gz_actuators_msg->angular_velocities(i);
432 gz_fluid_pressure_msg->fluid_pressure();
447 ros_imu_msg_.orientation.x = gz_imu_msg->orientation().x();
448 ros_imu_msg_.orientation.y = gz_imu_msg->orientation().y();
449 ros_imu_msg_.orientation.z = gz_imu_msg->orientation().z();
450 ros_imu_msg_.orientation.w = gz_imu_msg->orientation().w();
454 GZ_ASSERT(gz_imu_msg->orientation_covariance_size() == 9,
455 "The Gazebo IMU message does not have 9 orientation covariance " 459 "The ROS IMU message does not have 9 orientation covariance elements.");
460 for (
int i = 0; i < gz_imu_msg->orientation_covariance_size(); i++) {
462 gz_imu_msg->orientation_covariance(i);
465 ros_imu_msg_.angular_velocity.x = gz_imu_msg->angular_velocity().x();
466 ros_imu_msg_.angular_velocity.y = gz_imu_msg->angular_velocity().y();
467 ros_imu_msg_.angular_velocity.z = gz_imu_msg->angular_velocity().z();
469 GZ_ASSERT(gz_imu_msg->angular_velocity_covariance_size() == 9,
470 "The Gazebo IMU message does not have 9 angular velocity " 471 "covariance elements.");
472 GZ_ASSERT(
ros_imu_msg_.angular_velocity_covariance.size() == 9,
473 "The ROS IMU message does not have 9 angular velocity covariance " 475 for (
int i = 0; i < gz_imu_msg->angular_velocity_covariance_size(); i++) {
477 gz_imu_msg->angular_velocity_covariance(i);
480 ros_imu_msg_.linear_acceleration.x = gz_imu_msg->linear_acceleration().x();
481 ros_imu_msg_.linear_acceleration.y = gz_imu_msg->linear_acceleration().y();
482 ros_imu_msg_.linear_acceleration.z = gz_imu_msg->linear_acceleration().z();
484 GZ_ASSERT(gz_imu_msg->linear_acceleration_covariance_size() == 9,
485 "The Gazebo IMU message does not have 9 linear acceleration " 486 "covariance elements.");
487 GZ_ASSERT(
ros_imu_msg_.linear_acceleration_covariance.size() == 9,
488 "The ROS IMU message does not have 9 linear acceleration " 489 "covariance elements.");
490 for (
int i = 0; i < gz_imu_msg->linear_acceleration_covariance_size(); i++) {
492 gz_imu_msg->linear_acceleration_covariance(i);
505 for (
int i = 0; i < gz_joint_state_msg->name_size(); i++) {
510 for (
int i = 0; i < gz_joint_state_msg->position_size(); i++) {
528 gz_magnetic_field_msg->magnetic_field().x();
530 gz_magnetic_field_msg->magnetic_field().y();
532 gz_magnetic_field_msg->magnetic_field().z();
536 GZ_ASSERT(gz_magnetic_field_msg->magnetic_field_covariance_size() == 9,
537 "The Gazebo MagneticField message does not have 9 magnetic field " 538 "covariance elements.");
540 "The ROS MagneticField message does not have 9 magnetic field " 541 "covariance elements.");
542 for (
int i = 0; i < gz_magnetic_field_msg->magnetic_field_covariance_size();
545 gz_magnetic_field_msg->magnetic_field_covariance(i);
560 switch (gz_nav_sat_fix_msg->service()) {
561 case gz_sensor_msgs::NavSatFix::SERVICE_GPS:
563 sensor_msgs::NavSatStatus::SERVICE_GPS;
565 case gz_sensor_msgs::NavSatFix::SERVICE_GLONASS:
567 sensor_msgs::NavSatStatus::SERVICE_GLONASS;
569 case gz_sensor_msgs::NavSatFix::SERVICE_COMPASS:
571 sensor_msgs::NavSatStatus::SERVICE_COMPASS;
573 case gz_sensor_msgs::NavSatFix::SERVICE_GALILEO:
575 sensor_msgs::NavSatStatus::SERVICE_GALILEO;
579 "Specific value of enum type gz_sensor_msgs::NavSatFix::Service is " 580 "not yet supported.");
583 switch (gz_nav_sat_fix_msg->status()) {
584 case gz_sensor_msgs::NavSatFix::STATUS_NO_FIX:
586 sensor_msgs::NavSatStatus::STATUS_NO_FIX;
588 case gz_sensor_msgs::NavSatFix::STATUS_FIX:
590 sensor_msgs::NavSatStatus::STATUS_FIX;
592 case gz_sensor_msgs::NavSatFix::STATUS_SBAS_FIX:
594 sensor_msgs::NavSatStatus::STATUS_SBAS_FIX;
596 case gz_sensor_msgs::NavSatFix::STATUS_GBAS_FIX:
598 sensor_msgs::NavSatStatus::STATUS_GBAS_FIX;
602 "Specific value of enum type gz_sensor_msgs::NavSatFix::Status is " 603 "not yet supported.");
610 switch (gz_nav_sat_fix_msg->position_covariance_type()) {
611 case gz_sensor_msgs::NavSatFix::COVARIANCE_TYPE_UNKNOWN:
613 sensor_msgs::NavSatFix::COVARIANCE_TYPE_UNKNOWN;
615 case gz_sensor_msgs::NavSatFix::COVARIANCE_TYPE_APPROXIMATED:
617 sensor_msgs::NavSatFix::COVARIANCE_TYPE_APPROXIMATED;
619 case gz_sensor_msgs::NavSatFix::COVARIANCE_TYPE_DIAGONAL_KNOWN:
621 sensor_msgs::NavSatFix::COVARIANCE_TYPE_DIAGONAL_KNOWN;
623 case gz_sensor_msgs::NavSatFix::COVARIANCE_TYPE_KNOWN:
625 sensor_msgs::NavSatFix::COVARIANCE_TYPE_KNOWN;
629 "Specific value of enum type " 630 "gz_sensor_msgs::NavSatFix::PositionCovarianceType is not yet " 636 GZ_ASSERT(gz_nav_sat_fix_msg->position_covariance_size() == 9,
637 "The Gazebo NavSatFix message does not have 9 position covariance " 640 "The ROS NavSatFix message does not have 9 position covariance " 642 for (
int i = 0; i < gz_nav_sat_fix_msg->position_covariance_size(); i++) {
644 gz_nav_sat_fix_msg->position_covariance(i);
667 gz_odometry_msg->pose().pose().position().x();
669 gz_odometry_msg->pose().pose().position().y();
671 gz_odometry_msg->pose().pose().position().z();
674 gz_odometry_msg->pose().pose().orientation().w();
676 gz_odometry_msg->pose().pose().orientation().x();
678 gz_odometry_msg->pose().pose().orientation().y();
680 gz_odometry_msg->pose().pose().orientation().z();
682 for (
int i = 0; i < gz_odometry_msg->pose().covariance_size(); i++) {
684 gz_odometry_msg->pose().covariance(i);
691 gz_odometry_msg->twist().twist().linear().x();
693 gz_odometry_msg->twist().twist().linear().y();
695 gz_odometry_msg->twist().twist().linear().z();
698 gz_odometry_msg->twist().twist().angular().x();
700 gz_odometry_msg->twist().twist().angular().y();
702 gz_odometry_msg->twist().twist().angular().z();
704 for (
int i = 0; i < gz_odometry_msg->twist().covariance_size(); i++) {
706 gz_odometry_msg->twist().covariance(i);
719 ros_pose_msg_.orientation.w = gz_pose_msg->orientation().w();
720 ros_pose_msg_.orientation.x = gz_pose_msg->orientation().x();
721 ros_pose_msg_.orientation.y = gz_pose_msg->orientation().y();
722 ros_pose_msg_.orientation.z = gz_pose_msg->orientation().z();
740 gz_pose_with_covariance_stamped_msg->pose_with_covariance()
745 gz_pose_with_covariance_stamped_msg->pose_with_covariance()
750 gz_pose_with_covariance_stamped_msg->pose_with_covariance()
756 gz_pose_with_covariance_stamped_msg->pose_with_covariance()
761 gz_pose_with_covariance_stamped_msg->pose_with_covariance()
766 gz_pose_with_covariance_stamped_msg->pose_with_covariance()
771 gz_pose_with_covariance_stamped_msg->pose_with_covariance()
778 GZ_ASSERT(gz_pose_with_covariance_stamped_msg->pose_with_covariance()
779 .covariance_size() == 36,
780 "The Gazebo PoseWithCovarianceStamped message does not have 9 " 781 "position covariance elements.");
783 "The ROS PoseWithCovarianceStamped message does not have 9 " 784 "position covariance elements.");
786 i < gz_pose_with_covariance_stamped_msg->pose_with_covariance()
790 gz_pose_with_covariance_stamped_msg->pose_with_covariance().covariance(
810 gz_transform_stamped_msg->transform().translation().x();
812 gz_transform_stamped_msg->transform().translation().y();
814 gz_transform_stamped_msg->transform().translation().z();
820 gz_transform_stamped_msg->transform().rotation().w();
822 gz_transform_stamped_msg->transform().rotation().x();
824 gz_transform_stamped_msg->transform().rotation().y();
826 gz_transform_stamped_msg->transform().rotation().z();
844 gz_twist_stamped_msg->twist().linear().x();
846 gz_twist_stamped_msg->twist().linear().y();
848 gz_twist_stamped_msg->twist().linear().z();
851 gz_twist_stamped_msg->twist().angular().x();
853 gz_twist_stamped_msg->twist().angular().y();
855 gz_twist_stamped_msg->twist().angular().z();
893 gz_wind_speed_msg->velocity().x();
895 gz_wind_speed_msg->velocity().y();
897 gz_wind_speed_msg->velocity().z();
914 gz_wrench_stamped_msg->wrench().force().x();
916 gz_wrench_stamped_msg->wrench().force().y();
918 gz_wrench_stamped_msg->wrench().force().z();
924 gz_wrench_stamped_msg->wrench().torque().x();
926 gz_wrench_stamped_msg->wrench().torque().y();
928 gz_wrench_stamped_msg->wrench().torque().z();
938 const mav_msgs::ActuatorsConstPtr& ros_actuators_msg_ptr,
939 gazebo::transport::PublisherPtr gz_publisher_ptr) {
942 gz_sensor_msgs::Actuators gz_actuators_msg;
945 gz_actuators_msg.mutable_header());
947 for (
int i = 0; i < ros_actuators_msg_ptr->angles.size(); i++) {
948 gz_actuators_msg.add_angles(
949 ros_actuators_msg_ptr->angles[i]);
952 for (
int i = 0; i < ros_actuators_msg_ptr->angular_velocities.size(); i++) {
953 gz_actuators_msg.add_angular_velocities(
954 ros_actuators_msg_ptr->angular_velocities[i]);
957 for (
int i = 0; i < ros_actuators_msg_ptr->normalized.size(); i++) {
958 gz_actuators_msg.add_normalized(
959 ros_actuators_msg_ptr->normalized[i]);
963 gz_publisher_ptr->Publish(gz_actuators_msg);
967 const mav_msgs::ActuatorsConstPtr& ros_actuators_msg_ptr,
968 gazebo::transport::PublisherPtr gz_publisher_ptr) {
971 gz_mav_msgs::CommandMotorSpeed gz_command_motor_speed_msg;
973 for (
int i = 0; i < ros_actuators_msg_ptr->angular_velocities.size(); i++) {
974 gz_command_motor_speed_msg.add_motor_speed(
975 ros_actuators_msg_ptr->angular_velocities[i]);
979 gz_publisher_ptr->Publish(gz_command_motor_speed_msg);
983 const mav_msgs::RollPitchYawrateThrustConstPtr&
984 ros_roll_pitch_yawrate_thrust_msg_ptr,
985 gazebo::transport::PublisherPtr gz_publisher_ptr) {
988 gz_mav_msgs::RollPitchYawrateThrust gz_roll_pitch_yawrate_thrust_msg;
991 gz_roll_pitch_yawrate_thrust_msg.mutable_header());
993 gz_roll_pitch_yawrate_thrust_msg.set_roll(
994 ros_roll_pitch_yawrate_thrust_msg_ptr->roll);
995 gz_roll_pitch_yawrate_thrust_msg.set_pitch(
996 ros_roll_pitch_yawrate_thrust_msg_ptr->pitch);
997 gz_roll_pitch_yawrate_thrust_msg.set_yaw_rate(
998 ros_roll_pitch_yawrate_thrust_msg_ptr->yaw_rate);
1000 gz_roll_pitch_yawrate_thrust_msg.mutable_thrust()->set_x(
1001 ros_roll_pitch_yawrate_thrust_msg_ptr->thrust.x);
1002 gz_roll_pitch_yawrate_thrust_msg.mutable_thrust()->set_y(
1003 ros_roll_pitch_yawrate_thrust_msg_ptr->thrust.y);
1004 gz_roll_pitch_yawrate_thrust_msg.mutable_thrust()->set_z(
1005 ros_roll_pitch_yawrate_thrust_msg_ptr->thrust.z);
1008 gz_publisher_ptr->Publish(gz_roll_pitch_yawrate_thrust_msg);
1012 const rotors_comm::WindSpeedConstPtr& ros_wind_speed_msg_ptr,
1013 gazebo::transport::PublisherPtr gz_publisher_ptr) {
1016 gz_mav_msgs::WindSpeed gz_wind_speed_msg;
1019 gz_wind_speed_msg.mutable_header());
1021 gz_wind_speed_msg.mutable_velocity()->set_x(
1022 ros_wind_speed_msg_ptr->velocity.x);
1023 gz_wind_speed_msg.mutable_velocity()->set_y(
1024 ros_wind_speed_msg_ptr->velocity.y);
1025 gz_wind_speed_msg.mutable_velocity()->set_z(
1026 ros_wind_speed_msg_ptr->velocity.z);
1029 gz_publisher_ptr->Publish(gz_wind_speed_msg);
1035 stamp.
sec = broadcast_transform_msg->header().stamp().sec();
1036 stamp.
nsec = broadcast_transform_msg->header().stamp().nsec();
1038 tf::Quaternion tf_q_W_L(broadcast_transform_msg->transform().rotation().x(),
1039 broadcast_transform_msg->transform().rotation().y(),
1040 broadcast_transform_msg->transform().rotation().z(),
1041 broadcast_transform_msg->transform().rotation().w());
1043 tf::Vector3 tf_p(broadcast_transform_msg->transform().translation().x(),
1044 broadcast_transform_msg->transform().translation().y(),
1045 broadcast_transform_msg->transform().translation().z());
1049 tf_, stamp, broadcast_transform_msg->parent_frame_id(),
1050 broadcast_transform_msg->child_frame_id()));
void ConvertHeaderGzToRos(const gz_std_msgs::Header &gz_header, std_msgs::Header_< std::allocator< void > > *ros_header)
void GzFloat32MsgCallback(GzFloat32MsgPtr &gz_float_32_msg, ros::Publisher ros_publisher)
void GzWindSpeedMsgCallback(GzWindSpeedMsgPtr &gz_wind_speed_msg, ros::Publisher ros_publisher)
A helper class that provides storage for additional parameters that are inserted into the callback...
void GzTwistStampedMsgCallback(GzTwistStampedMsgPtr &gz_twist_stamped_msg, ros::Publisher ros_publisher)
void GzVector3dStampedMsgCallback(GzVector3dStampedMsgPtr &gz_vector_3d_stamped_msg, ros::Publisher ros_publisher)
void callback(const boost::shared_ptr< GazeboMsgT const > &msg_ptr)
This is what gets passed into the Gazebo Subscribe method as a callback, and hence can only have one ...
void GzOdometryMsgCallback(GzOdometryMsgPtr &gz_odometry_msg, ros::Publisher ros_publisher)
rotors_comm::WindSpeed ros_wind_speed_msg_
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
static const std::string kConnectRosToGazeboSubtopic
GZ_REGISTER_WORLD_PLUGIN(GazeboRosInterfacePlugin)
ros::NodeHandle * ros_node_handle_
Handle for the ROS node.
mav_msgs::Actuators ros_actuators_msg_
void GzNavSatFixCallback(GzNavSatFixPtr &gz_nav_sat_fix_msg, ros::Publisher ros_publisher)
void GzWrenchStampedMsgCallback(GzWrenchStampedMsgPtr &gz_wrench_stamped_msg, ros::Publisher ros_publisher)
void GzConnectGazeboToRosTopicMsgCallback(GzConnectGazeboToRosTopicMsgPtr &gz_connect_gazebo_to_ros_topic_msg)
void GzTransformStampedMsgCallback(GzTransformStampedMsgPtr &gz_transform_stamped_msg, ros::Publisher ros_publisher)
void GzActuatorsMsgCallback(GzActuatorsMsgPtr &gz_actuators_msg, ros::Publisher ros_publisher)
tf::TransformBroadcaster transform_broadcaster_
void RosRollPitchYawrateThrustMsgCallback(const mav_msgs::RollPitchYawrateThrustConstPtr &ros_roll_pitch_yawrate_thrust_msg_ptr, gazebo::transport::PublisherPtr gz_publisher_ptr)
void GzConnectRosToGazeboTopicMsgCallback(GzConnectRosToGazeboTopicMsgPtr &gz_connect_ros_to_gazebo_topic_msg)
Subscribes to the provided ROS topic and publishes on the provided Gazebo topic (all info contained w...
GazeboRosInterfacePlugin * ptr
Pointer to the ROS interface plugin class.
geometry_msgs::WrenchStamped ros_wrench_stamped_msg_
geometry_msgs::PoseWithCovarianceStamped ros_pose_with_covariance_stamped_msg_
void publish(const boost::shared_ptr< M > &message) const
geometry_msgs::Pose ros_pose_msg_
void RosWindSpeedMsgCallback(const rotors_comm::WindSpeedConstPtr &ros_wind_speed_msg_ptr, gazebo::transport::PublisherPtr gz_publisher_ptr)
void ConnectHelper(void(GazeboRosInterfacePlugin::*fp)(const boost::shared_ptr< GazeboMsgT const > &, ros::Publisher), GazeboRosInterfacePlugin *ptr, std::string gazeboNamespace, std::string gazeboTopicName, std::string rosTopicName, transport::NodePtr gz_node_handle)
Provides a way for GzConnectGazeboToRosTopicMsgCallback() to connect a Gazebo subscriber to a ROS pub...
void GzImuMsgCallback(GzImuPtr &gz_imu_msg, ros::Publisher ros_publisher)
nav_msgs::Odometry ros_odometry_msg_
void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf)
static const bool kPrintOnPluginLoad
void GzMagneticFieldMsgCallback(GzMagneticFieldMsgPtr &gz_magnetic_field_msg, ros::Publisher ros_publisher)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
geometry_msgs::PointStamped ros_position_stamped_msg_
void GzPoseWithCovarianceStampedMsgCallback(GzPoseWithCovarianceStampedMsgPtr &gz_pose_with_covariance_stamped_msg, ros::Publisher ros_publisher)
geometry_msgs::TwistStamped ros_twist_stamped_msg_
std_msgs::Float32 ros_float_32_msg_
sensor_msgs::MagneticField ros_magnetic_field_msg_
std::vector< gazebo::transport::SubscriberPtr > subscriberPtrs_
sensor_msgs::JointState ros_joint_state_msg_
ros::Publisher ros_publisher
The ROS publisher that is passed into the modified callback.
geometry_msgs::TransformStamped ros_transform_stamped_msg_
sensor_msgs::FluidPressure ros_fluid_pressure_msg_
sensor_msgs::NavSatFix ros_nav_sat_fix_msg_
physics::WorldPtr world_
Pointer to the world.
sensor_msgs::Imu ros_imu_msg_
void GzPoseMsgCallback(GzPoseMsgPtr &gz_pose_msg, ros::Publisher ros_publisher)
ROS interface plugin for Gazebo.
void GzFluidPressureMsgCallback(GzFluidPressureMsgPtr &gz_fluid_pressure_msg, ros::Publisher ros_publisher)
transport::SubscriberPtr gz_connect_ros_to_gazebo_topic_sub_
event::ConnectionPtr updateConnection_
Pointer to the update event connection.
transport::SubscriberPtr gz_broadcast_transform_sub_
void ConvertHeaderRosToGz(const std_msgs::Header_< std::allocator< void > > &ros_header, gz_std_msgs::Header *gz_header)
~GazeboRosInterfacePlugin()
static const std::string kConnectGazeboToRosSubtopic
void OnUpdate(const common::UpdateInfo &)
This gets called by the world update start event.
void GzJointStateMsgCallback(GzJointStateMsgPtr &gz_joint_state_msg, ros::Publisher ros_publisher)
transport::SubscriberPtr gz_connect_gazebo_to_ros_topic_sub_
static const std::string kBroadcastTransformSubtopic
Special-case topic for ROS interface plugin to listen to (if present) and broadcast transforms to the...
transport::NodePtr gz_node_handle_
Handle for the Gazebo node.
GazeboRosInterfacePlugin()
static const bool kPrintOnMsgCallback
void RosActuatorsMsgCallback(const mav_msgs::ActuatorsConstPtr &ros_actuators_msg_ptr, gazebo::transport::PublisherPtr gz_publisher_ptr)
void RosCommandMotorSpeedMsgCallback(const mav_msgs::ActuatorsConstPtr &ros_command_motor_speed_msg_ptr, gazebo::transport::PublisherPtr gz_publisher_ptr)
void GzBroadcastTransformMsgCallback(GzTransformStampedWithFrameIdsMsgPtr &broadcast_transform_msg)
This is a special-case callback which listens for Gazebo "Transform" messages. Upon receiving one it ...