prop_follower Package Documentation

This package uses a camera and a lidar to follow moving objects

Dependencies

  • Lidar node/package

  • object_detection_pkg

  • mavros

Launching

The launch file is called prop_follower.launch

Set the following parameters depending on the mode you want to run:

  • object_detection: set to true if we are using object detection, set to false if not. If true, angle_finder will be launched. If false, fake_angle_finder will be instantiated instead of angle_finder. fake_angle_finder will continuously publish a PropAngleRange message like angle_finder, except theta_1 will be 0, and theta_2 will be 180 degrees.

  • lidar-distance-angle-measurement: set to true if we use lidar to detect objects, false if we just want to use fake coordinates for testing. Launches coord finder if true, fake_coord_finder if false.

  • velocity_sender: set to true to launch velocity sender, false to launch waypoint_sender

Gazebo Sim

Use prop_follower_sim.launch instead to test coord_finder with the box_bot_sim package to use a simulated LiDAR.

Nodes

angle_finder(NOT FINISHED)

Finds an angle range for the LiDAR based on object detection bounding boxes.

Instantiates a prop for each object detected per camera frame, then gets the angle range for each prop.

Subscribes to

  • /bounding_boxes

Publishes to

  • /prop_angle_range

fake_angle_finder

Provides an angle range when there is no object detection. Sets the range to the entire camera frame width.

Publishes to

  • /prop_angle_range

coord_finder

Finds the relative local coordinates of the prop with the robot's current position as a reference.

Using the angle range and LiDAR scan, picks the closest point within the angle range. The props are small enough that this point can be taken to represent the center of the prop. Converts this distance and angle to x and y coordinates

  • /prop_angle_range

  • /laser_scan

Publishes

  • /prop_local_coords

fake_coord_finder

Publishes local coordinates from a list. For testing waypoint and velocity sender without LiDAR

Publishes

  • /prop_local_coords

velocity_sender

Sends velocity commands to mavros to move the robot toward the prop.

Uses the local coordinates of the prop and a scaling factor to determine x and y velocities.

Subscribes to

  • /prop_local_coords

Publishes to

  • ~setpoint_velocity/cmd_vel_unstamped

waypoint_sender

Sends position setpoints (waypoints) to mavros to move the robot toward the prop.

Subscribes to

  • /prop_local_coords

Publishes to

  • ~setpoint_position/local OR ~setpoint_raw/local (Need to find out which is better)

Topics

/topic_name (MessageType)

Internal

/prop_angle_range (prop_follower/AngleRange)

  • Label of Identified prop

  • Angle range of Identified prop

/prop_local_coords (geometry_msgs/Vector3)

  • relative x and y coordinates of prop

  • z coordinate is unused here

External

Topics published to and subscribed from nodes outside this package

/bounding_boxes (object_detection/BoundingBoxes)

  • Bounding box information

/laser_scan (sensor_msgs/LaserScan)

  • LiDAR scan data

~setpoint_velocity/cmd_vel_unstamped (geometry_msgs/Twist)

  • Velocity setpoint for mavros

Custom Messages

AngleRange

string prop_label
float32 theta_1
float32 theta_2

Parameters

Parameters are stored in yaml files under config/.

params.yaml

Contains all settings and constants for this package

fake_coords.yaml

Contains lists of x, y, and z coordinates for use with the fake_coord_finder node.

Last updated