Summary

The aim of this chapter was to stretch your knowledge of ROS by implementing an advanced practical experience to identify and highlight some of the ROS advantages. A ROS system of nodes was created to visualize the environment in which a Crazyflie quadrotor was seen and controlled. The Kinect for Windows v2 depth camera was used to visualize this environment, and ROS nodes handled the detection of markers on the Crazyflie and the target. The location of the Crazyflie was identified in Cartesian coordinates (x, y, z), with the x and y values referring to the quadrotor's position in the image frame and z referring to its distance from the camera. These coordinates were converted into a tf transform and published. The target location was published in a message by a separate ROS node.

The advantage of ROS layers of tf and message passing leaves lower-level details to be handled by another dedicated node. The tf transform for the Crazyflie was used by a controller node to apply PID control to Crazyflie's flight. This controller node implemented a state machine to control the Crazyflie based on its state of flight. These states included idle, takeoff, hover, flight, and land. PID controllers were implemented to determine the control command based on the position errors for hover and flight to the target. Crazyflie control commands included pitch, roll, and thrust components to accomplish the feat of hovering or navigating the quadrotor accurately to a target location.

The next chapter,Chapter 10, Controlling Baxter with MATLAB©, will introduce the MATLAB Robotics System Toolbox. The Robotics System Toolbox enables MATLAB to communicate with ROS robots giving the user the advantage of MATLAB tools for image processing, path planning, motor control and more. Baxter will be added to MATLAB and controlled with ROS commands through the Robotics System Toolbox.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.39.59