Skip to content
Snippets Groups Projects

Description

This ROS node is intended to estimate the position and orientation of a vehicle using a camera looking at the ceiling and four color markers placed at known positions. At least three color markers have to be detected in order to generate a pose estimation.

This node requires one YAML configuration file for each of the color markers (this configuration files can be generated with the iri_color_calibration tool, and also the position of the markers with respect of the world frame (which can also be provided with a YAML configuration file).

When this node does not have enough information to estimate the vehicle pose, it returns the last valid pose estimation, until enough markers are detected again. The information provided by this node is published as a ROS odometry message and also as at TF transform.

The camera has to be properly calibrated in order to reduce the estimation error.

publishers

This node publishes the following topics:

  • ~/odom (nav_msgs/Odom.msg): This topic contains the pose estimation of the vehicle with respect to the world frame in which the markers positions are defined.

subscribers

This node subscribes to the following topics:

  • ~/camera/camera_info (sensor_msgs/CameraInfo.msg): provides the calibration information for the original image.

  • ~/color1_blobs (iri_blob_detector/blob_array.msg): a list of all the connected regions generated by the iri_blob_detector node for the first color.

  • ~/color2_blobs (iri_blob_detector/blob_array.msg): a list of all the connected regions generated by the iri_blob_detector node for the second color.

  • ~/color3_blobs (iri_blob_detector/blob_array.msg): a list of all the connected regions generated by the iri_blob_detector node for the third color.

  • ~/color4_blobs (iri_blob_detector/blob_array.msg): a list of all the connected regions generated by the iri_blob_detector node for the fourth color.

services

This node provides the following service clients:

  • ~/set_exposure (iri_visual_gps/set_exposure.srv): This service is used to change on-line the exposure time of the camera used. This exposure time must coincide with the one used to obtain the color filtering parameters of the four colors.

parameters

This node has the following parameters. These parameters can be modified with the dynamic reconfigure tool.

  • world_frame (string): name of the reference frame used for the world. This name is used when publishing TF and odometry data.
  • odom_gps_frame (string): name of the reference frame used for the GPS specific odometry to avoid conflicts with the normal odometry. This name is used when publishing TF and odometry data.
  • color1_id (string): Identifier of the first color. This identifier must match only one of identifier received through the colorX_blobs topics.
  • color1_x (double): X coordinate in meters of the color marker for the first color.
  • color1_y (double): Y coordinate in meters of the color marker for the first color.
  • color1_z (double): Z coordinate in meters of the color marker for the first color.
  • color2_id (string): Identifier of the second color. This identifier must match only one of identifier received through the colorX_blobs topics.
  • color2_x (double): X coordinate in meters of the color marker for the second color.
  • color2_y (double): Y coordinate in meters of the color marker for the second color.
  • color2_z (double): Z coordinate in meters of the color marker for the second color.
  • color3_id (string): Identifier of the third color. This identifier must match only one of identifier received through the colorX_blobs topics.
  • color3_x (double): X coordinate in meters of the color marker for the third color.
  • color3_y (double): Y coordinate in meters of the color marker for the third color.
  • color3_z (double): Z coordinate in meters of the color marker for the third color.
  • color4_id (string): Identifier of the fourth color. This identifier must match only one of identifier received through the colorX_blobs topics.
  • color4_x (double): X coordinate in meters of the color marker for the fourth color.
  • color4_y (double): Y coordinate in meters of the color marker for the fourth color.
  • color4_z (double): Z coordinate in meters of the color marker for the fourth color.

Dependencies

This node has the following dependencies:

  • OpenCV

  • Eigen

  • iri_blob_detector: see the documentation of this node for instructions on how to install it.

How to use it

Download the node inside a catkin workspace:

git clone https://gitlab.iri.upc.edu/seat_adc/iri_visual_gps.git

Build the node:

roscd

cd ..

catkin_make --only-pkg-with-deps iri_visual_gps

This node provides two launch files:

  • visual_gps.launch: this file launches four instances of the iri_blob_detector together with the camera driver node inside a nodelet to reduce the overhead of sending the image between several nodes in the same computer. It also launches the visual GPS node to generate the pose estimation.

  • visual_gps_sim.launch: This file does the same as the previous one, except for the camera driver node that is not launched. It expects the model car simulator to be already running.

Once the node is running, you can use the dynamic reconfigure ROS tool to change online the coordinates of the four markers:

rosrun rqt_reconfigure rqt_reconfigure