Extract timeseries from rosbag with std_msgs/Bool messages
7 views (last 30 days)
Show older comments
Hi,
I have recorded a rosbag with a /teleop_control topic, to which messages of type std_msgs/Bool are published. I need to read this as a timeseries object, to later synchronize with other topics. But I'm getting errors when trying to use the timeseries function, which worked fine with Twist messages.
To check it, I have done:
bag_teleop_control.MessageList
ans =
46×4 table
Time Topic MessageType FileOffset
__________ _______________ _____________ __________
1.5637e+09 /teleop_control std_msgs/Bool 208303
1.5637e+09 /teleop_control std_msgs/Bool 214527
1.5637e+09 /teleop_control std_msgs/Bool 1307088
.
.
.
And:
rosmsg info std_msgs/Bool
logical Data
But this gives me an error:
timeseries(bag_teleop_control, 'Data');
Error using robotics.ros.BagSelection/getTimeseriesArguments (line 726)
The Data property does not exist for message type std_msgs/Bool.
Error in robotics.ros.BagSelection/timeseries (line 442)
props = obj.getTimeseriesArguments(messageType, varargin{:});
Does someone know what am I getting wrong?
4 Comments
Cam Salzberger
on 25 Jul 2019
That is pretty odd. When you did readMessages (both with and without the struct option), did the messages contain values in the Data property of the messages? Or were they empty, or all equal to the same value?
It does look like you could extract the time series to get the structure and time, then fill in the data using messages?
boolData = timeseries(bag_teleop_control);
boolMsgStructs = readMessages(bag_teleop_control, "DataFormat", "struct");
boolData.Data = [boolMsgStruct.Data]';
Sorry if the code might not work. I'm away from MATLAB right now, so can't try it out. But that's one idea for a workaround.
-Cam
Answers (0)
See Also
Categories
Find more on Pulsed Waveforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!