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;
}
}
}
Thanks!