2 #include <geometry_msgs/Pose.h> 5 #include <mrpt_msgs/ObservationRangeBeacon.h> 10 #include <mrpt/version.h> 11 #include <mrpt/obs/CObservationBeaconRanges.h> 18 const mrpt::poses::CPose3D& _pose, CObservationBeaconRanges& _obj)
21 mrpt::poses::CPose3D cpose_obj;
23 _obj.stdError = _msg.sensor_std_range;
24 _obj.sensorLabel = _msg.header.frame_id;
25 _obj.maxSensorDistance = _msg.max_sensor_distance;
26 _obj.minSensorDistance = _msg.min_sensor_distance;
30 convert(_msg.sensor_pose_on_robot, cpose_obj);
31 _obj.setSensorPose(cpose_obj);
35 _obj.setSensorPose(_pose);
38 ASSERT_(_msg.sensed_data.size() >= 1);
39 const size_t N = _msg.sensed_data.size();
41 _obj.sensedData.resize(N);
43 for (std::size_t i_mrpt = 0; i_mrpt < N; i_mrpt++)
45 _obj.sensedData[i_mrpt].sensedDistance = _msg.sensed_data[i_mrpt].range;
46 _obj.sensedData[i_mrpt].beaconID = _msg.sensed_data[i_mrpt].id;
52 const CObservationBeaconRanges& _obj,
55 mrpt::poses::CPose3D cpose_obj;
58 _obj.getSensorPose(cpose_obj);
59 convert(cpose_obj, _msg.sensor_pose_on_robot);
61 _msg.sensor_std_range = _obj.stdError;
62 _msg.header.frame_id = _obj.sensorLabel;
63 _msg.max_sensor_distance = _obj.maxSensorDistance;
64 _msg.min_sensor_distance = _obj.minSensorDistance;
66 ASSERT_(_obj.sensedData.size() >= 1);
67 const size_t N = _obj.sensedData.size();
69 _msg.sensed_data.resize(N);
71 for (std::size_t i_msg = 0; i_msg < N; i_msg++)
73 _msg.sensed_data[i_msg].range = _obj.sensedData[i_msg].sensedDistance;
74 _msg.sensed_data[i_msg].id = _obj.sensedData[i_msg].beaconID;
80 const CObservationBeaconRanges& _obj,
84 mrpt::poses::CPose3D pose;
85 _obj.getSensorPose(pose);
File includes methods for converting CNetworkOfPoses*DInf <=> NetworkOfPoses message types...
bool convert(const mrpt_msgs::ObservationRangeBeacon &_msg, const mrpt::poses::CPose3D &_pose, mrpt::obs::CObservationBeaconRanges &_obj)
bool convert(const CObservationBeaconRanges &_obj, mrpt_msgs::ObservationRangeBeacon &_msg, geometry_msgs::Pose &_pose)