ROS Publishers and Substribers C - olinrobotics/avatar GitHub Wiki

Including ROS

At the top of the file, write:

#include <ros/ros.h>

#include <std_msgs/String.h>

Using ROS namespace

Under that, write:

using namespace ros;

For more on namespaces go here

Publishers

Initialize ROS

This initializes the node. argc and argv allow ROS to communicate through the command line.

`ros::init(argc, argv, "talker");

Create a node handle

ros::NodeHandle <handle_name>

Subscribers

Callback

(ConstPtr&)[http://answers.ros.org/question/212857/what-is-constptr/]

Specific Subscribers

  • [usb_cam](ADD LINK)

Reference

  • (Writing a Simple Publisher and Subscriber (C++))[http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29]
⚠️ **GitHub.com Fallback** ⚠️