Exercises
VSCode
Using VSCode
Left panel
Build and deploy
Syntax debugging
Changing team number
Explain the various files plus basic Java
Digital input.
Connect a limit switch.
shuffle board.
Sharp IR sensor. Connect and display distance.
public double getIRDistance();
Cobra sensor. Connect and display distance. // Can skip??
public int getCobraRawValue(final int channel);
Remote controller. Connect and control 1 servo motor.
Display servo position on shuffle board.
Use one of the joystick to control the servo motor
public void setServoAngle(final double degrees);
Create a new subsystem.
Why need a new subsystem?
Arm
Movement control
Create a new subsystem.
Using version control in VSCode
Stage (Git add)
Commit (Git commit);
What's a repository, commit, branch?
.git; .gitignore directories
Push (Git push)
Pull (Git pull)
Use remote controller to control the 3 DC motors.
Refer to Studica website example.
One joystick for one motors
Encoder (display encoders (count and distance)
Convert control to open loop control of Robot Speed?
public void setRobotSpeedXYW_Open(double x, double y, double z);
See difference between open and close loop
IMU
Command based programing
AutoMainCmd(), MoveRobot()
Move 2m or stop 20 cm before wall (sharp sensor)
MoveRobotSense
How does MoveRobotSense works?
How to use AutoMainCmd()?
Move to line and stop (line sensor) //KIV
Write a command MoveServo(double pos, double maxSpeed) to control speed profile of servo motor.
Can modify from MoveRobot
Move a distance. Use IR sensor to decide move left or right.
Simulate a simple loop
From home position, move forward 0.5m. This shall be point A.
If switch is pressed, return to home and end.
If front is blocked (IR sensor), turn right and move forward 0.5m. Return to point A.
If front is not blocked, move forward 0.5m. Return to point A.
Repeat 1-4
Write a command MoveArm() to move the end effector of a 2DOF arm in a straight line.
you will need two servo motor for this
Write a function GotoPosXY(double x, double y) in Arm subsystem to move arm tip to (x, y) position first
The MoveArm() command will make use of GotoPosXY();
Future (Oct 2022)
Path Planning - Astar
Trajectory generation - Generate a trajectory given the path
Path following - Control the robot to follow the path
Vision - recognise objects in pickup bin, work order board, target area and trolley