Skip to content

l2ktech/joycon-robotics

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

51 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Joycon pairing button

Joycon-Robotics: Low-Cost, Convenient Teleoperation for One- and Two-Arm Robots

English โ€ข ไธญๆ–‡


๐Ÿ†• What's New?

  • 2025-04-19: Added support for initial parameters for all robot arms + updated Chinese documentation
  • 2025-04-16: Optimized yaw drift compensation with more robust auto-calibration
  • 2025-02-24: Added compatibility with Robosuite
  • 2025-02-12: Added support for RLBench-ACT data collection

๐Ÿ’ป Installation (Recommended: Ubuntu 20.04 / 22.04 with Bluetooth)

git clone https://github.com/box2ai-robotics/joycon-robotics.git
cd joycon-robotics

pip install -e .
sudo apt-get update
sudo apt-get install -y dkms libevdev-dev libudev-dev cmake git
make install

๐Ÿ”— Connection Setup

1. Initial Bluetooth Pairing

  1. Enter Pairing Mode
    • Hold the small circular button on the Joy-Con for 3 seconds.
    • In your system Bluetooth settings, connect to Joycon (L) or Joycon (R).

Joycon pairing button

  1. Confirm Connection
    • Joy-Con will vibrate when connected.
    • Single Controller Mode: Hold R + ZR for 3 seconds.
    • Dual Controller Mode: After both Joy-Cons vibrate, press:
      • Left: L (upper trigger) + Right: R (upper trigger)

Joycon binding

2. Reconnecting

  • For already paired devices, press L or R to auto-reconnect.
  • Wait for vibration confirmation and repeat step 2 above.

โšก Quick Start

1. Basic Usage

from joyconrobotics import JoyconRobotics
import time

joyconrobotics_right = JoyconRobotics("right")

for i in range(1000):
    pose, gripper, control_button = joyconrobotics_right.get_control()
    print(f'{pose=}, {gripper=}, {control_button=}')
    time.sleep(0.01)

joyconrobotics_right.disconnnect()

2. Custom Parameters for Robot Arms

# Initial pose [x, y, z, roll, pitch, yaw]
init_gpos = [0.210, -0.4, -0.047, -3.1, -1.45, -1.5]

# Pose limits: [[min], [max]]
glimit = [
    [0.210, -0.4, -0.047, -3.1, -1.45, -1.5],
    [0.420, 0.4, 0.30, 3.1, 1.45, 1.5]
]

offset_position_m = init_gpos[:3]

3. Lightweight Collaborative Arms (e.g., ViperX 300S, So-100 Plus)

JR_controller = JoyconRobotics(
    device="right",
    glimit=glimit,
    offset_position_m=offset_position_m,
    pitch_down_double=True,
    gripper_close=-0.15,
    gripper_open=0.5
)

4. Industrial Arms (e.g., UR, Panda, Sawyer)

import math

JR_controller = JoyconRobotics(
    device="right",
    offset_position_m=offset_position_m,
    pitch_down_double=False,
    offset_euler_rad=[0, -math.pi, 0],
    euler_reverse=[1, -1, 1],
    direction_reverse=[-1, 1, 1],
    pure_xz=False
)

๐Ÿ‘‰ More code examples: Quick Start Tutorial Notebook


๐ŸŽฎ Control Manual

Coordinate System

  • Home: (offset_position_x, offset_position_y, offset_position_z)
  • Forward: X+
  • Right: Y+
  • Up: Z+

End-Effector Attitude Control

Action Direction
Joystick โ†‘ Forward (X+)
Joystick โ†“ Backward (Xโˆ’)
Joystick โ† Strafe Left (Yโˆ’)
Joystick โ†’ Strafe Right (Y+)
Joystick โ— (Press) Down (Zโˆ’)
R/L Up (Z+)

Button Mapping

Joycon reset

Function Left Joycon Right Joycon
Reset Pose Capture (O) Home
Gripper ZL ZR
Delete and Record โ€” A (custom)
Save and Record New โ€” Y (custom)

All other buttons are user-configurable.


โ“ FAQ

Q1: No Vibration / Can't Connect

Solution:

  1. Re-run make install
  2. Remove and re-pair Bluetooth devices
  3. Restart your computer
  4. Fully power off Joy-Con, re-enter pairing mode

Q2: Frequent Disconnection or Data Loss

Solution:

  • Charge Joy-Con for 30+ minutes
  • Remove the Bluetooth pairing info from your computer
  • Restart both computer and Joy-Con
  • โš  Ubuntu Bluetooth compatibility can vary by device

๐Ÿ’ก Compatibility

System Supported
Ubuntu 20.04 โœ…
Ubuntu 22.04 โœ…
Windows / WSL / Mac / VM โŒ (due to kernel-level drivers)

๐Ÿ“ฆ Hardware Purchase

Joycon pairing button


๐Ÿ“ข Community & Support

  • Video Tutorials: Bilibili ่ง†้ข‘่ดฆๅท
  • QQไบคๆต็พค๏ผš948755626
  • Open-source license: For research/robotics use only. Strictly prohibited for gaming or Nintendo systems.
  • Use at your own risk โ€” no warranty provided.

If you find this project helpful, please star the repo! โญโญโญโญโญ

About

Joycon-Robotics: Low-Cost, Convenient Teleoperation for One- and Two-Arm Robots

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 90.4%
  • Python 9.3%
  • Makefile 0.3%