Skip to content

About

MATLAB robotics labs and homework for Georgia Tech ME 4451: robot kinematics, Dynamixel servo control, CNN digit classification, and ROS-based TurtleBot3 navigation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

ME 4451 Robotics — Labs and Homework

MATLAB coursework for Georgia Tech ME 4451 Robotics, Spring 2026. This collection covers serial and parallel robot kinematics, Dynamixel servo control, convolutional neural networks, and TurtleBot3 navigation using ROS, odometry, LiDAR, IMU, and Marvelmind indoor positioning.

The folders preserve course starter code, student implementations, experiments, reference PDFs, and selected homework figures and reports. They are independent lab workspaces rather than one integrated application. Some supplied mobile robotics handouts are dated Spring 2024; the Lab 2, Lab 3, and Lab 5 handouts are dated Spring 2026.

GitHub repository description

MATLAB robotics labs and homework for Georgia Tech ME 4451: robot kinematics, Dynamixel servo control, CNN digit classification, and ROS-based TurtleBot3 navigation.

Repository guide

Folder Main topic Starting point
4451_Lab1_matlab_updated/ Servo communication, joint commands, and repeatability interface.m, task8.m
4451_Lab2_matlab/ Serial RRR kinematics and Cartesian path drawing RRR_draw_shape.m
Lab 3/ Parallel 3RRR inverse kinematics and motion 4451_Lab3_matlab/RRR3_draw_shape.m
Lab 5/ CNN handwritten digit classification Lab5_Student_Code/SHELL_Lab_51_Rev1.m
Lab 6/ TurtleBot3 and ROS fundamentals Sections of lab6_skeleton.m
Lab 7/ Straight motion and obstacle avoidance Sections of lab7_skeleton.m
Lab 8/ Smooth navigation with indoor positioning and heading feedback smoothNagivationTest.m, sections of lab8_skeleton.m
HW1/ RobotSketch poses and joint interpolation RobotSketch2016/demo_robot_serial_movie_HW01.m
HW2/ Forward/inverse kinematics and Cartesian interpolation RobotSketch2016/demo_robot_serial_movie_HW02.m

Lab 4 is not included. A Lab 1 handout is also absent from this folder; its description below is based on the code and references to Lab 1 in later handouts.

Labs

Lab 1 — Dynamixel servo control and repeatability

Introduces communication with the physical RRR serial robot and control of its individual revolute joints. The code opens a serial connection, sets servo positions and velocities, reads joint positions, enables or disables torque, and operates the pen gripper.

  • interface.m contains individual servo communication and motion experiments.
  • RRR_go_angles.m is intended to constrain and command three joint angles.
  • task8.m commands several configurations and repeatedly returns to a starting configuration, supporting accuracy and repeatability measurements using a star-like motion sequence.
  • dxl_*.m provides the serial packet, byte conversion, error checking, servo, and gripper functions reused in Labs 2 and 3.
  • updates.txt records changes to the supplied communication utilities.

Reference: No Lab 1 PDF is included. Lab 2, Section 5 refers back to joint-angle control, and Lab 3, Section 8 describes reusing the Lab 1 repeatability exercise.

Lab 2 — Serial RRR kinematics and path drawing

Uses forward and inverse displacement analysis to command the pen's Cartesian position and orientation, rather than specifying joint angles directly. The lab accounts for the pen's lateral offset from the last link and explores both elbow configurations. Its main task is to draw a straight line; circular motion is a bonus task.

  • data_RRR.m defines the robot's Denavit–Hartenberg parameters.
  • RRR_FDA.m and RRR_RDA.m calculate forward and inverse kinematics.
  • RRR_forward.m and RRR_reverse.m account for the pen offset when converting between joint configurations and pen poses.
  • RRR_go_configuration.m converts a desired pose into servo commands through RRR_go_angles.m.
  • path_line.m and path_circle.m generate sampled Cartesian paths.
  • RRR_draw_shape.m commands the path, records joint angles, reconstructs measured pen positions, and plots the desired and measured motion. The saved configuration selects a straight line.
  • TriggerFcn.m provides the timer flag used to sequence path points.

Reference: Lab 2 handout — RRR Serial Robot Servo Control, especially Sections 4–5 for the pen offset, inverse kinematics, line drawing, and circular motion.

Lab 3 — Parallel 3RRR inverse kinematics

Extends the serial-robot inverse kinematics to a planar parallel mechanism with three RRR chains. Each chain is treated as a virtual serial robot with its own base location and orientation offset. The handout asks students to command platform poses, measure accuracy and repeatability, draw a line, and rotate the platform in place.

  • 4451_Lab3_matlab/data_RRR3.m defines link lengths, base locations, and the platform and servo offsets.
  • 4451_Lab3_sample_code/RRR3_reverse.m applies inverse kinematics to all three virtual chains and collects their actuated joint angles.
  • 4451_Lab3_sample_code/RRR_RDA.m supplies the underlying serial-chain calculation.
  • 4451_Lab3_matlab/RRR3_go_configuration.m applies the servo coordinate offsets, wraps angles, and sends the commands through RRR_go_angles.m in the sample-code folder.
  • 4451_Lab3_matlab/RRR3_draw_shape.m, path_line.m, and TriggerFcn.m provide timed path execution and joint-angle recording.

Both code subfolders are needed on the MATLAB path. Calibration fields and joint bounds still require attention; see the current-code notes below.

Reference: Lab 3 handout — 3RRR Inverse Kinematics, Sections 6–9 for coordinate offsets, servo commands, accuracy tests, and path motion.

Lab 5 — Convolutional neural networks

Builds and trains CNNs to classify 28 × 28 grayscale handwritten digits. The sequence introduces a basic classifier, compares a baseline network with a single-parameter modification, and offers an open-ended network design exercise.

  • SHELL_Lab_51_Rev1.m loads MATLAB's bundled DigitDataset, makes an 80/20 training/test split, trains a basic convolution/ReLU classifier, and evaluates test accuracy.
  • buildStage2Layers.m builds a two-stage convolution/ReLU/max-pooling network with optional dropout and a ten-class output.
  • SHELL_Lab_52_Rev1.m runs the BASE-versus-MOD comparison to investigate how a selected parameter affects accuracy and training behavior.
  • SHELL_Lab_53_Rev1.m contains a custom CNN experiment within limits on epochs and batch size.
  • Lab5_showPlots.m displays a sample prediction, class probabilities, first-layer activation maps, and learned filters.

All five files are in Lab5_Student_Code/. The handout discusses MNIST, while the actual scripts load the example DigitDataset installed with MATLAB. The bonus accuracy target is an assignment objective, not a verified result for this repository.

References: Lab 5 handout — An Overview of Neural Networks, Sections 5.1–5.3; Convolutional Neural Networks reference PDF. Block 5 Notes.docx is also included.

Lab 6 — TurtleBot3, ROS, and basic motion control

Introduces the TurtleBot3 Burger, ROS publishers and subscribers, velocity commands, odometry, and LiDAR. The handout asks students to improve distance control with odometry feedback and follow a square with 3 ft sides in both directions, recording position and heading around the route.

  • lab6_skeleton.m contains sections for connecting to ROS, inspecting messages, commanding motion, and collecting sensor data.
  • turtlebotSendSpeed.m publishes forward and angular velocity; turtlebotStop.m sends repeated zero-velocity commands.
  • getTurtlebotOdometry.m extracts position and quaternion-derived heading, with a supplied heading offset.
  • turtlebotGoDistance.m includes odometry-based distance checking; turtlebotTurnAngle.m uses heading feedback for relative turns.
  • calibratePrecession.m estimates heading drift from successive odometry readings.
  • square_path.jpg is an included path image.

References: Lab 6 handout, Sections 3–6; TurtleBot startup instructions; bundled TurtleBot3 documentation.

Lab 7 — Straight-line control and obstacle avoidance

Builds on Lab 6 by holding a heading during a 10 ft straight run and using LiDAR to detect and travel around an obstacle. The handout then asks for navigation across the room, with optional final-heading control and obstacle avoidance during navigation.

  • lab7_skeleton.m organizes ROS connection, sensor exploration, and motion experiments.
  • straightLineMotion.m, straightLineMotion_v2.m, and straightLineMotion_v3.m preserve alternative straight-motion implementations.
  • evadeObstacle.m uses scan data and incremental movement to pass an obstacle and return toward the original path.
  • resetOdometry.m publishes an odometry reset request.
  • Local copies of the odometry, distance, turn, speed, and stop helpers support these experiments.

The handout's complete room-navigation task describes the assignment scope; the presence of these component functions does not establish that every task or bonus was completed.

Reference: Lab 7 handout, Sections 3–5 for straight-line motion, obstacle avoidance, and room navigation.

Lab 8 — Smooth navigation with indoor positioning

Combines position and heading feedback to drive toward a goal pose while commanding linear and angular velocity together. The handout calls the positioning system “GPS,” but it is Marvelmind ultrasonic indoor positioning. The code explores GPS with odometry or IMU heading feedback, along with an odometry-only waypoint variant.

  • lab8_skeleton.m contains ROS setup, sensor inspection, and navigation experiment sections.
  • GPSNav.m implements a smooth goal-pose navigation experiment using positioning and odometry feedback.
  • smoothGPSNavigation.m uses indoor position and IMU heading, previews a simulated trajectory, and logs the measured motion and controller signals.
  • smoothGPSNavigation2.m and Copy_of_smoothGPSNavigation.m preserve alternative controller versions.
  • smoothNagivationTest.m simulates a goal-pose controller without robot communication. The filename's spelling is preserved.
  • smoothOdomWaypointNavigation.m follows multiple goal poses using odometry and logs the active waypoint and controller history.
  • straightLineMotion.m records and plots indoor-position and odometry trajectories while inspecting LiDAR.
  • IMU_testing.m, getTurtlebotIMUYaw.m, zeroTurtlebotIMU.m, turtlebotTurnAngleIMU.m, turtlebotGoStraightIMU.m, and wrapTo180Deg.m support IMU heading experiments.
  • marvelmind_nav/msg/ contains ROS message definitions. matlab_msg_gen_ros1.zip, install/, and VersionInfo.mat support custom-message registration; install/ includes generated MATLAB, Python, and C/C++ message interfaces and setup files.

The handout discusses a 2 cm position target and a 5° orientation target, with final orientation also presented as extra credit. Controller variants use different tolerances; these targets should not be read as measured performance claims.

References: Lab 8 handout, Sections 3–4 for message registration and navigation; additional MATLAB-version instructions; Lecture 25 notes supplied alongside the controller code.

Homework and simulation support

HW1 — Robot visualization and joint interpolation

Uses RobotSketch to draw three RRR configurations and animate transitions between them by interpolating joint angles. The exercise illustrates how different joint configurations can produce the same end-effector pose and how a joint-space path affects the tool trajectory.

In HW1/RobotSketch2016/, start with demo_robot_serial_HW01.m and demo_robot_serial_movie_HW01.m. data_RRR_lab_HW01.m supplies robot data; data_path12_movie.m and data_path23_movie.m generate the transitions. The folder also contains pose/path PNGs, a report, and general RobotSketch demos and drawing utilities.

References: Homework 1 assignment; included HW1 report.

HW2 — Forward/inverse displacement analysis and Cartesian paths

Implements forward kinematics to recover the end-effector pose and inverse kinematics to recover joint angles. Unlike HW1's joint interpolation, the straight path is sampled in Cartesian space and converted into joint configurations. A second animation moves the tool around a circle while pointing toward its center.

In HW2/RobotSketch2016/, RRR_FDA.m and RRR_RDA.m provide the kinematics. data_path12_movie_HW02.m and data_circle_movie_HW02.m generate the paths used by demo_robot_serial_movie_HW02.m; test.m visually compares the forward-kinematics result with the robot drawing. Figures and a report are included in HW2/.

References: Homework 2 assignment; included HW2 report.

The two RobotSketch2016/ folders contain supporting DH transforms, rotation/translation matrices, link and frame drawing functions, geometry patches, robot parameter files, and generic serial/parallel demos. These are bundled course utilities, not additional labs.

Setup and use

  1. Open the specific lab or homework directory in MATLAB. Keep only the relevant directories on the MATLAB path: many labs reuse function names with different implementations.
  2. For HW1 and HW2, use the corresponding RobotSketch2016/ directory and inspect the selected robot/movie data file in the demo before running it.
  3. For Labs 1–3, use the physical robot and USB2Dynamixel connection expected by the course. Set the correct COM port, servo IDs, calibration offsets, and joint limits. The helpers use the legacy serial, fopen, fread, and fwrite interface, so MATLAB release compatibility matters.
  4. For Lab 5, install Deep Learning Toolbox and confirm the bundled DigitDataset exists at the path constructed by the scripts. Keep the training scripts and plotting/layer helpers together.
  5. For Labs 6–8, use ROS Toolbox and the course's ROS 1 TurtleBot3 setup. Set the robot IP and actual topic names. Typical topics in this code are /cmd_vel, /odom, /scan, /imu, and /reset; available topics depend on the robot configuration.
  6. For Lab 8, follow the included custom-message registration PDFs. The original handout specifies MATLAB R2022b, Python 3.9, and Visual Studio Community 2022. The additional instructions explain regeneration with rosgenmsg for other MATLAB versions. The checked-in generated installation contains machine-specific paths and should not be assumed portable.

Run the mobile-robot skeleton files section by section. They deliberately print a warning and return when run as whole scripts. Inspect the chosen section before executing it because motion sections send commands to physical hardware.

For an offline navigation preview, open Lab 8/ in MATLAB and run:

history = smoothNagivationTest([0, 0, 0], [1, 1, 90]);

This invokes the simulation function and does not connect to ROS. Positions are in meters and input headings are in degrees. Serial-robot lab poses generally use centimeters and degrees at their command interfaces, with radians inside the kinematics. Some mobile scripts accept feet and convert internally; check each signature and coordinate convention before reusing it.

Current-code notes

This is a coursework archive containing completed portions alongside starter files and experimental variants. Source inspection identifies several setup or implementation gaps:

  • Lab 1's RRR_go_angles.m has empty joint-limit arrays. It also opens and closes the serial connection internally, while task8.m manages a connection around its calls.
  • Lab 3's data_RRR3.m references undefined delta1–delta3 and beta1–beta3. Its sample RRR_go_angles.m stores bounds as [90, -90], inconsistent with its minimum/maximum clipping expression. These need correction and calibration before use.
  • Lab 6's turtlebotGoDistance.m and calibratePrecession.m reference theta_offset without defining it locally or accepting it as an argument. The skeleton also retains IP/topic placeholders.
  • Lab 5.1's saved network omits the global-average-pooling layer listed in the handout's required architecture chain.
  • Lab 8's smoothGPSNavigation2.m sets its preview integration interval to zero. It and smoothOdomWaypointNavigation.m use 0.20 m / 15° tolerances, while smoothGPSNavigation.m uses 0.02 m / 5°.
  • Duplicate functions, alternate controllers, .asv autosaves, generated message files, and local configuration values are preserved. Select a specific implementation rather than adding the entire repository recursively to the MATLAB path.

The documentation was checked against the available source and handouts. MATLAB training, simulations, and physical robot tasks were not executed as part of this documentation update.

Course materials and attribution

Course handouts, RobotSketch, Dynamixel helpers, and generated ROS support retain their original authorship and embedded notices. Student work and supplied support code coexist in this archive. No repository-wide license is supplied here.

About

MATLAB robotics labs and homework for Georgia Tech ME 4451: robot kinematics, Dynamixel servo control, CNN digit classification, and ROS-based TurtleBot3 navigation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages