The robot infra used to collect the dataset is released as part of the serl project and works for both Franka Emika Panda and the newer Franka Research 3 arms.
All robot code is structured as follows:
custom_server: hosts a Flask server which sends commands to the robot via ROS.franka_env: gym env for the robot which communicates with the Flask server via POST requests.
- ROS Noetic
- Franka Panda or Franka Research 3 arm and gripper
libfranka>=0.8.0andfranka_ros>=0.8.0installed according to Franka FCI Documentation
cd robot_infra
conda create -n franka_controller python=3.10
conda activate franka_controller
pip install -e .Disable the franka_ros realtime kernel constraint in catkin_ws/src/franka_ros/franka_control/config/franka_control_node.yaml by setting the line:
realtime_config: ignore-
Launch the robot server The robot server runs the robot controller and a Flask server which streams robot commands to the gym environment using HTTP requests.
conda activate franka_controller python robot_infra/custom_server.py --robot_ip 172.16.0.2
Flags Description --robot_ipIP of the robot for launching the controller --gripper_distDistance the gripper should open to. 0.09 for single-object task, 0.075 for the multi-object task --force_base_frameWhether to read the end-effector force/torque information in the base frame. This starts the ROS impedance controller and the HTTP server. You can test compliance by gently pushing the end effector.
The HTTP server communicates between the ROS controller and gym environments:
Request Description startimpStart the impedance controller stopimpStop the impedance controller poseCommand robot to desired end-effector pose in base frame (xyz+quaternion) getposReturn current end-effector pose (xyz+rpy) getvelReturn current end-effector velocity getforceReturn estimated force on end-effector gettorqueReturn estimated torque on end-effector getqReturn current joint position getdqReturn current joint velocity getjacobianReturn current zero-jacobian getstateReturn all robot states jointresetPerform joint reset get_gripperReturn current gripper position close_gripperClose the gripper completely open_gripperOpen the gripper completely clearerrClear errors precision_modeSet impedance parameters to precision mode for resets compliance_modeSet impedance parameters to compliance mode for execution curl -X POST http://127.0.0.1:5000/activate_gripper # Activate gripper curl -X POST http://127.0.0.1:5000/close_gripper # Close gripper curl -X POST http://127.0.0.1:5000/open_gripper # Open gripper curl -X POST http://127.0.0.1:5000/getpos # Print current EE pose curl -X POST http://127.0.0.1:5000/jointreset # Perform joint reset curl -X POST http://127.0.0.1:5000/stopimp # Stop impedance controller curl -X POST http://127.0.0.1:5000/startimp # Start impedance controller
-
Launch Gym Environment Create an instance of the gym environment in a second terminal:
python franka_controller.py --gripper close --port 4999
-
Data Collection (Space Mouse) Use a 3D space mouse for robot action data sampling:
python data_record.py
Note: For low-level SpaceMouse testing, you can also use:
python robot_infra/spacemouse/spacemouse_custom.py
-
Kinect Recording (Optional) To record high-quality Azure Kinect video data:
python record_azure.py