Inverted X and Y geometry data [SOLVED]

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
cafeciaojoe
Member
Posts: 83
Joined: Mon Jun 18, 2018 2:37 am

Inverted X and Y geometry data [SOLVED]

Post by cafeciaojoe »

The title of this thread has been changed to reflect the actual problem, which was that the lighthouses were mounted upside down. (ie hanigng down from the ceiling)

Hi everyone,

I am trying to troubleshoot the use of motion commander py scripts with the lighthouse system.

Setup.

CF2.1 latest firmware,
latest cfclient on mac os 10.14
latest cflib
version 1 base stations

I have...
- obtained calibration data and hard coded it into lighthouse_core.c
- flashed the firmware using the following line in the config.mk file (which sits in tools/make)
CFLAGS += -DDISABLE_LIGHTHOUSE_DRIVER=0
- obtained the geometry data, checked to see if twas reasonable and written it to ram using get_bs_geometry.py --write
- observed the raw angles x and y from both lighthouses, moving around on the plotter tab (as kimberly did in the recent Spiral Swarm Demo) whilst moving the CF around with my hands.

but when i go to run any of the follwoing...
-- autonomous_sequence.py -> the drone lifts then immediately flips out
-- initial_position.py, sbs_motion_commander or position_commander_demo.py -> the drone lifts but travels aggressively backwards and crashes into the celing
-- autonomous_sequence -> sometimes, straight up into the ceiling, somtimes flips....

i have tried
- flying the drone with he controller, does not feel any different to when the deck is not on the board.
- as soon as i hit the trigger for position or alititude hold, it flips out.

Given that I am a begginer at this, I will be doing these two tutorials in the coming days to see if anything comes up.
https://www.bitcraze.io/documentation/r ... ython_api/
https://www.bitcraze.io/documentation/r ... commander/

But just wanted to make sureI am not missing anything for now..

Should these scripts run as they are?
Last edited by cafeciaojoe on Wed Dec 16, 2020 12:46 am, edited 1 time in total.
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: Basic trouble shooting when running motion commander py scripts

Post by kimberly »

Hi!

First of all it would be good to hold the crazyflie in your hand and move it around while observing the state estimate's position in the plotter before doing any flight. That is also what I showed in the tutorial and if this is not correct you shouldn't try flying yet before that is fixed.

Maybe it would be good to force the firmware to only recognize lighthouse 1 sweepangles:

Code: Select all

CFLAGS += -DLIGHTHOUSE_FORCE_TYPE=1
Also be aware that we are doing a lot of changes lately in the firmware to make more things ready for lighthouse v2. It might be saver to use the latest releases on all software and firmware, which should be 2020.09, to make sure that you are not hitting any bleeding edge bugs.
PB_
Beginner
Posts: 7
Joined: Tue Nov 17, 2020 10:35 am

Re: Basic trouble shooting when running motion commander py scripts

Post by PB_ »

Hi,
I don't know if this helps you, but when you checked the geometry data, did you make sure that the axes were not flipped? Coz sometimes I notice that happening to me.
cafeciaojoe
Member
Posts: 83
Joined: Mon Jun 18, 2018 2:37 am

Re: Basic trouble shooting when running motion commander py scripts

Post by cafeciaojoe »

hey PB_ you are right, the X and Y axes are flipped in the geo data, only the Z axis is flipped in the the state estimator.

if the crazyflie reference frame is used, (https://www.bitcraze.io/documentation/r ... finitions/)
and the geo data is read (X,Y,Z) {.origin = {-2.258867, -1.303101, 2.312021, },
when in fact the baste station is +2.2m and +1.3m away on the x and y axes respectively.
IMG_5846.jpg
before i did anything, I placed the drone on the floor got the geo data, flashed the drone, ran the client and screenshot the state estimator. all looks reasonable when I start the client.
pos 0 0 .png
placing the drone (.8, 0, 0) is ok butI get some funny variance of around .2m
pos x.png
placing the drone (0, .8, 0) is ok as well but still get that variance
pos y.png
lifting the drone in the air is a major problem, the state estimator thinkis it is -1.2m
pos z neg.png
Cheers
joe
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: Basic trouble shooting when running motion commander py scripts

Post by kimberly »

This flipping can happen sometimes since the estimation is prone to flip ambiguity so we do have a note in the documentation to always double check this.

Try the geometry script again and check the output if it makes sense. If it does, put those values in the basestation geometry in your crazyflie.
cafeciaojoe
Member
Posts: 83
Joined: Mon Jun 18, 2018 2:37 am

Re: Basic trouble shooting when running motion commander py scripts

Post by cafeciaojoe »

Hello,

The geometry data is consistantly coming in inverted in the X and Y axis. I think i have run that script at least 100 times since flagging this flippig issue.

I have tried:
- inverting the X and Y values for the .origin data,
- inverting the X and Y values for the .origin and .mat data
- swtiching the channels on the basetstations, bthis only changes the order in whcih the geometry data comes in.

thanks for your patience!
PhD Student
RMIT University
School of Design
http://www.cafeciaojoe.com
Image
cafeciaojoe
Member
Posts: 83
Joined: Mon Jun 18, 2018 2:37 am

Re: Inverted X and Y geometry data [SOLVED]

Post by cafeciaojoe »

So the Lighthouses were mounted upside down (ie hanging down from the ceiling). In the past this has not been a problem because I was running the drones through the HTC software.

Thanks again for all of your help.
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: Inverted X and Y geometry data [SOLVED]

Post by kimberly »

Ah yeah, that is also a possible explanation. :P Technically it should be able to handle that but good to know that it doesnt. Happy you were able to find the problem
Post Reply