ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I finally find the right syntax to define a publisher
include "ros.h"
include "geometry_msgs/Twist.h"
float x;
ros::NodeHandle nh;
void velCallback( const geometry_msgs::Twist& vel) { x = vel.linear.x - 1.0; // I CAN USE VEL AS I WANT }
ros::Subscriber<geometry_msgs::twist> sub("cmd_vel" , velCallback);
void setup() { nh.initNode(); nh.subscribe(sub); }
void loop() { nh.spinOnce(); delay(10); }
2 | No.2 Revision |
I finally find the right syntax to define a publisher
include "ros.h"
include "geometry_msgs/Twist.h"
float x;
ros::NodeHandle nh;
void velCallback( const geometry_msgs::Twist& vel) { x = vel.linear.x - 1.0; // I CAN USE VEL AS I WANT }
ros::Subscriber<geometry_msgs::twist> sub("cmd_vel" , velCallback);
void setup() { nh.initNode(); nh.subscribe(sub); }
void loop() { nh.spinOnce(); delay(10); }
3 | No.3 Revision |
I finally find the right syntax to define a publisher
include "ros.h"
include "geometry_msgs/Twist.h"
float x;
ros::NodeHandle nh;
void velCallback( const geometry_msgs::Twist& vel) { x = vel.linear.x - 1.0; // I CAN USE VEL AS I WANT }
ros::Subscriber<geometry_msgs::twist> sub("cmd_vel" , velCallback);
void setup() { nh.initNode(); nh.subscribe(sub); }
void loop() { nh.spinOnce(); delay(10); }
Thanks for support
PS : I am still don't knwo how to properly insert cpp code citation
4 | No.4 Revision |
I finally find the right syntax to define a publisher
#include "ros.h"
include "ros.h"
include "geometry_msgs/Twist.h"
ros::Subscriber<geometry_msgs::twist>
Thanks for support
PS : I am still don't knwo how to properly insert cpp code citation