Merge pull request #21 from westonrobot/cleanup-fix_protocol_detector_typo

typo: fixed spelling of protocol detector class name
This commit is contained in:
Du Ruixiang
2022-10-18 15:24:48 +08:00
committed by GitHub
6 changed files with 9 additions and 9 deletions

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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);

View File

@@ -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: {