Ros indigo serial to Arduino UNO but unable to sync

asked 2015-06-01 14:36:02 -0500

crazymumu gravatar image

I connect UNO to ROS indigo , ROS publish message to UNO. have problems like this:

[ERROR] [WallTime: 1433186203.033925] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

But I use ROS indigo and rosserial-indigo-devel. Actually, code sometimes works, and "lose sync" again. sometimes have error like that.
Is the problem of publish rate in ROS and subscribe rate in UNO?
Somebody can help me, thanks so much.

node "determine_path" in ros publish an angle with rate 0.09,
then another node "zumo_controller " in ros subscribe it and publish to UNO with rate 0.019. UNO subscribe like this:

  void loop(){
  nh.spinOnce();
  delay(10);
}

Launch file:

<launch>
    <group ns = "space1">
                <node
            pkg = "rosserial_python"
            type = "serial_node.py"
            name = "serial_node"
            >
            <param name = "port" value = "/dev/ttyACM1"/>
        </node>

        <node
            pkg = "jl"
            type = "zumo_controller"
            name = "zumo_controller"
        />
        <node
            pkg = "jl"
            type = "determine_path"
            name = "hokuyo_analyze"
        />
        <node
            pkg = "hokuyo_node"
            type = "hokuyo_node"
            name = "hokuyo"
            >
            <param name = "port" value = "/dev/ttyACM0"/>
        </node>
    </group>
</launch>
edit retag flag offensive close merge delete

Comments

If your code "sometimes" works maybe you run out of SRAM, see http://answers.ros.org/question/19320...

Wolf gravatar image Wolf  ( 2015-06-02 04:58:39 -0500 )edit

you could also try using something like the teensy that has a lot more RAM, amongst other things https://www.pjrc.com/teensy/teensy31....

nickw gravatar image nickw  ( 2015-06-02 07:37:01 -0500 )edit

thanks all

crazymumu gravatar image crazymumu  ( 2015-06-04 19:45:34 -0500 )edit