Skip to content

Palletizing exercise: add SKU-based UR10 palletizing exercise - #791

Open
Ashwani1330 wants to merge 18 commits into
humble-develfrom
palletizing-exercise
Open

Palletizing exercise: add SKU-based UR10 palletizing exercise#791
Ashwani1330 wants to merge 18 commits into
humble-develfrom
palletizing-exercise

Conversation

@Ashwani1330

Copy link
Copy Markdown
Collaborator

Summary

This PR adds the RoboticsInfrastructure side of a new SKU-based Palletizing exercise for RoboticsAcademy.

The exercise uses:

  • Gazebo Harmonic
  • ROS 2 Humble
  • a UR10 arm with a simulated suction gripper
  • MoveIt with OMPL and Pilz motion planning
  • a moving conveyor with dynamically generated SKU boxes
  • an online feeder lifecycle
  • browser tools for Gazebo, RViz, and the console

Runtime architecture

Runtime ownership is intentionally separated:

Palletizing scene launcher
→ Gazebo, conveyor bridge, feeder, and /clock

UR10 suction launcher
→ robot, controllers, MoveIt, action servers, and planning scene

RAM tool orchestration
→ Gazebo GUI, RViz, and console browser tools

Main changes

Palletizing workcell

  • Add the Gazebo Harmonic palletizing scene.
  • Add conveyor and pallet models.
  • Add the palletizing scene launcher.
  • Add the browser RViz launcher.
  • Add database mappings for:
    • world 81
    • scene 77
    • robot 34
    • world-robot row 58

SKU feeder

  • Add configurable SMALL, MEDIUM, and LONG box SKUs.
  • Add an 18-box mixed sequence.
  • Dynamically generate box SDF files from task metadata.
  • Track the active box through Gazebo Transport.
  • Stop the conveyor using the observed pickup pose rather than only timing.
  • Publish:
    • /box_ready
    • /box_info
    • /pallet_info
  • Consume /box_done to advance the feeder.

UR10 suction robot

  • Add the UR10 suction URDF/xacro.
  • Add isolated controllers, joint limits, kinematics, SRDF, OMPL, and MoveIt controller configuration.
  • Add Move/RobMove/RobPose action servers for group ur10_arm.
  • Keep the robot launcher headless; browser RViz is owned by RAM tool orchestration.
  • Generate one ros2_control system.

Suction attachment

  • Extend gz_link_attacher with configurable:
    • robot model name
    • gripper link name
    • contact topic
  • Preserve existing Pick and Place defaults when these parameters are absent.
  • Resolve dynamically generated box model names from contact collision data.

Planning-scene reliability

Static conveyor and pallet collision objects are applied using MoveIt's acknowledged /apply_planning_scene service.

The scene node:

  1. waits for MoveIt;
  2. applies conveyor and pallet;
  3. requires response.success;
  4. exits normally after confirmation;
  5. fails with a bounded timeout if MoveIt is unavailable.

Clock ownership

The Palletizing scene launcher is the single owner of the Gazebo-to-ROS /clock bridge.

Database integration note

This PR updates database/worlds.sql on the feature branch.

The official RoboticsAcademy application image uses Infrastructure humble-devel, while the official database image currently uses the separate RoboticsInfrastructure database branch.

Before release, the Palletizing world/scene/robot rows must also be synchronized into the database branch:

world 81
scene 77
robot 34
world-robot row 58

Please advise on the preferred database-branch update workflow.

Validation performed

Build and configuration

  • custom_robots builds successfully with colcon.
  • Palletizing Python/launch files parse successfully.
  • The expanded UR10 suction xacro contains exactly one <ros2_control> element.
  • Direct Python runtime dependencies are declared:
    • rclpy
    • moveit_msgs
    • shape_msgs

Native runtime

  • Gazebo Harmonic world starts.
  • UR10 spawns.
  • Joint state broadcaster becomes active.
  • Joint trajectory controller becomes active.
  • Move/RobMove action servers become available.
  • Feeder publishes box and pallet metadata.
  • Suction attach/lift lifecycle works.

MoveIt planning scene

  • /apply_planning_scene reports success.
  • /get_planning_scene contains:
    • conveyor
    • pallet
  • Scene node exits cleanly after successful application.
  • Missing MoveIt service produces a bounded 30-second fatal error.

RoboticsAcademy browser integration

Using matching custom Academy/Infrastructure/database images:

  • RAM 5.6.13 launches the gz scene.
  • RAM launches the gz robot.
  • Gazebo renders in the browser.
  • RViz renders in the browser.
  • Console tool starts.
  • Browser reaches world_ready.
  • Browser reaches tools_ready.
  • One complete Palletizing box pick, lift, feeder acknowledgment, and pallet placement cycle succeeds.
  • Existing Pick and Place default UR5/Robotiq attachment and lift path remains operational after the shared gz_link_attacher changes.

Follow-up work

  • Feeder recovery logic is not yet implemented for box-spawn failures or boxes that fail to reach the pickup point.
  • The MoveIt planning scene currently models the static conveyor and pallet; dynamic, carried, and placed boxes are not modeled yet.
  • Reset and entity-cleanup behavior across repeated exercise runs needs additional validation and hardening.

Media

palletizing

- Exercise templates (Python + C++ HAL, WebGUI) copied from pick_place
- DB: exercise 27 with tools (console, simulator, rviz) linked to universe 71
…xercise

- New CustomRobots/palletizing/ subsystem with TrackController belt model,
  palletizing_box model, box_spawner.py node, and ros_gz_bridge YAML config
- Remove static conveyor and hardcoded brown boxes from world file; include
  conveyor_belt model via model:// URI
- Wire conveyor speed bridge and box spawner into palletizing.launch.py
  (delayed 5s after gz sim starts)
- Box lifecycle: spawn at belt feed end → ride to centre → belt stops →
  teleport to pallet table → restart cycle
…onfig

- Add ur5_suction.urdf.xacro, ur5_suction.srdf, ur5_suction_controllers.yaml,
  and moveit_controllers_suction.yaml for the suction gripper variant of UR5
- Add ur5_suction.launch.py that loads the suction URDF, starts MoveIt with
  the suction SRDF, and spawns the robot in Gazebo
- Add palletizing_harmonic.launch.py (Launchers/rviz) so RViz loads the
  suction URDF instead of the Robotiq finger gripper
- Register robot 25 (Ur5 Suction) in the DB and point universe 71 to it
- Wire gz_link_attacher in the palletizing world with robot_model_name and
  gripper_link_name params for the suction cup contact attach
- Parameterize MOVE_GROUP in move/robmove/robpose (default "ur5_manipulator",
  P&P unaffected); add MOVE_GROUP=ur10_arm to UR10 launcher
- Rename ur5_suction.* → ur10_suction.*, move URDF to models/ur10/
- Update SRDF group → ur10_arm, ur_type/ROB_PARAM → ur10, gz entity/world name
- Fix visual_parameters.yaml: phantom pkg ur5_gripper_description → ros2srrc_robots
- /clock bridge: use bidirectional @gz.msgs.Clock (the [ ] form fails on ros_gzharmonic, starving move_group of sim time)
- add ur10_arm OMPL planner config + time-parameterization adapters (fixes wild paths and rejected execution)
- isolate UR10 MoveIt config (kinematics/ompl/controllers) into custom_robots so Pick & Place is untouched
…llision scene

Address motion-quality review feedback on the UR10 suction arm:

- Constrain wrist freedom: narrow wrist_3 to +-120 deg (kills the box
  "swirl" about the suction-cup axis); keep wrist_1/2 at +-180 for the
  far-row descent reach. (joints 4/5/6)
- Make pick->place deterministic: asymmetric shoulder_pan [-150, +30] and
  elbow [0, 180] force a single consistent (clockwise) swing instead of the
  planner choosing either direction run to run.
- Add a planning-scene publisher (palletizing_scene.py) that injects the
  conveyor and pallet as collision objects so MoveIt routes around them
  natively, instead of hand-tuned via-waypoints in the exercise code.
- Model the target as a wooden pallet on a low stand (world file) for a more
  realistic workcell than a plain table.

Also folds in a config/comment tidy-up:
- Consolidate UR10-suction MoveIt configs under config/ur10_suction/
  (drop redundant ur10_suction_ prefix), matching the ur10/ layout.
- Point palletizing_harmonic.launch.py at the dedicated ur10_suction rviz;
  drop the unused ur5_gripper_moveit_config dependency.
Sync 279 upstream commits (Worlds→Scenes rename, DB restructure, UR3, etc.)
into the palletizing exercise. Conflict resolutions:

- ros2srrc_execution move/robmove/robpose.cpp: adopt upstream's ROB_GROUP
  parameterization wholesale (we had independently added an equivalent
  MOVE_GROUP param; converging on upstream's name avoids future re-conflicts).
- ur10_suction.launch.py: pass ROB_GROUP=ur10_arm to the 3 execution nodes
  to match the adopted C++ param name.
- palletizing world relocated Worlds/ → Scenes/ (upstream dir rename);
  palletizing.launch.py world dir updated to /opt/jderobot/Scenes.
- database: universes.sql → worlds.sql under the new schema (universes→worlds,
  worlds→scenes; worlds.scene_id column). Upstream claimed our old IDs, so
  palletizing rows renumbered: world 71→73, scene 71→73, robot 25→31,
  cross-references updated accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant