Skip to content

PRISHIta123/Franka_Manipulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Franka_Manipulation

Manipulate a Franka Emika Robot Arm in Simulation using classical control and learned control algorithms.

Instructions:
Clone this repo, create a conda environment and install the requirements.

conda create -n libfranka python=3.10  
conda activate libfranka
cd Franka_Manipulation
pip install -r requirements.txt

To run the simulator use this command:

run-franka-sim-server -v

You might need to hold the option key (if using Mac) and drag the robot to the center of the simulation.
All the algorithms will generate robot motions in this simulation.

Classical Control

In another terminal window, activate the same conda env and navigate to the libfranka-python subfolder:

conda activate libfranka
cd Franka_Manipulation/libfranka-python/Classical_Control
  • Sinusoidal y-axis joint 4 motion
python sinusoidal_motion.py

alt text

  • Pick and place joints 0 and 4 motion
python pick_and_place.py

alt text

  • Proportional-Derivative (PD) control
    • Follow reference joint trajectories
python pd_control.py

alt text

  • Inverse Kinematics (IK) / Operational Space Control
    • Cartesian control of the end-effector
python inverse_kinematics_osc.py

alt text

  • Impedance Control
    • Simulate compliant behaviors (e.g., pushing, insertion)
python impedance_control.py

alt text

Learning-based Control

In another terminal window, activate the same conda env and navigate to the libfranka-python subfolder:

conda activate libfranka
cd Franka_Manipulation/libfranka-python/Learned_Control
  • Behavior Cloning (BC)
    • Imitate trajectory from expert demonstration
cd "Behavior Cloning"
python collect_data.py

Will store the expert path in trajectory_data.pkl, and display expert path in the simulator.

python train_policy.py

Will save trained model in trajectory_model.pth

python run_policy.py

alt text

  • Reinforcement Learning (RL)
    • Algorithms: SAC / PPO
    • Use stable-baselines3 or custom RL code
cd "Reinforcement Learning"
python franka_env.py

Creates a state-action-reward environment within libfranka-sim for end effector goal

python reinforcement_learning.py

PPO model is saved as ppo_franka_joint.zip
alt text

  • Residual Policy Learning
    • Combine scripted control with learned corrections
cd "Residual Policy Learning"  
python residual_policy_learning.py

Creates a state-action-reward environment within libfranka-sim for end effector goal.

python train_residual_policy.py

PPO finetuning model over base oscillatory controller is saved as ppo_residual_franka.zip

python deploy_residual_policy.py

alt text

About

Manipulate a Franka Emika Robot Arm in Simulation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors