Enable Carefree mode in firmware

Firmware/software/electronics/mechanics
Post Reply
kristof
Beginner
Posts: 1
Joined: Thu Jun 22, 2017 8:03 pm

Enable Carefree mode in firmware

Post by kristof »

Hi,
I have read on a couple forum discussions that there is a carefree mode that can be enabled within the firmware and the client. I am looking to control the quad in carefree mode while using the android app. I can't seem to figure out how to permanently set the yaw flight mode to carefree. I don't need to be able to toggle it to normal mode so maybe someone can give me some guidance on how to do this.
I have already tried to set

Code: Select all

#define DEFAULT_YAW_MODE  CAREFREE
in the commander.h file but this didn't seem to do anything.
It seems that it makes sense that nothing should be happening because in crpt_commander_rypt.c I found this

Code: Select all

case CAREFREE:
      // TODO: Add frame of reference to setpoint
      ASSERT(false);
      break;
So, I'm kinda stuck here and would appreciate some guidance if possible. From this discussion, [FEATURE ADDED] CareFree Mode viewtopic.php?t=975, it seems that Carefree is actually in the firmware but I can't seem to find how to enable.

Also, I am also looking for a way to reset location of the quadcopter front reference. Right now front is set so that the nub on the board is the forward direction. Is there a way to say change the front so that the front is rotated 90 degrees. I guess this would essentially make motor1 = motor2, motor2 = motor3, motor3=motor4, and motor4 = motor1.

Any help on this would be greatly appreciated. THANKS!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Enable Carefree mode in firmware

Post by arnaud »

Hi,

Carefree mode has been disabled (ie. broken) when we implemented the new commander packets and subsystem. the existing implementation was a hack and was not very usable: the reset part was one of the big problem.

I see two ways to get carefree mode back:
- We could make a new generic commander packet for it. The commander packet could contain a "reset" flag that would reset the heading. The code for this commander packet could just "rotate" roll and pitch setpoint according to the current heading setpoint (the yaw controll loop is pretty good so we can have an accurate idea of the current yaw just accumulating the yaw rate setpoint, I think there is no need to fetch the actual yaw estimate)
- The same calculation could be done in whatever client in which we want carefree mode. This is less practical because it would need to be implemented in each client, but for development it might be easier than starting poking in the Crazyflie firmware. The algorithm could then be ported to a new commander packet.

Changing the front could be easily done by rotating the setpoint.
Post Reply