mirror of
https://github.com/westonrobot/ugv_sdk
synced 2023-04-08 06:32:14 +08:00
updated mobile base to use lastest serial communication impl
This commit is contained in:
@@ -50,11 +50,11 @@ void MobileBase::ConfigureCAN(const std::string &can_if_name) {
|
|||||||
void MobileBase::ConfigureSerial(const std::string uart_name,
|
void MobileBase::ConfigureSerial(const std::string uart_name,
|
||||||
int32_t baud_rate) {
|
int32_t baud_rate) {
|
||||||
serial_if_ = std::make_shared<AsyncSerial>(uart_name, baud_rate);
|
serial_if_ = std::make_shared<AsyncSerial>(uart_name, baud_rate);
|
||||||
if (serial_if_->IsOpened()) serial_connected_ = true;
|
|
||||||
serial_if_->SetReceiveCallback(
|
serial_if_->SetReceiveCallback(
|
||||||
std::bind(&MobileBase::ParseUARTBuffer, this, std::placeholders::_1,
|
std::bind(&MobileBase::ParseUARTBuffer, this, std::placeholders::_1,
|
||||||
std::placeholders::_2, std::placeholders::_3));
|
std::placeholders::_2, std::placeholders::_3));
|
||||||
serial_if_->StartListening();
|
serial_if_->StartListening();
|
||||||
|
if (serial_if_->IsOpened()) serial_connected_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MobileBase::StartCmdThread() {
|
void MobileBase::StartCmdThread() {
|
||||||
|
|||||||
Reference in New Issue
Block a user