I am having the same issue here. I have added a config.mk and managed to compile and upload the firmware. I also printed CFLAGS in Makefile to make sure my config.mk was really taking effects. Here is my output after running make:
Code: Select all
$CFLAGS is [-DDISABLE_LIGHTHOUSE_DRIVER=0 ]
$CFLAGS is [-DDISABLE_LIGHTHOUSE_DRIVER=0 ]
CLEAN_VERSION
$CFLAGS is [-DDISABLE_LIGHTHOUSE_DRIVER=0 ]
VTMPL version.c
CC version.o
LD cf2.elf
COPY cf2.hex
COPY cf2.bin
DFUse cf2.dfu
$CFLAGS is [-DDISABLE_LIGHTHOUSE_DRIVER=0 ]
Build for the CF2 platform!
Build 45:9e47ecfe6967 (2020.02 +45) MODIFIED
Version extracted from git
Crazyloader build!
$CFLAGS is [-DDISABLE_LIGHTHOUSE_DRIVER=0 ]
text data bss dec hex filename
200104 4784 109032 313920 4ca40 cf2.elf
and here is my output after running "tools/lighthouse/get_bs_geometry.py --uri radio://0/80/2M"
Code: Select all
Connecting to radio://0/80/2M
Connected to radio://0/80/2M
Reading sensor data...
Traceback (most recent call last):
File "tools/lighthouse/get_bs_geometry.py", line 335, in <module>
sensor_sweeps_all = read_sensors(scf)
File "tools/lighthouse/get_bs_geometry.py", line 94, in read_sensors
with SyncLogger(scf, confs) as logger:
File "/home/taodu/projects/aerial_robots/crazyflie-lib-python/cflib/crazyflie/syncLogger.py", line 113, in __enter__
self.connect()
File "/home/taodu/projects/aerial_robots/crazyflie-lib-python/cflib/crazyflie/syncLogger.py", line 72, in connect
self._cf.log.add_config(config)
File "/home/taodu/projects/aerial_robots/crazyflie-lib-python/cflib/crazyflie/log.py", line 453, in add_config
raise KeyError('Variable {} not in TOC'.format(var.name))
KeyError: 'Variable lighthouse.angle0x not in TOC'
Is there any other reason that could cause this error?
In case this is helpful for debugging: I was using 1 HTC VIVE base stations (this one:
https://www.vive.com/us/accessory/base-station/) and an Ubuntu 18.04 PC. My crazyflie version is 2.1. For the base station, I just plugged in the power adaptor and saw the green light and a 3 x 3 red array on it. I didn't do any setup for the base station on my PC. Did I miss any steps on the hardware side?
---- EDIT ----
I managed to resolve this error by replacing
Code: Select all
#ifndef DISABLE_LIGHTHOUSE_DRIVER
#define DISABLE_LIGHTHOUSE_DRIVER 1
#endif
with
Code: Select all
#ifndef DISABLE_LIGHTHOUSE_DRIVER
#define DISABLE_LIGHTHOUSE_DRIVER 0
#endif
in crazyflie-firmware/src/deck/drivers/src/lighthouse.c. It seems that the macro definition "-DDISABLE_LIGHTHOUSE_DRIVER=0" in my config.mk did not come through, which was a surprise to me because I did print out the value of CFLAGS in Makefile and noticed -DDISABLE_LIGHTHOUSE_DRIVER=0.
----- EDIT2 -----
I think I figured the problem: I first compiled the default firmware then created config.mk for my lighthouse, but I didn't use 'make clean' before I make the new firmware. Once I ran 'make clean' and re-make, everything now works as expected.