#include <ros/ros.h>
#include <ros/console.h>
#include <sensor_msgs/TimeReference.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <signal.h>
#include <cstring>
#include <cerrno>
#include <Poco/Process.h>
#include <Poco/Pipe.h>
#include <Poco/PipeStream.h>
#include <Poco/Format.h>
#include <Poco/StreamCopier.h>
Go to the source code of this file.
Classes | |
struct | shmTime |
Functions | |
static volatile struct shmTime * | get_shmTime (int unit) |
int | main (int argc, char *argv[]) |
static void | memory_barrier (void) |
static void | put_shmTime (volatile struct shmTime **shm) |
static void | sig_handler (int sig) |
static void | time_ref_cb (const sensor_msgs::TimeReference::ConstPtr &time_ref) |
Variables | |
static bool | g_set_date = false |
volatile struct shmTime * | g_shm = NULL |
const long int | NTPD_SHM_BASE = 0x4e545030 |
ROS ntpd driver (via shm)
This node will subscribe to any TimeReference message and sends it's data to ntpd.
Copyright 2014 Vladimir Ermakov. Based on ntpshm.c from gpsd.
Definition in file shm_driver.cpp.
|
static |
Map SHM page
NOTE: this function did not create SHM like gpsd/ntpshm.c
Definition at line 66 of file shm_driver.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 203 of file shm_driver.cpp.
|
inlinestatic |
Memory barrier. unfortunatly we can't use C stdatomic.h So only one option: asm magick
from gpsd compiler.h
Definition at line 122 of file shm_driver.cpp.
|
static |
Definition at line 93 of file shm_driver.cpp.
|
static |
Definition at line 110 of file shm_driver.cpp.
|
static |
Definition at line 127 of file shm_driver.cpp.
|
static |
Definition at line 108 of file shm_driver.cpp.
volatile struct shmTime* g_shm = NULL |
global SHM time handle
Definition at line 107 of file shm_driver.cpp.
const long int NTPD_SHM_BASE = 0x4e545030 |
Definition at line 60 of file shm_driver.cpp.