generated from wessel/boilerplate
fix(naming): Change all to UpperCamelCase
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Simulator Unit Tests
|
||||
|
||||
Unit tests for `Simulator` are implemented in `src/g2_2025_odometry_pkg/test/test_simulator.cpp` using Google Test and ROS2 test utilities. The tests validate interval-based value generation with different interpolation types.
|
||||
Unit tests for the `Simulator` class are implemented in `src/g2_2025_odometry_pkg/test/test_simulator.cpp` using Google Test and ROS2 test utilities. The tests validate interval-based value generation with different interpolation types.
|
||||
|
||||
## Test Cases
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ find_package(geometry_msgs REQUIRED)
|
||||
find_package(std_msgs REQUIRED)
|
||||
|
||||
add_executable(imu_data_simulator_node
|
||||
src/g2_2025_imu_data_simulator_node/nodes/imu_data_simulator.cpp
|
||||
src/g2_2025_imu_data_simulator_node/nodes/ImuDataSimulator.cpp
|
||||
src/g2_2025_imu_data_simulator_node/main.cpp
|
||||
src/simulator/Simulator.cpp)
|
||||
|
||||
@@ -28,7 +28,7 @@ target_include_directories(imu_data_simulator_node PRIVATE
|
||||
ament_target_dependencies(imu_data_simulator_node rclcpp sensor_msgs geometry_msgs)
|
||||
|
||||
add_executable(wheel_data_simulator_node
|
||||
src/g2_2025_wheel_data_simulator_node/nodes/wheel_data_simulator.cpp
|
||||
src/g2_2025_wheel_data_simulator_node/nodes/WheelDataSimulator.cpp
|
||||
src/g2_2025_wheel_data_simulator_node/main.cpp
|
||||
src/simulator/Simulator.cpp)
|
||||
|
||||
@@ -53,13 +53,13 @@ if(BUILD_TESTING)
|
||||
find_package(ament_cmake_gtest REQUIRED)
|
||||
|
||||
# Simulator unit tests
|
||||
ament_add_gtest(test_simulator test/test_simulator.cpp src/simulator/Simulator.cpp)
|
||||
ament_add_gtest(test_simulator test/TestSimulator.cpp src/simulator/Simulator.cpp)
|
||||
target_include_directories(test_simulator PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
ament_target_dependencies(test_simulator rclcpp)
|
||||
|
||||
# IMU simulator integration tests
|
||||
ament_add_gtest(test_imu_simulator test/test_imu_simulator.cpp
|
||||
src/g2_2025_imu_data_simulator_node/nodes/imu_data_simulator.cpp
|
||||
ament_add_gtest(test_imu_simulator test/TestImuSimulator.cpp
|
||||
src/g2_2025_imu_data_simulator_node/nodes/ImuDataSimulator.cpp
|
||||
src/simulator/Simulator.cpp)
|
||||
target_include_directories(test_imu_simulator PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
@@ -67,8 +67,8 @@ if(BUILD_TESTING)
|
||||
ament_target_dependencies(test_imu_simulator rclcpp sensor_msgs geometry_msgs)
|
||||
|
||||
# Wheel simulator integration tests
|
||||
ament_add_gtest(test_wheel_simulator test/test_wheel_simulator.cpp
|
||||
src/g2_2025_wheel_data_simulator_node/nodes/wheel_data_simulator.cpp
|
||||
ament_add_gtest(test_wheel_simulator test/TestWheelSimulator.cpp
|
||||
src/g2_2025_wheel_data_simulator_node/nodes/WheelDataSimulator.cpp
|
||||
src/simulator/Simulator.cpp)
|
||||
target_include_directories(test_wheel_simulator PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
imu_data_simulator:
|
||||
ros__parameters:
|
||||
max_intervals: 4
|
||||
publish_rate: 10.0
|
||||
linear_x:
|
||||
num_intervals: 2
|
||||
num_intervals: 4
|
||||
interval_0:
|
||||
type: "linear"
|
||||
t_start: 0.0
|
||||
@@ -11,10 +12,22 @@ imu_data_simulator:
|
||||
y_end: 9.81
|
||||
interval_1:
|
||||
type: "linear"
|
||||
t_start: 10.0
|
||||
t_end: 15.0
|
||||
t_start: 7.5
|
||||
t_end: 12.5
|
||||
y_start: 9.81
|
||||
y_end: 0.0
|
||||
interval_2:
|
||||
type: "linear"
|
||||
t_start: 15.0
|
||||
t_end: 20.0
|
||||
y_start: 0.0
|
||||
y_end: -9.81
|
||||
interval_3:
|
||||
type: "linear"
|
||||
t_start: 22.5
|
||||
t_end: 25.0
|
||||
y_start: -9.81
|
||||
y_end: 0.0
|
||||
angular_z:
|
||||
num_intervals: 1
|
||||
interval_0:
|
||||
@@ -22,15 +35,23 @@ imu_data_simulator:
|
||||
t_start: 2.0
|
||||
y_start: 1.57
|
||||
angular_x:
|
||||
num_intervals: 1
|
||||
num_intervals: 2
|
||||
interval_0:
|
||||
type: "quadratic"
|
||||
t_start: 3.0
|
||||
y_start: 0.785
|
||||
y_start: 0.0
|
||||
t_mid: 4.5
|
||||
y_mid: 1.57
|
||||
t_end: 6.0
|
||||
y_end: 0.0
|
||||
interval_1:
|
||||
type: "quadratic"
|
||||
t_start: 7.0
|
||||
y_start: 0.0
|
||||
t_mid: 8.5
|
||||
y_mid: -1.57
|
||||
t_end: 10.0
|
||||
y_end: 0.0
|
||||
|
||||
wheel_data_simulator:
|
||||
ros__parameters:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "rclcpp/rclcpp.hpp"
|
||||
#include "nodes/imu_data_simulator.hpp"
|
||||
#include "nodes/ImuDataSimulator.hpp"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rclcpp::init(argc, argv);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "imu_data_simulator.hpp"
|
||||
#include "ImuDataSimulator.hpp"
|
||||
|
||||
namespace assignments::three::data_simulator_node {
|
||||
|
||||
DataSimulator::DataSimulator() : Node("imu_data_simulator") {
|
||||
RCLCPP_INFO(this->get_logger(), "DataSimulator node created");
|
||||
RCLCPP_INFO(this->get_logger(), "ImuDataSimulator node created");
|
||||
|
||||
start_time_ = this->now();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "rclcpp/rclcpp.hpp"
|
||||
#include "nodes/wheel_data_simulator.hpp"
|
||||
#include "nodes/WheelDataSimulator.hpp"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rclcpp::init(argc, argv);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "wheel_data_simulator.hpp"
|
||||
#include "WheelDataSimulator.hpp"
|
||||
|
||||
namespace assignments::three::wheel_data_simulator_node {
|
||||
|
||||
DataSimulator::DataSimulator() : Node("wheel_data_simulator") {
|
||||
RCLCPP_INFO(this->get_logger(), "DataSimulator node created");
|
||||
RCLCPP_INFO(this->get_logger(), "WheelDataSimulator node created");
|
||||
|
||||
start_time_ = this->now();
|
||||
|
||||
@@ -29,7 +29,7 @@ DataSimulator::DataSimulator() : Node("wheel_data_simulator") {
|
||||
}
|
||||
|
||||
DataSimulator::~DataSimulator() {
|
||||
RCLCPP_INFO(this->get_logger(), "DataSimulator node destroyed");
|
||||
RCLCPP_INFO(this->get_logger(), "WheelDataSimulator node destroyed");
|
||||
}
|
||||
|
||||
void DataSimulator::publish_wheel_data() {
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <sensor_msgs/msg/imu.hpp>
|
||||
#include "g2_2025_imu_data_simulator_node/nodes/imu_data_simulator.hpp"
|
||||
#include "g2_2025_imu_data_simulator_node/nodes/ImuDataSimulator.hpp"
|
||||
#include <memory>
|
||||
|
||||
using namespace assignments::three::data_simulator_node;
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <std_msgs/msg/float64_multi_array.hpp>
|
||||
#include "g2_2025_wheel_data_simulator_node/nodes/wheel_data_simulator.hpp"
|
||||
#include "g2_2025_wheel_data_simulator_node/nodes/WheelDataSimulator.hpp"
|
||||
#include <memory>
|
||||
|
||||
using namespace assignments::three::wheel_data_simulator_node;
|
||||
Reference in New Issue
Block a user