16 #include <geometry_msgs/Pose.h>
19 #include <mrpt_msgs/ObservationRangeBearing.h>
24 #include <mrpt/version.h>
25 #include <mrpt/obs/CObservationBearingRange.h>
32 const mrpt::poses::CPose3D& _pose, CObservationBearingRange& _obj)
36 mrpt::poses::CPose3D cpose_obj;
40 _obj.maxSensorDistance = _msg.max_sensor_distance;
41 _obj.minSensorDistance = _msg.min_sensor_distance;
42 _obj.sensor_std_yaw = _msg.sensor_std_yaw;
43 _obj.sensor_std_pitch = _msg.sensor_std_pitch;
44 _obj.sensor_std_range = _msg.sensor_std_range;
48 convert(_msg.sensor_pose_on_robot, cpose_obj);
49 _obj.setSensorPose(cpose_obj);
53 _obj.setSensorPose(_pose);
56 ASSERT_(_msg.sensed_data.size() >= 1);
57 const size_t N = _msg.sensed_data.size();
59 _obj.sensedData.resize(N);
61 for (std::size_t i_mrpt = 0; i_mrpt < N; i_mrpt++)
63 _obj.sensedData[i_mrpt].range = _msg.sensed_data[i_mrpt].range;
64 _obj.sensedData[i_mrpt].landmarkID = _msg.sensed_data[i_mrpt].id;
65 _obj.sensedData[i_mrpt].yaw = _msg.sensed_data[i_mrpt].yaw;
66 _obj.sensedData[i_mrpt].pitch = _msg.sensed_data[i_mrpt].pitch;
72 const CObservationBearingRange& _obj,
75 mrpt::poses::CPose3D cpose_obj;
78 _obj.getSensorPose(cpose_obj);
79 convert(cpose_obj, _msg.sensor_pose_on_robot);
81 _msg.max_sensor_distance = _obj.maxSensorDistance;
82 _msg.min_sensor_distance = _obj.minSensorDistance;
83 _msg.sensor_std_yaw = _obj.sensor_std_yaw;
84 _msg.sensor_std_pitch = _obj.sensor_std_pitch;
85 _msg.sensor_std_range = _obj.sensor_std_range;
87 ASSERT_(_obj.sensedData.size() >= 1);
88 const size_t N = _obj.sensedData.size();
90 _msg.sensed_data.resize(N);
92 for (std::size_t i_msg = 0; i_msg < N; i_msg++)
94 _msg.sensed_data[i_msg].range = _obj.sensedData[i_msg].range;
95 _msg.sensed_data[i_msg].id = _obj.sensedData[i_msg].landmarkID;
96 _msg.sensed_data[i_msg].yaw = _obj.sensedData[i_msg].yaw;
97 _msg.sensed_data[i_msg].pitch = _obj.sensedData[i_msg].pitch;
103 const CObservationBearingRange& _obj,
107 mrpt::poses::CPose3D pose;
108 _obj.getSensorPose(pose);