Tags as Anchors for Swarm Positioning

All discussions related to the Loco Positioning system
Post Reply
Posts: 6
Joined: Thu Jun 28, 2018 12:00 am

Tags as Anchors for Swarm Positioning

Post by snyderthorst » Fri Aug 10, 2018 4:38 pm


I am attempting to implement a system to make the Crazyflies broadcast their own position and avoid each other. I have 10 Crazyflies and the LPS system running well. I was wondering if I could set the LPS tags on the Crazyflies to broadcast their position like the anchors do? Would that be a feasible system for collision avoidance? What would I need to implement and where? I have some guesses like the following function seems like a good place to start (Bottom of locodeck.c):

Code: Select all

void lpsHandleLppShortPacket(const uint8_t srcId, const uint8_t *data, const int length)
  uint8_t type = data[0];

  if (type == LPP_SHORT_ANCHORPOS) {
    if (srcId < LOCODECK_NR_OF_ANCHORS) {
      struct lppShortAnchorPos_s *newpos = (struct lppShortAnchorPos_s*)&data[1];
      algoOptions.anchorPosition[srcId].timestamp = xTaskGetTickCount();
      algoOptions.anchorPosition[srcId].x = newpos->x;
      algoOptions.anchorPosition[srcId].y = newpos->y;
      algoOptions.anchorPosition[srcId].z = newpos->z;
I am using TDoA 2, so I would prefer sticking with that for the time being, but I welcome any ideas or suggestions on implementing this.


Post Reply