mirror of
https://github.com/westonrobot/ugv_sdk
synced 2023-04-08 06:32:14 +08:00
moved ugv_sdk out from sub-folder
This commit is contained in:
3
apps/scout_monitor/app/CMakeLists.txt
Normal file
3
apps/scout_monitor/app/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
# Add executables
|
||||
add_executable(app_scout_monitor app_scout_monitor.cpp)
|
||||
target_link_libraries(app_scout_monitor monitor)
|
||||
40
apps/scout_monitor/app/app_scout_monitor.cpp
Normal file
40
apps/scout_monitor/app/app_scout_monitor.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#include "monitor/scout_monitor.hpp"
|
||||
|
||||
using namespace westonrobot;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
std::string device_name;
|
||||
int32_t baud_rate = 0;
|
||||
|
||||
if (argc == 2)
|
||||
{
|
||||
device_name = {argv[1]};
|
||||
std::cout << "Specified CAN: " << device_name << std::endl;
|
||||
}
|
||||
else if (argc == 3)
|
||||
{
|
||||
device_name = {argv[1]};
|
||||
baud_rate = std::stol(argv[2]);
|
||||
std::cout << "Specified serial: " << device_name << "@" << baud_rate << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Usage: app_scout_monitor <interface>" << std::endl
|
||||
<< "Example 1: ./app_scout_monitor can1" << std::endl
|
||||
<< "Example 2: ./app_scout_monitor /dev/ttyUSB0 115200" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
ScoutMonitor monitor;
|
||||
monitor.Run(device_name, baud_rate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user