Skip to content

Commit

Permalink
Annotated some lines of code.
Browse files Browse the repository at this point in the history
  • Loading branch information
iandareid committed Jul 25, 2024
1 parent e4a6d02 commit 86df3b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions rosflight_sim/src/rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def __init__(self):

self.declare_parameter('use_vimfly', False)
self.use_vimfly = self.get_parameter('use_vimfly').get_parameter_value().bool_value


# Intercept if using VimFly.
if self.use_vimfly and not self.transmitter_detected:
self.get_logger().info('Using VimFly...')
self.vim_fly = VimFly()
Expand All @@ -166,7 +167,6 @@ def __init__(self):
self.rc_publisher = self.create_publisher(RCRaw, 'RC', 10)
self.timer = self.create_timer(1.0 / 50, self.timer_callback)


# Transmitter detected, initialize joystick
if self.transmitter_detected:
self.joy.init()
Expand All @@ -187,7 +187,7 @@ def __init__(self):
self.transmitter_detected = False

# Transmitter not detected, use simulated joystick
if not self.transmitter_detected and not self.use_vimfly:
if not self.transmitter_detected:
self.THROTTLE_CHANNEL = 2
self.ARM_SWITCH_CHANNEL = 4
self.OVERRIDE_CHANNEL = 5
Expand Down
4 changes: 2 additions & 2 deletions rosflight_sim/src/vimfly.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ def __init__(self):
self.thrust_start_time = self.node.get_clock().now()

self.armed = 1000 # Unarmed
self.ARM_DEBOUNCE_THRESHOLD = 0.250
self.ARM_DEBOUNCE_THRESHOLD = 0.500
self.arm_debouncing = [False]
self.arm_start_time = self.node.get_clock().now()

self.RC_override = 2000 # Start under manual control
self.RC_OVERRIDE_DEBOUNCE_THRESHOLD = 0.250
self.RC_OVERRIDE_DEBOUNCE_THRESHOLD = 0.500
self.RC_override_debouncing = [False]
self.RC_override_start_time = self.node.get_clock().now()

Expand Down

0 comments on commit 86df3b5

Please sign in to comment.