Repository Summary
Description | Code wrapper for MoveIt2! and ROS 2. |
Checkout URI | https://github.com/croboticsolutions/arm_api2.git |
VCS Type | git |
VCS Version | master |
Last Updated | 2025-06-25 |
Dev Status | UNKNOWN |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | robotics manipulation ros2 moveit2 |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
arm_api2 | 0.0.0 |
README
arm_api2
:mechanical_arm: API for robotic manipulators based on ROS 2 and MoveIt2!
Docker for building required environment can be found here.
Use prebuilt docker
Pull and run docker container arm_api2_cont
:
git clone git@github.com:CroboticSolutions/docker_files.git
cd ./docker_files/ros2/humble/arm_api2
./pull_and_run_docker.sh
<robot>_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 moveit_simple_iface.launch.py robot_name:=<robot_name>
Currently supported robot names are: ur
, kinova
, franka
, piper
.
For full instructions check section How to use arm_api2?
Build your own docker
In order to build it easily, run following comands:
git clone git@github.com: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 bash
Docker for building required environment can be found here.
For building ROS 2 packages and moveit, it is neccessary to use colcon.
Tell us anonymously what arms we should support here. :smile:
Depends on:
Aditional dependencies are (depending on the arm you use):
How to use arm_api2?
Change robot state:
The robot state can be changed via a ROS2 service.
- name:
arm/change_state
- srv:
/arm_api2_msgs/srv/ChangeState.srv
- values
JOINT_TRAJ_CTL || CART_TRAJ_CTL || SERVO_CTL
Example 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 control -
CART_TRAJ_CTL
, which is used for cartesian control -
SERVO_CTL
, which is used for the end effector servoing
Set max velocity and acceleration scaling factor:
Set velocity and acceleration scaling factors via service call:
- name:
arm/set_vel_acc
- srv:
/arm_api2_msgs/srv/SetVelAcc.srv
- values
max_vel
andmax_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:
- name:
arm/set_eelink
- srv:
/arm_api2_msgs/srv/SetStringParam.srv
- values
value
(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:
- name:
arm/set_planonly
- srv:
/std_srvs/srv/SetBool.srv
- values
value
(bool)
Example service call:
ros2 service call /arm/set_planonly std_srvs/srv/SetBool "{data: true}"
Simple interface (topic)
Run minimal simple interface with:
ros2 launch arm_api2 moveit2_simple_iface.launch.py robot_name=<robot>
Simple interface contains topics to command robot pose, path and
retrieve arm information.
Topic names are defined in the config/<robot_name>_sim
file.
Command robot pose:
- name:
arm/cmd/pose
- msg:
geometry_msgs/msg/PoseStamped.msg
ros2 topic pub /arm/cmd/pose geometry_msgs/msg/PoseStamped <wanted_pose>
Command cartesian path:
- name:
arm/cmd/traj
- msg:
arm_api2_msgs/msg/CartesianWaypoints.msg
Get current end effector pose:
- name
arm/current/pose
- msg:
geometry_msgs/msg/PoseStamped.msg
ros2 topic echo /arm/current/pose
Advanced interface (action)
Run advanced interface with:
ros2 launch arm_api2 moveit2_iface.launch.py robot_name=<robot>
Command robot pose:
A robot pose where the robot should move to can be commanded via ROS2 action.
- name:
arm/move_to_pose
« - action:
arm_api2_msgs/action/MoveCartesian.action
ros2 action send_goal /arm/move_to_pose arm_api_msgs/action/MoveCartesian <wanted_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:
colcon build --packages-select arm_api2
Build with the compile commands (enable autocomplete):
colcon build --symlink-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
Building 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-error
Full verbose build command:
colcon build --symlink-install --packages-select moveit2_tutorials --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_VERBOSE_MAKEFILE=ON
</details>
Simplify your life
Aliases
Copy 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_api2
Start franka sim with:
franka_sim
Start kinova sim with:
kinova_sim
Start ur sim with:
ur_sim
Start 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:=<robot_name>
Tmunxinator
Start kinova with:
tmuxinator start kinova_api2
after calling
./copy_tmuxinator_config.sh kinova_api2.yml
located in utils/tmux_configs
. Navigate between
panes with Ctrl+B
+(arrows).