Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smoother serial #124

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Smoother serial #124

wants to merge 6 commits into from

Conversation

BillThePlatypus
Copy link
Contributor

Improves performance with serial connections:

  • Adds parameters ~wait_for_serial and ~serial_check_period. If ~wait_for_serial is set to true, and the serial port is not available when the node comes up, it will wait ~serial_check_period seconds and then try again, until the node is killed or connects.
  • When the serial connection is lost, displays an error message so stating, and closes gracefully, instead of a thread error.
  • I'm considering adding the ability to automatically reconnect on a lost connection.

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8.3)
project(rosflight)

set(CMAKE_BUILD_TYPE Release)
set(CMAKE_BUILD_TYPE Debug)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you just remove this line?

@@ -84,25 +85,67 @@ rosflightIO::rosflightIO()
std::string port = nh_private.param<std::string>("port", "/dev/ttyACM0");
int baud_rate = nh_private.param<int>("baud_rate", 921600);

wait_for_serial_ = nh_private.param<bool>("wait_for_serial", false);
serial_retry_delay_s_ = nh_private.param<float>("serial_check_period", 1.0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems long. (I assume that this is designed for hardfault recovery.) How small can we make this?

@bsutherland333
Copy link
Contributor

This is something that we've actually talked about improving, funny that work on it already exists. We should definitely finish this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants