Alexander Belyaev 2018-02-12 09:55:24 +01:00 committed by GitHub
parent c2b0143a5e
commit 7b9e2fe2e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 2 deletions

View File

@ -30,6 +30,7 @@ namespace {
using ::cartographer::transform::Rigid3d;
constexpr double kTrajectoryLineStripMarkerScale = 0.07;
constexpr double kLandmarkMarkerScale = 0.3;
constexpr double kConstraintMarkerScale = 0.025;
::std_msgs::ColorRGBA ToMessage(const cartographer::io::FloatColor& color) {
@ -62,7 +63,7 @@ int GetLandmarkIndex(
auto it = landmark_id_to_index->find(landmark_id);
if (it == landmark_id_to_index->end()) {
const int new_index = landmark_id_to_index->size();
landmark_id_to_index->at(landmark_id) = new_index;
landmark_id_to_index->emplace(landmark_id, new_index);
return new_index;
}
return it->second;
@ -74,9 +75,12 @@ visualization_msgs::Marker CreateLandmarkMarker(int landmark_index,
visualization_msgs::Marker marker;
marker.ns = "Landmarks";
marker.id = landmark_index;
marker.type = visualization_msgs::Marker::SPHERE;
marker.type = visualization_msgs::Marker::CUBE;
marker.header.stamp = ::ros::Time::now();
marker.header.frame_id = frame_id;
marker.scale.x = kLandmarkMarkerScale;
marker.scale.y = kLandmarkMarkerScale;
marker.scale.z = kLandmarkMarkerScale;
marker.color = ToMessage(cartographer::io::GetColor(landmark_index));
marker.pose = ToGeometryMsgPose(landmark_pose);
return marker;

View File

@ -177,6 +177,14 @@ Visualization Manager:
"": true
Queue Size: 100
Value: true
- Class: rviz/MarkerArray
Enabled: true
Marker Topic: /landmark_poses_list
Name: Landmark Poses
Namespaces:
"": true
Queue Size: 100
Value: true
Enabled: true
Global Options:
Background Color: 100; 100; 100

View File

@ -239,6 +239,14 @@ Visualization Manager:
"": true
Queue Size: 100
Value: true
- Class: rviz/MarkerArray
Enabled: true
Marker Topic: /landmark_poses_list
Name: Landmark Poses
Namespaces:
"": true
Queue Size: 100
Value: true
Enabled: true
Global Options:
Background Color: 100; 100; 100