11#define M_PI (3.14159265358979323846)
20 ok = m_poly->
view(m_iOrientationSensors);
25 ok = m_poly->view(m_iPositionSensors);
30 ok = m_iPositionSensors->getPositionSensorFrameName(m_sens_index, m_framename);
47 pose_data.pose.position.x = vecpos[0];
48 pose_data.pose.position.y = vecpos[1];
49 pose_data.pose.position.z = vecpos[2];
50 vecrpy[0] = vecrpy[0] *
M_PI / 180.0;
51 vecrpy[1] = vecrpy[1] *
M_PI / 180.0;
52 vecrpy[2] = vecrpy[2] *
M_PI / 180.0;
55 pose_data.pose.orientation.x = q.
x();
56 pose_data.pose.orientation.y = q.
y();
57 pose_data.pose.orientation.z = q.
z();
58 pose_data.pose.orientation.w = q.
w();
contains the definition of a Matrix type
const yarp::os::LogComponent & GENERICSENSORROSPUBLISHER()
yarp::os::Publisher< yarp::rosmsg::geometry_msgs::PoseStamped > m_publisher
const size_t m_sens_index
PoseStampedRosPublisher: This wrapper connects to a device and publishes a ROS topic of type geometry...
void run() override
Loop function.
bool view(T *&x)
Get an interface to the device driver.
virtual bool getOrientationSensorMeasureAsRollPitchYaw(size_t sens_index, yarp::sig::Vector &rpy, double ×tamp) const =0
Get the last reading of the orientation sensor as roll pitch yaw.
virtual bool getPositionSensorMeasure(size_t sens_index, yarp::sig::Vector &xyz, double ×tamp) const =0
Get the last reading of the position sensor as x y z.
void fromRotationMatrix(const yarp::sig::Matrix &R)
Converts a rotation matrix to a quaternion.
bool isOpen() const
Check if the port has been opened.
Port & asPort() override
Get the concrete Port being used for communication.
void write(bool forceStrict=false)
Write the current object being returned by Publisher::prepare.
T & prepare()
Access the object which will be transmitted by the next call to yarp::os::Publisher::write.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
yarp::sig::Matrix rpy2dcm(const yarp::sig::Vector &rpy)
Converts roll-pitch-yaw angles in the corresponding dcm (direction cosine matrix) rotation matrix (de...