0
$\begingroup$

Rosanswers logo

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?


Originally posted by tom on ROS Answers with karma: 1079 on 2011-04-06

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Can you check out the personal repository of the author (http://github.com/adasta/rutgers-ros-pkg.git)? This might be similar to the problem I encountered before.


Originally posted by Homer Manalo with karma: 475 on 2011-04-06

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by tom on 2011-04-06:
OK - there is obviously the imu_9drazor code using it to look up.

Comment by tom on 2011-04-06:
Thanks Homer. Is there a HelloWorld example for this code as well? I run gen_avr.py and got the avr_ros directory for the callResponse example generated. But, as naming in the code changed, it would be handy to have a quick example to look at.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.