Skip to content

Commit

Permalink
getting there but still work to do on the calibration instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
liampaull committed Sep 26, 2018
1 parent e19cfa7 commit 442fae2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 52 deletions.
@@ -1,6 +1,6 @@
# Wheel calibration {#wheel-calibration status=ready}

Assigned: Andrea Daniele
Assigned: Jacopo Tani

<div class='requirements' markdown='1'>

Expand All @@ -11,46 +11,10 @@ when you command it to. Set the maximum speed of the Duckiebot.

</div>

TODO: Jacopo Tani - separate theory from demo instructions

## Introduction

The motors used on the Duckiebots are called "Voltage-controlled motors".

This means that the velocity of each motor is directly proportional to the voltage it is subject to. Even though we use the same model of motor for left and right wheel, they are not exactly the same. In particular, every motor responds to a given voltage signal in a slightly different way. Similarly, the wheels that we are using look "identical", but they might be slightly different.

If you drive the Duckiebot around using the joystick, you might notice that it doesn’t really go in a straight line when you command it to. This is due to those small differences between the motors and the wheels explained above.

Different motors can cause the left wheel and right wheel to travel at different speed even though the motors received the same command signal. Similarly, different wheels travel different distances even though the motors made the same rotation.

Comment: It might be helpful to talk about the ROS Parameter Server here, or at least
reference another page. -AD


## What is the Calibration step?

We can counter this behavior by *calibrating* the wheels. A calibrated Duckiebot
sends two different signals to left and right motor such that the robot moves in
a straight line when you command it to.

The relationship between linear and angular velocity of the robot and the velocities
of left and right motors are:

$$
\begin{align*}
v_{\text{right}} &= (g + r) \cdot (v + \dfrac{1}{2} \omega l ) \\
v_{\text{left}} &= (g - r) \cdot (v - \dfrac{1}{2} \omega l )
\end{align*}
$$

where $v_{\text{right}}$ and $V_{\text{left}}$ are the velocities of the two motors, $g$ is called *gain*, $r$ is called *trim*, $v$ and $\omega$ are the desired linear and the angular velocity of the robot, and $l$ is the distance between the two
wheels. The gain parameter $g$ controls the maximum speed of the robot.

With $g > 1.0$, the vehicle goes faster given the same velocity command, and for $g < 1.0$ it goes slower. The trim parameter $r$ controls the balance between the two motors.

With $r > 0$, the right wheel will turn slightly more than the left wheel given the same velocity command; with $r < 0$, the left wheel will turn slightly more the right wheel.

TODO for Jacopo Tani: It might be helpful to add the differential equations that relate velocities and voltages of the motors. -AD
For the theoretical treatment of the odometry calibration see [](+learning_materials#odometry_calibration)


## Perform the Calibration
Expand Down
Expand Up @@ -15,10 +15,8 @@ Results: Calibration for the robot camera.

### Setup

Download and print a PDF of the calibration checkerboard

TODO:link to checkerboard pattern

Download and print a PDF of the calibration checkerboard
([A4 intrinsic](github:org=duckietown,repo=duckiefleet,path=calibrations/Calibration_pattern_A4_intrinsic.pdf), [A3 extrinsic](github:org=duckietown,repo=duckiefleet,path=calibrations/calibration_pattern_A3.pdf), [US Letter](github:org=duckietown,repo=Software,branch=master17,path=duckietown/config/baseline/calibration/camera_intrinsic/calibration_pattern.pdf)).
Fix the checkerboard to a planar surface.

<div figure-id="fig:calibration_checkerboard" figure-caption="">
Expand All @@ -27,26 +25,36 @@ Fix the checkerboard to a planar surface.

Note: the squares must have side equal to 0.031 m = 3.1 cm.

Download and print a PDF of the calibration checkerboard

Fix the checkerboard to a planar surface.

### Calibration

Make sure your Duckiebot is on, and both your laptop and Duckiebot are connected to the duckietown network.

#### Step 1
#### Docker

On your laptop run

```
laptop $ dts update (if necessary)
laptop $ dts install calibrate_duckiebot (if necessary)
laptop $ dts calibrate_duckiebot ![DUCKIEBOT_NAME]
```


Open two terminals on the laptop.

#### Step 2
#### ROS

In the first terminal, log in into your robot using SSH and launch the camera process:
Open two terminals on the laptop. In the first terminal, log in into your robot using SSH and launch the camera process:

```
duckiebot $ cd ![duckietown root]
duckiebot $ source environment.sh
duckiebot $ roslaunch duckietown camera.launch veh:=![robot name] raw:=true
```

#### Step 3

In the second laptop terminal run the camera calibration:

```
Expand All @@ -56,7 +64,9 @@ laptop $ source set_ros_master.sh ![robot name]
laptop $ roslaunch duckietown intrinsic_calibration.launch veh:=![robot name]
```

You should see a display screen open on the laptop ([](#fig:intrinsic_callibration_pre)).


Whether you did the Docker way or the ROS way you should see a display screen open on the laptop ([](#fig:intrinsic_callibration_pre)).

<div figure-id="fig:intrinsic_callibration_pre" figure-caption="">
<img src="intrinsic_callibration_pre.png" style='width: 30em'/>
Expand Down Expand Up @@ -102,10 +112,12 @@ If you are satisfied with the calibration, you can save the results by pressing
This will automatically save the calibration results on your Duckiebot:

```
![duckiefleet root]/calibrations/camera_intrinsic/![robot name].yaml
/data/calibrations/camera_intrinsic/![robot name].yaml
```

####




## Extrinsic Camera Calibration {#extrinsic-camera-calibration}

Expand Down
@@ -1,4 +1,4 @@
# `DB17`: Taking and verifying a log {#take-a-log status=outdated}
# Taking and verifying a log {#take-a-log status=outdated}

<div class='requirements' markdown='1'>

Expand Down

0 comments on commit 442fae2

Please sign in to comment.