Logging validAngles resets the cf

All discussions related to the Loco Positioning system
Post Reply
cafeciaojoe
Member
Posts: 83
Joined: Mon Jun 18, 2018 2:37 am

Logging validAngles resets the cf

Post by cafeciaojoe »

Hello.

Looging validAngles in a script or just turnign it on as a logged block in the client resets the crazyflie. Is this a bug with this new variabe?
It has been very handy so far through the LED ring I want to use it in my scripts.

Cheers
PhD Student
RMIT University
School of Design
http://www.cafeciaojoe.com
Image
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Logging validAngles resets the cf

Post by kimberly »

Hi!

I actually was able to verify this as well, and yes the crazyflie gets a hardfault. We don't exactly know why this happens, as this log was part of a pull request done by an external and maybe this one works only for V1. We might remove this due to our current work to stabilize LH.

Could you make an issue on the crayflie firmware repo for this? That will remind us to look at it and remove it if we don't need it anymore.
cafeciaojoe
Member
Posts: 83
Joined: Mon Jun 18, 2018 2:37 am

Re: Logging validAngles resets the cf

Post by cafeciaojoe »

Thanks, rather than start a new issue I thought I would comment on issue 679 instead(https://github.com/bitcraze/crazyflie-f ... issues/679)

Also, if you do git rid of validAngles, I think my code would become clunky.

I am moving to a multi lighthouse setup and want to make sure that the logged stated estimates were made with at least one base station in view.
Here is my code below, you can see that it will become bloated if I use multiple basestations.

Code: Select all

 if 'lighthouse.rawAngle0x' in log_entry[1]:
                        data_1 = log_entry[1]
                        rawAngle0x.append(data_1['lighthouse.rawAngle0x'])
                        rawAngle0x.pop(0)
                        rawAngle1x.append(data_1['lighthouse.rawAngle1x'])
                        rawAngle1x.pop(0)
                        # if you cannot see ANY of the trackers,
                        if rawAngle0x[0] == rawAngle0x[1] and rawAngle1x[0] == rawAngle1x[1]:
                            self.cf_pos_dict[key] = Position(float('nan'), float('nan'), float('nan'))
                            
           if 'stateEstimate.x' in log_entry[1]:
                        # if you can see ANY of the trackers.
                        if rawAngle0x[0] != rawAngle0x[1] or rawAngle1x[0] != rawAngle1x[1]:
                            data_2 = log_entry[1]
                            state_estimate[0] = data_2['stateEstimate.x']
                            state_estimate[1] = data_2['stateEstimate.y']
                            state_estimate[2] = data_2['stateEstimate.z']
                            state_estimate[3] = data_2['stateEstimate.roll']
                            state_estimate[4] = data_2['stateEstimate.pitch']
                            state_estimate[5] = data_2['stateEstimate.yaw']
                            self.cf_pos_dict[key] = Position(state_estimate[0], state_estimate[1], state_estimate[2],
                                                             state_estimate[3], state_estimate[4], state_estimate[5])
validAngles seems like a great way to validate the quality of the state estimate, and much less needs to be logged.
PhD Student
RMIT University
School of Design
http://www.cafeciaojoe.com
Image
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Logging validAngles resets the cf

Post by kimberly »

Hi!

So actually what you are making right now, is exactly what we are currently implementing in the lighthouse implementation but then onboard the crazyflie, see this issue. So there will be actually a new logging variable that indicates that at least one basestation is in sight with the right calib and geo data already.
Post Reply