用于 MoveIt2! 和 ROS 2 的代码包装器
:mechanical_arm: API for robotic manipulators based on ROS 2 and MoveIt2!
Docker for building required environment can be found here.
Pull and run docker container arm_api2_cont:
git clone [email protected]:CroboticSolutions/docker_files.git
cd ./docker_files/ros2/humble/arm_api2
./pull_and_run_docker.sh
_sim (start robot in simulation)Run move_group for that robot (see particular instructions for supported arms in How to use section). And after that run:
ros2 launch arm_api2 moveit2_simple_iface.launch.py robot_name:=Currently supported robot names are: ur, kinova, franka, piper.
For full instructions check section How to use arm_api2?
In order to build it easily, run following comands:
git clone [email protected]:CroboticSolutions/docker_files.git
cd ./docker_files/ros2/humble/arm_api2
docker build -t arm_api2_img:humble .
./run_docker.sh After running docker, you can enter container with:
docker exec -it arm_api2_cont bashDocker for building required environment can be found here.
For building ROS 2 packages and moveit, it is neccessary to use colcon.
Aditional dependencies are (depending on the arm you use):
Change robot state:
The robot state can be changed via a ROS2 service.
arm/change_state/arm_api2_msgs/srv/ChangeState.srvJOINT_TRAJ_CTL || CART_TRAJ_CTL || SERVO_CTLExample service call:
ros2 service call /arm/change_state arm_api2_msgs/srv/ChangeState "{state: JOINT_TRAJ_CTL}"Currently implemented and available robot states are:
JOINT_TRAJ_CTL, which is used for joint controlCART_TRAJ_CTL, which is used for cartesian controlSERVO_CTL, which is used for the end effector servoingSet max velocity and acceleration scaling factor:
Set velocity and acceleration scaling factors via service call:
arm/set_vel_acc/arm_api2_msgs/srv/SetVelAcc.srvmax_vel and max_acc (both float64)Example service call:
ros2 service call /arm/set_vel_acc arm_api2_msgs/srv/SetVelAcc "{max_vel: 0.5, max_acc: 0.5}"Set end effector link:
Set end effector link via service call:
arm/set_eelink/arm_api2_msgs/srv/SetStringParam.srvvalue (string)Example service call:
ros2 service call /arm/set_eelink arm_api2_msgs/srv/SetStringParam "{value: 'tcp'}"Set planonly mode:
Planonly mode is used to plan a trajectory without executing it. Set planonly mode via service call:
arm/set_planonly/std_srvs/srv/SetBool.srvvalue (bool)Example service call:
ros2 service call /arm/set_planonly std_srvs/srv/SetBool "{data: true}"Run minimal simple interface with:
ros2 launch arm_api2 moveit2_simple_iface.launch.py robot_name=Simple interface contains topics to command robot pose, path and
retrieve arm information.
Topic names are defined in the config/_sim file.
Command robot pose:
arm/cmd/posegeometry_msgs/msg/PoseStamped.msgros2 topic pub /arm/cmd/pose geometry_msgs/msg/PoseStamped Command cartesian path:
arm/cmd/trajarm_api2_msgs/msg/CartesianWaypoints.msgGet current end effector pose:
arm/current/posegeometry_msgs/msg/PoseStamped.msgros2 topic echo /arm/current/poseRun advanced interface with:
ros2 launch arm_api2 moveit2_iface.launch.py robot_name=Command robot pose:
A robot pose where the robot should move to can be commanded via ROS2 action.
arm/move_to_pose
**Command cartesian path**:
A catesian path can be commanded via ROS2 action.
- name: `arm/move_to_pose_path`
- action: `arm_api2_msgs/action/MoveCartesianPath.action`
**Command joint position**:
A robot joint position where the robot should move to can be commanded via ROS2 action.
- name: `arm/move_to_pose`
- msg: `arm_api2_msgs/action/MoveJoint.msg`
How to build package?
### Build
Build in ROS 2 workspace.
Build just one package with:
```bash
colcon build --packages-select arm_api2Build with the compile commands (enable autocomplete):
colcon build --symlink-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ONBuilding with --symlink-install causes it to fail often because of already built ROS 2 packages, you can run:
colcon build --symlink-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --continue-on-errorFull verbose build command:
colcon build --symlink-install --packages-select moveit2_tutorials --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_VERBOSE_MAKEFILE=ONCopy to ~/.bashrc and source it.
alias cbp="colcon build --symlink-install --packages-select"
alias panda_sim="ros2 launch panda gz.launch.py"
alias kinova_sim="ros2 launch kortex_bringup kortex_sim_control.launch.py dof:=7 use_sim_time:=true launch_rviz:=false"
alias ur_sim="ros2 launch ur_simulation_gz ur_sim_control.launch.py ur_type:=\"ur10\""Build arm_api2 package as:
cbp arm_api2Start franka sim with:
franka_simStart kinova sim with:
kinova_simStart ur sim with:
ur_simStart iface by changing robot_name argument to kinova, ur, franka, piper. Depending which arm you want to use, when running:
ros2 launch arm_api2 moveit2_iface.launch.py robot_name:=Start kinova with:
tmuxinator start kinova_api2after calling
./copy_tmuxinator_config.sh kinova_api2.ymllocated in utils/tmux_configs. Navigate between
panes with Ctrl+B+(arrows).
How to use Kinova?
First clone and build kinova repository in your workspace with:
cd /src
git clone https://github.com/CroboticSolutions/ros2_kortex
cd
colcon build --packages-select ros2_kortex
source /install/setup.bashYou can run kinova in simulation by executing following commands:
ros2 launch kortex_bringup kortex_sim_control.launch.py dof:=7 use_sim_time:=true launch_rviz:=falseor
kinova_simif alias has been added.
After that run move_group node as follows:
ros2 launch kinova_gen3_7dof_robotiq_2f_85_moveit_config sim.launch.pyAfter that run arm_api2 moveit2_iface node as follows:
ros2 launch arm_api2 moveit2_iface.launch.py robot_name:="kinova"How to setup real kinova here.
How to use UR?
You can run UR in simulation by executing following commands:
ros2 launch ur_simulation_gz ur_sim_control.launch.py ur_type:="ur10"or
ur_simif alias has been added.
After that run move_group node as follows:
ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:="ur10" use_sim_time:=trueAfter that run arm_api2 moveit2_iface node as follows:
ros2 launch arm_api2 moveit2_iface.launch.py robot_name:="ur"First run:
sudo apt-get install ros-humble-ur
…
publish_robot_description_semantic = {"publish_robot_description_semantic": True}
publish_robot_description = {"publish_robot_description": True}
publish_robot_description_kinematics = {"publish_robot_description_kinematics": True}
…
INVALID = -1,
NO_WARNING = 0,
DECELERATE_FOR_APPROACHING_SINGULARITY = 1,
HALT_FOR_SINGULARITY = 2,
DECELERATE_FOR_COLLISION = 3,
HALT_FOR_COLLISION = 4,
JOINT_BOUND = 5,
DECELERATE_FOR_LEAVING_SINGULARITY = 6timeline
6/2025 : Merge latest developments
6/2025 : Decouple joy for different joys
6/2025 : Test with cumotion
9/2025 : Integrated with GUI
10/2025 : Tested on 5 manipulatorsIf you want to contribute, please check Status section and check CONTRIBUTE.
暂无开放 Issues,或尚未同步最近议题。