6 _humanoids_pub( _nh_rel.advertise<
_HumanoidsMsg>( topic, 10 ) )
14 auto & joint_msg( *joint_msg_ptr );
16 joint_msg.type =
static_cast<uint32_t
>( joint.
joint_type_ );
19 joint_msg.position.x = joint.
position_.x();
20 joint_msg.position.y = joint.
position_.y();
21 joint_msg.position.z = joint.
position_.z();
37 _HumanoidMsg::Ptr humanoid_msg_ptr(
new _HumanoidMsg() );
38 auto & humanoid_msg( *humanoid_msg_ptr );
40 humanoid_msg.id = humanoid.
id_;
41 humanoid_msg.tracking_state =
static_cast<uint32_t
>( humanoid.
tracking_state_ );
42 humanoid_msg.joints.reserve( humanoid.
joints_.size() );
44 for(
auto const & joint_item : humanoid.
joints_ )
49 return humanoid_msg_ptr;
60 auto & humanoids_msg( *humanoids_msg_ptr );
62 humanoids_msg.humanoids.reserve( humanoids.size() );
64 for(
auto const & humanoid : humanoids )
69 return humanoids_msg_ptr;
virtual void publishToSink(HumanoidArray const &humanoids)
Convert humanoids to a ROS message and publish it to ROS.
float orientation_confidence_
TrackingState tracking_state_
semio_msgs_ros::Humanoid _HumanoidMsg
ROS message for a single humanoid.
static _HumanoidJointMsg toROSMsg(HumanoidJoint const &joint)
Create a _HumanoidJointMsg from a semio::HumanoidJoint.
Eigen::Vector3d position_
semio_msgs_ros::HumanoidJoint _HumanoidJointMsg
ROS message for a humanoid joint.
float position_confidence_
static _HumanoidJointMsg::Ptr toROSMsgPtr(HumanoidJoint const &joint)
Create a _HumanoidJointMsg::Ptr from a semio::HumanoidJoint.
semio_msgs_ros::Humanoids _HumanoidsMsg
ROS message for a vector of humanoids.
Eigen::Quaterniond orientation_
std::vector< semio::Humanoid > HumanoidArray
::ros::Publisher _humanoids_pub
Publisher for humanoid messages.
HumanoidSinkROS(::ros::NodeHandle const &nh_rel, std::string const &topic="humanoids")