https://github.com/graiola/rt_logger
A simple real time safe logger based on the ROS real time publishers.
https://github.com/graiola/rt_logger
Last synced: 12 months ago
JSON representation
A simple real time safe logger based on the ROS real time publishers.
- Host: GitHub
- URL: https://github.com/graiola/rt_logger
- Owner: graiola
- License: apache-2.0
- Created: 2019-09-04T13:40:19.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-08T07:46:27.000Z (over 1 year ago)
- Last Synced: 2025-01-08T08:34:57.918Z (over 1 year ago)
- Language: C++
- Size: 53.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rt_logger
A simple ROS package to log numeric data such as doubles, std vectors, Eigen matrices and vectors.
## How to use
Include this header wherever you want to access the logger:
`#include `
Add a real time publisher to the logger:
` rt_logger::RtLogger::getLogger().addPublisher("/topic_name",data_to_publish) `
*
Note: This operation is not real time safe! If you are using a real time controller from ros-control, perform this operation in the init of the controller.
*
Finally, add this line in the main loop of your code to publish the data:
` rt_logger::RtLogger::getLogger().publish(ros_time)`
Check out this [test](https://github.com/graiola/rt_logger/blob/master/test/rt_logger_test.cpp) for more examples.
## Import data in Matlab or Octave
First, be sure to have [scipy](https://www.scipy.org/) and [numpy](https://numpy.org/) installed:
`sudo apt-get update && sudo apt-get install python-scipy python-numpy -y`
Create the publishers with rt_logger and record the topics with rosbag, see the command line [here](http://wiki.ros.org/rosbag/Commandline)
Use this [script](https://github.com/graiola/rt_logger/blob/master/scripts/read_bag.py) to extract the .mat files from the bag files:
` ./read_bag.py -b test.bag `
This command will create a mat file for each topic in the bag. To see the available options type:
` ./read_bag.py -h `