Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 314

Connecting to ROS using rosserial on Windows?

$
0
0
I have ROS running on my Linux machine and I wanna connect to ROS using rosserial on Windows. So I have been following the tutorial on rosserial given here: http://wiki.ros.org/rosserial_windows/Tutorials/Hello%20World This is what my code looks like which is pretty much the same as the tutorial: // ConsoleApplication1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include #include "ros.h" #include #include using std::string; int main(int argc, _TCHAR * argv[]) { ros::NodeHandle nh; char *ros_master = "172.17.194.162"; printf("Connecting to server at %s\n", ros_master); nh.initNode (ros_master); printf("Advertising message\n"); std_msgs::Float32 a; ros::Publisher cmd("", &a); nh.advertise(cmd); printf("Go Car!\n"); while (1) { nh.spinOnce(); Sleep(100); } printf("All done\n"); return 0; } So, I am getting these errors with the code (the part where I am giving the IP of my Linux machine). I am doing it the same way it is done in the tutorial. Don't understand what is wrong with the way i am passing the IP address here Severity Code Description Project File Line Suppression State Error (active) E0144 a value of type "const char *" cannot be used to initialize an entity of type "char *" ConsoleApplication1 c:\Users\kaela\source\repos\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.cpp 19 Severity Code Description Project File Line Suppression State Error C2664 'void ros::NodeHandle_::initNode(char *)': cannot convert argument 1 from 'const char *' to 'char *' ConsoleApplication1 c:\users\kaela\source\repos\consoleapplication1\consoleapplication1\consoleapplication1.cpp 22 Can't seem to figure out what the problem is.

Viewing all articles
Browse latest Browse all 314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>