ROS 1 codebase for Franka Panda kitting experiments. The main package is franka_kitting_controller, a ros_control controller that publishes robot state, detects contact with SMS-CUSUM, controls the Franka gripper during grasp trials, and records trial data to rosbag/CSV.
| Path | Use |
|---|---|
franka_kitting_controller/ |
Main package. Contains the kitting controller, logger node, custom messages, configs, launch files, and tests. |
sms_cusum/ |
Contact and secure-grasp detection algorithm. The controller uses the C++ headers in sms_cusum/cpp/include. Python tools are included for offline validation and plotting. |
franka_control/ |
Franka hardware control node and state controller. Use this to start the real robot control loop. |
franka_hw/ |
Franka ros_control hardware interfaces used by franka_control and the kitting controller. |
franka_gripper/ |
Franka gripper action/message definitions. The kitting controller uses these types and connects to the gripper through libfranka. |
franka_msgs/ |
Franka messages, services, and actions required by the control packages. |
kitting_bags/ |
Recorded trial bags, CSV files, plots, and metadata from tests. Treat this as experiment data. |
Use a ROS 1 catkin setup with ROS Noetic or Melodic.
Install or provide:
libfranka0.8 or 0.9franka_descriptionfrom an external Franka ROS installation, needed byfranka_control.launchfor the Panda URDF- ROS packages for
controller_manager,controller_interface,hardware_interface,combined_robot_hw,joint_limits_interface,pluginlib,realtime_tools,actionlib,rosbag,topic_tools,control_msgs,sensor_msgs,geometry_msgs,tf, andtf2_msgs
The repository already includes the local Franka packages needed by the kitting controller: franka_control, franka_hw, franka_gripper, and franka_msgs.
Put this repository inside a catkin workspace source directory:
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
# clone or copy this repository hereInstall dependencies and build:
cd ~/catkin_ws
rosdep install --from-paths src --ignore-src -r -y
catkin_make
source devel/setup.bashWith catkin_tools, build the kitting package and its dependencies:
cd ~/catkin_ws
catkin build franka_kitting_controller
source devel/setup.bashStart the Franka robot control loop first:
roslaunch franka_control franka_control.launch robot_ip:=<ROBOT_IP> load_gripper:=falseUse load_gripper:=false. The kitting controller opens its own direct franka::Gripper connection, so franka_gripper_node should not be running at the same time.
In a second terminal, source the workspace and launch the kitting controller:
source ~/catkin_ws/devel/setup.bash
roslaunch franka_kitting_controller kitting_state_controller.launch robot_ip:=<ROBOT_IP>The controller loads franka_kitting_controller/config/kitting_state_controller.yaml, spawns kitting_state_controller, publishes state data, and waits for a trial command.
The main command topic is:
/kitting_controller/state_cmd
It uses the message type:
franka_kitting_controller/KittingGripperCommand
Manual mode uses three commands: BASELINE, CLOSING, then GRASPING.
# 1. Prepare and collect baseline
rostopic pub /kitting_controller/state_cmd franka_kitting_controller/KittingGripperCommand \
"{command: 'BASELINE', open_gripper: true}" --once
# 2. Close the gripper until contact is detected
rostopic pub /kitting_controller/state_cmd franka_kitting_controller/KittingGripperCommand \
"{command: 'CLOSING'}" --once
# 3. Start the force ramp and evaluation sequence
rostopic pub /kitting_controller/state_cmd franka_kitting_controller/KittingGripperCommand \
"{command: 'GRASPING'}" --onceAutomatic mode runs the same sequence from one command:
rostopic pub /kitting_controller/state_cmd franka_kitting_controller/KittingGripperCommand \
"{command: 'AUTO', open_gripper: true, auto_delay: 3.0}" --onceThe controller publishes the current trial state on:
/kitting_controller/state
Typical states are START, UNKNOWN, BASELINE, CLOSING, CONTACT, GRASP_1, GRASP_2, UPLIFT, EVALUATE, SUCCESS, and FAILED.
Launch the controller with recording enabled:
roslaunch franka_kitting_controller kitting_state_controller.launch \
robot_ip:=<ROBOT_IP> \
record:=true \
object_name:=<OBJECT_NAME> \
base_directory:=/path/to/kitting_bagsThe logger starts automatically, records one bag per trial, and exports CSV files when a trial stops. If you want new data saved in this repository, point base_directory at this repo's kitting_bags/ directory.
Stop or abort recording manually with:
rostopic pub /kitting_controller/record_control std_msgs/String "data: 'STOP'" --once
rostopic pub /kitting_controller/record_control std_msgs/String "data: 'ABORT'" --onceTerminal states SUCCESS and FAILED also stop recording automatically.
Controller parameters live in:
franka_kitting_controller/config/kitting_state_controller.yaml
Logger parameters live in:
franka_kitting_controller/config/kitting_logger.yaml
Most per-trial command fields can override YAML defaults. For example:
rostopic pub /kitting_controller/state_cmd franka_kitting_controller/KittingGripperCommand \
"{command: 'GRASPING', f_min: 3.0, f_max: 70.0, f_step: 3.0}" --onceRun the kitting controller tests from the catkin workspace:
catkin_make run_tests_franka_kitting_controller
catkin_test_results buildWith catkin_tools:
catkin build franka_kitting_controller --catkin-make-args run_tests
catkin_test_results buildThe kitting controller tests use mocked handles and do not require robot hardware. Some franka_hw tests require franka_description because they load the Panda URDF.
franka_kitting_controller/README.mdexplains the controller state machine, topics, messages, force-ramp behavior, logger behavior, and test structure.sms_cusum/README.mdexplains the SMS-CUSUM algorithm, C++ headers, Python validation tools, and detection parameters.