Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

velocity command and rate input at the same time for motion commander #239

Merged
merged 4 commits into from May 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions cflib/positioning/motion_commander.py
Expand Up @@ -383,9 +383,9 @@ def start_circle_right(self, radius_m, velocity=VELOCITY):

self._set_vel_setpoint(velocity, 0.0, 0.0, rate)

def start_linear_motion(self, velocity_x_m, velocity_y_m, velocity_z_m):
def start_linear_motion(self, velocity_x_m, velocity_y_m, velocity_z_m, rate_yaw=0.0):
"""
Start a linear motion. This function returns immediately.
Start a linear motion with an optional yaw rate input. This function returns immediately.

positive X is forward
positive Y is left
Expand All @@ -394,10 +394,11 @@ def start_linear_motion(self, velocity_x_m, velocity_y_m, velocity_z_m):
:param velocity_x_m: The velocity along the X-axis (meters/second)
:param velocity_y_m: The velocity along the Y-axis (meters/second)
:param velocity_z_m: The velocity along the Z-axis (meters/second)
:param rate: The angular rate (degrees/second)
:return:
"""
self._set_vel_setpoint(
velocity_x_m, velocity_y_m, velocity_z_m, 0.0)
velocity_x_m, velocity_y_m, velocity_z_m, rate_yaw)

def _set_vel_setpoint(self, velocity_x, velocity_y, velocity_z, rate_yaw):
if not self._is_flying:
Expand Down