mirror of
https://github.com/westonrobot/ugv_sdk
synced 2023-04-08 06:32:14 +08:00
code cleanup
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Changelog for scout_sdk
|
||||
|
||||
## 0.5 (2020-04-01)
|
||||
-------------------
|
||||
* Added initial support of Hunter
|
||||
|
||||
## 0.4 (2019-09-15)
|
||||
------------------
|
||||
* Unified implementation of UART/CAN for firmware and SDK
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.1.0)
|
||||
project(scout_sdk)
|
||||
project(wrp_sdk)
|
||||
|
||||
# generate symbols for IDE indexer
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Add source directories
|
||||
add_subdirectory(apps)
|
||||
add_subdirectory(async_io)
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(hunter_sdk)
|
||||
add_subdirectory(scout_sdk)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
add_executable(app_scout_demo scout_demo/scout_demo.cpp)
|
||||
target_link_libraries(app_scout_demo scoutbase)
|
||||
|
||||
add_executable(app_scout_discharge scout_demo/scout_discharge.cpp)
|
||||
target_link_libraries(app_scout_discharge scoutbase)
|
||||
# add_executable(app_scout_discharge scout_demo/scout_discharge.cpp)
|
||||
# target_link_libraries(app_scout_discharge scoutbase)
|
||||
|
||||
add_executable(app_hunter_demo hunter_demo/hunter_demo.cpp)
|
||||
target_link_libraries(app_hunter_demo hunterbase)
|
||||
|
||||
@@ -21,22 +21,15 @@ int main(int argc, char **argv)
|
||||
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_demo <interface>" << std::endl
|
||||
<< "Example 1: ./app_scout_demo can0" << std::endl
|
||||
<< "Example 2: ./app_scout_demo /dev/ttyUSB0 115200" << std::endl;
|
||||
<< "Example 1: ./app_scout_demo can0" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
HunterBase scout;
|
||||
scout.Connect(device_name, baud_rate);
|
||||
scout.Connect(device_name);
|
||||
|
||||
int count = 0;
|
||||
while (true)
|
||||
@@ -44,33 +37,33 @@ int main(int argc, char **argv)
|
||||
// motion control
|
||||
if (count < 5)
|
||||
{
|
||||
std::cout << "Motor: 0.2, 0" << std::endl;
|
||||
std::cout << "Motor: 0.2, 0.0" << std::endl;
|
||||
scout.SetMotionCommand(0.2, 0.0);
|
||||
}
|
||||
else if (count < 10)
|
||||
{
|
||||
std::cout << "Motor: 0.8, 0" << std::endl;
|
||||
scout.SetMotionCommand(0.8, 0.0);
|
||||
std::cout << "Motor: 0.8, 0.3" << std::endl;
|
||||
scout.SetMotionCommand(0.8, 0.3);
|
||||
}
|
||||
else if (count < 15)
|
||||
{
|
||||
std::cout << "Motor: 1.5, 0" << std::endl;
|
||||
scout.SetMotionCommand(1.5, 0.0);
|
||||
std::cout << "Motor: 1.5, 0.5" << std::endl;
|
||||
scout.SetMotionCommand(1.5, 0.5);
|
||||
}
|
||||
else if (count < 20)
|
||||
{
|
||||
std::cout << "Motor: 1.0, 0.5" << std::endl;
|
||||
scout.SetMotionCommand(1.0, 0.5);
|
||||
std::cout << "Motor: 1.0, 0.3" << std::endl;
|
||||
scout.SetMotionCommand(1.0, 0.3);
|
||||
}
|
||||
else if (count < 25)
|
||||
{
|
||||
std::cout << "Motor: 0.0, 0" << std::endl;
|
||||
std::cout << "Motor: 0.0, 0.0" << std::endl;
|
||||
scout.SetMotionCommand(0.0, 0.0);
|
||||
}
|
||||
else if (count < 30)
|
||||
{
|
||||
std::cout << "Motor: -0.5, 0" << std::endl;
|
||||
scout.SetMotionCommand(-0.5, 0.0);
|
||||
std::cout << "Motor: -0.5, -0.3" << std::endl;
|
||||
scout.SetMotionCommand(-0.5, -0.3);
|
||||
}
|
||||
else if (count < 35)
|
||||
{
|
||||
@@ -79,7 +72,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else if (count < 40)
|
||||
{
|
||||
std::cout << "Motor: 0.0, 0, Light: breath" << std::endl;
|
||||
std::cout << "Motor: 0.0, 0.0," << std::endl;
|
||||
scout.SetMotionCommand(0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
2
src/common/CMakeLists.txt
Normal file
2
src/common/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(async_io)
|
||||
add_subdirectory(utilities)
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user