10 #include <geometry_msgs/Pose.h>
13 #include <mrpt_msgs/ObservationRangeBeacon.h>
18 #include <mrpt/version.h>
19 #include <mrpt/obs/CObservationBeaconRanges.h>
26 const mrpt::poses::CPose3D& _pose, CObservationBeaconRanges& _obj)
29 mrpt::poses::CPose3D cpose_obj;
31 _obj.stdError = _msg.sensor_std_range;
32 _obj.sensorLabel = _msg.header.frame_id;
33 _obj.maxSensorDistance = _msg.max_sensor_distance;
34 _obj.minSensorDistance = _msg.min_sensor_distance;
38 convert(_msg.sensor_pose_on_robot, cpose_obj);
39 _obj.setSensorPose(cpose_obj);
43 _obj.setSensorPose(_pose);
46 ASSERT_(_msg.sensed_data.size() >= 1);
47 const size_t N = _msg.sensed_data.size();
49 _obj.sensedData.resize(N);
51 for (std::size_t i_mrpt = 0; i_mrpt < N; i_mrpt++)
53 _obj.sensedData[i_mrpt].sensedDistance = _msg.sensed_data[i_mrpt].range;
54 _obj.sensedData[i_mrpt].beaconID = _msg.sensed_data[i_mrpt].id;
60 const CObservationBeaconRanges& _obj,
63 mrpt::poses::CPose3D cpose_obj;
66 _obj.getSensorPose(cpose_obj);
67 convert(cpose_obj, _msg.sensor_pose_on_robot);
69 _msg.sensor_std_range = _obj.stdError;
70 _msg.header.frame_id = _obj.sensorLabel;
71 _msg.max_sensor_distance = _obj.maxSensorDistance;
72 _msg.min_sensor_distance = _obj.minSensorDistance;
74 ASSERT_(_obj.sensedData.size() >= 1);
75 const size_t N = _obj.sensedData.size();
77 _msg.sensed_data.resize(N);
79 for (std::size_t i_msg = 0; i_msg < N; i_msg++)
81 _msg.sensed_data[i_msg].range = _obj.sensedData[i_msg].sensedDistance;
82 _msg.sensed_data[i_msg].id = _obj.sensedData[i_msg].beaconID;
88 const CObservationBeaconRanges& _obj,
92 mrpt::poses::CPose3D pose;
93 _obj.getSensorPose(pose);