Depending on your application and your proficiency with ROS and HAL, you may want to use the low-level APIs behind the robot application. However, there is not a single low-level API, instead the whole system is built on top of the ROS and Machinekit’s HAL.
High Level API (Python)
First, you may want to consider staying within the possibilities of the robot program. This will give you the advantage of using the robot UI for most tasks, such as for example teaching waypoints and at the same time you can still use Python to write your application software. Moreover, you can simply connect to other ROS nodes, written in the programming language of your choice, using the ROS API.
This is most useful if you are a power user who is familiar with ROS and you want to tweak some parts of the system.
ROS API (Python/C++/…)
If you are familiar with ROS, you can use the underlying ROS API directly. However, please be aware that the TRPL interpreter simplifies a lot of things such as for example move commands and offsets. You won’t be able to use the simplified API through ROS.
Run the following command on the robot computer to open a terminal in the robots Docker container.
docker exec -itu 1000:1000 ros-dist-ui bash -i
Then source the ROS environment:
Now you can use the ROS command line tools to take a look at the published topics and services:
To connect to the ROS master from another Docker container use the following environment variables:
Alternatively, you can use the position trajectory controller interface directly /position_trajectory_controller/follow_joint_trajectory for more info take a look at the joint trajectory controller documentation http://wiki.ros.org/joint_trajectory_controller.
You can use the services exposed by MoveIt to compute the forward and inward kinematics solutions.
Step or Interactive Jogging
Step based or interactive jogging can be executed as follows:
Set the target pose or joint position using one of the following services
/jog/absolute/set_joints, absolute jog to joint positions
/jog/absolute/set_pose, absolute jog to pose
/jog/offset/set_joints, incremental jog using joint offset
/jog/offset/set_joints, incremental jog using pose offset
Publish true to the /jog/execute topic with a rate of 10Hz
Publish false to stop jog move
The /jog/active, /jog/complete, and /jog/failed topics reports the current state of jogging.