Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

multiple messages from the arduino are ignored #332

Open
goruck opened this issue Aug 14, 2017 · 0 comments
Open

multiple messages from the arduino are ignored #332

goruck opened this issue Aug 14, 2017 · 0 comments

Comments

@goruck
Copy link
Contributor

goruck commented Aug 14, 2017

The Arduino can send more than one message in response to a single write but only the first message is processed, the others will be ignored. The Arduino can send multiple messages in the following cases.

  1. A bad message is received from the arduino_handler and in this case (if the debug code is enabled) the Arduino will send back the bad message followed by a normal sensor status message (if all sensors are operating normally). This is probably no big deal assuming there aren't many bad messages received by the Arduino (which seems to be the case).

  2. If more than one sensor reports a problem. In this case the Arduino will send multiple sensor error messages but only the first will be processed by the arduino_handler, the other(s) will be ignored. This is undesirable since it will make hardware diagnostics difficult.

Note that a combination of 1 and 2 is possible.

When rosserial was used to communicate with the Arduino, it looks like it published sensor status to the /internal_diagnostics topic in ROS through rosserial and so the state of all sensors was reflected properly via the /diagnostics topic (which no longer works).

The arduino_handler should probably perform multiple readlines until the buffer is empty, storing multiple messages in a list and processed one by one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant