Closed
Description
I noticed that when docking backwards (the plug is on the back of the robot, with the detected maker pose of the docking station pointing forward towards the robot), the target pose offset is applied in the wrong direction. Here is the change that solves it for me, but I'm not sure if it's a real bug or a problem with my setup.
diff --git a/opennav_docking/src/docking_server.cpp b/opennav_docking/src/docking_server.cpp
index 75d428e..6146d25 100644
--- a/opennav_docking/src/docking_server.cpp
+++ b/opennav_docking/src/docking_server.cpp
@@ -412,7 +412,8 @@ bool DockingServer::approachDock(Dock * dock, geometry_msgs::msg::PoseStamped &
// Thus, we backward project the controller's target pose a little bit after the
// dock so that the robot never gets to the end of the spiral before its in contact
// with the dock to stop the docking procedure.
- const double backward_projection = 0.25;
+ float sign = dock_backwards_ ? -1.0 : 1.0;
+ const double backward_projection = 0.25 * sign;
const double yaw = tf2::getYaw(target_pose.pose.orientation);
target_pose.pose.position.x += cos(yaw) * backward_projection;
target_pose.pose.position.y += sin(yaw) * backward_projection;
Metadata
Metadata
Assignees
Labels
No labels