7 #include <geometry_msgs/Pose.h> 10 #include <mrpt_msgs/ObservationRangeBearing.h> 15 #include <mrpt/version.h> 16 #include <mrpt/obs/CObservationBearingRange.h> 23 const mrpt::poses::CPose3D& _pose, CObservationBearingRange& _obj)
27 mrpt::poses::CPose3D cpose_obj;
31 _obj.maxSensorDistance = _msg.max_sensor_distance;
32 _obj.minSensorDistance = _msg.min_sensor_distance;
33 _obj.sensor_std_yaw = _msg.sensor_std_yaw;
34 _obj.sensor_std_pitch = _msg.sensor_std_pitch;
35 _obj.sensor_std_range = _msg.sensor_std_range;
39 convert(_msg.sensor_pose_on_robot, cpose_obj);
40 _obj.setSensorPose(cpose_obj);
44 _obj.setSensorPose(_pose);
47 ASSERT_(_msg.sensed_data.size() >= 1);
48 const size_t N = _msg.sensed_data.size();
50 _obj.sensedData.resize(N);
52 for (std::size_t i_mrpt = 0; i_mrpt < N; i_mrpt++)
54 _obj.sensedData[i_mrpt].range = _msg.sensed_data[i_mrpt].range;
55 _obj.sensedData[i_mrpt].landmarkID = _msg.sensed_data[i_mrpt].id;
56 _obj.sensedData[i_mrpt].yaw = _msg.sensed_data[i_mrpt].yaw;
57 _obj.sensedData[i_mrpt].pitch = _msg.sensed_data[i_mrpt].pitch;
63 const CObservationBearingRange& _obj,
66 mrpt::poses::CPose3D cpose_obj;
69 _obj.getSensorPose(cpose_obj);
70 convert(cpose_obj, _msg.sensor_pose_on_robot);
72 _msg.max_sensor_distance = _obj.maxSensorDistance;
73 _msg.min_sensor_distance = _obj.minSensorDistance;
74 _msg.sensor_std_yaw = _obj.sensor_std_yaw;
75 _msg.sensor_std_pitch = _obj.sensor_std_pitch;
76 _msg.sensor_std_range = _obj.sensor_std_range;
78 ASSERT_(_obj.sensedData.size() >= 1);
79 const size_t N = _obj.sensedData.size();
81 _msg.sensed_data.resize(N);
83 for (std::size_t i_msg = 0; i_msg < N; i_msg++)
85 _msg.sensed_data[i_msg].range = _obj.sensedData[i_msg].range;
86 _msg.sensed_data[i_msg].id = _obj.sensedData[i_msg].landmarkID;
87 _msg.sensed_data[i_msg].yaw = _obj.sensedData[i_msg].yaw;
88 _msg.sensed_data[i_msg].pitch = _obj.sensedData[i_msg].pitch;
94 const CObservationBearingRange& _obj,
98 mrpt::poses::CPose3D pose;
99 _obj.getSensorPose(pose);
bool convert(const CObservationBearingRange &_obj, mrpt_msgs::ObservationRangeBearing &_msg, geometry_msgs::Pose &_pose)
File includes methods for converting CNetworkOfPoses*DInf <=> NetworkOfPoses message types...