6 _humanoids_sub( _nh_rel.subscribe( topic, 10, &
HumanoidSourceROS::humanoidsCB, this ) )
25 static_cast<semio::HumanoidJoint::JointType>( msg.type ),
26 Eigen::Vector3d( msg.position.x, msg.position.y, msg.position.z ),
27 Eigen::Quaterniond( msg.orientation.w, msg.orientation.x, msg.orientation.y, msg.orientation.z ),
28 msg.position_confidence,
29 msg.orientation_confidence );
36 for(
auto const & joint_msg : msg.joints )
38 joints.emplace( std::make_pair(
39 static_cast<semio::HumanoidJoint::JointType>( joint_msg.type ),
43 return semio::Humanoid( msg.id, static_cast<semio::Humanoid::TrackingState>( msg.tracking_state ), std::move( joints ) );
49 humanoids.reserve( msg.humanoids.size() );
51 for(
auto const & humanoid_msg : msg.humanoids )
std::map< HumanoidJoint::JointType, HumanoidJoint > _JointArray
semio_msgs_ros::HumanoidJoint _HumanoidJointMsg
ROS message for a humanoid joint.
HumanoidSourceROS(::ros::NodeHandle const &nh_rel, std::string const &topic="humanoids")
void humanoidsCB(_HumanoidsMsg::ConstPtr const &msg)
ROS callback for humanoids messages.
semio_msgs_ros::Humanoids _HumanoidsMsg
ROS message for a vector of humanoids.
static HumanoidJoint fromROSMsg(_HumanoidJointMsg const &msg)
Create a semio::HumanoidJoint from a humanoid joint message.
_HumanoidsMsg::ConstPtr _last_humanoids_msg
ConstPtr to the last message received from ROS.
semio::HumanoidSource to source humanoids from ROS
HumanoidArray updateFromSource()
Convert _last_humanoids_msg to a semio::HumanoidArray.
std::vector< semio::Humanoid > HumanoidArray
semio_msgs_ros::Humanoid _HumanoidMsg
ROS message for a single humanoid.