public class RobotPOC
extends java.lang.Object
It is composed of two main parts: the robot (part 1) and a "joystick remote" (part 2). The part 1 combines a Raspberry Pi 2, a BrickPi, some LEGO Mindstorms NXT sensors and motors, and a set of additional components. The part 2 combines a Raspberry Pi 2 and a joystick.
The operating principle is the following: the joystick part (part 2) of the project is used to control the robot (part 1) through the network, as a remote control. To do so, part 2 is used to create a WiFi hotspot. Part 1 will automatically connect to this hotspot, so that both sides are part of the same network, and can communicate together. There are two different modes for the joystick. The first mode controls the movements of the robot (by sending commands to control the two motors) while the second one controls the orientation of the camera support (by sending commands to control the two servomotors composing the camera support - the robot contains a camera support which is able to rotate along x and y axis (horizontally and vertically), via two servomotors). The communications between the joystick remote and the robot are performed by using a MessageLikeSocketServer on part 1 to deal with commands received from part 2. They respect the related specific protocol as presented in the network part of this report. From the joystick, it is possible to switch from one mode to another by pressing the green button. When the LED is ON: the movements of the robot are controlled; when the LED is OFF: the camera support is controlled. The joystick is an analog component: we used an ADC to convert analog signals coming from the joystick into digital commands.
Do not hesitate to check our online post regarding this robot. We made some videos and pictures to illustrate the result: Raspoid.com
Modifier and Type | Class and Description |
---|---|
static class |
RobotPOC.DisplayScreen
Different screens available.
|
Constructor and Description |
---|
RobotPOC(POCConfig config)
Constructor for our proof of concept robot, with a specific config.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Command-line interface.
|
void |
newCameraSupportPosition(int x,
int y)
Update the current position of the camera support.
Called when the position of the remote joystick has changed. |
void |
pause()
Sets the robot to the pause mode.
|
void |
rotateCameraSupportHorizontally(double angle)
!ATTENTION! pay attention to how you build your support !
The position of the rotor is important as your support couldn't rotate
in all directions.
|
void |
rotateCameraSupportVertically(double angle)
!ATTENTION! pay attention to how you build your support !
The position of the rotor is important as your support couldn't rotate
in all directions.
|
void |
start()
Starts the robot.
|
void |
stop()
Stops the robot.
|
public RobotPOC(POCConfig config)
config
- the config to apply for this instance of the robot.public void start()
public void pause()
public void stop()
public void rotateCameraSupportHorizontally(double angle)
angle
- the new angle to apply.public void rotateCameraSupportVertically(double angle)
angle
- the new angle to apply.public void newCameraSupportPosition(int x, int y)
x
- the new x position received.y
- the new y position received.public static void main(java.lang.String[] args)
args
- unused here.