This repository contains a ROS 2 Cartesian Impedance Controller specifically designed for Franka Emika research robots (fer, fr3, fp3). It utilizes franka_ros2 and franka_semantic_components to provide compliant motion control by adjusting robot joint torques based on a desired Cartesian pose.
The impedance_controller implements a virtual spring-damper system at the robot's end-effector.
- Compliant Control: Instead of moving rigidly to a point, the robot behaves like a mass attached to springs. If it encounters an obstacle, it will "give way" based on its defined stiffness.
- Dynamic Updating: The controller continuously calculates the necessary joint torques to maintain a target pose while compensating for Coriolis forces.
- Configuration: It reads translational and rotational stiffness parameters from a YAML configuration file to define how "stiff" or "soft" the robot behaves in Cartesian space.
The package provides a custom service to dynamically update the robot's target pose without restarting the controller.
-
Purpose: This service allows an external node or user to update the desired Cartesian target (position and orientation) of the robot in real-time.
-
Service Type:
franka_msgs/srv/SetPose. -
Request Parameters:
-
x,y,z: Target Cartesian position. -
roll,pitch,yaw: Target orientation in Euler angles. -
Behavior: When a request is received, the
PoseInputServer(running on a dedicated thread within the controller) updates the target vectors used in the torque calculation loop.
Use the provided launch file to start the robot bringup and the impedance controller:
ros2 launch impedance_controller impedance_controller.launch.py robot_ip:=<ROBOT_IP> arm_id:=fr3
- Key Arguments:
robot_ip: The IP address of your Franka Control Unit.arm_id: The type of arm (default isfr3; supported:fer,fr3,fp3).load_gripper: Set totrueif a Franka Gripper is attached.
Stiffness values can be adjusted in launch/controllers.yaml:
translational_stiffness: Default is150.0.rotational_stiffness: Default is10.0.
To move the robot to a new target pose via the command line:
ros2 service call /set_pose franka_msgs/srv/SetPose "{x: 0.5, y: 0.1, z: 0.4, roll: 3.14, pitch: 0.0, yaw: 0.0}"
Alternatively, you can run the included client node to send a hardcoded test pose:
ros2 run impedance_controller set_pose_client
This project is licensed under the Apache License 2.0.