Motion commander : _set_vel_setpoint

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
romixtar
Beginner
Posts: 1
Joined: Sun May 16, 2021 3:38 pm

Motion commander : _set_vel_setpoint

Post by romixtar »

Hello,

I would like to use the motion commander to set a velocity setpoint composed of specified x, y velocities and an angular rate.

Is it possible to use these two following methods in succession :
motion_commander.start_linear_motion(velocity_x, velocity_y, 0)
motion_commander.start_turn_left(my_rate)

I think that a better way to do it would be to set a unique setpoint composed of my x,y velocities and my angular rate instead of two different setpoints, however _set_vel_setpoint is a private method if i'm not mistaken and there is no public method in the motion commander class that allows to specify at the same time x,y velocities and a rate (there are the start_circle_left that allows to set a x velocity and a rate which depends on a radius or the start_linear_motion that allows to set x,y,z velocities but no rate).

What would be the proper way to do it ?

Best regards.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Motion commander : _set_vel_setpoint

Post by kimberly »

Hi!

You are right, there should be a open function for this. Technically you can already go ahead and use it with the private function you mentioned (these functions in python are not really 'private'), but the clean way is to make a wrapper around this.

I made this pull request which should open it up: https://github.com/bitcraze/crazyflie-l ... /239/files
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Motion commander : _set_vel_setpoint

Post by kimberly »

its possible now to add a yaw rate to start_linear_motion

So just pull the latest master of the motion commander and make sure that [the cflib is installed from source](https://github.com/bitcraze/crazyflie-l ... install.md) with 'pip install -e .'
Post Reply