CSCE 439/839: Robotics
Lab 1: Fanboat Construction and ROS


Instructor: Carrick Detweiler
carrick _at_ cse.unl.edu
University of Nebraska-Lincoln
Fall 2015

Started: Friday, September 4, 2015
Lab 1 Checkpoint 1 (Up through Sec. 4): Friday, September 11, 2015
Lab 1 Checkpoint 2 (Up through Sec. 5): Friday, September 18, 2015
Lab 1 Due Date: Friday, September 25, 2015

1  Overview

In this lab you will design, construct, and perform experiments with the fan boat. In addition, you will continue learn to use ROS (www.ros.org). This lab has a checkpoints. In lab on the date of the checkpoint you will be responsible for showing the instructor your progress. Also, the points for this lab do not add up to 100, but each lab is worth the same amount as any other lab even if the points are not equal.
Before starting you should read through the whole lab. Some parts can be done in parallel, while some sections rely on the completion of previous sections. You should discuss your plan of attack for the lab in your group and decide how you will work together and divide the work. Everyone, however, is responsible for knowing about all sections of the lab. In addition to completing the lab report, on the due date, you will demonstrate what you accomplished for the instructor.

2  Materials

The main materials you will use in this part of the lab to construct the fanboat are:
You will also use a various hand tools including knives, soldering irons, power supplies, etc.

3  Safety

In this lab you will be using a number of tools and devices that can be dangerous if mishandled. You should always follow instructions, think twice, and ask for help if you are unsure what you are doing or are unsure about safety. Please report any accidents to the course staff and seek medical attention immediately if needed. Reasonable precautions will prevent most accidents. Do not work in the lab alone or when you are tired.
Throughout this course you will be using propellers that are moving very fast. Please make sure to keep your fingers, lose clothing, hair, and anything else away from them. Along these lines, if you have long hair, you should make sure to tie it back or cover it while in the lab. Also, as a policy, do not touch anything near the propellers or on the fanboat while the motors are powered. Either disconnect the battery completely or disconnect the ESC from the battery or motor before working on your vehicle.
We will also be using power supplies and batteries in this course. Make sure to follow instructions when using these devices as they can be dangerous if misused. You should always be careful not to short wires on batteries or power supplies and follow appropriate methods for charging batteries.
In this lab you will also be using drills, knives, and soldering irons. These can cut or burn you or your classmates. Always be aware of your surroundings when using these devices and never cut towards yourself or anyone else.
We will be using high-power, two cell Lithium-Polymer (LiPo) batteries to power the fanboats. Please be extremely careful with these batteries and recall the safety information we discussed in lab. In particular, only use the designated chargers in the lab to charge the batteries. The fanboats will not turn on if the voltage on the battery is too low, however, you should also be aware of the use of your battery and never leave it connected to the fanboat when not in use (as this could dangerously discharge the battery). A fully charged battery will have a voltage of 8.4V. A battery that is about half charged will have a voltage of approximately 7.4V, and a nearly discharged battery will have a voltage of around 7.0V. A voltage below 6.0V can be dangerous, especially if you try to recharge it. If this happens, please let the instructor know immediately. With care, it is possible to revive an over discharged battery if it is done quickly (but putting it on the charger is not the way to do it and it is dangerous).
Unlike most programming, it is possible that a bug in your code could physically damage your robot or injure your classmates. Take care when running testing your robot to make sure that everyone around you is aware of what is going on and that you are able to quickly stop your Fanboat when it goes out of your control.

4  Robot Construction (15pts)

Note that up to and including this section must be completed for Checkpoint 1.
In this section of the lab you will start building your robot. Make sure to think through your design before you start attaching and placing parts as it is hard to un-drill a hole. Also, you can do much of this in parallel, so divide and concur, just make sure that everyone contributes and knows how to do all sections.
Throughout you should make sure to document your construction process with pictures to include in the report.

4.1  Soldering

You have a number of components that need soldering. In particular, the motors and ESCs all need connectors soldered onto them. See the demonstration unit to determine which connectors to solder where. Also pay attention to the fact that you need to put heat shrink tubing on all connectors, but before you heat shrink them make sure to talk to an instructor if you have limited experience soldering these types of connectors. Make sure that everyone in your group solders at least two connectors.
Question: For each member in your group, have you soldered before? If so, what kind of soldering did you do and how much experience did you have with it? Did you have any trouble soldering these connectors?

4.2  Constructing Props and Guards

In your box you have a number of acrylic pieces that you need to connect together to form the prop guards as demonstrated by the instructor. You may need to drill out some of the holes a little bit to remove some of the leftover acrylic pieces from the laser cutting process. In addition, it is a good idea to sand the sharp corners of the acrylic where ever they are in contact with wires to prevent the wires from getting cut.
In addition, you will need to mount your propellers to the motors. This requires drilling out the propeller, which should be done carefully to make it as straight as possible. Otherwise your motor and propeller will be unstable.
Question: Describe the prop guard construction process and make sure to discuss any challenges you encountered.

4.3  Mounting Parts

Fanboats that have loose parts are a bad idea. So you need to make sure to securely attach all of your parts. This includes making sure wires are routed (and possibly ziptied/taped) in good locations where they will not be pulled or abraded by contact with sharp edges of acrylic. Note, that you might want to experiment with different locations to see how the weight and balance impacts the motion, but you won't be able to run the motors until you complete more of the lab.
Question: Where did you mount the various parts and why?

5  ROS and Interfacing with Fanboat (25pts)

Note that up to and including this section must be completed for Checkpoint 2.
In this lab, we will explore the ROS interface to the fanboat and write code to control the fanboat using a remote control (you can use either your Arduino one or the xbox controller).

5.1  Computer Setup

You should all have ROS already installed on your computers. You should make sure that you keep copies of your code and anything else on the computer elsewhere. The best option is to setup a source control repository for your code. While this is the recommended option, it is not required for this lab. You can also use a usb stick, space on CSE or UNL shared drives, or other services like Dropbox to backup your code. If your drive crashes it is not an excuse to turn in the lab or assignment late. No extensions will be granted.

5.2  Basics

Create a workspace for your code and a lab1 node. You should then be able change directories to the sample code directory by typing in the terminal:
roscd lab1

or alternatively you can manually cd to the directory. The command roscd is useful, however, because you can use it to go to the source directory for any ROS module. Explore ros a little bit and find out where roscpp is.
Question: What is the absolute path of the roscpp module? What does roscpp do?
You should download the fanboat_ll from the course website. This package contains a node and messages that allow you to control the IMU on the fanboat. Put this in your workspace and start exploring this node.
Question: What is the name of the nodes, the topics, message types, etc that allow you to control the fanboat? How can you start the node(s) needed to control the fanboat?
In order to communicate with the fanboat you need to use the pair of xbee radios. Simply plug in the radio into a usb port on your computer. Before you connect the battery remove the propellers from your fanboat to make sure that if you inadvertently start the motors the fanboat will not take off.
Question: By examining the source code, what port/file is the radio located on by default? You may need to change this to work with your computer configuration.
Once you get this configured properly you should be able to start receiving messages from the IMU after starting this node. Note that when the lights are blinking on startup the IMU is going through a calibration process. Keep it level and do not move it while this is happening.

5.3  rostopic and rosmsg

The command rostopic lets you examine messages that have been advertised and are being published. Use the command rostopic list to show all active message topics. Use rostopic echo to display the output of the IMU.
Question: What command did you use to do this? And what information do you get from the output? How fast is this published and how did you determine this?
The command rostopic can also be used to publish messages. Use the command rostopic pub --help to determine how to publish messages, you can also refer to the ROS online tutorials.
Question: Publish a command to turn on the motors (make sure your propellers are disconnected!). Describe how you figured out how to do this, you can use the command rosmsg to determine parameters for messages.
Question: If you do not publish the motor commands repeatedly the motors will turn off. How fast do you need to publish the motor messages for the motors to stay on?

5.4  rqt_plot

The command rqt_plot is a command you can use to quickly visualize and plot values in published message topics. You can plot the IMU data, for instance, by doing:
rqt_plot /fanboatLL/yaw

If you separate fields by commas they will be plotted on one graph, if you use spaces instead, they will be plotted in different graphs.
Question: What are the min and max values for the yaw? Which direction causes an increase in yaw? Also explore pitch and roll and discuss how they work.
Question: What is the maximum rotational rate that the IMU can measure? Is it the same for positive and negative rotations? How did you determine this?

5.5  Writing a ROS Joystick Node

We are now going to going to write a new ROS node to control the fanboat with the xbox controllers, although you can also do the same with your Arduino controllers (which should have the same joy interface). Note, you may want to write this node after or concurrently with Section 6.
The ROS node that reads the joystick is called joy. You can start this node by running rosrun joy joy_node, however, before you do this you may need to start roscore if it is not already running.
Question: What messages does the joy node publish? What are the mappings from the different buttons and joysticks on the controller to various joy messages?
We will now create a new ROS node to control the fanboat using the joystick. You can do this in a way similar to the homework, but you should write a node that publishes to the motors based on your joystick input. For consistency use the left joystick to control the rotation and forward speed.
Question: What messages did you connect the joystick node to? Include a picture of the rqt_graph of your configuration and describe why you chose the configuration you did.

6  Fanboat Experiments (30pts)

Now that you have designed and assembled your fanboat, it is time to test how well it moves. Make sure that you perform your tests in the designated testing area and that everyone around you is aware that you will be testing your robot. Note also that if the propellers start to make strange sounds when they are spinning fast, then you should slow them down as this could lead to propellers breaking or other damage.
In this section you will implement nodes that allow you to drive basic primitive patterns. There are a number of ways you can implement this, so think about the best design before you get started. In the future, you will need to be able to chain sequences of patterns/motions together to form more complex motions. For this lab, you should also implement the ability to press a button on your controller to have your robot execute the different motion primitives. Finally, make sure you have a launch file that starts up all of the nodes for these experiments.
Question: Include a printout of the rqt_graph of your system from the end of this section and make sure to describe the different nodes in the system.

6.1  Translation Experiments

Question: What is the minimum power setting that is needed to move the fanboat? Also, it is important to note that as the battery voltage decreases, you will need to increase thrust to be able to move, so make sure you report on the charge level of the battery.
Question: Report on how much force is required to move your fanboat in Newtons. How did you figure this out? Hint: there are pulleys in the common tools box.
Question: What is the maximum force that your thrusters can produce? Note, please be careful when powering the thrusters at maximum. If they vibrate, make bad noises, etc do not run them that fast. Instead, report on the maximum force that you can use without encountering these potential problems.
Question: How much weight can your fanboat support while still being able to move? Does it depend on where you put the weight? If so, where is it better to put weight. Make sure to describe this in detail.
Question: How much force does it take to move the weighted and unweighted fanboat? How did you figure this out?
Question: Create a node that lets you input a specific distance to travel and then moves that distance before stopping. How repeatable are motions if you give the same inputs? The group that has the most accurate and repeatable translation will get the most points for this question.

6.2  Rotational Experiments

We will now perform some experiments to determine how well the fanboat rotates.
Question: What is the maximum rotational rate you can achieve?
Question: Can you rotate in place, or do you need a larger area to turn? Report on the values of thrust needed to do these types of rotations.
Question: Perform experiments to characterize the accuracy of the IMU in yaw. Does the IMU drift over time? Does the gyroscope report angles accurately when moved slow? fast? If you return to the zero angle, does it always end up in the same spot? Report your findings and support them by detailing the experiments you performed. Back up your experiments with tables and graphs as needed.
Question: Create a node that turns the fanboat a specific angle. How repeatable are the rotations? The group that has the most accurate and repeatable rotation will get the most points for this question.

7  To Hand In

You should designate one person from your group as the point person for this lab (each person needs to do this at least once over the semester). This person is responsible for organizing and handing in the report, but everyone must contribute to writing the text. You should list all group members and indicate who was the point person on this lab. Your lab should be submitted by handin, http://cse.unl.edu/~cse439/handin/, before the start of class on the due date. Include a pdf of your report and your source code in handin. Also make sure to bring in a printed copy to class on the due date.
Your lab report should have an introduction and conclusion and address the various questions (highlighted as Question: ) throughout the lab in detail. It should be well written and have a logical flow. Including pictures, charts, and graphs may be useful in explaining the results. There is no set page limit, but you should make sure to answer questions in detail and explain how you arrived at your decisions. You are also welcome to add additional insights and material to the lab beyond answering the required questions. The clarity, organization, grammar, and completeness of the report is worth 10 points of your lab report grade.
In addition to your lab report, you will demonstrate your system and what you accomplished up to this point to the instructor at the beginning of lab on the due date. This is worth 15 points of your overall lab grade. You do not need to prepare a formal presentation, however, you should plan to discuss and demonstrate what you learned and accomplished in all sections of the lab. This presentation should take around 10 minutes.
Question: Please include your code with the lab report. Note that you will receive deductions if your code is not reasonably well commented. You should comment the code as you write it, do not leave writing comments until the end.
Question: You should make sure to include a picture of your final fanboat.
Question: Robots like to have names, what are you going to call your fanboat?
Question: For everyone in your group how many hours did each person spend on this part and the lab in total? Did you divide the work, if so how? Work on everything together? Give details on the hours each group member worked (e.g. keep a list of how many hours per day each person worked and on what).
Question: Please discuss and highlight any areas of this lab that you found unclear or difficult.



File translated from TEX by TTH, version 4.03.
On 11 Sep 2015, 09:23.