Giter VIP home page Giter VIP logo

autodock's Introduction

autodock

ROS packages for automatic docking

autodock a state machine based auto docking solution for differential-drive robot, allows accurate and reliable docking. It utilizes 3 fiducial markers to locate the position of the docking station. Hence, the Robot should equip with a camera input for fiducial marker detection. Note that, this package works on top of the navigation stack, not making any alteration to the robot's nav stack. The solution is fully tested on multiple simulated and actual robots.

Packages:

  • autodock_core: Core autodock scripts and lib
  • autodock_examples: Examples for autodock
  • autodock_sim: Autodock Simulation

Installation

ROS Noetic is used during development.

Dependencies

# First, clone repos and deps to 'catkin_ws/src', then install
cd catkin_ws
rosdep update && rosdep install --from-paths src --ignore-src -yr
catkin_make

Architecture Diagram

State Machine Diagram


Run Examples on Simulation with MockRobot

Run MockRobot in gazebo world

roslaunch autodock_sim dock_sim.launch

try to send an action goal request

rostopic pub /autodock_action/goal autodock_core/AutoDockingActionGoal {} --once

Now you will see the robot starts to execute a series of autodocking sequence.

To explain..... when an action goal AutoDockingActionGoal is received by the robot, the robot will start to docking sequence. When it manages to reach the targer docking station, it will send a std_srvs/Trigger to the MockCharger charging station, to activate the charger. The charger will validate if the robot is docked, then send a "Success" back to the robot if all goes well. Subsequently, end the entire docking action.

# To remote control the robot: 
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
# To cancel an active docking action: 
rostopic pub /autodock_action/cancel actionlib_msgs/GoalID {} --once
# To pause an active docking action: 
rostopic pub /pause_dock std_msgs/Bool True --once

More Tests

This simple smoke test script will randomly move the robot to some random position in the gazebo world, and initiate the docking sequence.

# indicate the number of "spawn" with the -c arg
rosrun autodock_examples dock_sim_test.py -c 10

Run with turtlebot3

This demonstrates front dock with turtlebot3, attached with a front camera. A smaller docking station is used here.

  • dependency: sudo apt install ros-noetic-turtlebot3-gazebo
roslaunch autodock_sim tb3_dock_sim.launch
rostopic pub /autodock_action/goal autodock_core/AutoDockingActionGoal {} --once

Run Turtlebot3 with navigation

This demo depends on turtlebot3_simulation and move_base. Please ensures that you have all dependencies are fully installed.

Note: You can install all turtlebot simulation related packages by sudo apt install ros-noetic-turtlebot3*, or follow the setup steps in Robotis docs. Once done, continue to follow the steps to launch and map the world with a burger robot.

Please ensures that entire pipeline of the turtlebot works before proceeding with the autodock tb3 demo below. Once done with mapping, you can start with the autodock simulation:

# 1. launch turtlebot3 gazebo world, and also autodock_server
roslaunch autodock_sim tb3_nav_dock_sim.launch

# 2. launch navigation stack, with provided map. You can also remap the environment by following the turtlebot sim tutorial
## New Terminal
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/catkin_ws/src/autodock/autodock_sim/maps/map.yaml open_rviz:=0

Now, localize the robot and move the robot with rviz. Move the robot as such that the camera is facing the charging station.

# 3. send a dock action. make sure that the robot's camera is facing the charger
## New Terminal
rostopic pub /autodock_action/goal autodock_core/AutoDockingActionGoal {} --once

This will also demonstrate how the simple obstacle_observer works. Try place an obstacle near the robot during docking and see if it pauses.

Note: the current obstacle_observer will only pause if it is in predock, steer_dock, or parralel_correction state.


Docker Container

A docker file is provieded to buid a container for autodock. Follow these steps:

cd catkin_ws/src/autodock
docker build -t osrf/autodock:v1 .
docker run -it --network host osrf/autodock:v1 bash -c "$COMMAND"

Notes

The initial development of this code was graciously supported by Kabam Robotics (aka Cognicept).

Future Work

  • Advance ObstacleObserver: filter occupancy of charging station on costmap.

Stray Commands

Debug by launching autodock node on a seperate terminal

# Terminal 1
roslaunch autodock_sim dock_sim.launch autodock_server:=false

# Terminal 2, specify config.yaml with the 'autodock_config' arg
roslaunch autodock_core autodock_server.launch \
    autodock_config:=src/autodock/autodock_examples/configs/mock_robot.yaml

autodock's People

Contributors

codebot avatar robertblakeanderson avatar swaroophs avatar youliangtan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autodock's Issues

High CPU usage even when IDLE

Hi!

Thanks for this project! We have successfully deployed this algorithm long term and it has been working well :). Over time, we have observed that the simple_autodock node seems to be taking a lot of CPU resources even when IDLE. Sample htop screenshot shown below when TB3 sim is at the dock.

image

Since this is just a state machine, could we figure out if there is something in the implementation that is causing it to have high CPU usage? I have done some preliminary investigation to look at if there are unrated loops or high frequency timer callbacks but could not find any egregious issues. We are running this in a moderately resource limited computer (4 core/8GB RAM) and sometimes, we see other issues because of the dock node overloading the system. If you have ideas on how to debug, I will be more than happy to try them out and report back/make a PR for review. FWIW this issue has been observed on both 18.04/Melodic and 20.04/Noetic.

Best,
Swarooph

autodock failed when robot turned

when I run autodock , I have this problem like below picture.
I found that when the robot turned, the tf wouldn't be detected.
How could I fix this?
autodock_fail_about_tf

And the second problem is the robot have a large turn and result in aruco marker didn't appear in screen.
Which param could improve this situation?

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

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

[Question] Working with high latency

We are using this camera driver for publishing the video as rostopics.

However, it was noticed that it takes about 1s for the video to appear when viewing the compressed rqt_image_view. Latency between the fiducial_images output from aruco_detect and the raw compressed image was not noticeable by human eye. Understandably, the robot steers out of control as the error compounds as it tries to steer dock with a mix of current and outdated tf (but as far as ROS is aware, they are current).

Are there sample configs for when the camera image latency is high?

There was also problems exiting the parallel correction loop, but I think that can be solved by setting a longer tf expiry time, and setting averaging sample(s) to 1.

MockRobot Failed lookup: fiducial_10, from base_footprint

Hi,

i am able to run the turtelbot and getting docked without any error. but when i run the mockbot i am getting the below mentioned error eventhough the Markers are detected. Am i missing anything here?

INFO] [1680685721.064356, 44.498000]: Will attempt with 2 retry
[WARN] [1680685721.065865, 44.500000]: State: [PREDOCK] | start docking
[WARN] [1680685721.451993, 45.000000]: Failed lookup: fiducial_10, from base_footprint
[WARN] [1680685721.842108, 45.450000]: State: [PREDOCK] | Try single marker yaw adjustment
[WARN] [1680685722.068391, 45.952000]: Failed lookup: fiducial_10, from base_footprint
[WARN] [1680685722.470830, 46.452000]: Failed lookup: fiducial_11, from base_footprint
[ERROR] [1680685722.472098, 46.452000]: Not detecting two side markers, exit state
[WARN] [1680685722.472879, 46.452000]: Failed to Dock attempt
[WARN] [1680685722.473596, 46.452000]: Attemping retry: 1/2
[INFO] [1680685722.474667, 46.452000]: State is not retry-able
[WARN] [1680685722.475783, 46.452000]: Not able to retry
[WARN] [1680685722.477316, 46.452000]: State: [IDLE] | Failed execute Dock Action

Failed

AutoDock ..bug issue

Unable to open and run Autodock from last 4-5 months.
Sometimes it works well but after 1or 2 dock process it suddenly stops working.
Now I am getting this problem to much..... Showing

  1. Contact to application support team.
  2. Attribute error: set user preference instance has no attribute 'form'.
  3. Hit enter to continue.....after this all windows suddenly closes and not allow autodock GUI to open.

Autodock is a majorly used tool for my work and due to this problem my work is so much affected. Require solution urgently.

cannot launch autodock

when launching autodock_sim i have an error:

[simple_autodock-2] process has died [pid 3189120, exit code 1, cmd /home/user/catkin_ws/src/autodock/autodock_core/scripts/simple_autodock.py --server --rosparam __name:=simple_autodock __log:=/home/user/.ros/log/f978cfa0-e22e-11ec-ac9d-75877b4c1b58/simple_autodock-2.log].
log file: /home/user/.ros/log/f978cfa0-e22e-11ec-ac9d-75877b4c1b58/simple_autodock-2*.log

AutodockActionGoal not working

I was trying to use follow the instructions for the Mock Robot, when I encountered the following error as I was using the command line "rostopic pub /autodock_action/goal autodock_core/AutoDockingActionGoal {} --once" The error messages are as follows:
autodock testing failed 2
autodock testing failed

Any tips on this scenario?

[Question] Why do the code use 3 marker instead 1?

I think when the robot gets closer and closer to the marker, aruco vision gets unvisible that's why in code there are 2 plus little one, but I am wondering is there any other reason ? Because almost all other packages are using only one aruco marker.

AutoDock not progressing after checking yaw for 1st time

Hi,

I am testng the autodock on linorobot with usbcam . Markers are getting detected and it is identifying the current yaw diff and sending the cmd_vel for the first time. post which nothing is happening. Attaching the output for your reference. Please suggest if i am missing any steps here.

Autodocking.txt

Thank you
Sasi

ros-melodic: catkin_make failed

../src/autodock/autodock_sim/src/ChargingStationPlugin.cpp:28:10: fatal error: gazebo/plugins/FlashLightPlugin.hh: No such file or directory
#include <gazebo/plugins/FlashLightPlugin.hh>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.