Cornell University: ECE 4960

Return to main page


Lab 3(a): Characterize your car

Procrastinating.

Objective:

Before we start taking the car apart, we can leverage the remote control to familiarize ourselves with the capabilities of the hardware. In later labs we will seek to replicate manual behavior with autonomous control and in some cases exceed what manual control can make it do for planar navigation and more dynamic (‘flippy’) behaviors. This is a fairly open ended lab, but the goal is to methodically document your car in any way you think might be useful later on. We will brainstorm things that may be important in class, and there is an additional list of suggestions below.

Prioritize - you only need to do a couple of these! You will be graded for your reasoning of why you measure particular aspects, and how well you document it. Note that we expect you to pick from both type A (simple measurements) and B (require experimental setups). Many of these experiments may require replicas, so we encourage you to coordinate in teams on what and how you want to measure system properties. Think of it this way: whatever you write down, you should -yourself- be able to use in later labs.

Examples of non-destructive testing (don’t destroy your car!)

Don’t forget, the battery only lasts 10-20min on a full charge, so plan out 1-2 tests per day.

  • (A) What are the dimensions of the car?
  • (A) What is the weight?
  • (A) How long does it take to charge?
  • (A) What is the battery life time?
  • (B) What is the range of speed? (remember, this is battery dependent)
  • (B) What is the range of acceleration?
  • (B) What is the braking distance?
  • (B) What surfaces can it handle?
  • (B) What stunts can it do?
  • (B) How reliably does the robot turn around its own axis?
  • (B) How well can you operate the car with manual control?
    • Ex. starting from ~5m distance, at full speed, how close can you get to a wall and stop the car, without a crash?
    • Ex. how accurately can you hit four corners of a meter-scale square as fast as possible?
    • Ex. can you reliably reproduce tricks? (describe which and what control inputs you give it)
    • Ex. can you make the robot balance on one set of wheels (front or back)?
  • Feel free to come up with other ideas!

Write-up

To demonstrate that you’ve successfully completed lab 3(a), please upload a brief lab report (<600 words) with description, data, photos, and/or videos. Do not forget to mention your collaborators. We will also ask you to give a brief 3-5min presentation in class, based on your Github page, together with your collaborators.


Lab 3(b): Characterize your virtual robot

Objective

In this lab, you will become more familiar with the simulator and the virtual robot. You will learn how to start/stop the simulator and how to perform teleoperation using your keyboard. (Lab 3b should be performed individually, not in the teams from lab 3a.)

Virtual Environment

The virtual environment consists of three modules/applications:

1. Simulator: The robot simulator includes a wheeled robot with a laser range finder, similar to the physical robot and the TOF sensor. The simulated world is defined in a “.world” xml like file. This file tells the simulator everything about the world, from obstacles to robots and other objects.

2. Plotter: The 2d plotting tool allows for live asynchronous plotting of multiple scatter plots using Python.

3. Controller: You will be programming the controller in Python to perform various functions on your virtual robot. We provide you with a robot class which, among other things, provides a minimal control interface for the robot in the simulator. It allows you to:

  • Get robot odometry pose
  • Move the robot
  • Read the range finder data

Many of the future labs will involve writing code to automate your virtual robot.

Instructions

Workflow Tips

  • You can create a new terminal tab instead of a terminal window. Select “File->New Tab” in the terminal window or use the keyboard shortcut <CTRL+SHIFT+T>.
  • You can place a window always on top by right by clicking on the window and selecting “Always on Top”.
  • When typing commands in the terminal, you can type in a few letters and press <TAB> on your keyboard to autocomplete/autosuggest commands.
  • The bash command pwd prints the working directory.

Install software dependencies

We need to install/update a backend libaray that is utilized for all future lab simulations. In a terminal window, type in:

sudo apt install ros-melodic-rosmon -y

Type in the password when requested.

If this is the first time you are using the VM, you might see the following error:

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

Ubuntu is probably performing background updates and is preventing you from installing/updating any software at the same time in order to prevent race conditions. Give it 10-15 minutes to finish what it is doing. If the issue persists, refer to this guide.

Setup the base code

Follow the instructions here to setup the lab3 base code in your VM. You will need to follow these steps only once per lab.
The video here depicts a visual walkthrough of the setup procedure.

  1. Close all open terminal windows. (Make sure no terminals are currently open)
  2. Download and extract the lab3 base code in your VM.
  3. In your file explorer, navigate into the extracted directory “lab3 base code”. It should have three files within it: lab3.zip, bash_aliases and setup.sh. DO NOT edit or move these files.
  4. Right click in an empty space in the file explorer and select “Open in Terminal”.

    This will open a terminal to the directory lab3_base_code.

  5. In the terminal window, type in:
     ./setup.sh 
    
  6. A successful setup process should output something like this:
      > Log output written to: /media/sf_vm_shared/lab3_base_code/output_lab3.log 
      > Lab Work Directory: /home/artemis/catkin_ws/src/lab3/scripts/ 
      Validating...
      Step 1/3: Extracting Files to: /home/artemis/catkin_ws/src/ 
      Step 2/3: Setting up commands
      Step 3/3: Compiling Project
    
      Successfully compiled lab.
      NOTE: Make sure you close all terminals after this message.
    

    If it wasn’t successful, you will notice an error message. If so upload the log file (location shown in the first line of the output) in a post in campuswire and we can help you with the issue.

  7. Close all open terminal windows. Make sure no terminals are currently open after this step.

Start the simulator

Each lab has a “lab-manager”. It is an interactive launcher for various tools/apps required for the lab.

  • At the bottom of the lab-manager, a green bar shows the various tools available for the lab.
  • Each tool has a letter assigned to it.
  • Once you press the assigned letter, you can start the tool by pressing <s> on your keyboard.
  • You can stop a running tool by pressing <k> after selecting the specific tool.
  • To quit the lab-manager (and all the toosl that were launched), press <CTRL + C> in the lab-manager terminal window.
  • These instructions should also be displayed in your terminal.
  • Please refrain from using the “close button” in the top right corner of the simulator window to close it.

The video here depicts the process of starting a new terminal, launching the lab3-manager, and starting/stopping the various tool(s).

  1. Start the lab3-manager: Open a terminal window and type in the command:
      lab3-manager
    
  2. To launch the simulator, press <a> on your keyboard followed by <s>.

    The simulator window should open up. The robot is depicted as a green sqaure and the obstacles as black line segments.

  3. Use your mouse to move around/change the view in the simulator.
  4. Check the view menu from the menubar in your simulator and play around with the various toggles.

    You can press on your keyboard to reset the simulator view to the top down view.

Start the keyboard teleoperation tool

  1. To launch the keyboard teleoperation tool, open a new terminal and type the below command:
    robot-keyboard-teleop
    

    The terminal catches your keyboard inputs and sends appropriate signals to the virtual robot in the simulator.

  2. With the terminal window running the keyboard teleoperation tool as the active window, use the keys on your keyboard to move the robot around based on the displayed keymap.
  3. To quit, press <CTRL+C> on your keyboard.

Perform tests on your virtual robot

Perform some basic tests on your virtual robot using the keyboard teleoperation tool.

Examples of testing

  • What is the minimum linear speed of the robot?
  • What is the minimum angular speed of the robot?
  • What happens when the robot bumps into an obstacle?
  • Did you try to “kidnap” the robot using your mouse?

Write-up

Please upload a brief lab report (<300 words) describing the various tests performed along with a short video of the virtual robot moving around in the simulator. Please add this write-up to the page you generated for Lab 3(a).