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

sync rosserial arduino

$
0
0
There was a couple of seconds a couple of seconds ago a question regarding rosserial arduino I accidentally deleted (I wanted to delete my own comment but accidentally deleted the entire question), sorry. The issue was after running rosrun `rosserial_python serial_node.py _port:=/dev/ttyACM0` the error `unable to sync with device occurred.` The code looked quite like the example service client code but with a custom message (does not matter for the issue) and some parts commented out: /* * rosserial Service Client */ #include #include #include ros::NodeHandle nh; using rosserial_arduino::Test; ros::ServiceClient client("test_srv"); // std_msgs::String str_msg; // ros::Publisher chatter("chatter", &str_msg); // char hello[13] = "hello world!"; void setup() { nh.initNode(); nh.serviceClient(client); // nh.advertise(chatter); while(!nh.connected()) nh.spinOnce(); nh.loginfo("Startup complete"); } void loop() { Test::Request req; Test::Response res; req.input = hello; client.call(req, res); // str_msg.data = res.output; // chatter.publish( &str_msg ); // nh.spinOnce(); delay(100); }

Viewing all articles
Browse latest Browse all 59

Latest Images

Trending Articles



Latest Images

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