27 ignition::math::Vector3d(M_PI, 0, 0));
53 GZ_ASSERT(_sdf->HasElement(
"link_name"),
"No link name provided");
54 GetSDFParam<std::string>(_sdf,
"link_name", linkName,
"");
55 GZ_ASSERT(!linkName.empty(),
"Link name string is empty");
61 if (_sdf->HasElement(
"reference_link_name"))
63 std::string refLinkName;
64 GetSDFParam<std::string>(_sdf,
"reference_link_name", refLinkName,
"");
65 if (!refLinkName.empty())
68 GZ_ASSERT(this->
referenceLink != NULL,
"Invalid reference link");
74 this->
link = this->
model->GetLink(linkName);
75 GZ_ASSERT(this->
link != NULL,
"Invalid link pointer");
97 geometry_msgs::TransformStamped
msg;
physics::LinkPtr referenceLink
Reference link.
static tf::Quaternion createQuaternionFromRPY(double roll, double pitch, double yaw)
tf::StampedTransform tfLocalNEDFrame
Local NED TF frame.
physics::WorldPtr world
Pointer to the world.
bool enableLocalNEDFrame
True if a the local NED frame needs to be broadcasted.
void SendLocalNEDTransform()
Returns true if the base_link_ned frame exists.
event::ConnectionPtr updateConnection
Pointer to the update event connection.
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Load plugin and its configuration from sdf,.
virtual bool OnUpdate(const common::UpdateInfo &)=0
Update callback from simulation.
bool InitBasePlugin(sdf::ElementPtr _sdf)
Initialize base plugin.
std::string referenceFrameID
Frame ID of the reference frame.
ignition::math::Pose3d localNEDFrame
Pose of the local NED frame wrt link frame.
physics::LinkPtr link
Pointer to the link.
ROSBaseModelPlugin()
Class constructor.
physics::ModelPtr model
Pointer to the model.
tf::TransformBroadcaster * tfBroadcaster
TF broadcaster for the local NED frame.
virtual bool OnUpdate(const common::UpdateInfo &)
Update callback from simulation.
static void transformStampedTFToMsg(const StampedTransform &bt, geometry_msgs::TransformStamped &msg)
virtual ~ROSBaseModelPlugin()
Class destructor.