ROS ".msg" files to csv Excel
I been looking forROS msg files to csv Excel files. I am trying to use MATLAB or Python to do that. However, it does not work as I want it to be. For example, I have ROS msg files like
I used MATLAB code as
messageName = 'AdjustXY';
% Read the information about the message and store it in a table
tableMessage = readtable([messageName '.msg'], 'FileType', 'text', 'ReadVariableNames', false);
% Prepare the first Excel column with the name of the message
toAppend = repmat({messageName}, size(tableMessage, 1), 1);
tableMessage = [toAppend tableMessage];
% Output the message information into an Excel file
writetable(tableMessage, [messageName '.xlsx'], 'WriteVariableNames', false)
I do have output in excel as (I do not understand why I am not able to update the photo, but here is the link that I have on MATLAB)
Some msg file does work on this code but some does not. If anyone can help me with it will be great. I want the output without that common text in csv. I did research. But all of them are about getting info from rosbag files to csv. That is not what I am talking about. I do need the info from ROS msg files. Please please help me with it no matter use MATLAB or python. Thank you
Can't you go from
.csv
to excel? Excel can natively import.csv
files.you don't really have
boxturtle
as your ROS distro, do you?Hi gv I know Excel can read csv files. The problem is I want to get output from a .msg file. Not csv file. I do not have any csv files fright now. All I have are .msg files.
Hi mg I am not sure I understand what you saying. Cause I am really new for this type of code. So I think I do not have it. You can take look at those links.
Let's make sure what you actually want: are you looking to convert message data into excel files, or message structure?
Hi gv Thank you for write back so quick. As I said to mgruhler, I am really now to this type of code. I believe what I want is those message structure to excel. If you take look at the first example that I post"ROS msg files like ". The messages are something like "header header;int32 accel".
Continue from the last one. I want to transfer this info from a msg file to excel in order. If you take look at that Matlab code, you will understand well. However, that MATLAB code only works on some msg file without common text in them. I want to find out one that works for all msg files
Please someone Help.