Transform landmark poses to the tracking frame. (#1076)
* Transform landmark poses to the tracking frame. * Address the comment.master
parent
54f0cfeee4
commit
a4f3850912
|
@ -30,7 +30,7 @@ namespace {
|
|||
using ::cartographer::transform::Rigid3d;
|
||||
|
||||
constexpr double kTrajectoryLineStripMarkerScale = 0.07;
|
||||
constexpr double kLandmarkMarkerScale = 0.3;
|
||||
constexpr double kLandmarkMarkerScale = 0.2;
|
||||
constexpr double kConstraintMarkerScale = 0.025;
|
||||
|
||||
::std_msgs::ColorRGBA ToMessage(const cartographer::io::FloatColor& color) {
|
||||
|
@ -75,7 +75,7 @@ visualization_msgs::Marker CreateLandmarkMarker(int landmark_index,
|
|||
visualization_msgs::Marker marker;
|
||||
marker.ns = "Landmarks";
|
||||
marker.id = landmark_index;
|
||||
marker.type = visualization_msgs::Marker::CUBE;
|
||||
marker.type = visualization_msgs::Marker::SPHERE;
|
||||
marker.header.stamp = ::ros::Time::now();
|
||||
marker.header.frame_id = frame_id;
|
||||
marker.scale.x = kLandmarkMarkerScale;
|
||||
|
|
|
@ -100,7 +100,18 @@ void SensorBridge::HandleNavSatFixMessage(
|
|||
void SensorBridge::HandleLandmarkMessage(
|
||||
const std::string& sensor_id,
|
||||
const cartographer_ros_msgs::LandmarkList::ConstPtr& msg) {
|
||||
trajectory_builder_->AddSensorData(sensor_id, ToLandmarkData(*msg));
|
||||
auto landmark_data = ToLandmarkData(*msg);
|
||||
|
||||
auto tracking_from_landmark_sensor = tf_bridge_.LookupToTracking(
|
||||
landmark_data.time, CheckNoLeadingSlash(msg->header.frame_id));
|
||||
if (tracking_from_landmark_sensor != nullptr) {
|
||||
for (auto& observation : landmark_data.landmark_observations) {
|
||||
observation.landmark_to_tracking_transform =
|
||||
*tracking_from_landmark_sensor *
|
||||
observation.landmark_to_tracking_transform;
|
||||
}
|
||||
}
|
||||
trajectory_builder_->AddSensorData(sensor_id, landmark_data);
|
||||
}
|
||||
|
||||
std::unique_ptr<carto::sensor::ImuData> SensorBridge::ToImuData(
|
||||
|
|
Loading…
Reference in New Issue