-
Notifications
You must be signed in to change notification settings - Fork 104
Added missing transform of start and target pose in planner implementations #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
edddc8d
3b9531f
755fa4f
33b4f1d
814be20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,43 +41,42 @@ | |
| #include <boost/uuid/uuid_io.hpp> | ||
| #include <optional> | ||
| #include <memory> | ||
|
|
||
| #include <functional> | ||
| #include <geometry_msgs/msg/point_stamped.hpp> | ||
| #include <geometry_msgs/msg/vector3.hpp> | ||
| #include <visualization_msgs/msg/marker_array.hpp> | ||
| #include <mutex> | ||
| #include <filesystem> | ||
| #include <assimp/Importer.hpp> | ||
| #include <assimp/postprocess.h> | ||
| #include <assimp/scene.h> | ||
|
|
||
| #include <lvr2/geometry/Normal.hpp> | ||
| #include <lvr2/algorithm/GeometryAlgorithms.hpp> | ||
| #include <lvr2/algorithm/NormalAlgorithms.hpp> | ||
| #include <lvr2/io/deprecated/hdf5/MeshIO.hpp> | ||
| #include <lvr2/types/MeshBuffer.hpp> | ||
|
|
||
| // Mesh structure for fast surface traversal | ||
| #include <lvr2/geometry/PMPMesh.hpp> | ||
|
|
||
| // Raycaster implementations | ||
| #ifdef LVR2_USE_EMBREE | ||
| #include <lvr2/algorithm/raycasting/EmbreeRaycaster.hpp> | ||
| #else | ||
| #include <lvr2/algorithm/raycasting/BVHRaycaster.hpp> | ||
| #endif | ||
|
|
||
| #include <rclcpp/rclcpp.hpp> | ||
| #include <tf2_ros/buffer.h> | ||
| #include <tf2_geometry_msgs/tf2_geometry_msgs.hpp> | ||
| #include <geometry_msgs/msg/point_stamped.hpp> | ||
| #include <geometry_msgs/msg/transform_stamped.hpp> | ||
| #include <geometry_msgs/msg/vector3.hpp> | ||
| #include <visualization_msgs/msg/marker.hpp> | ||
| #include <visualization_msgs/msg/marker_array.hpp> | ||
|
|
||
| #include <mesh_map/abstract_layer.h> | ||
| #include <mesh_map/mesh_map.h> | ||
| #include <mesh_map/util.h> | ||
| #include <mesh_map/timer.h> | ||
| #include <mesh_msgs/msg/mesh_geometry_stamped.hpp> | ||
| #include <mesh_msgs_conversions/conversions.h> | ||
| #include <mutex> | ||
| #include <rclcpp/rclcpp.hpp> | ||
| #include <visualization_msgs/msg/marker.hpp> | ||
|
|
||
| #include <filesystem> | ||
|
|
||
| #include <assimp/Importer.hpp> | ||
| #include <assimp/postprocess.h> | ||
| #include <assimp/scene.h> | ||
|
|
||
| namespace fs = std::filesystem; | ||
|
|
||
|
|
@@ -1307,6 +1306,24 @@ bool MeshMap::resetLayers() | |
| return true; // TODO implement | ||
| } | ||
|
|
||
| geometry_msgs::msg::PoseStamped MeshMap::transformToMapFrame( | ||
| const geometry_msgs::msg::PoseStamped& input_pose) const | ||
| { | ||
| if(input_pose.header.frame_id == mapFrame()) | ||
| { | ||
| return input_pose; | ||
| } | ||
|
|
||
| // we shouldn't catch/ignore the error that comes from here, as it indicates a misconfiguration | ||
| const geometry_msgs::msg::TransformStamped Tim = tf_buffer.lookupTransform( | ||
| mapFrame(), input_pose.header.frame_id, input_pose.header.stamp); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This transform lookup uses a timeout of 0 seconds by default, which will fail immediately if there is latency with the localization e.g. on a real robot. We could either make the timeout configurable using a MeshNav wide parameter every plugin can read, or expose the timeout in the |
||
|
|
||
| geometry_msgs::msg::PoseStamped output_pose; | ||
| tf2::doTransform(input_pose, output_pose, Tim); | ||
|
|
||
| return output_pose; | ||
| } | ||
|
|
||
| void MeshMap::publishVertexCosts(const lvr2::VertexMap<float>& costs, const std::string& name, const rclcpp::Time& map_stamp) | ||
| { | ||
| layer_manager_.publish_cost_layer(costs, name, map_stamp); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should catch the transform errors here to prevent MeshNav from crashing and return an error code