Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 5.02 KB

workshop.md

File metadata and controls

78 lines (60 loc) · 5.02 KB

Workshop: How do robots move?

nirmitsu_overview

Overview

In this session, we will assemble a simple two-wheeled robot and learn how it moves around. The goal is to develop an intuition of how changing the direction and speeds of individual wheels can steer such a robot around a space. There are two components to this session:

Hardware assembly

assembly_step_0

Each robot has requires the following components:

Step 1: Motors

image Fix the motors to the chassis with the help of the M3 screws and nuts as shown above. There is a small cylindrical extrustion on the motor that will fit into the hole in center hole. Then push the wheels into the motor shaft.

Step 2: Electronics

image Mount the RPi and motor driver to the chassis using M2 screws.

Step 3: Wiring

image TODO

Step 4: Configuration

The following configuration on the RPi are needed:

  1. Install Ubuntu 22.04 + ROS 2 Humble on the RPi
  2. Clone this repository git clone https://github.com/yadunund/nirmitsu-ros2

Software assembly

On a laptop, follow insturctions from here to install the programming interface. Launch the software with these commands.

cd ws_nirmitsu
source install/setup.bash
ros2 run nirmitsu_ros2_flowgraph nirmitsu 

A grey canvas will open up. If you right click on the canvas, a list of items which can be added will open up. They are grouped into 3 categories: Input, Display and Robot. We will not "assemble" the robot in software following the instructions below.

image image image image image image image

Network setup

TODO

Session

After assembling the robot in hardware and software, it's time to learn how the robot moves. First, move the slider connected to the Left Wheel and observe how the speed of rotation changes as you slide along. Click on the Reverse switch to flip the direction of rotation. Then try the same with the Right Wheel.

Things to try out:

  1. Set the sliders for both wheels to the same value and turn on the robot. What direction does the robot move?
  2. Now flip the direction of both wheels. Does the direction of the robot change?
  3. What happens when one wheel is not in reverse but the other is?
  4. What happens when both wheels have the same direction but one is spinning faster than the other?

Now that we're familair with how each individual wheel should spin to move the robot, let's have some fun. Right click on the canvas and add the Joystick input. Then connect the output of the Joystick to the Joystick input on the robot node as shown below. As you move the joystick around, the robot should follow the same direction and speed. You will notice that the joystick automatically sets the direction and speed of each wheel to follow the requested motion. But in principle, it does exactly what you did in the steps above 🙂

image