From 3764a0b19a9aa148bb857e8c0d6c58d00e86fb78 Mon Sep 17 00:00:00 2001 From: RafaGuil Date: Mon, 13 Jul 2026 00:22:33 +0000 Subject: [PATCH 1/6] fix: removed strange tv declaration on launch --- src/arussim/launch/arussim_launch.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/arussim/launch/arussim_launch.py b/src/arussim/launch/arussim_launch.py index b526277f..6f5a1f1c 100755 --- a/src/arussim/launch/arussim_launch.py +++ b/src/arussim/launch/arussim_launch.py @@ -23,8 +23,7 @@ def generate_launch_description(): ), create_node(pkg='arussim', exec='arussim_exec', - config='simulator_config.yaml', - params=[{'vehicle.torque_vectoring': True}]), + config='simulator_config.yaml'), create_node(pkg='arussim', exec='sensors_exec', config='sensors_config.yaml'), From 5758b0b243c9285b988ed1797d1a2e96a4c11ea3 Mon Sep 17 00:00:00 2001 From: RafaGuil Date: Mon, 13 Jul 2026 00:24:31 +0000 Subject: [PATCH 2/6] feat: correction of can signals && added enable logic && send GSS signals --- src/arussim/include/arussim/arussim_node.hpp | 12 +++ src/arussim/src/arussim_node.cpp | 104 +++++++++++++++++-- src/arussim/src/sensors.cpp | 100 +++++++++++++----- 3 files changed, 180 insertions(+), 36 deletions(-) diff --git a/src/arussim/include/arussim/arussim_node.hpp b/src/arussim/include/arussim/arussim_node.hpp index 32cbeff5..215d9ad4 100755 --- a/src/arussim/include/arussim/arussim_node.hpp +++ b/src/arussim/include/arussim/arussim_node.hpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include "arussim/csv_generator.hpp" @@ -171,6 +172,7 @@ class Simulator : public rclcpp::Node //raspi_sim control_raspi::ControlRaspi control_raspi_manager_; + std::array amk_enabled_ = {false, false, false, false}; visualization_msgs::msg::Marker marker_; pcl::PointCloud track_; @@ -219,6 +221,15 @@ class Simulator : public rclcpp::Node */ void on_controller_sim_timer(); + /** + * @brief Callback function for the raspi_sim timer. + * + * Periodically sends on can0 the status frames Control-RaspPi needs to + * command torque: 0x160 (autonomous mode), 0x161 (AS driving) and + * 0x221 (R2D enable flag). Only active while the simulation is launched. + */ + void on_raspi_sim_timer(); + /** * @brief Callback function for the fast timer. * @@ -353,6 +364,7 @@ class Simulator : public rclcpp::Node rclcpp::TimerBase::SharedPtr slow_timer_; rclcpp::TimerBase::SharedPtr fast_timer_; rclcpp::TimerBase::SharedPtr controller_sim_timer_; + rclcpp::TimerBase::SharedPtr raspi_sim_timer_; rclcpp::TimerBase::SharedPtr perception_timer_; rclcpp::Subscription::SharedPtr cmd_sub_; rclcpp::Subscription::SharedPtr ebs_sub_; diff --git a/src/arussim/src/arussim_node.cpp b/src/arussim/src/arussim_node.cpp index 813e0081..451be023 100644 --- a/src/arussim/src/arussim_node.cpp +++ b/src/arussim/src/arussim_node.cpp @@ -219,9 +219,12 @@ Simulator::Simulator() : Node("simulator") RCLCPP_ERROR(this->get_logger(), "Failed loading car parameters: %s", e.what()); } + // Needed in every mode: raspi_sim/hil use car_parameters_.gear_ratio to convert + // the CAN torque command (motor side) to wheel torque + this->load_control_parameters(); + if (kSimulationMode == "default") { - this->load_control_parameters(); control_init(&sensors_, &car_parameters_); // Initialize CON-VehicleControl RCLCPP_WARN(this->get_logger(), "SIL control simulation enabled."); controller_sim_timer_ = this->create_wall_timer( @@ -232,6 +235,9 @@ Simulator::Simulator() : Node("simulator") else if(kSimulationMode == "raspi_sim") { RCLCPP_WARN(this->get_logger(), "Raspi control simulation enabled."); + raspi_sim_timer_ = this->create_wall_timer( + std::chrono::milliseconds(100), + std::bind(&Simulator::on_raspi_sim_timer, this)); } else if(kSimulationMode == "hil") { @@ -641,6 +647,43 @@ void Simulator::on_controller_sim_timer() write(can_socket_0_, &frame, sizeof(struct can_frame)); } +/** + * @brief Timer callback for raspi_sim mode. + * + * While the simulation is launched (as_status_ == 0x03), periodically sends on can0 + * the frames Control-RaspPi needs to command torque: + * - 0x160: data[2] != 0 -> dv_.autonomous = 1 + * - 0x161: data[0] == 0x03 -> dv_.driving = 1 + * - 0x221: data[0] -> enable_flag_ (R2D), required to start the inverters enable sequence + */ +void Simulator::on_raspi_sim_timer() +{ + if (as_status_ != 0x03) + return; + + struct can_frame frame; + std::memset(&frame, 0, sizeof(frame)); + + // Autonomous mode + frame.can_id = 0x160; + frame.can_dlc = 3; + frame.data[2] = 0x01; + write(can_socket_0_, &frame, sizeof(struct can_frame)); + + // AS status: driving + std::memset(frame.data, 0, sizeof(frame.data)); + frame.can_id = 0x161; + frame.can_dlc = 1; + frame.data[0] = 0x03; + write(can_socket_0_, &frame, sizeof(struct can_frame)); + + // R2D enable flag + frame.can_id = 0x221; + frame.can_dlc = 1; + frame.data[0] = 0x01; + write(can_socket_0_, &frame, sizeof(struct can_frame)); +} + /** * @brief Fast timer callback for state updates. * @@ -666,8 +709,18 @@ void Simulator::on_fast_timer() vehicle_dynamics_.vx_ = 0.0; vehicle_dynamics_.vy_ = 0.0; vehicle_dynamics_.r_ = 0.0; + + // DEBUG: EBS active -> vx forced to 0 every tick, the car cannot move + RCLCPP_WARN_THROTTLE(this->get_logger(), *this->get_clock(), 1000, + "[FAST] EBS activo: as_status=0x%02X (!= 0x03), velocidad forzada a 0", as_status_); } + // DEBUG: what reaches the dynamics every tick (1 Hz) + RCLCPP_INFO_THROTTLE(this->get_logger(), *this->get_clock(), 1000, + "[FAST] as_status=0x%02X | can_torque=[%.2f %.2f %.2f %.2f] delta=%.3f | vx=%.3f x=%.2f", + as_status_, can_torque_cmd_[0], can_torque_cmd_[1], can_torque_cmd_[2], can_torque_cmd_[3], + can_delta_, vehicle_dynamics_.vx_, vehicle_dynamics_.x_); + double dt = 1.0 / kStateUpdateRate; if (kSimulationMode == "default") @@ -839,6 +892,47 @@ void Simulator::receive_can_1() continue; } + // Setpoints from Control-RaspPi: enable sequence and torque command per motor + if (frame_1_.can_id == 0x200 || frame_1_.can_id == 0x203 || + frame_1_.can_id == 0x206 || frame_1_.can_id == 0x209) + { + int idx = (frame_1_.can_id - 0x200) / 3; // 0,1,2,3 + + int16_t torque_scaled = static_cast((frame_1_.data[3] << 8) | frame_1_.data[2]); + can_torque_cmd_.at(idx) = torque_scaled * 9.8 / 1000.0 * car_parameters_.gear_ratio; + + // DEBUG: confirm torque reception and scaling (1 Hz) + RCLCPP_INFO_THROTTLE(this->get_logger(), *this->get_clock(), 1000, + "[CAN1 rx] torque motor %d: raw=%d -> %.2f Nm rueda (gear_ratio=%.2f) | cmd=[%.2f %.2f %.2f %.2f]", + idx, torque_scaled, can_torque_cmd_.at(idx), car_parameters_.gear_ratio, + can_torque_cmd_[0], can_torque_cmd_[1], can_torque_cmd_[2], can_torque_cmd_[3]); + + if (kSimulationMode == "raspi_sim") + { + if (!amk_enabled_.at(idx)) + { + amk_enabled_.at(idx) = true; + RCLCPP_INFO(this->get_logger(), + "Enable sequence detected for motor %d, replying inverter enabled", idx); + } + + // Emulate inverter status: (data[1] & 0x62) == 0x60 -> enable_amk_[idx] = 1 + static constexpr uint32_t kAmkStatusIds[4] = {0x100, 0x104, 0x108, 0x112}; + struct can_frame status_frame; + std::memset(&status_frame, 0, sizeof(status_frame)); + status_frame.can_id = kAmkStatusIds[idx]; + status_frame.can_dlc = 8; + status_frame.data[1] = 0x60; + if (idx == 0) + { + // 0x100 also carries the DC bus voltage in data[6..7] + int16_t dc_voltage = static_cast(sensors_.battery_voltage); + status_frame.data[6] = dc_voltage & 0xFF; + status_frame.data[7] = (dc_voltage >> 8) & 0xFF; + } + write(can_socket_1_, &status_frame, sizeof(struct can_frame)); + } + } } } @@ -855,13 +949,6 @@ void Simulator::receive_can_2() continue; } - if (frame_0_.can_id == 0x200 || frame_0_.can_id == 0x203 || - frame_0_.can_id == 0x206 || frame_0_.can_id == 0x209) - { - int idx = (frame_0_.can_id - 0x200) / 3; // 0,1,2,3 - int16_t torque_scaled = static_cast((frame_0_.data[3] << 8) | frame_0_.data[2]); - can_torque_cmd_.at(idx) = torque_scaled * 9.8 / 1000.0 * car_parameters_.gear_ratio; - } } } @@ -993,6 +1080,7 @@ void Simulator::reset_callback([[maybe_unused]] const std_msgs::msg::Bool::Share can_delta_ = 0.0; can_target_r_ = 0.0; can_torque_cmd_ = {0.0, 0.0, 0.0, 0.0}; + amk_enabled_ = {false, false, false, false}; as_status_ = 0x02; vehicle_dynamics_ = VehicleDynamics(); diff --git a/src/arussim/src/sensors.cpp b/src/arussim/src/sensors.cpp index 3f329f35..487f6fd0 100644 --- a/src/arussim/src/sensors.cpp +++ b/src/arussim/src/sensors.cpp @@ -175,14 +175,23 @@ Sensors::Sensors() : Node("sensors") {"GSS/yaw_rate", {32, 47, true, 0.02*M_PI/180, 0.0}} }, Sensors::CanBus::kCan1 }, - {0x1B0, 4, { // IMU accelerations + {0x1B0, 6, { // IMU accelerations (Control-RaspPi reads it on can2) {"IMU/ax", {0, 15, true, 0.01, 0.0}}, {"IMU/ay", {16, 31, true, 0.01, 0.0}}, - }, Sensors::CanBus::kCan1 + }, Sensors::CanBus::kCan2 }, - {0x1B1, 6, { // IMU rates - {"IMU/yaw_rate", {32, 47, true, 1.0, 0.0}} - }, Sensors::CanBus::kCan1 + {0x1B1, 6, { // IMU rates (Control-RaspPi decodes rad/s with factor 0.001) + {"IMU/yaw_rate", {32, 47, true, 0.001, 0.0}} + }, Sensors::CanBus::kCan2 + }, + {0x540, 8, { // Doppla GSS speeds (Control-RaspPi reads it on can2, m/s x0.01) + {"Doppla/vx", {32, 47, true, 0.01, 0.0}}, + {"Doppla/vy", {48, 63, true, 0.01, 0.0}} + }, Sensors::CanBus::kCan2 + }, + {0x54A, 1, { // Doppla GSS status (bit 0 of data0 = 1 -> GSS OK) + {"Doppla/status", {0, 7, false, 1.0, 0.0}} + }, Sensors::CanBus::kCan2 }, {0x134, 2, { // Extensometer {"extensometer", {0, 15, true, 0.000035, -0.482442}} @@ -195,6 +204,28 @@ Sensors::Sensors() : Node("sensors") {"rr_inv_speed", {96, 127, true, 0.01, 0.0}}, // Rear Right inverter }, Sensors::CanBus::kCan2 }, + // AMK inverters actual values: motor speed (raw x0.0001 = rpm) and + // motor torque (raw x0.0098 = Nm). Control-RaspPi reads them on can1. + {0x102, 8, { // Motor 0: Front Left + {"motor_speed", {0, 31, true, 0.0001 * 2 * M_PI / 60, 0.0}}, + {"motor_torque", {32, 47, true, 0.1 * 9.8 / 100, 0.0}} + }, Sensors::CanBus::kCan1 + }, + {0x106, 8, { // Motor 1: Front Right + {"motor_speed", {0, 31, true, 0.0001 * 2 * M_PI / 60, 0.0}}, + {"motor_torque", {32, 47, true, 0.1 * 9.8 / 100, 0.0}} + }, Sensors::CanBus::kCan1 + }, + {0x110, 8, { // Motor 2: Rear Left + {"motor_speed", {0, 31, true, 0.0001 * 2 * M_PI / 60, 0.0}}, + {"motor_torque", {32, 47, true, 0.1 * 9.8 / 100, 0.0}} + }, Sensors::CanBus::kCan1 + }, + {0x114, 8, { // Motor 3: Rear Right + {"motor_speed", {0, 31, true, 0.0001 * 2 * M_PI / 60, 0.0}}, + {"motor_torque", {32, 47, true, 0.1 * 9.8 / 100, 0.0}} + }, Sensors::CanBus::kCan1 + }, {0x100, 2, { {"enable_amk_status_byte1", {8, 15, false, 1.0, 0.0}} }, Sensors::CanBus::kCan2 @@ -211,10 +242,6 @@ Sensors::Sensors() : Node("sensors") {"enable_amk_status_byte1", {8, 15, false, 1.0, 0.0}} }, Sensors::CanBus::kCan2 }, - {0x161, 2, { - {"dv_driving", {0, 7, false, 1.0, 0.0}}, - }, Sensors::CanBus::kCan0 - }, {0x221, 1, { {"enable_flag", {0, 7, false, 1.0, 0.0}} }, Sensors::CanBus::kCan0 @@ -397,17 +424,30 @@ void Sensors::inverter_timer() //Send Inverter CAN frames std::map values = { - {"fl_inv_speed", motor_speed_msg.front_left}, - {"fr_inv_speed", motor_speed_msg.front_right}, - {"rl_inv_speed", motor_speed_msg.rear_left}, + {"fl_inv_speed", motor_speed_msg.front_left}, + {"fr_inv_speed", motor_speed_msg.front_right}, + {"rl_inv_speed", motor_speed_msg.rear_left}, {"rr_inv_speed", motor_speed_msg.rear_right}, {"enable_amk_status_byte1", 96.0} - }; + }; - for (auto &frame : frames) { - if (frame.id == 0x123) { + // AMK actual values per motor (0 = FL, 1 = FR, 2 = RL, 3 = RR), read by Control-RaspPi on can1 + const std::array>, 4> amk_values = {{ + {0x102, {{"motor_speed", motor_speed_msg.front_left}, {"motor_torque", torque_msg.front_left}}}, + {0x106, {{"motor_speed", motor_speed_msg.front_right}, {"motor_torque", torque_msg.front_right}}}, + {0x110, {{"motor_speed", motor_speed_msg.rear_left}, {"motor_torque", torque_msg.rear_left}}}, + {0x114, {{"motor_speed", motor_speed_msg.rear_right}, {"motor_torque", torque_msg.rear_right}}} + }}; + + for (auto &frame : frames) { + if (frame.id == 0x123) { send_can_frame(frame, values); } + for (const auto &amk : amk_values) { + if (frame.id == amk.first) { + send_can_frame(frame, amk.second); + } + } } } @@ -432,15 +472,18 @@ void Sensors::groundspeed_timer() gss_vx_pub_->publish(msg_vx); gss_vy_pub_->publish(msg_vy); - std::map values = { {"GSS/ax", ax_ + dist_ax(gen)}, - {"GSS/ay", ay_ + dist_ay(gen)}, {"GSS/yaw_rate", r_ + dist_r(gen)}, - {"GSS/vx", vx_ + dist_vx(gen)}, {"GSS/vy", vy_ + dist_vy(gen)} }; + std::map values = { {"GSS/ax", ax_ + dist_ax(gen)}, + {"GSS/ay", ay_ + dist_ay(gen)}, {"GSS/yaw_rate", r_ + dist_r(gen)}, + {"GSS/vx", vx_ + dist_vx(gen)}, {"GSS/vy", vy_ + dist_vy(gen)}, + {"Doppla/vx", vx_ + dist_vx(gen)}, {"Doppla/vy", vy_ + dist_vy(gen)}, + {"Doppla/status", 1.0} }; + + for (auto &frame : frames) { + if (frame.id == 0x1A3 || frame.id == 0x1A4 || frame.id == 0x1A0 || + frame.id == 0x540 || frame.id == 0x54A) { + send_can_frame(frame, values); + } - for (auto &frame : frames) { - if (frame.id == 0x1A3 || frame.id == 0x1A4 || frame.id == 0x1A0) { - send_can_frame(frame, values); - } - } } @@ -486,12 +529,13 @@ void Sensors::bms_timer() { void Sensors::as_timer() { - std::map values = { {"dv_driving", as_status_}, {"enable_flag", 1.0} }; + // 0x161 (dv_driving) is sent by the arussim node in raspi_sim mode + std::map values = { {"enable_flag", 1.0} }; - for (auto &frame : frames) { - if (frame.id == 0x161 || frame.id == 0x221) { - send_can_frame(frame, values); - } + for (auto &frame : frames) { + if (frame.id == 0x221) { + send_can_frame(frame, values); + } } } From f4c6ccfe6ffda487b96c4b342f7f15d73103ec1a Mon Sep 17 00:00:00 2001 From: RafaGuil Date: Mon, 13 Jul 2026 00:26:01 +0000 Subject: [PATCH 3/6] feat: added more descriptive debug couts for potential errors --- src/arussim/include/arussim/control_raspi.hpp | 99 ++++++------------- src/arussim/include/arussim/sensors.hpp | 2 + 2 files changed, 32 insertions(+), 69 deletions(-) diff --git a/src/arussim/include/arussim/control_raspi.hpp b/src/arussim/include/arussim/control_raspi.hpp index d41f5b74..bd82d0ea 100644 --- a/src/arussim/include/arussim/control_raspi.hpp +++ b/src/arussim/include/arussim/control_raspi.hpp @@ -20,9 +20,10 @@ namespace control_raspi { namespace { - // Relative path from the ControlRaspi executable to the Control-RaspPi executable - // Change this path if doesn't match your workspace structure - constexpr const char *kControlRaspRelativePath = "../../../../../ws_raspi/src/Control-RaspPi/build/ControlRaspi"; + // Path to the Control-RaspPi executable, relative to some ancestor directory of the + // arussim executable (searched upwards, so it works from both build/ and install/ layouts). + // Change this path if it doesn't match your workspace structure. + constexpr const char *kControlRaspFromAncestor = "ws_raspi/src/Control-RaspPi/build/ControlRaspi"; /** * @brief Get the directory of the current executable @@ -183,43 +184,49 @@ namespace control_raspi private: /** - * @brief Get the directory of the current executable - * - * Not found or Not executable are related to a feilure to resolve the relative path + * @brief Resolve the path to the Control-RaspPi executable * + * Walks up from the arussim executable directory looking for + * kControlRaspFromAncestor at each level, so it works regardless of + * whether arussim runs from install/ (real copy) or build/ (symlink install). */ std::string resolve_control_rasp_path(rclcpp::Logger logger) const { const std::string exe_dir = get_executable_dir(); if (exe_dir.empty()) - return std::string{}; - - std::error_code error; - fs::path candidate = fs::path(exe_dir) / kControlRaspRelativePath; - fs::path normalized = fs::weakly_canonical(candidate, error); - if (error) - normalized = candidate; - - if (!fs::exists(normalized)) { - RCLCPP_ERROR(logger, "ControlRaspi not found: %s", normalized.string().c_str()); + RCLCPP_ERROR(logger, "Failed to resolve arussim executable directory"); return std::string{}; } - if (access(normalized.c_str(), X_OK) != 0) + std::error_code error; + for (fs::path dir = fs::path(exe_dir); !dir.empty(); dir = dir.parent_path()) { - RCLCPP_ERROR(logger, "ControlRaspi not executable: %s", normalized.string().c_str()); - return std::string{}; + fs::path candidate = dir / kControlRaspFromAncestor; + if (fs::exists(candidate, error) && !error) + { + if (access(candidate.c_str(), X_OK) != 0) + { + RCLCPP_ERROR(logger, "ControlRaspi found but not executable: %s", candidate.string().c_str()); + return std::string{}; + } + return candidate.string(); + } + + if (dir == dir.parent_path()) + break; } - return normalized.string(); + RCLCPP_ERROR(logger, "ControlRaspi not found: searched for '%s' in every ancestor of %s", + kControlRaspFromAncestor, exe_dir.c_str()); + return std::string{}; } /** * @brief Resolve the working directory for Control-RaspPi * - * This function assumes that the working directory is the parent directory of the Control-RaspPi executable. - * It checks if the directory exists and contains a parameters.yaml file to validate it. + * The working directory must be the Control-RaspPi repo root (parent of build/), + * since the executable loads its parameters internally from ./include/ART-Parameters/. */ std::string resolve_control_rasp_working_dir(const std::string &control_rasp_path, rclcpp::Logger logger) const { @@ -240,13 +247,6 @@ namespace control_raspi return std::string{}; } - fs::path parameters_yaml = repo_dir / "config" / "parameters.yaml"; - if (!fs::exists(parameters_yaml)) - { - RCLCPP_ERROR(logger, "parameters.yaml not found at: %s", parameters_yaml.string().c_str()); - return std::string{}; - } - return repo_dir.string(); } @@ -254,43 +254,4 @@ namespace control_raspi std::atomic stopping_{false}; }; -} // namespace control_raspi - -/*#pragma once - -#include -#include - -#include - -#include -#include -#include - -namespace control_raspi -{ - - class ControlRaspi : public rclcpp::Node - { - public: - explicit ControlRaspi(const rclcpp::NodeOptions &options = rclcpp::NodeOptions()); - - private: - void launch_callback(const std_msgs::msg::Bool::SharedPtr msg); - void reset_callback(const std_msgs::msg::Bool::SharedPtr msg); - - void start_control_rasp(); - void stop_control_rasp(); - - std::string resolve_control_rasp_path() const; - std::string resolve_control_rasp_working_dir(const std::string &control_rasp_path) const; - - rclcpp::Subscription::SharedPtr launch_raspi_; - rclcpp::Subscription::SharedPtr reset_raspi_; - - std::optional control_rasp_pid_; - std::atomic stopping_{false}; - }; - -} // namespace control_raspi -*/ \ No newline at end of file +} // namespace control_raspi \ No newline at end of file diff --git a/src/arussim/include/arussim/sensors.hpp b/src/arussim/include/arussim/sensors.hpp index fea03c01..7ea19787 100644 --- a/src/arussim/include/arussim/sensors.hpp +++ b/src/arussim/include/arussim/sensors.hpp @@ -14,9 +14,11 @@ #include #include "arussim_msgs/msg/four_wheel_drive.hpp" #include "std_msgs/msg/float32.hpp" +#include #include #include #include +#include #include #include #include From b312271e1dc4c4db7f277b9b6c9cb2c90462b11c Mon Sep 17 00:00:00 2001 From: RafaGuil Date: Mon, 13 Jul 2026 00:26:41 +0000 Subject: [PATCH 4/6] feat: changed to raspi_sim simulation mode --- src/arussim/config/simulator_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arussim/config/simulator_config.yaml b/src/arussim/config/simulator_config.yaml index e2394d2a..8d7beb66 100755 --- a/src/arussim/config/simulator_config.yaml +++ b/src/arussim/config/simulator_config.yaml @@ -1,7 +1,7 @@ arussim: ros__parameters: simulation_car: 'ART_26D_DV_old_tires' # str Simulation car model - simulation_mode: 'default' # str default/raspi_sim/hil + simulation_mode: 'raspi_sim' # str default/raspi_sim/hil track: "FSG" state_update_rate: 1000.0 # Hz controller_rate: 200.0 # Hz From 0ffcf234f42417c91034d33ca1fac709207f92d5 Mon Sep 17 00:00:00 2001 From: RafaGuil Date: Mon, 13 Jul 2026 00:33:18 +0000 Subject: [PATCH 5/6] refactor: maybe I exceeded myself with debug couts --- src/arussim/src/arussim_node.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/arussim/src/arussim_node.cpp b/src/arussim/src/arussim_node.cpp index 451be023..0d954875 100644 --- a/src/arussim/src/arussim_node.cpp +++ b/src/arussim/src/arussim_node.cpp @@ -709,18 +709,8 @@ void Simulator::on_fast_timer() vehicle_dynamics_.vx_ = 0.0; vehicle_dynamics_.vy_ = 0.0; vehicle_dynamics_.r_ = 0.0; - - // DEBUG: EBS active -> vx forced to 0 every tick, the car cannot move - RCLCPP_WARN_THROTTLE(this->get_logger(), *this->get_clock(), 1000, - "[FAST] EBS activo: as_status=0x%02X (!= 0x03), velocidad forzada a 0", as_status_); } - // DEBUG: what reaches the dynamics every tick (1 Hz) - RCLCPP_INFO_THROTTLE(this->get_logger(), *this->get_clock(), 1000, - "[FAST] as_status=0x%02X | can_torque=[%.2f %.2f %.2f %.2f] delta=%.3f | vx=%.3f x=%.2f", - as_status_, can_torque_cmd_[0], can_torque_cmd_[1], can_torque_cmd_[2], can_torque_cmd_[3], - can_delta_, vehicle_dynamics_.vx_, vehicle_dynamics_.x_); - double dt = 1.0 / kStateUpdateRate; if (kSimulationMode == "default") From 658d6880130b2fc0fb783e9d652b01dd46167535 Mon Sep 17 00:00:00 2001 From: Rodrigo-AO Date: Mon, 24 Aug 2026 17:44:06 +0200 Subject: [PATCH 6/6] fix: corrected enable can channel --- src/arussim/src/sensors.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arussim/src/sensors.cpp b/src/arussim/src/sensors.cpp index 487f6fd0..d503c941 100644 --- a/src/arussim/src/sensors.cpp +++ b/src/arussim/src/sensors.cpp @@ -228,19 +228,19 @@ Sensors::Sensors() : Node("sensors") }, {0x100, 2, { {"enable_amk_status_byte1", {8, 15, false, 1.0, 0.0}} - }, Sensors::CanBus::kCan2 + }, Sensors::CanBus::kCan1 }, {0x104, 2, { {"enable_amk_status_byte1", {8, 15, false, 1.0, 0.0}} - }, Sensors::CanBus::kCan2 + }, Sensors::CanBus::kCan1 }, {0x108, 2, { {"enable_amk_status_byte1", {8, 15, false, 1.0, 0.0}} - }, Sensors::CanBus::kCan2 + }, Sensors::CanBus::kCan1 }, {0x112, 2, { {"enable_amk_status_byte1", {8, 15, false, 1.0, 0.0}} - }, Sensors::CanBus::kCan2 + }, Sensors::CanBus::kCan1 }, {0x221, 1, { {"enable_flag", {0, 7, false, 1.0, 0.0}}