Problems using avr_bridge, Arduino <-> ROS communication
Hi,
I'd like to enable an Arduino Duemilanove to work with ROS. I've found the avr_bridge package, which is supposed to exactly do what I wanted. The problem is I cannot get the Hello World tutorial to work.
I think I did everything as explained in the aforementioned Wiki-pages. I've defined fputc
and fgetc
functions, corrected some minor errors in library paths and the project builds nicely. But when I load it to Atmega328P it's not echoing the messages sent.
I've done some debugging (without JTAG, so just blinking leds in different parts of the code) and have stated that the UART-read part isn't working (ie. the callback method is not being called when data from /call
topic is being read). I guess the error is somewhere in node_handle.cpp
, in the part:
if (com_state == msg_data_state) {
packet_data_left--;
if (packet_data_left < 0) {
resetStateMachine();
if (header->packet_type == 255) this->sendID();
if (header->packet_type == 0){ //topic,
//ie its a valid topic tag
//then deserialize the msg
this->msgList[header->topic_tag]->deserialize(buffer+4);
//call the registered callback function
this->cb_list[header->topic_tag](this->msgList[header->topic_tag]);
}
if(header->packet_type == 1){ //service }
}
}
I've been able to publish some data on the /response
topic, though.
Any clues?