User Tools

Site Tools


turtlebot:adventures:movingdr

Turtlebot: Moving Part 1


Intro

Assumption: Connection to and Teleoperation of the Turtlebot are functional.

This first step in learning how to control a robot is to learn how to get its actuators to work. The vanilla turtlebot only really has two of them, a left wheel and a right wheel. This would be the simplest instantiation of a (non-trivial) mobile robot. The Learn Turtlebot github repository has been cloned to the TurtleBot Adventures repository as “turtlebot.” It provides some simple python-based ROS scripts for controlling the robot. The code is quite primitive, so you will be able to see how well basic commands work by using open-loop control signalling and some form of dead-reckoning.

Investigation

Before downloading and checking out the code, see if you can figure out what types of commands the code should have by examining the teleoperation code, plus any related online tutorials/documentation. See if you can figure out:

  1. how to command the turtle bot to move it's wheels at predefined velocities;
  2. how to command them to move the robot a certain distance;
  3. how to command them to rotate for a certain amount (rather than at a certain speed).

List the commands that you've discovered regarding actuating (e.g. moving) the turtlebot.

Adventure

OK, now let's check out what we gained from the above exercise and see what's up. The particular python code of interest in the turtlebot repository is:

  1. goforward.py
  2. draw_a_square.py

which both command the robot to move via velocity commands. Do they agree with your background investigation?

The commands are organized into a twist vector, which encodes the forward, sideways/lateral, and rotational velocity commands to the robot. Due to the nature of the robot, it *cannot* move sideways, so the “y” component of the twist should always be zero (I believe that it gets ignored deeper in the code, so it might not matter. Just know that it is most likely not going to do anything). The robot can move forward (or backward) as well as turn in place, plus any reasonable combination of the two. In mechanics, a velocity given with the body as the reference frame (as opposed to some static world coordinate) is called a twist. Hence the use of that variable in the code.

Connect to the turtlebot and run the code on it (of course, you'll first have to git clone it). The Learn Turtlebot site has a nice series of inquiries and modifications related to the code. Go through them, the explore below (there might be some repetition).

Explore

Run the programs many times. How well does the robot execute the commands? If you work out the math for them, is it following the theoretical movements? Try out different surfaces. How do they impact the robot movement?

What are the topics that are published to in order to send the commands? Do they agree with what you found? Did you find any extra? If so, how do they relate to the ones here?


Adventure Contents

turtlebot/adventures/movingdr.txt · Last modified: 2023/03/06 10:31 by 127.0.0.1