Lighthouse positioning questions

Discussions related to positioning systems where the position is calculated outside the Crazyflie and sent to the device using radio, including MoCap systems
Post Reply
jamador
Beginner
Posts: 3
Joined: Mon Apr 29, 2019 2:22 pm

Lighthouse positioning questions

Post by jamador » Thu Jun 06, 2019 11:25 am

Hi,

I have some questions about the lighthouse positioning system:

1) I only want to use the system to get a more accurate pose avoiding the use of expensive systems (OptiTrack, etc). In my case, I understand (reading https://wiki.bitcraze.io/doc:lighthouse:index) that I only need two Base Station 1.0 and a VIVE controller/Tracker (is this last really necessary?) plus CF lighthouse decks. I want to mount a more or less 3x3x3 meters testbed, I need additional cables or some tool?

2) I need POSE, not only position. Do you know aprox the date that this feature could be implemented?

3) What is the precision in the obtained pose using this system?

4) Can Crazyswarm package work with lighthouse deck? Perhaps using "none" in the "motion_capture_type" of the crazyswarm_server node?

This is not a important question but, Do you know why the lighthouse deck need to use a FPGA? probably the POSE calc need an high burden in a microcontroller?

Thank you in advance!!



arnaud
Bitcraze
Posts: 2024
Joined: Tue Feb 06, 2007 12:36 pm

Re: Lighthouse positioning questions

Post by arnaud » Fri Jun 07, 2019 8:07 am

Hi,

I can answer in order:
1) This is correct that you need 2 lighthouse base station V1 and one tracker or controller. The tracker is required to setup the system geometry (ie. find the base-station pose), eventually this could be done with only a Crazyflie and the tracker will not be required anymore. If the base-station do not see each-other you might also want to have a synchronization cable between the base-station. Though, for 3x3m wireless optical synchronization should not be a problem.

2) The Crazyflie is estimating its full pose using an EKF and its IMU. The Lighthouse system only provides position but we could have the pose already: we get the individual position of all 4 sensors. The current Crazyflie EKF does not support full-pose sensors though so this is the main reason we do not feed the full pose yet.

3) We observe less than 1mm of relative accuracy. We still have to perform better measurement but the absolute accuracy seems to be within +/-10cm over the tracked space. The error is constant: in our ICRA demo we sample the position of the landing pad at take-off and we are able to come back to the same point later with a precision much better than 10cm. We are currently working on calibrating the system which should allow to get closer to millimeter precision over the tracked space.

4) Yes this is correct, lighthouse will appear very much like an LPS system to Crazyswarm and using 'none' as motion_capture_type will work.

As for the FPGA, the main reason to have it instead of a MCU is for Lighthouse base station V2 support: with V1 you only need the timing of the pulses and so a simple MCU timer is enough to acquire the signal but V2 encodes the synchronization in the laser beam. Since this is still very experimental, putting an FPGA on the board make it more likely that we will be able to decode the fast signals. This FPGA is very small and will not help very much for computation unfortunately, it is there for signal acquisition.

jamador
Beginner
Posts: 3
Joined: Mon Apr 29, 2019 2:22 pm

Re: Lighthouse positioning questions

Post by jamador » Wed Aug 14, 2019 10:17 am

Hi,

thanks for your answer. Finally I bought the LH system and it works great. Congratulations for your work!

Now I want to implement the orientation estimation using LH. I have alredy tested the transformation optimization out of the crazyflie, now I want to code the crazyflie-firmware with it and i would like to understand better the code of crazyflie.

Looking for in the code, I arrived to lighthouse.c where I found the function that calculates the drone position using the four IR positions:

Code: Select all

static void estimatePosition(pulseProcessorResult_t angles[]) {
  memset(&ext_pos, 0, sizeof(ext_pos));
  int sensorsUsed = 0;
  float delta;

  // Average over all sensors with valid data
  for (size_t sensor = 0; sensor < PULSE_PROCESSOR_N_SENSORS; sensor++) {
      if (angles[sensor].validCount == 4) {
        lighthouseGeometryGetPosition(lighthouseBaseStationsGeometry, (void*)angles[sensor].correctedAngles, position, &delta);

        deltaLog = delta;

        ext_pos.x -= position[2];
        ext_pos.y -= position[0];
        ext_pos.z += position[1];
        sensorsUsed++;

        positionCount++;
      }
  }

  ext_pos.x /= sensorsUsed;
  ext_pos.y /= sensorsUsed;
  ext_pos.z /= sensorsUsed;

  // Make sure we feed sane data into the estimator
  if (!isfinite(ext_pos.pos[0]) || !isfinite(ext_pos.pos[1]) || !isfinite(ext_pos.pos[2])) {
    return;
  }
  ext_pos.stdDev = 0.01;
  estimatorEnqueuePosition(&ext_pos);
}
I understand that "estimatorEnqueuePosition" function is the function that 'send' the data to the EKF, or the current estimator. My question is: Can I simply implement the orientation calc in this function and use "estimatorEnqueuePose" instead to 'send' the pose data to the estimator?

arnaud
Bitcraze
Posts: 2024
Joined: Tue Feb 06, 2007 12:36 pm

Re: Lighthouse positioning questions

Post by arnaud » Thu Aug 15, 2019 9:15 am

Hi,

This is correct, the code you copied is the part of the code that average sensors position to feed the EKF. You could implement a more clever algorithm there to calculate the pose and push it to the EKF with estimatorEnqueuePose which has been newly added by Wolfgang.

This would be a great improvement so please keep us updated of your progress :).

Post Reply