Skip to content

Commit

Permalink
planner ROS - PCL with explored trajectories extended with the traj…
Browse files Browse the repository at this point in the history
…ectory ID field
  • Loading branch information
rayvburn committed Jan 19, 2024
1 parent a97e739 commit afb87f2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/humap_planner_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,12 +743,13 @@ sensor_msgs::PointCloud2 HumapPlannerROS::createExploredTrajectoriesPcl() const

sensor_msgs::PointCloud2Modifier cloud_mod(traj_cloud);
cloud_mod.setPointCloud2Fields(
5,
6,
"x", 1, sensor_msgs::PointField::FLOAT32,
"y", 1, sensor_msgs::PointField::FLOAT32,
"z", 1, sensor_msgs::PointField::FLOAT32,
"theta", 1, sensor_msgs::PointField::FLOAT32,
"cost", 1, sensor_msgs::PointField::FLOAT32
"cost", 1, sensor_msgs::PointField::FLOAT32,
"id", 1, sensor_msgs::PointField::FLOAT32
);

// check how many points there will be in a point cloud
Expand Down Expand Up @@ -786,6 +787,8 @@ sensor_msgs::PointCloud2 HumapPlannerROS::createExploredTrajectoriesPcl() const
iter_x[2] = 0.0;
iter_x[3] = p_th;
iter_x[4] = t->cost_;
// ID of the trajectory
iter_x[5] = static_cast<double>(std::distance(explored_trajs.cbegin(), t));
++iter_x;
}
}
Expand Down

0 comments on commit afb87f2

Please sign in to comment.