コード例 #1
0
class REF(ATCommand):
    '''
    at.REF interface of version 0.5
    '''

    input = parameters.Int32(
        'an integer value, '
        'representing a 32 bit-wide bit-field controlling the drone')

    input._set_flags(
        default=bits(18, 20, 22, 24, 28),  # Always on
        start=bits(9),  # Takeoff / Land
        select=bits(8),  # Switch of emergency mode
    )
コード例 #2
0
class PCMD(ATCommand):
    '''
    Send progressive commands - makes the drone move (translate/rotate).
    '''

    flag = parameters.Int32(
        'flag enabling the use of progressive commands and/or the Combined'
        'Yaw mode (bitfield)')
    roll = parameters.Float('drone left-right tilt, [-1...1]', default=0)
    pitch = parameters.Float('drone front-back tilt, [-1...1]', default=0)
    gaz = parameters.Float('drone vertical speed, [-1...1]', default=0)
    yaw = parameters.Float('drone angular speed, [-1...1]', default=0)

    flag._set_flags(
        absolute_control=bits(2),
        combined_yaw=bits(1),
        progressive=bits(0),
    )
コード例 #3
0
 def test_bit_4_is_0x10(self):
     self.assertEqual(bits(4), 0x10)
コード例 #4
0
 def test_bits_accepts_multiple_arguments(self):
     self.assertEqual(bits(1) + bits(13) + bits(6), bits(1, 13, 6))
コード例 #5
0
 def test_bit_0_is_1(self):
     self.assertEqual(bits(0), 1)