IBAWSIP 10/10 Camera Calibration and APRILtag fun

My work on my cover EP has gotten to the point where I want to record vocals. I started some vocals but I discovered I really need a pop filter. I'm going to put that on hold and work on some other things now related to my RC car.

Camera Calibration

So with ROS it's super easy to do some camera calibration stuff because there are literally packages meant for this application. I'm going to use the usb_cam package as well the camera_calibration package.

To bring up the camera calibration stuff one needs to run the following commands
  • roscore
  • rosrun usb_cam usb_cam_node 
    • note this can be run with different arguments depending on if your usb camera is actually /dev/video0
  • rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.025 image:=/my_camera/image camera:=/my_camera
    • the arguments obviously depend on your particular setup, but this is an example they give on the ros wiki, the squares are given in meters
    • (made an edit here 5/11/2020 cuz I realized I was referencing my own post and I used the wrong square dimensions, I changed it from 0.108 to 0.025)


After I calibrated my camera, I want to use a simple system to detect where my robot is with my camera. There's a pretty good system that's well established called APRILtags. Unfortunately I can't seem to see the apriltags package I was familar with previous in the Ubuntu packages list, but there is a version you can build from source. I won't go into details about how to set up catkin workspaces as there is a good tutorial on ROS's site, but I will link it here. After I built that package I was able to launch the node
  • roslaunch apriltags2_ros continuous_detection.launch
    • note you need to edit the config yaml file to specify all desired detections
  • ROS_NAMESPACE=usb_cam rosrun image_proc image_proc
    • this is required because the node expects a rectified image
  • roslaunch apriltags2_ros continuous_detection.launch camera_name:=usb_cam
Below are some examples of the APRILtag detection working.










I guess I didn't mention that I put a giant walmart box on my robot. I think the next steps from here are to write a simple control loop to hopefully be able to control the distance from the camera. I still have to do a bunch of rewiring of things to get my robot back up and running.

Comments