Hi all,
This might be a very simple question, but how/where can I get the current position as estimated by the crazyflie?
I need to print this over the serial port about every second, and I'm getting kind of lost in the kalman filter.
(ps. I'm using the loco uwb deck for the positioning)
Thanks!
Get position crazyflie for output uart
-
- Bitcraze
- Posts: 630
- Joined: Tue Jun 30, 2015 7:47 am
Re: Get position crazyflie for output uart
Hi!
I think the easiest way to do this is to create an app in the firmware. You can find some (still very few) examples in https://github.com/bitcraze/crazyflie-f ... 9/examples. This way you will not have to modify the firmware and your app will be easy to port to new releases of the firmware.
The push demo should be a good starting point and inspiration.
This https://github.com/bitcraze/crazyflie-f ... ush.c#L112 shows how to read a log variable. The current position estimate is available as log variables here https://github.com/bitcraze/crazyflie-f ... #L637-L640
The UARTs are available in https://github.com/bitcraze/crazyflie-f ... ce/uart1.h and uart2.h. If you search for uart1Init you will find a bunch of examples of how they are used elsewhere.
I think the easiest way to do this is to create an app in the firmware. You can find some (still very few) examples in https://github.com/bitcraze/crazyflie-f ... 9/examples. This way you will not have to modify the firmware and your app will be easy to port to new releases of the firmware.
The push demo should be a good starting point and inspiration.
This https://github.com/bitcraze/crazyflie-f ... ush.c#L112 shows how to read a log variable. The current position estimate is available as log variables here https://github.com/bitcraze/crazyflie-f ... #L637-L640
The UARTs are available in https://github.com/bitcraze/crazyflie-f ... ce/uart1.h and uart2.h. If you search for uart1Init you will find a bunch of examples of how they are used elsewhere.
Re: Get position crazyflie for output uart
Thanks! That is exactly what I needed.
I am still having one other is now though, I'm also trying to get the positions of the anchors, but calling the locoDeckGetAnchorPosition like this seems o make the software crash. The the console repeats ESTKALMAN: state out of bounds, resetting. Why does retrieving the anchor positions make the kalman filter crash?
I am still having one other is now though, I'm also trying to get the positions of the anchors, but calling the locoDeckGetAnchorPosition like this seems o make the software crash. The the console repeats ESTKALMAN: state out of bounds, resetting. Why does retrieving the anchor positions make the kalman filter crash?
Code: Select all
point_t point;
for(uint8_t id = 0; id < 7; id++)
{
if(locoDeckGetAnchorPosition(id,&point))
{
DEBUG_PRINT(" id returned true ");
}
}
-
- Bitcraze
- Posts: 630
- Joined: Tue Jun 30, 2015 7:47 am
Re: Get position crazyflie for output uart
Hi!
Could you please post this as a new thread to avoid multiple questions in one thread?
Could you please post this as a new thread to avoid multiple questions in one thread?