How to log Clearpath Husky topic values in a text file
At the moment, I control my Husky robot by using a wireless joypad as described in Husky-ROS tutorial
roscore
roslaunch clearpath_base example.launch
roslaunch clearpath_teleop teleop.launch
Since I need to log some parameters (such as left and right linear velocity, encoders ticks, etc..), I use "rostopic echo" and then I re-direct the output to a text file.
For example, I do as follows:
rostopic echo /clearpath/robots/default/cmd_vel >> log-for-vel.txt
After this, I wrote down a bash script which is able to extract only the desired values from the log files.
Typically, each topic file is something like this:
header:
seq: 778
stamp:
secs: 1380713547
nsecs: 429730892
frame_id: ''
left_speed: 0.34
right_speed: 0.34
left_accel: 0.5
right_accel: 0.5
---
header:
seq: 779
stamp:
secs: 1380713544
nsecs: 735946893
frame_id: ''
left_speed: 0.26
right_speed: 0.26
left_accel: 0.5
right_accel: 0.5
And I just need to extract timestamp and left and right velocity information.
Since this is an intricate solution, I would like to know if there is any smarter solution to log these values in a text files without having to redirect the output for each topic. What's the best solution for my problem?
I really hope you can help me!
Thank you very much!