Dear Customers,

The PolySync Support Center is now just for submitting tickets to our support team. All articles and tutorials have been moved to the new PolySync Help Center and the content below will be removed shortly.

Thank you,
The PolySync Team

C and C++ examples

PolySync ships with an extensive C and C++ API that you can use to quickly prototype applications. Sometimes it helps to have some examples, so we've included a variety for you to try.

Before you can clone the example application repositories you will need to install git. If you intend to build C++ examples you will also need to install cmake.

$ sudo apt-get install git cmake
$ git clone # clones C++ examples $ git clone # clones C examples

 For instructions on how to build applications, see the guides:


C++ Tutorials

C++ Example Description
Hello World Supporting code for the Hello World tutorial. Learn to create a node and manage node-level events.
Hello World publisher
Hello World subscriber
Supporting code for the Hello World with two nodes tutorial. Learn how to publish and subscribe to messages on the PolySync bus.


Core APIs

C++ Example C Example Description
 Publish / Subscribe  Publish / Subscribe Publish and subscribe to a PolySync communications bus.
 Get / Set Get / Set Request and print all parameters on the PolySync bus.
 Node Template Node Template Understand the standardized PolySync node state machine.
 Coordinate Transformation Coordinate Transformation Use the Transform API to transform coordinate frames using a stack.
  Logfile Writer Use the Logfile API routines to log a PolySync byte array message.

Data Model

C Example
 Custom data model   Use publish/subscribe routines with a user data model message type.

Device APIs

C++ Example C Example Description
Socket Reader Socket Reader Read data from a network device.
Socket Writer Socket Writer Write data to a network device.
Serial Reader Serial Reader Read data from a serial device.
Serial Writer Serial Writer Write data to a serial device.
CAN Reader CAN Reader Read data from a CAN device.
CAN Writer CAN Writer Write data to a CAN device.
Video device with encode/decode Video device with encode/decode Communicate with a video device, encode, and decode video data.

Utilities and cool stuff

C++ Example C Example Description
Data Generator Data Generator Generate data by publishing messages to the PolySync bus

Record Control

Replay Control

Record and Replay Control Use the Record and Replay API to instruct nodes which logfiles to write or read
  Viewer Lite A lightweight 2D data viewer using OpenGL.
Image Data Viewer Image Data Viewer View compressed image data over the PolySync bus.
Shared memory image data viewer Shared memory image data viewer View image data received over the PolySync shared memory queue.
  Joystick vehicle control Use a USB joystick to send low-level control commands.
Parameter Get/Set Parameter Get/Set Get and set parameter values from parameter IDs

Community projects

C++ Example   Description
ROS-PolySync bridge node   Bridge PolySync messages into a ROS runtime. Requires PolySync V1.X.
Lane detector   A simple lane detector using OpenCV. Requires PolySync V1.X.
Have more questions? Submit a request


Please sign in to leave a comment.