The ROS package moveit_state_server
offers services to store the current joint angles or the end effector position (
for example, in the
world frame). Later the robot can return to the saved state. For this purpose, the state is given a unique name when it
is saved via a ROS service. Later an action client, which moves to the stored position using moveit, can be called with
the assigned name.
Launching the moveit_state_server can be done e.g. with the following command:
ros2 launch moveit_state_server moveit_state_server.launch.py
In case you robot is started within a namespace (e.g. /athena
), you can use
ros2 launch moveit_state_server moveit_state_server.launch.py --namespace /athena --remap /tf:=/athena/tf --remap /tf_static:=/athena/tf_static
The service /store_arm_poses
stores either the
current joint angles or the end-effector pose depending on the selected mode. Additionally, the user must provide a name
for the stored state.
int32 mode
string name
int32 STORE_JOINT_POSITIONS=0
int32 STORE_END_EFFECTOR_POSE=1
---
std_msgs/Bool success
Note that storing the end-effector pose persistently is not very useful because after restarting the robot the coordinate system will be different. Hence, only the joint states are stored persistently.
The service /retrieve_arm_poses
can be used to retrieve a stored joint_state or end-effector pose.
int32 mode
int32 RETRIEVE_JOINT_POSITIONS=0
int32 RETRIEVE_END_EFFECTOR_POSE=1
string name
---
sensor_msgs/JointState joint_state
geometry_msgs/PoseStamped pose
The action client /move_arm_to_stored_pose
can be used to move the robot such that it is again in a previously stored
state.
The goal message defines the type and name of the goal
int32 mode
string name
int32 GO_TO_STORED_JOINT_POSITIONS=0
int32 GO_TO_STORED_END_EFFECTOR_POSE=1
---
int32 success
---
int32 state
This ROS package requires moveit
, see here, to be installed
If you find a bug or would like to contribute to this ROS package, please open an issue on the Github repository or submit a pull request.