User Tools

Site Tools


ros

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ros [2010/08/11 15:32] 131.159.18.233ros [2021/02/01 05:55] (current) – external edit 127.0.0.1
Line 138: Line 138:
   rosrun image_view image_view image:=/gscam/image_rect_color   rosrun image_view image_view image:=/gscam/image_rect_color
  
 +==== Calibration manually ====
  
 +The algorithm that selects the pictures in camera_calibration is not perfect, and it prefers to select blur images over sharp, also most of the times it doesn't use enough pictures. So here we explain how to use your own pictures to calibrate.
 +
 +  * Run image_view and take the pictures that you consider adequate for calibration using the left clicking.
 +
 +  cd /tmp/
 +  rosrun image_view image_view image:=/gscam/image
 +
 +Images are store in the current directory.
 +
 +  * Run the calibration from disk images:
 +
 +  rosrun camera_calibration camera_calibrate_from_disk.py --size 8x6 --square 0.0247881 /tmp/frame00*
 +
 +  * This will print the parameters to screen. Replace them in one camera_calibration.txt example file. (look in gscam directory).
 +
 +===== Markers tracking =====
 +
 +==== Artoolkit in ros ====
 +
 +  roscd; cd ../stacks
 +  git clone http://robotics.ccny.cuny.edu/git/ccny-ros-pkg.git
 +  rosmake artoolkit
 +  rosmake ar_pose
 +
 +  * Add the markers that you want to detect in the file data/object_data2. For example:
 +
 +  4x4_23
 +  data/4x4/4x4_23.patt
 +  25.0
 +  0.0 0.0
 +
 +First is the name of the marker, second is the file of the marker, then the size in mm, then the relative position?
 +
 +  * run ar_pose:
 +
 +  rosrun ar_pose ar_multi /usb_cam/camera_info:=/gscam/camera_info /usb_cam/image_raw:=/gscam/image_rect
 +
 +  * To look at the markers detected:
 +
 +  rostopic echo /visualization_marker
 +
 +===== Getting images from yarp to ros =====
 +
 +  roscd; cd ../stacks
 +  svn co https://code.ros.org/svn/wg-ros-pkg/branches/trunk_cturtle/sandbox/yarp
 +  rosmake yarp
 +
 +  * Get tum-ros-internal repository and compile yarp2 and yarp_to_ros_image: (you need git access to our repo, tum-ros-pkg of the ros website is not complete and doesn't include all the stuff that is on tum-ros-internal)
 +
 +  roscd; cd ../stacks
 +  git command that I still don't know
 +  rosmake yarp2
 +  rosmake yarp_to_ros_image
 +
 +  * Running yarp_to_ros_image package:
 +
 +  rosrun yarp_to_ros_image yarp_to_ros_image
 +
 +===== iCub and all this =====
 +
 +==== Calibrate the icub cameras ====
 +
 +  * Get icub images in ros:
 +
 +  roscd yarp_to_ros_image
 +  rosrun yarp_to_ros_image yarp_to_ros_image
 +  yarp connect /icub/cam/left /yarp_to_ros_image
 +
 +  * Calibrate icub cameras:
 +
 +  rosrun camera_calibration cameracalibrator.py --size 6x4 --square 0.040625 image:=/yarp_to_ros_image/image camera:=/yarp_to_ros_image
 +
 +This is for our middle sized checker board.
 +
 +  * Do save and commit.
 +  * Now there is a camera_calibration.txt in yarp_to_ros_image directory. Save this file it is the calibration file for the camera.
 +
 +==== Detecting markers ====
 +
 +  * Run yarp to ros image module:
 +
 +  roscd yarp_to_ros_image
 +  rosrun yarp_to_ros_image yarp_to_ros_image
 +
 +This will use the camera_calibration.txt file that is in the yarp_to_ros_image directory.
 +
 +  * Connect icub camera image to yarp_to_ros_image module:
 +
 +  yarp connect /icub/cam/left /yarp_to_ros_image
 +
 +  * Run image_proc to undistort the image 
 +
 +  export ROS_NAMESPACE=yarp_to_ros_image
 +  rosrun image_proc image_proc image_raw:=image
 +
 +  * Run ar_pose for markers detection:
 +
 +  rosrun ar_pose ar_multi /usb_cam/camera_info:=/yarp_to_ros_image/camera_info /usb_cam/image_raw:=/yarp_to_ros_image/image_rect
 +
 +  * Markers detected can be read with:
 +
 +  rostopic echo /ar_multi/visualization_marker
 +
 +  * Start rviz and add the tf module.
 +  * Put some markers in front of the camera, so that they get detected. In this moment rviz will recognize the markers frames and the camera frames. Set the Fixed and target frame to /r_eye3. Then you will see the frames of the markers in rviz.
  
ros.1281540729.txt.gz · Last modified: 2021/02/01 05:55 (external edit)