Arduino code for RTK signal

瀏覽次數:1,399 次
跳到第一則未讀訊息

sven burkart

未讀,
2014年11月6日 上午10:59:252014/11/6
收件者: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

未讀,
2014年11月11日 下午1:26:142014/11/11
收件者: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

未讀,
2014年12月18日 上午9:34:002014/12/18
收件者:swiftnav...@googlegroups.com
yeah code prints out lat, lon distance . distance is realtive distance to base in millimeters

Matteus Andersson

未讀,
2014年12月18日 中午12:02:592014/12/18
收件者: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

未讀,
2014年12月29日 上午9:01:392014/12/29
收件者: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

未讀,
2015年2月26日 晚上8:42:482015/2/26
收件者: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

未讀,
2015年3月8日 晚上8:20:252015/3/8
收件者: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

未讀,
2015年3月14日 凌晨4:19:432015/3/14
收件者: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

未讀,
2015年3月21日 上午8:50:312015/3/21
收件者: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

未讀,
2015年3月24日 凌晨1:00:542015/3/24
收件者:swiftnav...@googlegroups.com
Thanks Matthias! Most appreciated.

Christopher Toney

未讀,
2015年5月1日 凌晨12:01:032015/5/1
收件者:swiftnav...@googlegroups.com
What board should be selected to compile this code on in the Arduino IDE? 

Matthias Schibli

未讀,
2015年5月5日 上午11:07:162015/5/5
收件者:swiftnav...@googlegroups.com
any 32bit board should work. I tried it with the due.

GB

未讀,
2015年6月18日 下午1:15:402015/6/18
收件者: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

未讀,
2015年6月18日 下午2:58:332015/6/18
收件者: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

未讀,
2015年8月27日 晚上8:38:462015/8/27
收件者: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

未讀,
2015年8月28日 上午9:38:592015/8/28
收件者:swiftnav-discuss
Couldn't you just use a cast?

GB

未讀,
2015年8月28日 上午11:29:352015/8/28
收件者:swiftnav-discuss
OK, I'm able to read those other values now!

Peter S

未讀,
2017年7月19日 下午3:28:132017/7/19
收件者: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á

未讀,
2018年10月23日 下午5:09:402018/10/23
收件者:swiftnav-discuss
Does anyone still have these codes? The download links are broke.

Thank you
回覆所有人
回覆作者
轉寄
0 則新訊息