osrf / autodock

ROS packages for automatic docking
Apache License 2.0
78 stars 27 forks source link

robot lose the connection with tags when it trying to go parallel #6

Open AmelFaidi opened 2 years ago

AmelFaidi commented 2 years ago

when the robot is in front of the charging station it can detect the 3 fiducials markers and its position is parallel to the station. it starts to rotate to the left then it displays this message: [INFO] [1653488377.911862, 903.320000] : Attempt with 1 try [WARN] [1653488377.914467, 903.322000]: Status: [PREDOCK] | start docking [INFO] [1653488377.919384483, 903.327000000]: ObstacleObserver received autodock status: 2 [WARN] [1653488378.454973, 903.827000]: Search failure: fiducial_10, from base_footprint [WARN] [1653488378.458897, 903.831000]: Status: [PREDOCK] | Try to set yaw of one marker [INFO] [1653488378.463162517, 903.836000000]: ObstacleObserver received autodock status: 2 [WARN] [1653488379.074444, 904.336000]: Search failure: fiducial_10, from base_footprint [WARN] [1653488379.129678, 904.388000]: Rotate with right marker: fiducial_11 [WARN] [1653488379.132816, 904.391000]: Status: [PREDOCK] | Rotate robot: -0.02 rad [INFO] [1653488379.137920379, 904.395000000] : ObstacleObserver received autodock status : 2 Current difference of x, y, yaw: -0.00 | -0.00 | -0.02 [WARN] [1653488379.217710, 904.471000] : Finished running the robot [INFO] [1653488379.218855, 904.472000]: Both markers are detected, execute pre-storage loop. [WARN] [1653488379.758596, 904.973000]: Search failure: fiducial_10, from base_footprint [ERROR] [1653488379.761544, 904.975000]: No detection of marker on two sides, exit status [WARN] [1653488379.766281, 904.979000]: Docking attempt failed [WARN] [1653488379.772542, 904.985000]: Retry attempt: 1/1 [INFO] [1653488379.777406, 904.989000]: Status is not retryable [WARN] [1653488379.779995, 904.992000]: Unable to retry [WARN] [1653488379.785579, 904.996000]: Status: [IDLE] | Dock Action failed to run

youliangtan commented 2 years ago

It seems that only one marker is detected when it is trying to enter the "steer_dock" state, that's why the action failed?

Can you check with the /fiducial_images image topic viz if the markers are still observable py the aruco_detect. We have encountered that tag detection is prone to the lighting condition of the local environment. Also, it seems that the robot isnt going into "parralel correction" state, you can also try to reduce the threshold of max_parallel_offset param.

AmelFaidi commented 2 years ago

Hi youliangtan, thanks for your response at the first time the robot is parallel to the 3 tags and it can detect all of them. I don't understand why it tries to turn left instead of going straight to the charging station. when it tries to turn left it loses the detection of the tags so it can't go to the station. actually max_parallel_offset: 0.16.

youliangtan commented 2 years ago

In the predock state, the current logic is that the robot will align itself vertically to the detected side markers. This realignment action will happen even if only 1 marker is detected.

I think there's some misinformation in the printout of this. This line get printed even if a marker is detecting 1 marker (do_single_side_marker_rotate()). So I believe that from the log that u have provided here, the robot is not able to detect fiducial_10. Do check the image view of the robot. All in all, the robot needs to detect both sides of the marker only to transition successfully to the next "steer_dock" state.

AmelFaidi commented 2 years ago

at first time the robot detected the 2 markers ( i verified this with image view )so it started to rotate in its place then it could detect just the marker fiducial_10 then it followed the rotation until no marker was detected. which parameters should i verify to ensure that the robot pass to steer_dock state. i reduced max_parallel_offset as you mentioned but there is no result .

AmelFaidi commented 2 years ago

Hi youliangtan I resolved the problem of tags but the robot stop at 1m from fiducials tags and publish that he arrive to the docking station.

youliangtan commented 2 years ago

Nice that you resovled the tags problem. It will be nice if you can share what changes you made to solve this.

Related to the robot stopping 1m from the tags, this is because the robot lost detection of the tags, and transitioned to "last_mile" state. Thus, try to adjust this value, which let the robot relies on pure odometry to move towards the charger.

AmelFaidi commented 2 years ago

i changed these values in turtlebot3.yaml stop_yaw_diff: 3 # radian max_parallel_offset: 0.05

AmelFaidi commented 2 years ago

to_last_mile_dis: 0.3 # edge2edge distance where transition to LM to_last_mile_tol: 0.1 # transition tolerance from SD to LM these parameters does not effect to the stopping distance from tags?

youliangtan commented 2 years ago

to_last_mile_dis and to_last_mile_tol that you mentioned are the condition which the state transition from "steer_dock" to "last_mile". Changing these 2 params help to ensure that the robot will move with odometry during the very last mile of docking (without relying of visual markers).

AmelFaidi commented 2 years ago

@youliangtan the same thing the robot stay 0.6 m (from tags when i try to set these value) max_last_mile_odom: 0.05 #0.2
stop_distance: 0.08 #0.08 # edge2edge distance to stop from charger when i try to increase the value max_last_mile_odom to 0.25 the robot still go forward until he losed the connection with tags and print IDEL.

youliangtan commented 2 years ago

I think you might need to increase the value of max_last_mile_odom. This is the value which the robot will move based on odometry, after losing the visual marker detection. Unfortunately, this pkg requires some tuning to make it work on different robots. Hopefully, you can provide me with a simple example for me to replicate this issue. If this is indeed an issue, a fix might be needed.