ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

matrix message

asked 2020-06-15 08:18:08 -0600

v.leto gravatar image

Hi! I would like to save a 2x2 matrix from a c++ script in a ros message. How can I do this? what kind od meassage type should I use? Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-06-15 09:32:17 -0600

pcoenen gravatar image

You could use the Multi Arrays in std_msgs, although they seem to be overkill for a simple 2x2 matrix.

If it's always a 2x2 matrix, a custom message using a one dimensional array would be sufficient. In that case you would have to take care of the reassembly yourself. Should your matrix dimensions vary, you could add those as extra fields to your message (similar to Image).

edit flag offensive delete link more

Comments

Should your matrix dimensions vary, you could add those as extra fields to your message (similar to Image).

so you'd essentially be re-creating the *MultiArray messages? :)

gvdhoorn gravatar image gvdhoorn  ( 2020-06-15 09:33:38 -0600 )edit

Not quite as excessive, but yes.

pcoenen gravatar image pcoenen  ( 2020-06-15 09:35:36 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-06-15 08:18:08 -0600

Seen: 1,563 times

Last updated: Jun 15 '20