Page 1 of 1

Logging validAngles resets the cf

Posted: Fri Feb 05, 2021 6:50 am
by cafeciaojoe

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.


Re: Logging validAngles resets the cf

Posted: Fri Feb 05, 2021 9:33 am
by kimberly

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.

Re: Logging validAngles resets the cf

Posted: Sat Feb 06, 2021 10:53 pm
by cafeciaojoe
Thanks, rather than start a new issue I thought I would comment on issue 679 instead( ... 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]
                        # 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.

Re: Logging validAngles resets the cf

Posted: Mon Feb 08, 2021 12:35 pm
by kimberly

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.