ROS ".msg" files to csv Excel

asked 2019-01-31 14:29:10 -0500

hsui gravatar image

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

edit retag flag offensive close merge delete



Can't you go from .csv to excel? Excel can natively import .csv files.

gvdhoorn gravatar image gvdhoorn  ( 2019-02-01 01:06:40 -0500 )edit

you don't really have boxturtle as your ROS distro, do you?

mgruhler gravatar image mgruhler  ( 2019-02-01 01:07:00 -0500 )edit

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.

hsui gravatar image hsui  ( 2019-02-01 01:35:23 -0500 )edit

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.

hsui gravatar image hsui  ( 2019-02-01 01:36:31 -0500 )edit

Let's make sure what you actually want: are you looking to convert message data into excel files, or message structure?

gvdhoorn gravatar image gvdhoorn  ( 2019-02-01 01:43:00 -0500 )edit

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".

hsui gravatar image hsui  ( 2019-02-01 01:49:22 -0500 )edit

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

hsui gravatar image hsui  ( 2019-02-01 01:52:41 -0500 )edit

Please someone Help.

hsui gravatar image hsui  ( 2019-02-20 18:12:31 -0500 )edit