![]() ![]() ![]() Why is it const? We don't want to modify it even accidentally. What is this ConstPtr? It simply expands to: void callback(const my_pkg::MyDataTypeConstPtr _msg) This is done in the definition of the callback function (c++). This means on the receiving end we need to specify the data-type properly. But, on the receiving end, it will be assembled back together (de-serialzed). Then, ROS will serialize the data into bytes and send it to all subscribers (including a 'rostopic echo' - it is after-all a subscriber). IMPORTANT: The publisher dictates the type of a topic. Refer to the tutorials ( writing a simple publisher/subscriber)) for what this means. My_pub.publish(garbage_data) // Send the data to the topic. Mypkg::MyDataType garbage_data // Create the variable. We usually do, ros::Publisher my_pub = nh.advertise ("/topic_name", 1) // register a publisher. What happens when you send a message to a ROS topic? Similarly a node can also publish on that topic (simply send a data structure to it). The creator of a group adds participants to it.). It can register a subscription, if it has the data-type of the data that is being posted on the topic (this is not true in whatsapp. Note here that no-one needs to add that node to the topic. So, if a node registers a subscription to a particular topic, it receives data from the topic (whenever a message is posted on a topic). Each contact in whatsapp is analogous to a node in ROS. If someone adds you to a group, you start receiving messages from them (whenever a participant posts a message). If you have the ROS_MASTER_URI set, and if the computer with that ip is running a ROS master you can see it. This is usually set to the ip of the computer whose bashrc you are looking at. If you have a friend's contact, and if he happens to be on whatsapp you can see him.Īnalogy: The computer itself is 'registered' by using ROS_HOSTNAME. bashrc file.Įxample: You are registered on whatsapp with your phone number. ![]() Your contacts list = ROS env variables in the. Tutorials, I feel, should not assume computer science knowledge). (People who don't know the basic Operating Systems concepts - like me - tend to find it utterly difficult to understand ROS.
0 Comments
Leave a Reply. |