ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Problems using avr_bridge, Arduino <-> ROS communication

asked 2011-04-06 00:35:14 -0600

tom gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-04-06 14:39:02 -0600

Homer Manalo gravatar image

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.

edit flag offensive delete link more

Comments

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.
tom gravatar image tom  ( 2011-04-06 21:10:26 -0600 )edit
OK - there is obviously the imu_9drazor code using it to look up.
tom gravatar image tom  ( 2011-04-06 21:40:02 -0600 )edit

Question Tools

Stats

Asked: 2011-04-06 00:35:14 -0600

Seen: 1,645 times

Last updated: Apr 06 '11