How can I send the location information calculated by Roadrunner to my robot

All discussions related to the Loco Positioning system
Post Reply
syylrqd
Beginner
Posts: 5
Joined: Fri Sep 20, 2019 12:01 am

How can I send the location information calculated by Roadrunner to my robot

Post by syylrqd » Fri Sep 20, 2019 12:25 am

Hi:
I am a student,I have three Roadrunners, In my project,I need send the Roadrunner's location information by usart to my roboat car,i have seen
Roadrunner's Schematic. but I don't know how to modify the program.what can i do ?
In addition, I want to ask, how many tags can TWR support?



Thank you.



tobias
Bitcraze
Posts: 1906
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How can I send the location information calculated by Roadrunner to my robot

Post by tobias » Mon Sep 23, 2019 12:17 pm

The Tx, Rx on the green connector are connected to the uart2 on the expansion port, thus you can use the uart2 functions to transfer the data you need. The data I think is easiest to get via the log framework, similar to what is done e.g. here.

You could also have a look at this roadrunner->mavlink implementation.

TWR only supports one tag but it is possible to time multiplex to support more. This we have not tested in a long time and I'm not sure of the state. TDoA supports many tags.

syylrqd
Beginner
Posts: 5
Joined: Fri Sep 20, 2019 12:01 am

Re: How can I send the location information calculated by Roadrunner to my robot

Post by syylrqd » Tue Sep 24, 2019 10:53 am

Hi:
I still can't achieve this function.Can you provide a firmware for uart2 output location information?This function should be used by more and more
people.
Thank you.

tobias
Bitcraze
Posts: 1906
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How can I send the location information calculated by Roadrunner to my robot

Post by tobias » Wed Sep 25, 2019 8:39 am

I can help you with the base but you will have to pack the data in the format you want etc. First have a look at the deck howto. Then below is an untested exmaple I put together

Code: Select all

#define DEBUG_MODULE "RR-DATA"
#include "FreeRTOS.h"
#include "task.h"
#include "debug.h"
#include "system.h"
#include "uart2.h"
#include "log.h"

#include "deck.h"

static struct __attribute__((packed)) rrData_s {
  float posX;
  float posY;
  float posZ;
} rrData;


void rrdataTask(void *param)
{
  int positionXid;
  int positionYid;
  int positionZid;

  systemWaitStart();

  // Setup data to transfer
  positionXid = logGetVarId("stateEstimate", "x");
  positionYid = logGetVarId("stateEstimate", "y");
  positionZid = logGetVarId("stateEstimate", "z");

  TickType_t lastWakeTime = xTaskGetTickCount();

  while (1)
  {
    // Set the loop unlock time in ms
    vTaskDelayUntil(&lastWakeTime, M2T(10));

    // Assemble the data
    rrData.posX = logGetFloat(positionXid);
    rrData.posY = logGetFloat(positionYid);
    rrData.posZ = logGetFloat(positionZid);

    // Send the three floates, byte by byte, to uart2.
    uart2SendDataDmaBlocking(sizeof(rrData), (uint8_t *)(&rrData));
  }
}

static void rrdataInit()
{
  DEBUG_PRINT("Starting position data task writing to uart2\n");

  xTaskCreate(rrdataTask, "RRDATA", configMINIMAL_STACK_SIZE, NULL, /*priority*/1, NULL);

  // Configure uart and set the baud rate
  uart2Init(115200);

}

static bool rrdataTest()
{
  return true;
}

static const DeckDriver rrdataDriver = {
  .name = "rrData",
  .init = rrdataInit,
  .test = rrdataTest,
};

DECK_DRIVER(rrdataDriver);

syylrqd
Beginner
Posts: 5
Joined: Fri Sep 20, 2019 12:01 am

Re: How can I send the location information calculated by Roadrunner to my robot

Post by syylrqd » Fri Sep 27, 2019 7:31 am

Hi:
Now i have one new problem.Roadrunner can't run after I burn the program.The light is not lit.The nrf51822 is locked.So i erase Imageimg]all.now Unlock it.but try use nrfgo studio close down clode_nrf_v1.0.hex nrf_mbs_v1.0.hex,but not work. How can i program program.

tobias
Bitcraze
Posts: 1906
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How can I send the location information calculated by Roadrunner to my robot

Post by tobias » Mon Sep 30, 2019 11:57 am

The roadrunner is basically a Crazyflie 2.1 with a Loco deck so I suggest you check out the Crazyflie 2.1 getting started with development guide.

You probably programmed the STM32 FW to the nrf51? The roadrunner is a bit special and requires some special tags in the nrf51 FW. I have provided the FW you need to flash.

What programmer do you use to program it and how? Tell us all the details.
Attachments
Roadrunner-nrf51-2019.09-FW.zip
Roadrunner nrf51 2019.09 FW
(39.98 KiB) Downloaded 8 times

syylrqd
Beginner
Posts: 5
Joined: Fri Sep 20, 2019 12:01 am

Re: How can I send the location information calculated by Roadrunner to my robot

Post by syylrqd » Tue Oct 08, 2019 1:11 am

I use nRFgo Studio erase all.so my roaderrunner 's nrf52812 don't have MBR,how can i flash MBR.

tobias
Bitcraze
Posts: 1906
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How can I send the location information calculated by Roadrunner to my robot

Post by tobias » Tue Oct 08, 2019 9:21 am

We do it using a JLink programmer with these commands

Code: Select all

loadbin s110_nrf51822_7.0.0_softdevice.bin, 0
loadbin cload_nrf_v1.0_rfx2411n.bin, 0x3A000
loadbin nrf_mbs_roadrunner_v1.1.bin, 0x3F000
loadbin cf2_nrf.bin, 0x16000

syylrqd
Beginner
Posts: 5
Joined: Fri Sep 20, 2019 12:01 am

Re: How can I send the location information calculated by Roadrunner to my robot

Post by syylrqd » Mon Oct 14, 2019 1:45 am

I flash crazyfile 2.0 by windows tool. Now i do as your commond. it still don't work .we want use roaderrunner in crazyfile formation and the roboat car formation.We don't want secondary development,it's so complax,can your company provide the program can provide the position by usart.We just want use it' position formation.I love your company's roadrunner,Its positioning accuracy is particularly good.Thank you.

Post Reply