FrankaMover
The FrankaMover class provides a high-level interface for controlling the Franka Emika Panda robot with built-in safety features and convenient methods for common robotic tasks.
- class moveit2_sdk_python.franka_mover.FrankaMover[source]
Bases:
object
Initialize the FrankaMover class.
This constructor initializes the Moveit2Python API, creates a ROS 2 node, sets up a reentrant callback group and a multi-threaded executor. It also creates an action client for the Franka gripper. Finally, it starts a thread to spin the ROS 2 node.
- __init__() None [source]
Initialize the FrankaMover class.
This constructor initializes the Moveit2Python API, creates a ROS 2 node, sets up a reentrant callback group and a multi-threaded executor. It also creates an action client for the Franka gripper. Finally, it starts a thread to spin the ROS 2 node.
- __del__()[source]
Clean up resources when the FrankaMover object is deleted.
This method shuts down the ROS 2 node, joins the node spinning thread, destroys the node, and attempts to shut down RCLPY.
- spin_node()[source]
Spin the ROS 2 node to process callbacks.
This method checks if RCLPY is initialized, initializes it if not, and then spins the node using the configured executor. This method is typically run in a separate thread.
- async pour(x: float, y: float, z: float)[source]
Execute a pouring motion.
- Parameters:
x (float) – The x-coordinate of the pouring position.
y (float) – The y-coordinate of the pouring position.
z (float) – The z-coordinate of the pouring position.
- Returns:
The result of the trajectory execution.
- Return type:
any
- async move(x: float, y: float, z: float)[source]
Move the robot to a specified Cartesian coordinate.
The robot first moves to a position 0.1m above the target and then moves to the target position.
- Parameters:
x (float) – The target x-coordinate.
y (float) – The target y-coordinate.
z (float) – The target z-coordinate.
- Returns:
The result of the trajectory execution.
- Return type:
any