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"
`/*
rosserial Subscriber Example
Blinks an LED on callback
*/
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
}
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