This package is used to analyze the relative pose of single duckiebot estimated by using AprilTag2. Except for the normal pipeline of AprilTag2, it also provides post-processing srcipts to get result analysis, as well as several unit-tests for testing the correctness of the system.
This package provide detection_post_process.launch to analyze the performance of relative pose estimation by using AprilTag2. Each time it collects a certain number of estimated pose (both postion and rotation) and then compute the following:
- max, min, range, mean, variance of these pose estimation.
- time used for each subprocess in the pipeline of relative pose estimation (detecting AprilTag + computing relative pose).
- cpu/ram comsumption for relative pose estimation.
=======
catkin_makesource devel/setup.bashroslaunch pi_camera camera_apriltag_demo.launch veh:=duckiebotroslaunch apriltags2_ros apriltag2_demo.launch veh:=duckiebotroslaunch apriltags2_ros detection_to_local_frame.launch veh:=duckiebotrosparam set enable_statistics true&rosrun rosprofiler rosprofilerroslaunch apriltags2_ros detection_post_process.launch veh:=duckiebot
Several test are provided in this package for testing the correctness of the system.
- This is used to test the correctness of pose estimation. All images in tests/test_image are tested and the name of the images are their groundtruth in degree. If you want to specify one image, for now you should put only that image in the above folder.
- In the test, each time we publish one of these images as well as camera info.
apriltag_detector_nodeis launched to detect apriltag and publish pose estimation (camera frame with respect to tag frame).detection_to_local_frameis launched for coverting pose estimation into appropriate frame (robot wrt world), which is the ultimate estimation of pose we are using for tests.
cd [REPO_ROOT]
catkin_makesource act_addon_environment.shrostest apriltags2_ros detection_to_local_frame_testor_node.testrostest --text apriltags2_ros detection_to_local_frame_testor_node.testto get console output to the screen
April Tag detection pipeline uses two container: the base container and the apriltag-addon container. This documemt prepend each command with the name of the environment in which that command needs to be run, i.e. ´[LOCAL_PC]´ represents that the command should be run on your local PC. Make sure to remove the environment identifier ´[ENVIRONMENT_NAME]´ before executing the command.
First set the DOCKER_HOST on your terminal
[LOCAL_PC] export DOCKER_HOST=![ROBOT_NAME].localThen, launch the base container by executing
[LOCAL_PC] docker -H ![ROBOT_NAME].local run -it --net host --privileged -v /data:/data --memory="300m" --memory-swap="2.0g" --name base selcukercan/frpi-base:v5 /bin/bashWhile in the base container roslaunch the file that starts the camera, decoding and rectification nodes
[BASE_CONTAINER] roslaunch pi_camera camera_apriltag_demo.launch veh:=![ROBOT_NAME]Then open up a new container and set ´DOCKER_HOST´ in this window as well.
[LOCAL_PC] export DOCKER_HOST=![ROBOT_NAME].localIn the new terminal window, launch the apriltag-addon container
[LOCAL_PC] docker -H ![ROBOT_NAME].local run -it --net host --privileged -v /data:/data --memory="300m" --memory-swap="2.0g" --name base selcukercan/apriltag2add-on:v12 /bin/bashNow you will be inside selcukercan/apriltag2add-on. Next, start the apriltag core algorithm
[APRILTAG_ADDON_CONTAINER] roslaunch apriltags2_ros apriltag2_demo.launch veh:=meteAt this point you should be able to see the results produced by the apriltag algorithm by inspecting
[APRILTAG_ADDON_CONTAINER] rostopic echo /![ROBOT_NAME]/tag_detectionsNote that this returns the pose of the camera frame with respect to the apriltag frame. To learn more about the coordinate frame definitions/conventions, please refer to this.
To get the position in fixed frame XYZ Euler Angles
[APRILTAG_ADDON_CONTAINER] roslaunch apriltags2_ros detection_to_local_frame.launch veh:=![ROBOT_NAME]To inspect the orientation expressed in Euler Angles
[APRILTAG_ADDON_CONTAINER] rostopic echo ![ROBOT_NAME]/apriltags2_ros/publish_detections_in_local_frame/tag_detections_local_frameThis project uses sphinx to generate project documentation automatically.
To start generating documents you have to first install sphinx
sudo apt-get install python-sphinxgenerate the documentation
cd ![APRILTAG_ADDON_ROOT]/src/apriltags2_ros/apriltags2_ros/docs
make htmlclick to open the generated document which is located at ![APRILTAG_ADDON_ROOT]/fapriltag2_addon/src/apriltags2_ros/apriltags2_ros/docs/build/html