nepyope commited on
Commit
3efb4cc
·
verified ·
1 Parent(s): 6b9097f

auto-detect controller

Browse files
Files changed (1) hide show
  1. sim/base_sim.py +5 -5
sim/base_sim.py CHANGED
@@ -580,12 +580,12 @@ class BaseSimulator:
580
  pass
581
 
582
  def init_unitree_bridge(self):
583
- """Initialize the unitree SDK bridge"""
584
  self.unitree_bridge = UnitreeSdk2Bridge(self.config)
585
- if self.config["USE_JOYSTICK"]:
586
- self.unitree_bridge.SetupJoystick(
587
- device_id=self.config["JOYSTICK_DEVICE"], js_type=self.config["JOYSTICK_TYPE"]
588
- )
589
 
590
  def start(self):
591
  """Main simulation loop"""
 
580
  pass
581
 
582
  def init_unitree_bridge(self):
583
+ """Initialize the unitree SDK bridge and auto-detect joystick."""
584
  self.unitree_bridge = UnitreeSdk2Bridge(self.config)
585
+ self.unitree_bridge.SetupJoystick(
586
+ device_id=self.config.get("JOYSTICK_DEVICE", 0),
587
+ js_type=self.config.get("JOYSTICK_TYPE", "xbox"),
588
+ )
589
 
590
  def start(self):
591
  """Main simulation loop"""