ros-drivers / rosserial

A ROS client library for small, embedded devices, such as Arduino. See: http://wiki.ros.org/rosserial
508 stars 527 forks source link

Creation of subscriber failed: need more than 1 value to unpack #524

Open rjam92 opened 3 years ago

rjam92 commented 3 years ago

Hello, I am testing out using rosserial with arduino mega 2560 and a jetson nano. I can run the blink example just fine but when I try to use a subscriber to a topic I am publishing it returns the error: " Creation of subscriber failed: need more than 1 value to unpack" `/*

include

include <nav_msgs/Odometry.h>

ros::NodeHandle nh;

void messageCb( const nav_msgs::Odometry& toggle_msg){ digitalWrite(13, HIGH-digitalRead(13)); // blink the led }

ros::Subscriber sub("/odom", &messageCb );

void setup() { pinMode(13, OUTPUT); nh.initNode(); nh.subscribe(sub); }

void loop() {
nh.spinOnce(); delay(1); }`

If it helps I am using this command to launch the arduino subscriber: rosrun rosserial_arduino serial_node.py _port:=/dev/ttyACM0

I face the same issue with the hello world publisher example as well. I am running ros melodic