Arduino code for RTK signal

1,398 vistas
Ir al primer mensaje no leído

sven burkart

no leída,
6 nov 2014, 10:59:25 a.m.6/11/14
para swiftnav...@googlegroups.com
as i could read in those threads a lot of people liked to get an arduino code for decoding rtk signals

try this out
this code decodes rtk signal (base is 0,0)

sketch_oct24a.ino

Matthias Schibli

no leída,
11 nov 2014, 1:26:14 p.m.11/11/14
para swiftnav...@googlegroups.com
I don't have the whole overview yet...

what I want is the relative distance (or actually the direction of the vector) between the two piksi units (lat,lon, height). what else would I need, besides the piksi set and and arduino? 
seems like your code prints out lat,lon distance (lines 69,70). 

thanks for the sketch!


sven burkart

no leída,
18 dic 2014, 9:34:00 a.m.18/12/14
para swiftnav...@googlegroups.com
yeah code prints out lat, lon distance . distance is realtive distance to base in millimeters

Matteus Andersson

no leída,
18 dic 2014, 12:02:59 p.m.18/12/14
para swiftnav...@googlegroups.com
This code looks perfect for my project, thanks!

If i connect my piksi to my arduino due, and run your code, then will i work? 
Dont i need run a lot of other things before even piksi works? And yes i am a bit of a noob, but im very glad for answers ;) 

sven burkart

no leída,
29 dic 2014, 9:01:39 a.m.29/12/14
para swiftnav...@googlegroups.com
if you connect the one piksi to RX2 and TX2 on your arduino due and to ground and 5V on the arduione it will work. with your serial monitor you can see your positions in mm from base.
connect your second piksi to a computer. it depends on your spot where your working, if you are on a flat area without mountains it will work quick. i live in switzerland high up in the mountains, and i've got a lot of troubles with gps traking due to hug rocks surrounding my place.

Adam Coates

no leída,
26 feb 2015, 8:42:48 p.m.26/2/15
para swiftnav...@googlegroups.com
Hi Sven,

Thanks for sharing the code for BASELINE NED on Arduino, most appreciated.

I have been trying to convert the code for decoding POS LLH, but my programming skills are severely lacking. I was doing alright until i had to alter the bit shift function to deal with 8 bytes, then my brain just gave up.

Would it possible for you to write a sketch for POS LLH?

Donald Choi

no leída,
8 mar 2015, 8:20:25 p.m.8/3/15
para swiftnav...@googlegroups.com
Thanks for sharing your code sven.
However, I cannot implement your code. It display nothing on the Serial Monitor.
I have tried to display the "inByte", the reading from UART port is fine but I cannot find any standard code, e.g. 0x55 for Preamble or "0x03" "0x02" for baseline result.
Do you have any idea how to read the incoming message byte by byte?

Matteus Andersson

no leída,
14 mar 2015, 4:19:43 a.m.14/3/15
para swiftnav...@googlegroups.com
Hi! Im quite a noob but i got Svens code working so I´ll tell you how I did.
First i put piksi i Simulation mode (and saved to flash, read the piksi integration tutorial if you don't know how to do this) 
Then i conected 
Piksi UART B (RX) ---> Arduino due (TX2)
Piksi UART B (TX) ---> Arduino due (RX2)
Then I uploaded the code and it worked! (actually took me 3 days to find out that RX goes to TX, and vise versa) :) 

My settings for UARTB in piksi console are: (think its also the default settings)
Mode: SBP
Sbp message mask: 65280
Configure telemetry radio on boot: TRUE
Baudrate: 115200

Hope it was for some help! Next ting will be to get it work outside with simulation mode off.

Matthias Schibli

no leída,
21 mar 2015, 8:50:31 a.m.21/3/15
para swiftnav...@googlegroups.com
Hey Adam,

based on Svens sketch (thanks very much!!), I included Lat/Lon. Have a look, hope it helps. 

Matt
onlyserial.ino

Adam Coates

no leída,
24 mar 2015, 1:00:54 a.m.24/3/15
para swiftnav...@googlegroups.com
Thanks Matthias! Most appreciated.

Christopher Toney

no leída,
1 may 2015, 12:01:03 a.m.1/5/15
para swiftnav...@googlegroups.com
What board should be selected to compile this code on in the Arduino IDE? 

Matthias Schibli

no leída,
5 may 2015, 11:07:16 a.m.5/5/15
para swiftnav...@googlegroups.com
any 32bit board should work. I tried it with the due.

GB

no leída,
18 jun 2015, 1:15:40 p.m.18/6/15
para swiftnav...@googlegroups.com
Hi Folks --

How would you add to this code to include reading the flag in SBP if the piksi had RTK fix or not?

How about sending the piksi a reset message?

Thanks!

Clive Turvey

no leída,
18 jun 2015, 2:58:33 p.m.18/6/15
para swiftnav...@googlegroups.com
byte_msg[26] should contain the RTK flags for the MSG_BASELINE_NED (0x0203) it's decoding

To send messages you're going to need to compose an SBP message in a byte array, then compute the CRC, and write() the bytes to the serial stream

GB

no leída,
27 ago 2015, 8:38:46 p.m.27/8/15
para swiftnav-discuss
Thanks Clive and Sven.
 
It looks like I would need to add a function to convert Bytes2IntU8 to get this value and some others I am interested in. Could either of you help me with that code? I don't have much experience with that kind of conversion.
 
Sven has already written Bytes2intU32 and Bytes2intU16 as follows:
 
// convert 2 bytes to int
int Bytes2Intu16 (int b2, int b1)
{
    int result=0;
    result=(b2<<8) | b1;
    return result;
}
 
signed long Bytes2Intu32 (unsigned char b4, unsigned char b3, unsigned char b2, unsigned char b1)
{
    signed long result=0;
    result=((signed long)b4 << 24) | ((signed long)b3<<16) | ((signed long)b2<<8) | b1;
    return result;
}
 
 
Thanks!

Clive Turvey

no leída,
28 ago 2015, 9:38:59 a.m.28/8/15
para swiftnav-discuss
Couldn't you just use a cast?

GB

no leída,
28 ago 2015, 11:29:35 a.m.28/8/15
para swiftnav-discuss
OK, I'm able to read those other values now!

Peter S

no leída,
19 jul 2017, 3:28:13 p.m.19/7/17
para swiftnav-discuss
Hello all, 

I have been working hard to get my Piksi integrated with my Arduino Due. I am interested in reading the pseudo-absolute Latitude and Longitude of my rover Piksi over UART. I have been able to read in and print a stream of bytes with the code posted by Sven, however, I only ever receive one full message. By which I mean that I see many 0x55 preamble bytes followed by 2 bytes (almost always 0 then 1) and then two more bytes and then what should be a length indicator byte, and then another 0x55! 

Shouldn't there be a payload of the length indicated by the 6th byte and a CRC before the next 0x55? Sometimes it sends even less (examples in the attached spreadsheet). Also the message types are almost always 0 and then 1, and 0x0001 isn't listed as a message type in the SBP documentation. Even when I do receive a complete message (with Sven's code) it's message type is a 5 and then a 2, and 0x0502 isn't defined either. 

When trying the code posted by Matthias, I was optimistic about it having just the features I needed, but when attempting to print the incoming bytes, I get jibberish with lots of little squares. It also doesn't print anything for the specific messages (NED, LatLon, etc.) even when I remove the line to print all incoming bytes. 

My hardware setup is just my laptop connected to the Arduino Due which has its TX2 and RX2 connected to a SparkFun logic level converter on the low voltage side. On the high voltage side it connects to the Piksi. The Piksi is powered by and communicates with the same laptop so I can view the status. The base Piksi is standard (Piksi, antenna, radio, power supply). 

Any help is much appreciated! 
UART Signal Sample.xlsx
sketch_oct24a.ino
onlyserial.ino

Tiago Sá

no leída,
23 oct 2018, 5:09:40 p.m.23/10/18
para swiftnav-discuss
Does anyone still have these codes? The download links are broke.

Thank you
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos