Skip to content

Commit 3f0c5a0

Browse files
committed
Use correct yaw convention in motion commander
Requires reverting commit f6c0e73 in `crazyflie-firmware`, i.e., requires no longer inverting received yaw rates upon arrival in `crazyflie-firmware`
1 parent dfd989c commit 3f0c5a0

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

cflib/positioning/motion_commander.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def start_turn_left(self, rate=RATE):
347347
:param rate: The angular rate (degrees/second)
348348
:return:
349349
"""
350-
self._set_vel_setpoint(0.0, 0.0, 0.0, -rate)
350+
self._set_vel_setpoint(0.0, 0.0, 0.0, rate)
351351

352352
def start_turn_right(self, rate=RATE):
353353
"""
@@ -356,7 +356,7 @@ def start_turn_right(self, rate=RATE):
356356
:param rate: The angular rate (degrees/second)
357357
:return:
358358
"""
359-
self._set_vel_setpoint(0.0, 0.0, 0.0, rate)
359+
self._set_vel_setpoint(0.0, 0.0, 0.0, -rate)
360360

361361
def start_circle_left(self, radius_m, velocity=VELOCITY):
362362
"""
@@ -369,7 +369,7 @@ def start_circle_left(self, radius_m, velocity=VELOCITY):
369369
circumference = 2 * radius_m * math.pi
370370
rate = 360.0 * velocity / circumference
371371

372-
self._set_vel_setpoint(velocity, 0.0, 0.0, -rate)
372+
self._set_vel_setpoint(velocity, 0.0, 0.0, rate)
373373

374374
def start_circle_right(self, radius_m, velocity=VELOCITY):
375375
"""
@@ -382,7 +382,7 @@ def start_circle_right(self, radius_m, velocity=VELOCITY):
382382
circumference = 2 * radius_m * math.pi
383383
rate = 360.0 * velocity / circumference
384384

385-
self._set_vel_setpoint(velocity, 0.0, 0.0, rate)
385+
self._set_vel_setpoint(velocity, 0.0, 0.0, -rate)
386386

387387
def start_linear_motion(self, velocity_x_m, velocity_y_m, velocity_z_m, rate_yaw=0.0):
388388
"""

examples/multiranger/multiranger_wall_following.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ def handle_range_measurement(range):
122122
'yaw_rate', yaw_rate, 'state_wf', state_wf)
123123

124124
# convert yaw_rate from rad to deg
125-
# the negative sign is because of this ticket:
126-
# https://github.com/bitcraze/crazyflie-lib-python/issues/389
127-
yaw_rate_deg = -1 * degrees(yaw_rate)
125+
yaw_rate_deg = degrees(yaw_rate)
128126

129127
motion_commander.start_linear_motion(
130128
velocity_x, velocity_y, 0, rate_yaw=yaw_rate_deg)

0 commit comments

Comments
 (0)