File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 55# tuples are (camera_name, camera_device_id)
66cameras = [
77 ('Camera 1' , 0 ),
8- # ('Camera 2', 1),
8+ ('Camera 2' , 1 ),
99]
1010
1111
@@ -32,10 +32,10 @@ def main():
3232 # camera_chooser.addDefault(name, cam_idx)
3333
3434 cam_server = cs_instance .addServer (name = 'camera_server' )
35- current_selected = int (table .getNumber ('Selected Camera' , 0 ))
35+ current_selected = int (table .getNumber ('Selected Camera' , 1 ))
3636
3737 if current_selected >= len (camera_objects ):
38- current_selected = 0
38+ current_selected = 1
3939
4040 cam_server .setSource (camera_objects [current_selected ])
4141
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def buttons(self):
3838 self .foc_enabled = not self .foc_enabled
3939
4040 if self .switch_camera_button .get ():
41- current_camera = (self .prefs .getInt ('Selected Camera' , 0 ) + 1 ) % 1
41+ current_camera = (self .prefs .getInt ('Selected Camera' , 0 ) + 1 ) % 2
4242 self .prefs .putInt ('Selected Camera' , current_camera )
4343
4444 def lift_control (self ):
@@ -90,7 +90,7 @@ def winch_control(self):
9090 self .robot .winch .forward ()
9191 else :
9292 self .robot .winch .forward ()
93- self .robot .lift .setLiftPower (0.35 )
93+ self .robot .lift .setLiftPower (constants . sync_power )
9494 elif self .throttle .getRawButton (3 ):
9595 self .robot .winch .forward ()
9696 elif self .throttle .getRawButton (2 ):
@@ -114,6 +114,12 @@ def drive(self):
114114 if constants .strInv :
115115 ctrl [1 ] *= - 1
116116
117+ if abs (ctrl [0 ]) < 0.1 :
118+ ctrl [0 ] = 0
119+
120+ if abs (ctrl [1 ]) < 0.1 :
121+ ctrl [1 ] = 0
122+
117123 linear_control_active = True
118124 if abs (np .sqrt (np .sum (ctrl ** 2 ))) < 0.1 :
119125 ctrl [0 ] = 0
You can’t perform that action at this time.
0 commit comments