Exercises

  1. VSCode

    • Using VSCode

      1. Left panel

      2. Build and deploy

      3. Syntax debugging

      4. Changing team number

    • Explain the various files plus basic Java

    • Digital input.

    • Connect a limit switch.

    • shuffle board.

  2. Sharp IR sensor. Connect and display distance.

public double getIRDistance();

  1. Cobra sensor. Connect and display distance. // Can skip??

public int getCobraRawValue(final int channel);

  1. 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);

  1. Create a new subsystem.

  • Why need a new subsystem?

  • Arm

  • Movement control

  • Create a new subsystem.

  1. 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)

  2. Use remote controller to control the 3 DC motors.

  • Refer to Studica website example.

  • One joystick for one motors

  1. Encoder (display encoders (count and distance)

  2. Convert control to open loop control of Robot Speed?

    • public void setRobotSpeedXYW_Open(double x, double y, double z);


  1. See difference between open and close loop

  2. IMU

  3. Command based programing

  4. Move 2m or stop 20 cm before wall (sharp sensor)

    • MoveRobotSense

  5. How does MoveRobotSense works?

  6. How to use AutoMainCmd()?

  7. Move to line and stop (line sensor) //KIV

  8. Write a command MoveServo(double pos, double maxSpeed) to control speed profile of servo motor.

    • Can modify from MoveRobot

  9. Move a distance. Use IR sensor to decide move left or right.

  10. Simulate a simple loop

    • From home position, move forward 0.5m. This shall be point A.

      1. If switch is pressed, return to home and end.

      2. If front is blocked (IR sensor), turn right and move forward 0.5m. Return to point A.

      3. If front is not blocked, move forward 0.5m. Return to point A.

      4. Repeat 1-4

  11. 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)

  1. Path Planning - Astar

  2. Trajectory generation - Generate a trajectory given the path

  3. Path following - Control the robot to follow the path

  4. Vision - recognise objects in pickup bin, work order board, target area and trolley