-
Notifications
You must be signed in to change notification settings - Fork 1
Home
The aim of this project is to track specific objects using color segmentation and control the Jackal using discrete control. A PS3 Eye camera has been mounted on the Jackal that provides visual feedback control from the Jackal. A subscriber node has been developed that imports the image from an image publisher and processes them using Open-CV.
Specific colors have been defined in the code that enable it and disable (masks) other colors. The assumption here is that the object of interest has a unique color. A radius is defined around these objects that change dynamically based on the orientation and distance of the object from the camera. For our testing, a yellow cup has been used that is bright as compared to other objects we could find (this probably wasn't the best choice since the jackal detects other jackal's and huskies). Since in an assumption it has been given that the lighting conditions would be similar to room 817 and NO objects would be surrounding the Jackal, we thought it best not to change the color at the moment. However, more colors have been defined and can be activated (uncommented) as required.
For the movement of the Jackal, a P controller has been designed for discrete control of the jackal in accord with the object. The input to this controller is a custom position message from the tracker code that published the 'X' and 'Y' coordinate of the object within the frame and the radius of the object. As the object in front of the Jackal moves, the controller code calculates its offset from the previous location and published a velocity to /cmd_vel. This velocity is in the direction of the movement of the object in front of the Jackal. The controller tries to center the object within the camera's field of view. The movement attempts to maintain the same approximate distance of the Jackal from the object. The controller also includes a hysteresis which ensuring that the visual feedback results in smooth tracking of the object. This hysteresis has been applied in both the linear as well as angular direction. The motion has finally has been saturated to 0.5m/s to prevent the Jackal from going too fast.
The joystick.launch file launches the joystick routine which basically listens to the joystick messages from bluetooth. Upon pressing the circle button on the PS3 controller the tracking of the object begins whereas on pressing the X button, it stops.
Our choice of controller was based on the requirements for the project, which are outlined below:
- The controller should respond quickly to the change, thus providing accurate tracking.
- The control input (in this case, the velocity) should not exceed a certain value, to prevent the Jackal from going too fast.
- To enable noise rejection, the control input should be suppressed for a set region around the equilibrium point, which can be set by the user.
We had the choice of using a proportional, PI, PD or PID controller for this application. However, we decided to use the proportional controller, because the fact that the equilibrium point we are supposed to achieve is no longer a point, but rather a region, makes using integral control unnecessary. Using a differential controller was considered initially, but based on testing, the system had no overshoot or jerkiness, and hence implementing the differential controller was ruled out.
Our controller incorporates a rosparam implementation of setting the equilibrium points, the hysteresis regions, the control input saturation values, and the controller magnitudes themselves. These settings can be found and modified in the PI_control.launch file