diff --git a/ROMFS/px4fmu_common/init.d/rc.rover_differential_apps b/ROMFS/px4fmu_common/init.d/rc.rover_differential_apps index 31c79ac980..848527a9e9 100644 --- a/ROMFS/px4fmu_common/init.d/rc.rover_differential_apps +++ b/ROMFS/px4fmu_common/init.d/rc.rover_differential_apps @@ -5,7 +5,7 @@ ekf2 start & # Start rover differential drive controller. -differential_drive_control start +differential_drive start # Start Land Detector. land_detector start rover diff --git a/boards/px4/fmu-v5x/default.px4board b/boards/px4/fmu-v5x/default.px4board index 877e2d2e25..e2b5833dfe 100644 --- a/boards/px4/fmu-v5x/default.px4board +++ b/boards/px4/fmu-v5x/default.px4board @@ -53,7 +53,7 @@ CONFIG_MODULES_CAMERA_FEEDBACK=y CONFIG_MODULES_COMMANDER=y CONFIG_MODULES_CONTROL_ALLOCATOR=y CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_DIFFERENTIAL_DRIVE_CONTROL=y +CONFIG_MODULES_DIFFERENTIAL_DRIVE=y CONFIG_MODULES_EKF2=y CONFIG_MODULES_ESC_BATTERY=y CONFIG_MODULES_EVENTS=y diff --git a/boards/px4/sitl/default.px4board b/boards/px4/sitl/default.px4board index 1e254b6a9d..7dd7ce481a 100644 --- a/boards/px4/sitl/default.px4board +++ b/boards/px4/sitl/default.px4board @@ -12,7 +12,7 @@ CONFIG_MODULES_CAMERA_FEEDBACK=y CONFIG_MODULES_COMMANDER=y CONFIG_MODULES_CONTROL_ALLOCATOR=y CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_DIFFERENTIAL_DRIVE_CONTROL=y +CONFIG_MODULES_DIFFERENTIAL_DRIVE=y CONFIG_MODULES_EKF2=y CONFIG_EKF2_VERBOSE_STATUS=y CONFIG_EKF2_AUX_GLOBAL_POSITION=y diff --git a/src/modules/differential_drive_control/CMakeLists.txt b/src/modules/differential_drive/CMakeLists.txt similarity index 93% rename from src/modules/differential_drive_control/CMakeLists.txt rename to src/modules/differential_drive/CMakeLists.txt index 877e470d5f..b562a8fc2c 100644 --- a/src/modules/differential_drive_control/CMakeLists.txt +++ b/src/modules/differential_drive/CMakeLists.txt @@ -35,11 +35,11 @@ add_subdirectory(DifferentialDriveKinematics) add_subdirectory(DifferentialDriveGuidance) px4_add_module( - MODULE modules__differential_drive_control - MAIN differential_drive_control + MODULE modules__differential_drive + MAIN differential_drive SRCS - DifferentialDriveControl.cpp - DifferentialDriveControl.hpp + DifferentialDrive.cpp + DifferentialDrive.hpp DEPENDS DifferentialDriveKinematics DifferentialDriveGuidance diff --git a/src/modules/differential_drive_control/DifferentialDriveControl.cpp b/src/modules/differential_drive/DifferentialDrive.cpp similarity index 91% rename from src/modules/differential_drive_control/DifferentialDriveControl.cpp rename to src/modules/differential_drive/DifferentialDrive.cpp index 2817da472b..24e754d4e1 100644 --- a/src/modules/differential_drive_control/DifferentialDriveControl.cpp +++ b/src/modules/differential_drive/DifferentialDrive.cpp @@ -31,14 +31,12 @@ * ****************************************************************************/ -#include "DifferentialDriveControl.hpp" +#include "DifferentialDrive.hpp" using namespace time_literals; using namespace matrix; -namespace differential_drive_control -{ -DifferentialDriveControl::DifferentialDriveControl() : +DifferentialDrive::DifferentialDrive() : ModuleParams(nullptr), ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::rate_ctrl) { @@ -47,13 +45,13 @@ DifferentialDriveControl::DifferentialDriveControl() : pid_init(&_speed_pid, PID_MODE_DERIVATIV_NONE, 0.001f); } -bool DifferentialDriveControl::init() +bool DifferentialDrive::init() { ScheduleOnInterval(10_ms); // 100 Hz return true; } -void DifferentialDriveControl::updateParams() +void DifferentialDrive::updateParams() { ModuleParams::updateParams(); @@ -81,7 +79,7 @@ void DifferentialDriveControl::updateParams() _differential_guidance_controller.setMaxAngularVelocity(_max_angular_velocity); } -void DifferentialDriveControl::Run() +void DifferentialDrive::Run() { if (should_exit()) { ScheduleClear(); @@ -200,9 +198,9 @@ void DifferentialDriveControl::Run() _actuator_motors_pub.publish(actuator_motors); } -int DifferentialDriveControl::task_spawn(int argc, char *argv[]) +int DifferentialDrive::task_spawn(int argc, char *argv[]) { - DifferentialDriveControl *instance = new DifferentialDriveControl(); + DifferentialDrive *instance = new DifferentialDrive(); if (instance) { _object.store(instance); @@ -223,12 +221,12 @@ int DifferentialDriveControl::task_spawn(int argc, char *argv[]) return PX4_ERROR; } -int DifferentialDriveControl::custom_command(int argc, char *argv[]) +int DifferentialDrive::custom_command(int argc, char *argv[]) { return print_usage("unknown command"); } -int DifferentialDriveControl::print_usage(const char *reason) +int DifferentialDrive::print_usage(const char *reason) { if (reason) { PX4_ERR("%s\n", reason); @@ -240,15 +238,13 @@ int DifferentialDriveControl::print_usage(const char *reason) Rover Differential Drive controller. )DESCR_STR"); - PRINT_MODULE_USAGE_NAME("differential_drive_control", "controller"); + PRINT_MODULE_USAGE_NAME("differential_drive", "controller"); PRINT_MODULE_USAGE_COMMAND("start"); PRINT_MODULE_USAGE_DEFAULT_COMMANDS(); return 0; } -extern "C" __EXPORT int differential_drive_control_main(int argc, char *argv[]) +extern "C" __EXPORT int differential_drive_main(int argc, char *argv[]) { - return DifferentialDriveControl::main(argc, argv); + return DifferentialDrive::main(argc, argv); } - -} // namespace differential_drive_control diff --git a/src/modules/differential_drive_control/DifferentialDriveControl.hpp b/src/modules/differential_drive/DifferentialDrive.hpp similarity index 95% rename from src/modules/differential_drive_control/DifferentialDriveControl.hpp rename to src/modules/differential_drive/DifferentialDrive.hpp index 17bd0f4ba1..9090e27237 100644 --- a/src/modules/differential_drive_control/DifferentialDriveControl.hpp +++ b/src/modules/differential_drive/DifferentialDrive.hpp @@ -72,15 +72,12 @@ using namespace time_literals; static constexpr uint64_t kTimeoutUs = 5000_ms; // Maximal time in microseconds before a loop or data times out -namespace differential_drive_control -{ - -class DifferentialDriveControl : public ModuleBase, public ModuleParams, +class DifferentialDrive : public ModuleBase, public ModuleParams, public px4::ScheduledWorkItem { public: - DifferentialDriveControl(); - ~DifferentialDriveControl() override = default; + DifferentialDrive(); + ~DifferentialDrive() override = default; /** @see ModuleBase */ static int task_spawn(int argc, char *argv[]); @@ -150,5 +147,3 @@ private: (ParamInt) _param_r_rev ) }; - -} // namespace differential_drive_control diff --git a/src/modules/differential_drive_control/DifferentialDriveGuidance/CMakeLists.txt b/src/modules/differential_drive/DifferentialDriveGuidance/CMakeLists.txt similarity index 100% rename from src/modules/differential_drive_control/DifferentialDriveGuidance/CMakeLists.txt rename to src/modules/differential_drive/DifferentialDriveGuidance/CMakeLists.txt diff --git a/src/modules/differential_drive_control/DifferentialDriveGuidance/DifferentialDriveGuidance.cpp b/src/modules/differential_drive/DifferentialDriveGuidance/DifferentialDriveGuidance.cpp similarity index 100% rename from src/modules/differential_drive_control/DifferentialDriveGuidance/DifferentialDriveGuidance.cpp rename to src/modules/differential_drive/DifferentialDriveGuidance/DifferentialDriveGuidance.cpp diff --git a/src/modules/differential_drive_control/DifferentialDriveGuidance/DifferentialDriveGuidance.hpp b/src/modules/differential_drive/DifferentialDriveGuidance/DifferentialDriveGuidance.hpp similarity index 100% rename from src/modules/differential_drive_control/DifferentialDriveGuidance/DifferentialDriveGuidance.hpp rename to src/modules/differential_drive/DifferentialDriveGuidance/DifferentialDriveGuidance.hpp diff --git a/src/modules/differential_drive_control/DifferentialDriveKinematics/CMakeLists.txt b/src/modules/differential_drive/DifferentialDriveKinematics/CMakeLists.txt similarity index 100% rename from src/modules/differential_drive_control/DifferentialDriveKinematics/CMakeLists.txt rename to src/modules/differential_drive/DifferentialDriveKinematics/CMakeLists.txt diff --git a/src/modules/differential_drive_control/DifferentialDriveKinematics/DifferentialDriveKinematics.cpp b/src/modules/differential_drive/DifferentialDriveKinematics/DifferentialDriveKinematics.cpp similarity index 99% rename from src/modules/differential_drive_control/DifferentialDriveKinematics/DifferentialDriveKinematics.cpp rename to src/modules/differential_drive/DifferentialDriveKinematics/DifferentialDriveKinematics.cpp index ffa96cbe90..6c28a0b38f 100644 --- a/src/modules/differential_drive_control/DifferentialDriveKinematics/DifferentialDriveKinematics.cpp +++ b/src/modules/differential_drive/DifferentialDriveKinematics/DifferentialDriveKinematics.cpp @@ -65,4 +65,3 @@ matrix::Vector2f DifferentialDriveKinematics::computeInverseKinematics(float lin return Vector2f(linear_velocity_x - rotational_velocity, linear_velocity_x + rotational_velocity) / _max_speed; } - diff --git a/src/modules/differential_drive_control/DifferentialDriveKinematics/DifferentialDriveKinematics.hpp b/src/modules/differential_drive/DifferentialDriveKinematics/DifferentialDriveKinematics.hpp similarity index 100% rename from src/modules/differential_drive_control/DifferentialDriveKinematics/DifferentialDriveKinematics.hpp rename to src/modules/differential_drive/DifferentialDriveKinematics/DifferentialDriveKinematics.hpp diff --git a/src/modules/differential_drive_control/DifferentialDriveKinematics/DifferentialDriveKinematicsTest.cpp b/src/modules/differential_drive/DifferentialDriveKinematics/DifferentialDriveKinematicsTest.cpp similarity index 100% rename from src/modules/differential_drive_control/DifferentialDriveKinematics/DifferentialDriveKinematicsTest.cpp rename to src/modules/differential_drive/DifferentialDriveKinematics/DifferentialDriveKinematicsTest.cpp diff --git a/src/modules/differential_drive_control/Kconfig b/src/modules/differential_drive/Kconfig similarity index 59% rename from src/modules/differential_drive_control/Kconfig rename to src/modules/differential_drive/Kconfig index 9d4a0b5468..a95897e91f 100644 --- a/src/modules/differential_drive_control/Kconfig +++ b/src/modules/differential_drive/Kconfig @@ -1,5 +1,5 @@ -menuconfig MODULES_DIFFERENTIAL_DRIVE_CONTROL - bool "differential_drive_control" +menuconfig MODULES_DIFFERENTIAL_DRIVE + bool "differential_drive" default n depends on MODULES_CONTROL_ALLOCATOR ---help--- diff --git a/src/modules/differential_drive_control/module.yaml b/src/modules/differential_drive/module.yaml similarity index 98% rename from src/modules/differential_drive_control/module.yaml rename to src/modules/differential_drive/module.yaml index 6d8ab3ff29..7785402d77 100644 --- a/src/modules/differential_drive_control/module.yaml +++ b/src/modules/differential_drive/module.yaml @@ -1,4 +1,4 @@ -module_name: Differential Drive Control +module_name: Differential Drive parameters: - group: Rover Differential Drive @@ -120,4 +120,3 @@ parameters: increment: 0.01 decimal: 2 default: 0.5 -