ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
It's probably the delay(500) at the bottom of your loop. This long of a delay (0.5 seconds) is probably causing it to lose sync and hang up.
Since you are using a timer, I would just remove it or delay(1).
2 | No.2 Revision |
It's probably the delay(500) at the bottom of your loop. This long of a delay (0.5 seconds) is probably causing it to lose sync and hang up.
Since you are using a timer, I would just remove it or delay(1).
Updated:
I upload your code (minus delay) to the arduino UNO (don't have an extra mega). I get a Low memory available, stability problems may occur. message. Which might be a clue?
But it runs good on the my UNO.
Just in case it helps, I ran this launch file.
<launch>
<node pkg="rosserial_python" type="serial_node.py" name="rosserial_lipo" output="screen">
<param name="~port" value="/dev/ttyACM1" />
</node>
</launch>
Then rostopic echo /LaserData
3 | No.3 Revision |
It's probably the delay(500) at the bottom of your loop. This long of a delay (0.5 seconds) is probably causing it to lose sync and hang up.
Since you are using a timer, I would just remove it or delay(1).
Updated:
I upload your code (minus delay) to the arduino UNO (don't have an extra mega). I get a Low memory available, stability problems may occur. message. Which might But you have a mega so you should be a clue? good.
But it runs good on the my UNO.
Just in case it helps, I ran this launch file.
<launch>
<node pkg="rosserial_python" type="serial_node.py" name="rosserial_lipo" output="screen">
<param name="~port" value="/dev/ttyACM1" />
</node>
</launch>
Then rostopic echo /LaserData