ROS Nodes

These are the ROS Nodes provided by this package. Most likely, you will use a launch file to run these. You can also run them by using rosrun:

rosrun rktl_perception <Node name>

ball_detection

C++ Node. Uses color thresholding to find a vector pointing from the camera in the direction of the ball.

Subscribed Topics

Published Topics

  • ball_vec (geometry_msgs/Vector3Stamped): The \(x\) and \(y\) components of the vector comprise the the unit vector which passes from the camera center to the detected ball. The \(z\) component is the largest contour area detected (the size of the ball as it appears to the camera).

  • threshold_img (image_transport Camera): The black-and-white output of the thresholding. Only published to if the publishThresh parameter is set to true.

Parameters

  • publishThresh (bool, default: false): Whether or not to publish the image after thresholding is applied.

  • minHue (int, default: 60): The lower value of the hue to threshold on a 0 - 255 scale.

  • minSat (int, default: 135): The lower value of the saturation to threshold on a 0 - 255 scale.

  • minVib (int, default: 50): The lower value of the vibrance to threshold on a 0 - 255 scale.

  • maxHue (int, default: 150): The upper value of the hue to threshold on a 0 - 255 scale.

  • maxSat (int, default: 225): The upper value of the saturation to threshold on a 0 - 255 scale.

  • maxVib (int, default: 255): The upper value of the vibrance to threshold on a 0 - 255 scale.


focus_vis

C++ Node. Publishes a version of image_color_rect that has had Canny Edge Detection applied. Useful when using a siemens star to get the focus of the camera just right.

Subscribed Topics

Published Topics


localizer

C++ Node. Calculates the location of all objects in the cameras’ view. Republishes AprilTag and ball detections (received in “camera space”) into a common reference frame for all cameras (referred to as “world space”). The measurements used to put the camera into world space are “averaged out” over a series of measurements to reduce noise.

Multiple topics are published to, given by the pub_topics parameter. This parameter is interpreted as key/value pairs, where the key is an AprilTag ID or the IDs of an AprilTag bundle and the value is the name of the topic that should be published to. In the case of a bundle, the tag IDs are given in ascending order, delimited by commas (e.g. "0,1,2,3").

For the inclined, “camera space” is defined as the space whose origin is defined as the center of the camera, where the \(x\)-axis points to the right of the image, the \(y\)-axis points towards the top of the image, and the camera looks down the positive \(z\)-axis (this is the same convention that OpenCV uses). “World space” is defined as the space whose origin is the center of the field, where the \(x\)-axis points towards the “right-hand” goals, the \(y\)-axis points towards the “top” sideline, and the \(z\)-axis points directly up.

Subscribed Topics

Published Topics

Parameters

  • dectection_topic (string, default: "tag_detections"): Name of topic subscribed to, published to by an AprilTag detection node.

  • origin_id (string, default: "0"): ID of the AprilTag or AprilTag bundle that defines the origin of world space, i.e. the center of the field.

  • pub_topic (string) Topic name to publish camera pose to.

  • pub_topics (dictionary): key/value pairs where each detections of AprilTag with ID key is published on the topic named value.

  • ball_sub_topic (string, default: "ball_vector"): Name of topic subscribed to, published to by a ball_detection node.

  • ball_pub_topic (string, default: "ball_pos"): Name of topic published containing the position of the ball in world space.

  • ball_radius (float, default: 0.05): Radius of the ball, in meters.

  • buffer_size (int, default: 10): Number of elements used in the “averaging” of the camera pose.

  • queue_size (int, default: 100): Size of the the queue for the publishers.


pose_to_tf

Publishes an output of the localizer node onto the tf tree.

Subscribed Topics

Parameters

  • ~cam_frame_id (string, default: "cam0"): Frame ID of the camera.


projector

Create a depth map to project camera data onto ground plane.

Subscribed Topics

  • projector (sensor_msgs/CameraInfo): Camera Info, containing the projection matrix used to re-project the image onto the plane.

Published Topics

Parameters

  • ~ground_height (float, default: 0.0): Height of the ground, in meters.

  • ~update_period (float, default: 1): Rate at which to re-compute depth map, in updates per second.