#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 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 |
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 struct shmTime* get_shmTime | ( | int | unit | ) | [static, read] |
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.
static void memory_barrier | ( | void | ) | [inline, static] |
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 void put_shmTime | ( | volatile struct shmTime ** | shm | ) | [static] |
Definition at line 93 of file shm_driver.cpp.
static void sig_handler | ( | int | sig | ) | [static] |
Definition at line 110 of file shm_driver.cpp.
static void time_ref_cb | ( | const sensor_msgs::TimeReference::ConstPtr & | time_ref | ) | [static] |
Definition at line 127 of file shm_driver.cpp.
bool g_set_date = false [static] |
Definition at line 108 of file shm_driver.cpp.
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.