Ask Your Question
0

Publishing multiple data types in one ros topic in Arduino

asked 2016-04-18 13:18:12 -0600

pankaj patel gravatar image

Hi all, I followed this tutorial for rosserial in arduino link text But here in this tutorial I need to add different ros topics for every new data types like string, int ,float etc. What if I want to publish multiple data types in a single ros topic ? What should I do ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-04-18 13:33:21 -0600

You can't publish multiple data types to a single topic. What you need to do is publish multiple topics from a single node.

edit flag offensive delete link more

Comments

Thanks Nicholas for replying, I am reading an arduino mega board by ros. I have string, integer and float data coming from arduino and I want to print all data in one terminal. But I can see only one type of data in one terminal by rostopic echo. How can I do this ? I am new to ROS.

pankaj patel gravatar imagepankaj patel ( 2016-04-19 03:43:40 -0600 )edit
1

You could make a custom message that holds a string, integer, and float. Populate that message type in your node and publish it.

Icehawk101 gravatar imageIcehawk101 ( 2016-04-19 07:29:23 -0600 )edit

Hi Nicholas I made header file for string and integer data type as you said. Now I am having another issue I posted here :link text

pankaj patel gravatar imagepankaj patel ( 2016-04-20 06:26:10 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-04-18 13:18:12 -0600

Seen: 1,060 times

Last updated: Apr 18 '16