Group project for the Fondamenti di Robotica (Fundamentals of Robotics) course of the MSc in Intelligent Systems Engineering at Università Campus Bio-Medico di Roma (2025).
The TIAGo robot, simulated in Gazebo with ROS 2 Humble, scans a table with its head camera, localises the objects and their destinations through ArUco markers, and moves two objects from their pick positions to their place positions. The arm motion is generated in two ways:
- Task 2: task-space interpolation and inverse kinematics;
- Task 3: dynamic movement primitives (DMPs) learned from demonstrations recorded on the real robot and adapted to the target poses.
Team: Gianluca Barnaba, Federico Bini, Beatrice Bussone, Federico Principi, Luca Scorza. The work was not split by task: all members contributed to every part.
The slides of the final presentation (in Italian) are in docs/presentation.pdf.
action_serverandaction_clientmove the head from left to right through the customMoveHeadaction, which publishes the current angle as feedback and can be cancelled.aruco_handlerreads the RGB camera stream and calibration, detects the ArUco markers with OpenCV (DICT_6X6_250, 6 cm markers) and estimates their poses in the camera optical frame. It transforms each pose intobase_footprintwith TF2 and publishes it on/aruco_pose_<id>. It also rebroadcasts the last pose of each marker as the TF framearuco_marker_<id>, so the targets remain available after the scan.grasp_publisherapplies position and orientation offsets to the marker frames and publishes the grasp poses of the two objects (/grasp_pose_1,/grasp_pose_2) and their place poses (/grasp_pose_3,/grasp_pose_4), also as TF frames for RViz.
-
state_machinewaits for a message on/start_sm, then sends the pick-and-place sequence to the planner asPlanAndExecutegoals, one at a time: open the gripper, move above the object, descend, close the gripper, lift, move above the destination, descend, open the gripper, and back to the home configuration before the second object. -
planner_ikloads the TIAGo URDF with the Robotics Toolbox for Python and executes each task:move: interpolates between the current end-effector pose and a pose 15 cm above the target, then solves the inverse kinematics of the torso and the 7 arm joints (Newton–Raphson) for each waypoint;lift/place: vertical motion of ±15 cm;open_gripper/close_gripperandback_to_home: planned directly in joint space.
The joint trajectories are sent to the torso, arm and gripper controllers through
FollowJointTrajectoryactions.
The course provided a dataset of joint-space trajectories recorded on a real TIAGo, with pick and place motions between several positions on a table. The dataset is not included in this repository.
planner_DMPreplaces the planner of task 2 for themovetask. For each target marker it selects one recorded demonstration, computes the end-effector trajectory with forward kinematics and fits a Cartesian DMP (movement_primitives). It then sets the current end-effector pose as the start and the pose above the marker as the goal, samples the generated trajectory and converts it to joint space with inverse kinematics.state_DMPruns the same sequence as task 2 and also passes the marker id to the planner.LbD.pyis an offline script that fits a DMP to a single demonstration and plots the original and the generalised trajectories.
.
├── docs/
│ └── presentation.pdf # final presentation (Italian)
├── my_bring_up/launch/
│ ├── action_app.launch.py # tasks 1-2: scan, start configuration, trigger on /start_sm
│ └── task_3.launch.py # task 3: scan and start configuration
├── personal_interfaces/ # MoveHead.action, PlanAndExecute.action, Attach.srv
├── task_1/task_1/ # head scan, ArUco localisation, grasp and place poses
├── task_2/task_2/ # state machine and IK planner, TIAGo URDF
└── task_3/task_3/ # DMP planner, state machine, offline LbD script, TIAGo URDF
- Ubuntu 22.04 with ROS 2 Humble.
- The TIAGo simulation from pal-robotics/tiago_simulation (branch
humble-devel) in a workspace such as~/tiago_public_ws. - The course scene: a Gazebo world with a table, ArUco markers and the two objects, plus a modified
tiago_gazebo.launch.py. Both were provided by the course and are not included here. - Python packages:
roboticstoolbox-python,spatialmath-python,movement_primitives,pytransform3d,scipy,matplotlib, and OpenCV with the ArUco module. The code uses the ArUco API of OpenCV before 4.7, as shipped with Ubuntu 22.04.
cd ~/tiago_public_ws/src
git clone https://github.com/Lebroms/Tiago_programming.git
cd ~/tiago_public_ws
colcon build --packages-select personal_interfaces task_1 task_2 task_3 my_bring_up
source install/setup.bashStart the simulation with the course scene:
ros2 launch tiago_gazebo tiago_gazebo.launch.py is_public_sim:=TrueTasks 1 and 2, each command in its own terminal. Start the planner and the state machine first: the launch file publishes the start trigger once, when the arm reaches the start configuration.
ros2 run task_2 planner_ik
ros2 run task_2 state_machine
ros2 launch my_bring_up action_app.launch.pyTask 3: the launch file does not publish the trigger, so it is sent by hand once the arm has stopped.
ros2 run task_3 planner_DMP --ros-args -p dataset_dir:=/path/to/tiago_traiettorie_SG
ros2 run task_3 state_DMP
ros2 launch my_bring_up task_3.launch.py
ros2 topic pub --once /start_sm std_msgs/msg/Empty "{}"- The system was tested only in simulation. Offsets, joint configurations and the demonstration used for each marker are tuned for the course scene.
- In task 2, the interpolation in task space uses only a few waypoints, and obstacles are avoided through the order of the operations in the state machine rather than by the planner.
- Code comments and log messages are in Italian.