mirror of
https://github.com/westonrobot/ugv_sdk
synced 2023-04-08 06:32:14 +08:00
Merge pull request #21 from westonrobot/cleanup-fix_protocol_detector_typo
typo: fixed spelling of protocol detector class name
This commit is contained in:
@@ -31,7 +31,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
std::unique_ptr<HunterRobot> hunter;
|
||||
|
||||
ProtocolDectctor detector;
|
||||
ProtocolDetector detector;
|
||||
detector.Connect(device_name);
|
||||
auto proto = detector.DetectProtocolVersion(5);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
std::unique_ptr<ScoutMiniOmniRobot> scout;
|
||||
|
||||
ProtocolDectctor detector;
|
||||
ProtocolDetector detector;
|
||||
detector.Connect(device_name);
|
||||
auto proto = detector.DetectProtocolVersion(5);
|
||||
if (proto == ProtocolVersion::AGX_V1) {
|
||||
|
||||
@@ -49,7 +49,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
std::unique_ptr<ScoutRobot> scout;
|
||||
|
||||
ProtocolDectctor detector;
|
||||
ProtocolDetector detector;
|
||||
if (detector.Connect(device_name)) {
|
||||
auto proto = detector.DetectProtocolVersion(5);
|
||||
if (proto == ProtocolVersion::AGX_V1) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
using namespace westonrobot;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
ProtocolDectctor detector;
|
||||
ProtocolDetector detector;
|
||||
if (detector.Connect("can0")) {
|
||||
auto proto = detector.DetectProtocolVersion(5);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "ugv_sdk/details/interface/parser_interface.hpp"
|
||||
|
||||
namespace westonrobot {
|
||||
class ProtocolDectctor {
|
||||
class ProtocolDetector {
|
||||
public:
|
||||
bool Connect(std::string can_name);
|
||||
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
#include "utilities/stopwatch.hpp"
|
||||
|
||||
namespace westonrobot {
|
||||
bool ProtocolDectctor::Connect(std::string can_name) {
|
||||
bool ProtocolDetector::Connect(std::string can_name) {
|
||||
can_ = std::make_shared<AsyncCAN>(can_name);
|
||||
can_->SetReceiveCallback(
|
||||
std::bind(&ProtocolDectctor::ParseCANFrame, this, std::placeholders::_1));
|
||||
std::bind(&ProtocolDetector::ParseCANFrame, this, std::placeholders::_1));
|
||||
return can_->Open();
|
||||
}
|
||||
|
||||
ProtocolVersion ProtocolDectctor::DetectProtocolVersion(uint32_t timeout_sec) {
|
||||
ProtocolVersion ProtocolDetector::DetectProtocolVersion(uint32_t timeout_sec) {
|
||||
msg_v1_detected_ = false;
|
||||
msg_v2_detected_ = false;
|
||||
|
||||
@@ -41,7 +41,7 @@ ProtocolVersion ProtocolDectctor::DetectProtocolVersion(uint32_t timeout_sec) {
|
||||
return ProtocolVersion::UNKONWN;
|
||||
};
|
||||
|
||||
void ProtocolDectctor::ParseCANFrame(can_frame *rx_frame) {
|
||||
void ProtocolDetector::ParseCANFrame(can_frame *rx_frame) {
|
||||
switch (rx_frame->can_id) {
|
||||
// state feedback frame with id 0x151 is unique to V1 protocol
|
||||
case 0x151: {
|
||||
|
||||
Reference in New Issue
Block a user