ROS2 package of h12 robot description.
- Robot description files (URDFs, SRDFs) and meshes are sourced from the parent
HAMSrepo's top-levelassets/directory. They are pulled in at build time bysetup.pyand installed under the package'sshare/tree, so consumers can keep usingpackage://h12_ros2_model/assets/h1_2/...URLs and the runtime layout is unchanged. - The default robot is the H1-2 with Magpie eflesh grippers
(
assets/h1_2/h1_2_magpie_ros.urdf, sourced fromassets/ros_assets/h1_2_magpie_ros.urdf). Ahandlessvariant is also available — selectable via themodel:=handlesslaunch argument.
Not standalone-buildable. This package must live at
<HAMS>/core_ws/src/h12_ros2_modelso thatsetup.pycan resolve../../../assets/. A bare clone outside that workspace will fail at build time with a clear error.
-
This package depends on
robot_description_publisher,joint_state_publisherandjoint_state_publisher_gui -
Taking ros2 humble as an example, you can install these dependencies by:
sudo apt install ros-humble-robot-state-publisher sudo apt install ros-humble-joint-state-publisher sudo apt install ros-humble-joint-state-publisher-gui
-
Building this package in your workscape and all the assets will be available at run time.
from ament_index_python.packages import get_package_share_directory package_path = get_package_share_directory('h12_ros2_model') print(f'Asset file: {package_path}/assets/{asset_file}')
-
Running
ros2 launch h12_ros2_model robot_description_launch.pywill start therobot_state_publishernode, thejoint_state_publisher_guinode andrvizto visualize the robot. -
In
rviz, you can view the robot by adding aRobotModelvisualization and subscribe torobot_descriptiontopic. -
On actual robot, you may want to implement your own joint state publisher to track the real joint positions.