Skip to content

parths5/franka-panda-api-16384

Repository files navigation

Franka Panda API for CMU 16-384

This repository contains a unified API interface for controlling Franka Panda robots, developed as a teaching assistant resource for Carnegie Mellon University's course 16-384 (Robot Kinematics and Dynamics) taught by Prof. Jeff Ichnowski.

The repository provides a clean, abstracted interface for robot control that works seamlessly with both simulation (MuJoCo) and real hardware. This allows students to develop and test their code in simulation before deploying to physical robots.

Features

  • Unified API: Single interface (RobotInterface) for both simulation and real robot control
  • MuJoCo Simulation: Full physics simulation with visual feedback
  • Real Robot Support: Direct integration with FrankaPy for physical robot control
  • Student-Friendly: Simple API design that abstracts away low-level robot control details

Structure

franka-panda-api-16384/
├── shared_api.py           # Abstract base class defining the robot interface
├── cmurkd_sim.py           # MuJoCo simulation implementation
├── cmurkd_real.py          # Real Franka Panda robot implementation
├── student_assignment.py   # Template file for student assignments
└── franka_emika_panda/     # MuJoCo model files and assets
    ├── panda_nohand.xml
    ├── panda_torque.xml
    └── assets/             # 3D model assets

Example Usage

Simulation Mode

from cmurkd_sim import MuJoCoSim as Robot

robot = Robot(model_path='path/to/panda_nohand_torque.xml')
robot.connect()

# Define your trajectory
trajectory = [home_pose, intermediate_pose, target_pose]

# Execute the trajectory
robot.execute_trajectory(trajectory)

robot.disconnect()

Real Robot Mode

from cmurkd_real import FrankaRobot as Robot

robot = Robot(robot_ip='172.16.0.2')
robot.connect()

# Define your trajectory
trajectory = [home_pose, intermediate_pose, target_pose]

# Execute the trajectory
robot.execute_trajectory(trajectory)

robot.disconnect()

Student Assignment Template

Students can use student_assignment.py as a starting point. Simply switch the import statement to toggle between simulation and real robot:

from cmurkd_sim import MuJoCoSim as Robot  # For simulation
# from cmurkd_real import FrankaRobot as Robot  # For real robot

Core Dependencies

  • MuJoCo: For simulation
  • FrankaPy: For real robot control
  • NumPy: For numerical operations
  • glfw: For visualization

License

See the LICENSE file in the franka_emika_panda directory for model licensing information.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages