diff --git a/app/raspberry_pi/repository/packages/r/rplidar/xmake.lua b/app/raspberry_pi/repository/packages/r/rplidar/xmake.lua index 74acd686..ba365873 100644 --- a/app/raspberry_pi/repository/packages/r/rplidar/xmake.lua +++ b/app/raspberry_pi/repository/packages/r/rplidar/xmake.lua @@ -1,7 +1,6 @@ package("rplidar") add_deps("serial", "spdlog", "tl_expected") set_sourcedir(path.join(os.scriptdir(), "rplidar")) - set_policy("package.install_always", true) on_install(function (package) local configs = {} import("package.tools.xmake").install(package, configs) diff --git a/app/raspberry_pi/src/car/system/movement/MovementSystem.hpp b/app/raspberry_pi/src/car/system/movement/MovementSystem.hpp index d4224743..4bc0cb59 100644 --- a/app/raspberry_pi/src/car/system/movement/MovementSystem.hpp +++ b/app/raspberry_pi/src/car/system/movement/MovementSystem.hpp @@ -25,9 +25,9 @@ namespace car::system::movement { void initalize() { - this->pwn->init(1, 0x40); + this->pwm->init(1, 0x40); std::this_thread::sleep_for(std::chrono::milliseconds(100)); - this->pwn->setPWMFreq(FREQUENCY); + this->pwm->setPWMFreq(FREQUENCY); std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } @@ -37,12 +37,12 @@ namespace car::system::movement { void terminate() { } - //def map(self, x, in_min, in_max, out_min, out_max): + + // https://www.arduino.cc/en/Reference/Map int map(int x, int in_min, int in_max, int out_min, int out_max) { return ((x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min); } - //def _angle_to_analog(self, angle): int setAngleToAnalog(int angle) { float pulse_wide; int analog_value; diff --git a/app/raspberry_pi/src/main.cpp b/app/raspberry_pi/src/main.cpp index 7b1f67ee..a6d76c94 100644 --- a/app/raspberry_pi/src/main.cpp +++ b/app/raspberry_pi/src/main.cpp @@ -46,10 +46,13 @@ int main() std::unique_ptr messaging_system = std::make_unique(websocket_url); + std::unique_ptr movement_system = std::make_unique(); + auto car_system = std::make_unique( websocket_url, std::move(scanner), - std::move(messaging_system) + std::move(messaging_system), + std::move(movement_system) ); // The CarConsole object will display the UI and handle user input: diff --git a/app/raspberry_pi/xmake.lua b/app/raspberry_pi/xmake.lua index 60fabc96..1fe426f6 100644 --- a/app/raspberry_pi/xmake.lua +++ b/app/raspberry_pi/xmake.lua @@ -18,7 +18,7 @@ add_requires("imath") if is_plat("linux", "macosx") then -- For the SunFounder Car - add_requires("pca9685", {configs = {shared = true}}) + add_requires("pca9685") end -- For Functional Programming?