Ask Your Question

Problem with subscriber on Chipkit [closed]

asked 2015-08-05 14:50:01 -0500

cjusto gravatar image

Hi. I'm working on a project using a Chipkit Max32. I made all the tutorials on the arduino ros serial and it works fine.

Now the problem is that i have a publisher on my computer (running Kubuntu 14.04) and i program my chipkit. After doing this:

rosrun rosserial_python /dev/ttyUSB1

I get the error:

[ERROR] [WallTime: 1438803266.042381] Creation of subscriber failed: agv_ipleiria ROS path [0]=/opt/ros/indigo/share/ros ROS path [1]=/opt/ros/indigo/share ROS path [2]=/opt/ros/indigo/stacks

my code is:

#include <ros.h>
#include <std_msgs/String.h>
#include <agv_ipleiria/AgvGeneral.h>

ros::NodeHandle  nh;

std_msgs::String str_msg;
ros::Publisher chatter("chatter", &str_msg);

void messageCb( const agv_ipleiria::AgvGeneral& msg){
   digitalWrite(PIN_LED2, LOW);    // set the LED off

ros::Subscriber<agv_ipleiria::AgvGeneral> sub("AGVipleiriaChatter", &messageCb );

char hello[13] = "hello world!";

void setup()
     pinMode(PIN_LED2, OUTPUT);  
  digitalWrite(PIN_LED2, LOW);    // set the LED off

  digitalWrite(PIN_LED2, HIGH);   // set the LED on
  delay(700);              // wait for a second

void loop()
{ = hello;
  chatter.publish( &str_msg );

Where is the problem on this code?

Thank You.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by cjusto
close date 2015-11-19 07:00:58.738646


Is it valid to create a subscriber before you've called ros.initNode() on platforms running rosserial?

gvdhoorn gravatar image gvdhoorn  ( 2015-08-05 14:52:09 -0500 )edit

well, i've seen that on some projects. And it worked.

cjusto gravatar image cjusto  ( 2015-08-05 15:43:21 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-11-19 07:00:17 -0500

cjusto gravatar image

The problem was on bad defined custom package.

Problem solved.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-08-05 14:50:01 -0500

Seen: 95 times

Last updated: Nov 19 '15