access to piksi positioning data

2,380 views
Skip to first unread message

Garrick Paskos

unread,
Jul 10, 2014, 10:27:20 AM7/10/14
to swiftnav...@googlegroups.com
Hi all.

I'm sorry if this question has been already answered somewhere.

Basically I'm just making sure i'm going the right way about accessing positioning data from the piksi -- in either single or RTK mode.

I saw on the wiki there's a tute for C++ with some basic single board computer, but it seemed a bit complicated.

Then i tried the libswiftnav-python, but the documentation didn't make it easy to understand which functions to call to get positioning data.

If anyone can provide some additional simplified sample code for accessing positioning data, that would be greatly appreciated.

Also, I noticed by running the console.py in the piksi_firmware/script folder, files such as position,baseline,velocity_log...csv are created and seem to have some data...

Is this how people are going about extracting positioning data from the piksi (i.e. reading the last line of those files)? Or is this going to be too delayed and these files are just meant to be used as log files.

I need to access the data relatively quickly so I can use it with ROS (robot operating system). I think I read a few people are developing a ROS driver for the piksi. Anyone have any updates on that?

Thanks in advance if anyone can help me with these questions.

Niels Laukens

unread,
Jul 11, 2014, 7:55:40 AM7/11/14
to Garrick Paskos, swiftnav-discuss
On Thu, Jul 10, 2014 at 4:27 PM, Garrick Paskos <gp8...@gmail.com> wrote:
Basically I'm just making sure i'm going the right way about accessing positioning data from the piksi -- in either single or RTK mode.
... 
If anyone can provide some additional simplified sample code for accessing positioning data, that would be greatly appreciated.

You don't give much information on your specific environment. Under Linux (and most Unixes), you can just open the emulated serial port (ttyUSB0 in my case), and the position data comes streaming in by itself. By default it's in the Swiftnav Binary protocol (documentation on the wiki), but you can reconfigure it to do NMEA (which is text based and more standard, but doesn't do RTK).

Niels

Garrick Paskos

unread,
Jul 11, 2014, 9:33:43 AM7/11/14
to swiftnav...@googlegroups.com, gp8...@gmail.com
Thanks for the reply Niels.

I'm using ubuntu 12.04 and it comes up under /dev/ttyUSB0 and i can cat /dev/ttyUSB0 and i get jibberish, so it must be outputting in SBP.

I wish I could set it to NMEA because there's a ROS driver for such gpss but i need it in RTK mode.

If I run the console.py and make sure it's all set up right and outputting solutions, is there any script that simply reads /dev/ttyUSB0 and gets the position solutions? I'm assuming SBP probably output some other things, like signal integrity and used satellites and such, but i really only need the positioning data.

If anyone could help me with this it would be greately appreciated.

Cheers, Garrick.

Niels Laukens

unread,
Jul 11, 2014, 2:33:47 PM7/11/14
to Garrick Paskos, swiftnav-discuss
On Fri, Jul 11, 2014 at 3:33 PM, Garrick Paskos <gp8...@gmail.com> wrote:
I'm using ubuntu 12.04 and it comes up under /dev/ttyUSB0 and i can cat /dev/ttyUSB0 and i get jibberish, so it must be outputting in SBP.

Or you didn't set the correct baud-rate; but either way, you'll see gibberish. 


If I run the console.py and make sure it's all set up right and outputting solutions, is there any script that simply reads /dev/ttyUSB0 and gets the position solutions? I'm assuming SBP probably output some other things, like signal integrity and used satellites and such, but i really only need the positioning data.

If anyone could help me with this it would be greately appreciated.

You know that the piksi is a development board, not a full solution. To quote from the datasheet:
> With these tools developers can quickly move from prototyping software on a desktop to running it standalone on the Piksi hardware.

But you are in luck: I've written a pair of perl scripts. The first one sets up the serial port and hex-dumps the messages; the second one parses the hex-dumps into human readable text. These scripts are meant as a learning and debugging tool, but from what you describe, they're close to what you are looking for, but they will need modifications! (And I'm not planning on doing free development work) If you are still interested, I can post these to the list (after some minor cleanup)

Garrick Paskos

unread,
Jul 13, 2014, 8:35:31 PM7/13/14
to swiftnav...@googlegroups.com, gp8...@gmail.com
Hi Niels.

Sorry for the late reply.

I wasn't aware the piksi is a development board as opposed to a full product.

Our university (The University of Western Australia) purchased a pair for some final year student robotics projects. I'm doing one of these where RTK accurate GPS readings will be extremely useful. Here's the blog of our project if you are interested: http://uwaagvc.blogspot.com.au/

If you could post those perl scripts you have written we will be extremely grateful.

If you don't have time to clean them up, don't worry. We can work on them and post them back here with your permission. Just having something to give us hints at using the SBP will be extremely helpful.

We understand this will be your code and we'll credit you for it in anything that requires it.

Thank you for your time.

Niels Laukens

unread,
Jul 14, 2014, 3:01:04 AM7/14/14
to Garrick Paskos, swiftnav-discuss
On Mon, Jul 14, 2014 at 2:35 AM, Garrick Paskos <gp8...@gmail.com> wrote:
Our university (The University of Western Australia) purchased a pair for some final year student robotics projects.

I think the piksi's make a great tool for final year projects. Especially since they're development boards, they can be tuned to various needs.

 
If you could post those perl scripts you have written we will be extremely grateful.

If you don't have time to clean them up, don't worry. We can work on them and post them back here with your permission. Just having something to give us hints at using the SBP will be extremely helpful.

We understand this will be your code and we'll credit you for it in anything that requires it.

I've licensed them under 3-clause BSD, so you hereby have that permission (and a lot more permissions as well). Feel free to send pull-requests with updates.
The documentation of SBP is here: http://docs.swift-nav.com/wiki/SwiftNav_Binary_Protocol   (PS: the documentation about the CRC is WRONG: it claims that the preamble is included, while it is not.)

The dumper-script opens the port given as parameter, configures it for piksi-use, and attempts to read piksi messages (taking care of framing). It will output SBP-messages one per line, with timestamp, in hexdump.
The parser-script takes this hexdump input, and tries to decode the messages it can, ignoring the rest. It does not (currently) decode the baseline (RTK) messages, since I don't have example data to test it, but adding this should be straightforward.


Niels

Colin Beighley

unread,
Jul 14, 2014, 1:56:06 PM7/14/14
to Niels Laukens, Garrick Paskos, swiftnav-discuss
Thanks for catching the error in the SBP wiki page about the CRC including the preamble, Niels. I've fixed this.



--
You received this message because you are subscribed to the Google Groups "swiftnav-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftnav-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fergus Noble

unread,
Jul 14, 2014, 4:27:38 PM7/14/14
to Colin Beighley, Niels Laukens, Garrick Paskos, swiftnav-discuss
Hi,

In case anyone is interested I just made a quick demo of how you could implement a simple script to decode baseline messages in python, using the libraries we have available. It only requires a few lines of code.


Fergus

--
Fergus Noble

CTO, Swift Navigation Inc.
1155 Indiana St.
San Francisco, CA 94107

James

unread,
Jul 25, 2014, 10:27:01 AM7/25/14
to swiftnav...@googlegroups.com, co...@swift-nav.com, niels....@innovatie.vrt.be, gp8...@gmail.com
Hi,

I am using the sbp_example.py script that you provided, and I was able to get it working fairly easily. Now I am trying to access the velocity in the NED directions, but the values I'm getting are the same as the NED positions, which I know isn't right. I believe the code I'm posting below should return the position and velocity:

b = sbp.BaselineNED(data)

v = sbp.VelNED(data)


print "%.4f,%.4f,%.4f,%.4f,%.4f,%.4f" % \

      (b.n * 1e-3, b.e * 1e-3, b.d * 1e-3, v.n * 1e-3, v.e * 1e-3, v.d * 1e-3 )

Garrick Paskos

unread,
Aug 12, 2014, 6:00:46 AM8/12/14
to swiftnav...@googlegroups.com, co...@swift-nav.com, niels....@innovatie.vrt.be, gp8...@gmail.com
Hi,

Thanks Fergus for the python code.  It has been really helpful and works great.

Some of the other students in my lab want to use the piksi, but in c++.  Any chance of likewise example?  They are finding the C libraries quite unwieldy and don't wish to purchase the discovery board promoted in the integration example.


Also, James:
I had a look at your problem (if you're still having it, seeing as your post is dated a couple of weeks ago).  It looks as though the callback function, baseline_callback(data), is only called by link when it recognizes a BASELINE_NED style message.  data is of baselineNED flavour.

In other words, I'm looking at the line:

link.add_callback(sbp.SBP_BASELINE_NED, baseline_callback)

And if you want your code to work, you'll have to add the line:

link.add_callback(sbp.SBP_VEL_NED, velocity_callback)

And write another callback function for when a velocityNED message is received.



Cheers,

Garrick

Colin Beighley

unread,
Aug 12, 2014, 1:53:32 PM8/12/14
to Garrick Paskos, swiftnav-discuss, Niels Laukens
Hey Garrick,

We could create another version of the Piksi Integration Tutorial (http://docs.swift-nav.com/wiki/Piksi_Integration_Tutorial) that uses the C libraries, but instead of using a microcontroller/UART as the example host uses Linux/virtual com ports.. Would this be helpful for your students?

Colin

Sam Thomas

unread,
Aug 13, 2014, 12:52:21 AM8/13/14
to swiftnav...@googlegroups.com, gp8...@gmail.com, niels....@innovatie.vrt.be
I would love a tutorial on this! I am about to start trying to access corrected llh from the piksi with python. An example script for libswiftnav-python would be ideal.
 
Cheers,
 
Sam
Message has been deleted

Colin Beighley

unread,
Aug 15, 2014, 3:12:25 PM8/15/14
to Sam Thomas, swiftnav-discuss, Garrick Paskos, Niels Laukens
Hey Sam,

So it sounds like what you're interested in is receiving SBP messages in Python, not C++?

When you say it works when you use the Piksi Console, but not the Python script, are you using the application from download.swift-nav.com? In order to run the Python Console from source or use the Python source to receive messages from Piksi, you'll need to run through the steps in the guide: http://docs.swiftnav.com/wiki/HOW-TO:_Running_the_Piksi_Console_from_source.

Let me know if that answers your questions,
Colin


On Tue, Aug 12, 2014 at 10:53 PM, Sam Thomas <samthoma...@gmail.com> wrote:
Also I'm not sure what I am doing wrong but I am getting a "No such file or directory" error when running the above example python script when it tries to open the serial on ttyUSB0.  I can connect using the console though.

Sam Thomas

unread,
Aug 15, 2014, 3:23:30 PM8/15/14
to swiftnav...@googlegroups.com
Hey Colin!

I have the example python code working no problem now. Did a reboot and it worked straight up so I deleted my previous post. Thanks though!

I think a tutorial on using the c library would be great. I think I am going to need the speed of c.

Thanks for all your hard work!

Colin Beighley

unread,
Aug 15, 2014, 3:56:14 PM8/15/14
to Sam Thomas, swiftnav-discuss
Noted - I'll try to set aside some time to create a demo for receiving SBP messages in C on a Linux host.


Sam Thomas

unread,
Aug 15, 2014, 4:44:58 PM8/15/14
to swiftnav...@googlegroups.com
Nice one. Thanks Colin.

Sam Thomas

unread,
Aug 29, 2014, 2:02:33 AM8/29/14
to swiftnav...@googlegroups.com
Anybody had any luck reading and parsing the data in C on linux? I'm stuck as.

Niels Laukens

unread,
Aug 29, 2014, 4:09:22 AM8/29/14
to Sam Thomas, swiftnav-discuss
On Fri, Aug 29, 2014 at 8:02 AM, Sam Thomas <samthoma...@gmail.com> wrote:
Anybody had any luck reading and parsing the data in C on linux? I'm stuck as.

I haven't done it in C under linux, but I have a working set of perl-scripts under linux that listens to the serial port, parses SBP and outputs it to "human" readable format. I'm confident that this can be easily translated to C. Perl scripts can be found here: https://github.com/VRT-onderzoek-en-innovatie/piksi-scripts

Niels

Sam Thomas

unread,
Aug 29, 2014, 4:14:26 AM8/29/14
to swiftnav...@googlegroups.com
Thanks Niels. I'll have a crack at it tomorrow!

Garrick Paskos

unread,
Sep 1, 2014, 5:27:09 AM9/1/14
to swiftnav...@googlegroups.com
Hi Sam.

If you can get a C or C++ callback function for the data, such as in NED form working i'd greatly appreciate it if you could post it on this forum.

I thought I would be right just having it in python, but now looks like i'm going to need it in C++ =(

Thanks for all the help guys.

Kevin D'Souza

unread,
Sep 16, 2014, 9:28:25 AM9/16/14
to swiftnav...@googlegroups.com
Hi Sam,

I am working on hooking the Piksi to a BeagleBone Black. Its connected via FTDI USB right now. 
U need to make changes to the sbp.h and sbp.c as g++ will give u errors for typedef statements. 

I managed to build main.c without any errors past "sbp_setup()",

Working on fifo_read now.

Sam Thomas

unread,
Sep 16, 2014, 10:24:38 PM9/16/14
to swiftnav...@googlegroups.com
Nice one.

I have a my c code parsing sbp now! I used the Piksi Integration Tutorial and just changed fifo_read() and UART_Setup().

Kevin D'Souza

unread,
Sep 17, 2014, 1:25:38 AM9/17/14
to swiftnav...@googlegroups.com
The C Code worked fine right from start. My Application is based in C++ as we use Classes a lot for the wireless framework. And porting the alreadt ready Xbee Stacks will just be a headache so we are using the lib with g++ instead oc gcc.

Joe Auchter

unread,
Oct 28, 2014, 4:46:36 PM10/28/14
to swiftnav...@googlegroups.com, samthoma...@gmail.com
Hello Colin,

I also need to receive SBP messages in C (or C++) on a Linux host, over USB. Have you had a chance to put together the demo you mentioned?

Thank you,
Joe

Colin Beighley

unread,
Oct 28, 2014, 4:50:03 PM10/28/14
to Joe Auchter, swiftnav-discuss, Sam Thomas
Hey Joe,

I believe Sam Thomas got this working. Sam, would you be interested in sharing your work with Joe?

Colin

Sam Thomas

unread,
Oct 28, 2014, 5:08:11 PM10/28/14
to swiftnav...@googlegroups.com, joe.a...@gmail.com, samthoma...@gmail.com
No problem! I'll email it through in a bit.

Andrew Carp

unread,
Feb 7, 2015, 12:03:04 PM2/7/15
to swiftnav...@googlegroups.com, joe.a...@gmail.com, samthoma...@gmail.com
Hello! I'm currently attempting to use C code to parse the Piksi GPS data on a linux machine. If I could possibly see a copy of this work, I'd very much appreciate it!

Andrew

Kevin D'Souza

unread,
Feb 7, 2015, 1:24:32 PM2/7/15
to Andrew Carp, swiftnav...@googlegroups.com, joe.a...@gmail.com, samthoma...@gmail.com
so where are you stuck?

--
You received this message because you are subscribed to a topic in the Google Groups "swiftnav-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swiftnav-discuss/mfBn9L4UcJY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swiftnav-discu...@googlegroups.com.

Andrew Carp

unread,
Feb 7, 2015, 3:18:39 PM2/7/15
to Kevin D'Souza, swiftnav...@googlegroups.com, joe.a...@gmail.com, samthoma...@gmail.com
I'm not necessarily stuck, just trying to use the integration tutorial code to read the data from the GPS directly to a Linux machine without the use of the discovery board.

From what it looks like, I'll need to change the uart_setup such that the gps communicates over usb, not uart. Not sure what else I need to change besides that though. I was hoping I could peek at somebody else's code/process to give me more of a picture of reading over usb directly to linux.

Kevin D'Souza

unread,
Feb 7, 2015, 3:22:06 PM2/7/15
to Andrew Carp, Joe Auchter, swiftnav...@googlegroups.com, samthoma...@gmail.com

U just need to modify the fifo_read and decompose it every time data comes on ur UART buffer. I don't have access to my codebase, but I can share it on Monday.

Jared Korinko

unread,
Feb 15, 2015, 4:28:01 PM2/15/15
to swiftnav...@googlegroups.com, andre...@gmail.com, joe.a...@gmail.com, samthoma...@gmail.com
Hi there, just wondering if i could get a peek at that code base as well! The discovery board option will work for my team but I am more interested in getting the USB data first.

Thanks!

Connor Cunningham

unread,
Feb 20, 2015, 4:55:18 PM2/20/15
to swiftnav...@googlegroups.com, joe.a...@gmail.com, samthoma...@gmail.com
Hi Sam,

I'm in a similar position to Joe - it would be much appreciated if you could email me the demo for receiving SBP messages in C or C++ on a Linux host.  Thanks for your help!

- Connor


On Tuesday, October 28, 2014 at 5:08:11 PM UTC-4, Sam Thomas wrote:

mi...@bfo.co.uk

unread,
Feb 20, 2015, 6:47:19 PM2/20/15
to swiftnav...@googlegroups.com, joe.a...@gmail.com, samthoma...@gmail.com
I have some code I'm working one which is rough, but is reading messages from the Piksi in C on Linux/Mac. I'm actually trying to read from two devices at once (both connected via USB) and relay the observational messages from one to the other - not tested yet but basic comms seems to be working.

Code is below, no apologies or explanations to accompany it as it is a work in progress and trimmed out from my larger project, however it does compile and run and give correct output. Compiling with something like "gcc -I../include/libswiftnav -fstack-protector-all -std=gnu99 -D_GNU_SOURCE -Wall -g example.c ../build/src/libswiftnav-static.a -lm", and #define MAC if you're on OSX, or not if you're on Linux.


I do have some questions as a result, most of which stem from trying to connect to two devices at once.

1. There is a sbp_state_set_io_context method, but no corresponding getter.

2. Unless I'm mistaken, there is no way to identify which sbp_state_t the message originated from in a callback? I am given the sender_id, which is nice except I don't have any way to identify which state that corresponds to without digging around inside the structure. And I am given the option of passing in a context, which is fine except the context is associated with the sbp_msg_callbacks_node_t, which means I need to create one of those for each {sender,messagetype} tuple. In short, I can associate an IO context with the sbp_state_t, but I have no practical way to retrieve that context in the message handler.

3. the libswiftnav has datestructures and constants for only a few of the message types - if I want to relay packed_obs messages (for example) from one unit to another, or report on the tracking status, I have to cut and paste vast amounts of structures and boilerplate from the firmware packages. I hope this is on the to-do list to fix for a subsequent revision.

4. There is a routine to convert from gps_time_t to sbp_gps_time_t, but not the other way around. If you're going to have a method that converts FROM gps_time_t TO sbp_gps_time_t, calling it sbp_make_gps_time is perhaps a bit backwards, no? Yes, it took me 20 minutes to figure out what was going on and yes, I'm still smarting a little :-)

Other than that it seems fairly easy to work with the C API directly. Gory example follows.



#include <stdio.h>

#include <string.h>

#include <sbp.h>

#include <sbp_messages.h>

#include <sbp_messages.h>

#include <sbp_utils.h>

#include <nav_msg.h>

#include <gpstime.h>

#include <unistd.h>

#include <fcntl.h>

#include <termios.h>

#include <stdint.h>

#include <sys/ioctl.h>

#include <sys/time.h>

#ifdef MAC

#include <IOKit/serial/ioss.h>

#else

#include <linux/serial.h>

#endif



// Simple per-connection context

typedef struct {

    int fd;

    char *path;

} context_t;


// State of the SBP message parser.

// Must be statically allocated.

//

sbp_state_t sbp_state;

context_t mycontext;


// Structs that messages from Piksi will feed.

sbp_pos_llh_t      pos_llh;

sbp_baseline_ned_t baseline_ned;

sbp_vel_ned_t      vel_ned;

sbp_dops_t         dops;

sbp_gps_time_t     gps_time;

sbp_heartbeat_t    heartbeat;


// SBP callback nodes must be statically allocated. Each message ID / callback

// pair must have a unique sbp_msg_callbacks_node_t associated with it.

//

sbp_msg_callbacks_node_t pos_llh_node;

sbp_msg_callbacks_node_t baseline_ned_node;

sbp_msg_callbacks_node_t vel_ned_node;

sbp_msg_callbacks_node_t dops_node;

sbp_msg_callbacks_node_t gps_time_node;

sbp_msg_callbacks_node_t heartbeat_node;


u32 serialread(u8 *buf, u32 n, void* context) {

    context_t ctx = *(context_t *)context;

    return read(ctx.fd, buf, n);

}


u32 serialwrite(u8 *buf, u32 n, void* context) {

    context_t ctx = *(context_t *)context;

    u32 orig = n;

    while (n) {

        ssize_t v = write(ctx.fd, buf, n);

        if (v < 0) {

            return v;

        }

        buf += v;

        n -= v;

    }

    return orig;

}


/*

 * Callback functions to interpret SBP messages.

 * Every message ID has a callback associated with it to

 * receive and interpret the message payload.

 */

void sbp_pos_llh_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    pos_llh = *(sbp_pos_llh_t *)msg;

    printf("{\"type\":\"absolution position\", \"sender\":%d, \"latitude\":%1.10f, \"longitude\":%1.10f, \"altitude\":%1.10f, \"numsatellites\":%d}\n", sender_id, pos_llh.lat, pos_llh.lon, pos_llh.height, pos_llh.n_sats);

}


void sbp_baseline_ned_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    baseline_ned = *(sbp_baseline_ned_t *)msg;

    printf("{\"type\": \"baseline ned mm\", \"sender\": %d, \"north\":%d \"east\":%d, \"down\":%d}\n", sender_id, (int)baseline_ned.n, (int)baseline_ned.e, (int)baseline_ned.d);

}


void sbp_vel_ned_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    vel_ned = *(sbp_vel_ned_t *)msg;

    printf("{\"type\":\"velocity ned mm/s\", \"sender\":%d, \"north\":%d, \"east\":%d, \"down\":%d}\n", sender_id, (int)vel_ned.n, (int)vel_ned.e, (int)vel_ned.d);

}


void sbp_dops_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    dops = *(sbp_dops_t *)msg;

    printf("{\"type\":\"dilution of precision\", \"sender\":%d, \"gdop\":%1.2f, \"hdop\":%1.2f, \"pdop\":%1.2f, \"tdop\":%1.2f, \"vdop\":%1.2f}\n", sender_id, (float)dops.gdop/100, (float)dops.hdop/100, (float)dops.pdop/100, (float)dops.tdop/100, (float)dops.vdop/100);

}


void sbp_gps_time_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    gps_time = *(sbp_gps_time_t *)msg;

    gps_time_t out;

    out.tow = (float)gps_time.tow / 1e3;

    out.wn = gps_time.wn;

    time_t now = gps2time(out);

    printf("{\"type\":\"gps time\", \"sender\":%d, \"week\":%d, \"seconds\":%d, \"unix\":%lld}\n", sender_id, (int)gps_time.wn, (int)((float)gps_time.tow / 1e3), (unsigned long long)now);

}


void sbp_heartbeat_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    heartbeat = *(sbp_heartbeat_t *)msg;

    printf("{\"type\":\"heartbeat\", \"sender\":%d, \"flags\":%d}\n", sender_id, heartbeat.flags);

}


/*

 * Set up SwiftNav Binary Protocol (SBP) nodes; the sbp_process function will

 * search through these to find the callback for a particular message ID.

 *

 * Example: sbp_pos_llh_callback is registered with sbp_state, and is associated

 * with both a unique sbp_msg_callbacks_node_t and the message ID SBP_POS_LLH.

 * When a valid SBP message with the ID SBP_POS_LLH comes through the UART, written

 * to the FIFO, and then parsed by sbp_process, sbp_pos_llh_callback is called

 * with the data carried by that message.

 */

void sbp_setup(sbp_state_t *sbp_state, context_t *context) {

    // SBP parser state must be initialized before sbp_process is called.

    sbp_state_init(sbp_state);

    sbp_state_set_io_context(sbp_state, context);

    // Register a node and callback, and associate them with a specific message ID.

    sbp_register_callback(sbp_state, SBP_HEARTBEAT, &sbp_heartbeat_callback, NULL, &heartbeat_node);

    sbp_register_callback(sbp_state, SBP_GPS_TIME, &sbp_gps_time_callback, NULL, &gps_time_node);

    sbp_register_callback(sbp_state, SBP_POS_LLH, &sbp_pos_llh_callback, NULL, &pos_llh_node);

    sbp_register_callback(sbp_state, SBP_BASELINE_NED, &sbp_baseline_ned_callback, NULL, &baseline_ned_node);

    sbp_register_callback(sbp_state, SBP_VEL_NED, &sbp_vel_ned_callback, NULL, &vel_ned_node);

    sbp_register_callback(sbp_state, SBP_DOPS, &sbp_dops_callback, NULL, &dops_node);

}


int openSerial(char *path, speed_t baud) {

    printf("Opening %s\b\n", path);

    int fd = open(path, O_RDONLY | O_NOCTTY);

    struct termios toptions;

    bzero(&toptions, sizeof(toptions));


    if (tcgetattr(fd, &toptions) < 0) {

        perror("tcgetattr");

        return -1;

    }

    toptions.c_cflag = CRTSCTS | CS8 | CLOCAL | CREAD;

    toptions.c_iflag = IGNPAR;

    toptions.c_oflag = 0;

    toptions.c_lflag = 0;

#ifndef MAC

    struct serial_struct ss; 

    ioctl(fd, TIOCGSERIAL, &ss); 

    ss.flags = (ss.flags & ~ASYNC_SPD_MASK) | ASYNC_SPD_CUST;

    ss.custom_divisor = ss.baud_base / baud; 

    ioctl(fd, TIOCSSERIAL, &ss);

#endif

    cfsetispeed(&toptions, B38400);

    cfsetospeed(&toptions, B38400);

    toptions.c_cc[VMIN]     = 5;   // blocking read until 1 char received

    toptions.c_cc[VTIME]    = 0;   // inter-character timer unused

    tcflush(fd, TCIFLUSH);

    if (tcsetattr(fd, TCSANOW, &toptions) < 0) {

        perror("tcsetattr");

        return -1;

    }

#ifdef MAC 

    ioctl(fd, IOSSIOSPEED, &baud);

#endif

    return fd;

}


int main(int argc, char **argv) {

    mycontext.path = argv[1];

    mycontext.fd = openSerial(argv[1], 1000000);

    sbp_setup(&sbp_state, &mycontext);



    while (1) {

        sbp_process(&sbp_state, &serialread);

    }

}.

Clive Turvey

unread,
Feb 20, 2015, 10:08:13 PM2/20/15
to swiftnav...@googlegroups.com
>>2. Unless I'm mistaken, there is no way to identify which sbp_state_t the message originated from in a callback? I am given the sender_id, which is nice except I don't have any way to identify which state that corresponds to without digging around inside the structure. And I am given the option of passing in a context, which is fine except the context is associated with the sbp_msg_callbacks_node_t, which means I need to create one of those for each {sender,messagetype} tuple. In short, I can associate an IO context with the sbp_state_t, but I have no practical way to retrieve that context in the message handler.


Couldn't you just register sbp_state as the context instead of the NULL?
sbp_register_callback(sbp_state, SBP_HEARTBEAT, &sbp_heartbeat_callback, NULL, &heartbeat_node);

This is the context passed into the callback, and not the same as io_context

mi...@bfo.co.uk

unread,
Feb 21, 2015, 4:36:09 AM2/21/15
to swiftnav...@googlegroups.com
On Saturday, February 21, 2015 at 3:08:13 AM UTC, Clive Turvey wrote:
Couldn't you just register sbp_state as the context instead of the NULL?
sbp_register_callback(sbp_state, SBP_HEARTBEAT, &sbp_heartbeat_callback, NULL, &heartbeat_node);
This is the context passed into the callback, and not the same as io_context

Yes, that would do it.

I've now tested with two units and have a question.

I'm trying to relay the observations from one unit to the other over USB. I can see from the Piksi console that the messages of type 0x40 are the ones sent over the radio between units ("uart uarta sbp message mask" is 64 in the console), and I can see that those messages should be relayed over USB to ("uart ftdi sbp message mask" is 65535 in the console). However I never see a message of type 0x40 over USB. I do get loads of 0x45 message, which I'm relaying like this:

sbp_register_callback(sbp_state, 0x45, &sbp_packed_obs_callback, NULL, &packed_ops_node);


void sbp_packed_obs_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    sbp_state_t *otherunit = sender_id == sbp_state1.sender_id ? &sbp_state2 : &sbp_state1;

    sbp_send_message(otherunit, 0x45, sender_id, len, msg, &serialwrite);

}


u32 serialwrite(u8 *buf, u32 n, void* context) {

    context_t ctx = *(context_t *)context;

    u32 orig = n;

    while (n) {

        ssize_t v = write(ctx.fd, buf, n);

        if (v < 0) {

            return v;

        }

        buf += v;

        n -= v;

    }

    return orig;

}


However I never get a SBP_BASELINE_NED message from either unit.

What am I doing wrong?


Cheers... Mike
 

Clive Turvey

unread,
Feb 21, 2015, 8:12:30 AM2/21/15
to swiftnav...@googlegroups.com
It's a mask, (0x45 & 0x40) == TRUE

And (x & 0xFFFF) is valid for all values 1 thru 65535, but not zero

mi...@bfo.co.uk

unread,
Feb 26, 2015, 6:18:41 AM2/26/15
to swiftnav...@googlegroups.com
Doh, of course it's a mask - I was having a stupid moment.

Turns out the only thing I was doing wrong was being impatient - waited for a while (quite a while) and started to get baseline observations, not fixed yet but that's not an issue with the code. So I'll post it here for posterity and in case it helps someone - this is a complete example to dump some SBP messages to console on Mac or Linux, and optionally relay the observations between two PIksis plugged in via USB. Most of it lifted shamelessly form the original Piksi tutorial. Thanks for your help Clive.

// Simple example to display SBP messages from Piksi on Linux or Mac,

// and optionally relay observations from one Piksi to another over USB

//

// To relay observations, both Pikis should be plugged in via USB and

// the path to both units should be passed in as arguments, along with

// the baud rate.

//

// To compile on Mac, #define MAC



#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <sbp.h>

#include <sbp_messages.h>

#include <sbp_utils.h>

#include <nav_msg.h>

#include <gpstime.h>

#include <unistd.h>

#include <fcntl.h>

#include <termios.h>

#include <stdint.h>

#include <sys/ioctl.h>

#include <sys/time.h>

#ifdef MAC

#include <IOKit/serial/ioss.h>

#else

#include <linux/serial.h>

#endif



// Simple per-connection context

typedef struct {

    int fd;

    char *path;

} context_t;


// State of the SBP message parser.

// Must be statically allocated.

//

sbp_state_t sbp_state1, sbp_state2;

context_t context1, context2;


// Structs that messages from Piksi will feed.

sbp_pos_llh_t      pos_llh;

sbp_baseline_ned_t baseline_ned;

sbp_vel_ned_t      vel_ned;

sbp_dops_t         dops;

sbp_gps_time_t     gps_time;

sbp_heartbeat_t    heartbeat;


// SBP callback nodes must be statically allocated. Each message ID / callback

// pair must have a unique sbp_msg_callbacks_node_t associated with it.

//

sbp_msg_callbacks_node_t pos_llh_node;

sbp_msg_callbacks_node_t baseline_ned_node;

sbp_msg_callbacks_node_t vel_ned_node;

sbp_msg_callbacks_node_t dops_node;

sbp_msg_callbacks_node_t gps_time_node;

sbp_msg_callbacks_node_t heartbeat_node;

sbp_msg_callbacks_node_t packed_ops_node;


u32 serialread(u8 *buf, u32 n, void* context) {

    context_t ctx = *(context_t *)context;

    return read(ctx.fd, buf, n);

}


u32 serialwrite(u8 *buf, u32 n, void* context) {

    context_t ctx = *(context_t *)context;

    u32 orig = n;

    while (n) {

        ssize_t v = write(ctx.fd, buf, n);

        if (v < 0) {

            return v;

        }

        buf += v;

        n -= v;

    }

    return orig;

}


/*

 * Callback functions to interpret SBP messages.

 * Every message ID has a callback associated with it to

 * receive and interpret the message payload.

 */

void sbp_pos_llh_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    pos_llh = *(sbp_pos_llh_t *)msg;

    printf("{\"type\":\"absolution position\", \"sender\":%d, \"latitude\":%1.10f, \"longitude\":%1.10f, \"altitude\":%1.10f, \"numsatellites\":%d}\n", sender_id, pos_llh.lat, pos_llh.lon, pos_llh.height, pos_llh.n_sats);

}


void sbp_baseline_ned_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    baseline_ned = *(sbp_baseline_ned_t *)msg;

    // Note - I'm only really in fixed NED position. Report floating NED to show we're getting signal

    if (baseline_ned.flags & 1) {

        // Fixed

        printf("{\"type\":\"baseline ned mm\", \"sender\":%d, \"north\":%d \"east\":%d, \"down\":%d}\n", sender_id, (int)baseline_ned.n, (int)baseline_ned.e, (int)baseline_ned.d);

    } else {

        // Floating

        printf("{\"type\":\"baseline ned mm\", \"sender\":%d}\n", sender_id);

    }

}


void sbp_vel_ned_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    vel_ned = *(sbp_vel_ned_t *)msg;

    printf("{\"type\":\"velocity ned mm/s\", \"sender\":%d, \"north\":%d, \"east\":%d, \"down\":%d}\n", sender_id, (int)vel_ned.n, (int)vel_ned.e, (int)vel_ned.d);

}


void sbp_dops_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    dops = *(sbp_dops_t *)msg;

    printf("{\"type\":\"dilution of precision\", \"sender\":%d, \"gdop\":%1.2f, \"hdop\":%1.2f, \"pdop\":%1.2f, \"tdop\":%1.2f, \"vdop\":%1.2f}\n", sender_id, (float)dops.gdop/100, (float)dops.hdop/100, (float)dops.pdop/100, (float)dops.tdop/100, (float)dops.vdop/100);

}


void sbp_gps_time_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    gps_time = *(sbp_gps_time_t *)msg;

    gps_time_t out;

    out.tow = (float)gps_time.tow / 1e3;

    out.wn = gps_time.wn;

    time_t now = gps2time(out);

    printf("{\"type\":\"gps time\", \"sender\":%d, \"week\":%d, \"seconds\":%d, \"unix\":%lld}\n", sender_id, (int)gps_time.wn, (int)((float)gps_time.tow / 1e3), (unsigned long long)now);

}


void sbp_heartbeat_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    heartbeat = *(sbp_heartbeat_t *)msg;

    printf("{\"type\":\"heartbeat\", \"sender\":%d, \"flags\":%d}\n", sender_id, heartbeat.flags);

}


void sbp_packed_obs_callback(u16 sender_id, u8 len, u8 msg[], void *context) {

    printf("{\"type\":\"packed obs\", \"sender\":%d, \"length\":%d}\n", sender_id, len);

    // Relay this message from one unit to another

    if (context2.fd) {

        sbp_state_t *other = sender_id == sbp_state1.sender_id ? &sbp_state2 : &sbp_state1;

        sbp_send_message(other, 0x45, sender_id, len, msg, &serialwrite);

    }

}


/*

 * Set up SwiftNav Binary Protocol (SBP) nodes; the sbp_process function will

 * search through these to find the callback for a particular message ID.

 *

 * Example: sbp_pos_llh_callback is registered with sbp_state, and is associated

 * with both a unique sbp_msg_callbacks_node_t and the message ID SBP_POS_LLH.

 * When a valid SBP message with the ID SBP_POS_LLH comes through the UART, written

 * to the FIFO, and then parsed by sbp_process, sbp_pos_llh_callback is called

 * with the data carried by that message.

 */

void sbp_setup(sbp_state_t *sbp_state, context_t *context) {

    // SBP parser state must be initialized before sbp_process is called.

    sbp_state_init(sbp_state);

    sbp_state_set_io_context(sbp_state, context);

    // Register a node and callback, and associate them with a specific message ID.

    sbp_register_callback(sbp_state, SBP_HEARTBEAT, &sbp_heartbeat_callback, NULL, &heartbeat_node);

    sbp_register_callback(sbp_state, SBP_GPS_TIME, &sbp_gps_time_callback, NULL, &gps_time_node);

    sbp_register_callback(sbp_state, SBP_POS_LLH, &sbp_pos_llh_callback, NULL, &pos_llh_node);

    sbp_register_callback(sbp_state, SBP_BASELINE_NED, &sbp_baseline_ned_callback, NULL, &baseline_ned_node);

    sbp_register_callback(sbp_state, SBP_VEL_NED, &sbp_vel_ned_callback, NULL, &vel_ned_node);

    sbp_register_callback(sbp_state, SBP_DOPS, &sbp_dops_callback, NULL, &dops_node);

    sbp_register_callback(sbp_state, 0x45, &sbp_packed_obs_callback, NULL, &packed_ops_node);

}


int openSerial(char *path, speed_t baud) {

    printf("Opening %s\b\n", path);

    int fd = open(path, O_RDWR | O_NOCTTY);

    struct termios toptions;

    bzero(&toptions, sizeof(toptions));


    if (tcgetattr(fd, &toptions) < 0) {

        perror("tcgetattr");

        return -1;

    }

    toptions.c_cflag = CRTSCTS | CS8 | CLOCAL | CREAD;

    toptions.c_iflag = IGNPAR;

    toptions.c_oflag = 0;

    toptions.c_lflag = 0;

#ifndef MAC

    struct serial_struct ss; 

    ioctl(fd, TIOCGSERIAL, &ss); 

    ss.flags = (ss.flags & ~ASYNC_SPD_MASK) | ASYNC_SPD_CUST;

    ss.custom_divisor = ss.baud_base / baud; 

    ioctl(fd, TIOCSSERIAL, &ss);

#endif

    cfsetispeed(&toptions, B38400);

    cfsetospeed(&toptions, B38400);

    toptions.c_cc[VMIN]     = 5;   // blocking read until 5 chars received

    toptions.c_cc[VTIME]    = 0;   // inter-character timer unused

    tcflush(fd, TCIFLUSH);

    if (tcsetattr(fd, TCSANOW, &toptions) < 0) {

        perror("tcsetattr");

        return -1;

    }

#ifdef MAC 

    ioctl(fd, IOSSIOSPEED, &baud);

#endif

    return fd;

}


int main(int argc, char **argv) {

    if (argc < 3) {

        printf("Usage: test <baudrate> <tty1> [<tty2>]\n");

    }

    int baud = atoi(argv[1]);

    context1.path = argv[2];

    context1.fd = openSerial(argv[2], baud);

    sbp_setup(&sbp_state1, &context1);

    if (argc > 3) {

        context2.fd = openSerial(argv[3], baud);

        context2.path = argv[3];

        sbp_setup(&sbp_state2, &context2);

    }


    while (1) {

        sbp_process(&sbp_state1, &serialread);

        if (context2.fd) {

            sbp_process(&sbp_state2, &serialread);

        }

    }
}

Daniel Merling

unread,
Apr 22, 2015, 12:19:26 PM4/22/15
to swiftnav...@googlegroups.com
Hello!

I have some questions regarding your code.

I tried your example and it works well but there is something which bothers me. If I use it with real data (one or two chips) or in simulation mode I have a problem:
- When I start the program it won't print anything. I have to start the GUI (the console from the piksi firmware) while my program is running and close it immediately. Then the program starts to print the data in the terminal (terminal from QtCreator).

Another problem/question concerns the position data in RTK mode.
- If I print the flag in my pos callback (ecef or pll) which states if I get SPP or RTK data I get alternating 0 and 1 (in simulation mode). So it prints my position data with flag 0 then it prints my position data and flag 1 (same sender id) but these two positions dont match (which is fine in my opinion but why do I still get the SPP Data?). With real data (one chip) I only get 0 (more about that in my next question).
- If I use only one chip SPP works fine. I get the 0 flag and the position. Everything as expected. My problem is that I want to use two chips and the RTK mode. With the GUI I managed to establish a fixed RTK mode (although it was very unstable) but I wasn't able to get these data with the program. The flag was constantly 0. How does the RTK mode work? Do I just have to connect the two chips with USB on my computer and then wait for about 15 min and they will establish RTK eventually when they get enough satelites and then I can get these data with this Code or do I have to something like triggering the communication between the two chips in my code (is this the purpose of sbp_send_message(...)?)

I want to use these Chips in RTK mode without the GUI from the piksi firmware. So just connect the two chips, start my script and read the data. Is this even possible?

I hope you can help me, guys!

Greetings

Clive Turvey

unread,
Apr 22, 2015, 2:00:00 PM4/22/15
to swiftnav...@googlegroups.com
I think using the term Receiver(s) will be less confusing than the term Chip(s). Each Piksi receiver incorporates several silicon chips (ICs), and chips has a different meaning in the GPS context.

The GUI is not part of the Piksi Firmware, the firmware is free standing and exists within the receiver, it does not require PC or USB connectivity to function. The receivers just need to be powered, and have radio connectivity, they will attempt to enter RTK mode.

Daniel Merling

unread,
Apr 23, 2015, 4:39:24 AM4/23/15
to swiftnav...@googlegroups.com
My mother language isn't englisch so I apologize for mixing up some terms.

And thank you for your answer!
Ok, I was talking about the console .../piksi_firmware/script/console.py (http://docs.swift-nav.com/wiki/HOW-TO:_Running_the_Piksi_Console_from_source). It's just a bit confusing that I can't get the data with the C++ programm unless I start this console.

I think I read somewhere that it can take up to 12 minutes to get the receivers into RTK mode?

Do you know the purpose of the sbo_send_message method? What can be achieved with sending data manually between the two receivers?

Clive Turvey

unread,
Apr 23, 2015, 10:45:56 AM4/23/15
to swiftnav...@googlegroups.com
No problem, it just came over awkwardly.

Not sure you need to run the console to get access to the SBP stream via USB/VCP (nominally 1 mbaud as I recall). Streams are also available via secondary UART outputs, UART A typically for radios, with a mask set to keep traffic to base position and observations messages (of this receiver, base/rover designation somewhat arbitrary).

Sending SBP would generally come down to configuration, but could also be used for sending time, position, ephemeris and almanac data, or network sourced observation from the other receiver.

Yes, it can take a significant amount of time to resolve the ambiguities, depending on a consistent lock and measurements from a common group of satellites (>=5).

Regards,
-Clive

Roy

unread,
Apr 24, 2015, 7:54:13 AM4/24/15
to swiftnav...@googlegroups.com
Hey

so today I managed to establish a stable connection between the two receiver and I got the baseline data even in fixed RTK mode (in the GUI). In the "solution"-tab however there was only the SPP-Solution displayed RTK-Solution stayed empty the whole time.
Is there a difference between fixed RTK Baseline and the RTK-Solution? I thought that once I get a fixed RTK baseline I will receive the RTK-Solution.

And I want to thank you again for your help! Pretty awesome!

sam.hes...@gmail.com

unread,
May 5, 2015, 4:22:27 PM5/5/15
to swiftnav...@googlegroups.com
Hey Sam,

I am working on something very similar, would it be possible to see your python code? I will credit you in anything i use it in! 

thanks!

-Sam

Colin Beighley

unread,
May 5, 2015, 4:27:12 PM5/5/15
to Roy, swiftnav-discuss
Hey Roy,

In order to get an RTK Solution, you have to specify the base station position in the Settings Tab of the Piksi Console with the base station Piksi attached.

Colin

--

Roy

unread,
May 5, 2015, 4:40:05 PM5/5/15
to swiftnav...@googlegroups.com, daniel...@gmail.com
Thank you for your answer!
I found that option too but I was kinda confused because you have to insert the position of the base station manually by typing it in.
I mean the base station as a GPS receiver should get its own position, shouldn't it? So why isn't it possible that the base station send its own determined position?

Clive Turvey

unread,
May 5, 2015, 4:58:05 PM5/5/15
to swiftnav...@googlegroups.com
Cause it going to do an awful job at it.

If you want something with 10cm accuracy, you'd better start by knowing something to 1cm, not 100cm

Roy

unread,
May 5, 2015, 5:13:42 PM5/5/15
to swiftnav...@googlegroups.com
Okay that makes sense but to determine the position of the base station I nevertheless have to rely on the data the receiver provides. For example the average value of some returned points.

Another maybe stupid generell question, with this given position and the fixed rtk baseline data the more accurate rtk position is calculated, isn't it? So if I dont have fixed baseline data it will work nonetheless but it won't be that accurate, right?

And thanks for your help guys! Appreciate it a lot!

Clive Turvey

unread,
May 5, 2015, 6:37:23 PM5/5/15
to swiftnav...@googlegroups.com
The length of the baseline is a relative/vector thing, it's fixed in an instant the measurements are made, it doesn't care what the latitude, longitude, altitude of the base are. If you need to know the rover "location" with any amount of accuracy, it becomes very important.

The mean position, either as an average, or least-squares, is useless. You just get to observe the inherent error in the solution/receiver. It's not how you determine position to 1cm, it's how you get close to 100cm.


Clive Turvey

unread,
May 5, 2015, 6:48:07 PM5/5/15
to swiftnav...@googlegroups.com
The centre of the plot is the truth location, I could run this test for months, it would never get the average into the centre.
ublox_002.jpg

Sam Thomas

unread,
May 6, 2015, 1:24:21 AM5/6/15
to swiftnav...@googlegroups.com
Hey Sam!

I am using c for my project but Fergus has a great example for python here https://gist.github.com/fnoble/8b1b12a1d15b26c5546a

Roy

unread,
May 6, 2015, 4:38:12 AM5/6/15
to swiftnav...@googlegroups.com
Jeah but how do I determine the "exact" position of the basestation? The default coordinates for long, lat, alt are 0,0,0 so this doesn't work obviously. I mean do I have to rely e.g. google maps and find the position and with that the "exact" coordinates?
Message has been deleted

Clive Turvey

unread,
May 6, 2015, 9:24:03 AM5/6/15
to swiftnav...@googlegroups.com
No, you survey the location, using either a local CORS, or via an antenna placed over a mapping monument/marker of known location.
https://groups.google.com/forum/#!topic/swiftnav-discuss/iqinfzJq3Fs

Absent the tools and equipment, you could use a local land surveyor.

You could use Google Maps to some extent but there is often a lot of distortion based on the camera path, and height, certainly wouldn't recommend for centimetre level work.

The relative frame works if you don't need to share information, and the base in your system remains fix.

Sam Thomas

unread,
May 15, 2015, 10:57:49 PM5/15/15
to swiftnav...@googlegroups.com
Hey Everyone,

I have had success reading POS_LLH from the piksi over USB on linux. I am not trying to do the exact same thing over UART. 
I have changed the mask on the piksi UART to the same as USB just to be sure.

If I cat /dev/ttyO1 I get a terminal full of garbage as you would expect so I think my RX TX connections are right.

The only thing I have modified in my working code from reading USB is the device name and baud rate.
My code is below. Does anyone know what I would have to change to read UART? I thought I wouldn't have to change anything.

// Serial setup
int serial_setup(char* port, int baud)
{
fd = open(port, O_RDONLY | O_NOCTTY);

if (fd == -1)
{
return -1;
}

struct termios toptions;
bzero(&toptions, sizeof(toptions));

toptions.c_cflag = baud | CS8 | CLOCAL | CREAD;
toptions.c_iflag = IGNPAR;
toptions.c_oflag = 0;
toptions.c_lflag = 0;

cfsetispeed(&toptions, baud);
cfsetospeed(&toptions, baud);
toptions.c_cc[VMIN] = 5;
toptions.c_cc[VTIME] = 0;
tcflush(fd, TCIFLUSH);

return 0;
}

// Read serial
u32 read_serial(u8 *buf, u32 n, void* context)
{
return read(fd, buf, n);
}

// Setup peripherals
rc = serial_setup("/dev/ttyO1", B115200);
if (rc == -1) {
fprintf(stderr, "Unable to connect to GPS\n");
exit(EXIT_FAILURE);
}



On Friday, 11 July 2014 00:27:20 UTC+10, Garrick Paskos wrote:
Hi all.

I'm sorry if this question has been already answered somewhere.

Basically I'm just making sure i'm going the right way about accessing positioning data from the piksi -- in either single or RTK mode.

I saw on the wiki there's a tute for C++ with some basic single board computer, but it seemed a bit complicated.

Then i tried the libswiftnav-python, but the documentation didn't make it easy to understand which functions to call to get positioning data.

If anyone can provide some additional simplified sample code for accessing positioning data, that would be greatly appreciated.

Also, I noticed by running the console.py in the piksi_firmware/script folder, files such as position,baseline,velocity_log...csv are created and seem to have some data...

Is this how people are going about extracting positioning data from the piksi (i.e. reading the last line of those files)? Or is this going to be too delayed and these files are just meant to be used as log files.

I need to access the data relatively quickly so I can use it with ROS (robot operating system). I think I read a few people are developing a ROS driver for the piksi. Anyone have any updates on that?

Thanks in advance if anyone can help me with these questions.

Sam Thomas

unread,
May 15, 2015, 11:20:17 PM5/15/15
to swiftnav...@googlegroups.com
 I am *now* trying to do the exact same thing over UART.

Benjamin Wagner

unread,
Nov 16, 2015, 10:07:17 AM11/16/15
to swiftnav-discuss, joe.a...@gmail.com, samthoma...@gmail.com
Hey guys,

I am working with a Swiftnav Piksi board as well and stumbled across this forum thread. Is there any way I could get the C++ parsing code you were talking about here. I am trying to create a ROS node, for a senior design project, for the piksi that allows for cm level accuracy and I am a beginner so I can you all the help I can get :P

Cheers
Ben


On Tuesday, October 28, 2014 at 5:08:11 PM UTC-4, Sam Thomas wrote:
No problem! I'll email it through in a bit.

On Wednesday, 29 October 2014 06:50:03 UTC+10, Colin Beighley wrote:
Hey Joe,

I believe Sam Thomas got this working. Sam, would you be interested in sharing your work with Joe?

Colin
On Tue, Oct 28, 2014 at 1:46 PM, Joe Auchter <joe.a...@gmail.com> wrote:
Hello Colin,

I also need to receive SBP messages in C (or C++) on a Linux host, over USB. Have you had a chance to put together the demo you mentioned?

Thank you,
Joe

On Friday, August 15, 2014 2:56:14 PM UTC-5, Colin Beighley wrote:
Noted - I'll try to set aside some time to create a demo for receiving SBP messages in C on a Linux host.
On Fri, Aug 15, 2014 at 12:23 PM, Sam Thomas <samthoma...@gmail.com> wrote:
Hey Colin!

I have the example python code working no problem now. Did a reboot and it worked straight up so I deleted my previous post. Thanks though!

I think a tutorial on using the c library would be great. I think I am going to need the speed of c.

Thanks for all your hard work!
--
You received this message because you are subscribed to the Google Groups "swiftnav-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftnav-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages