Skip to content

Commit

Permalink
rover: deprecate guidance status messages
Browse files Browse the repository at this point in the history
  • Loading branch information
chfriedrich98 committed Dec 9, 2024
1 parent d4f196d commit 04d6fda
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 68 deletions.
3 changes: 0 additions & 3 deletions msg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,10 @@ set(msg_files
RcParameterMap.msg
RegisterExtComponentReply.msg
RegisterExtComponentRequest.msg
RoverAckermannGuidanceStatus.msg
RoverAckermannSetpoint.msg
RoverAckermannStatus.msg
RoverDifferentialGuidanceStatus.msg
RoverDifferentialSetpoint.msg
RoverDifferentialStatus.msg
RoverMecanumGuidanceStatus.msg
RoverMecanumSetpoint.msg
RoverMecanumStatus.msg
Rpm.msg
Expand Down
6 changes: 0 additions & 6 deletions msg/RoverAckermannGuidanceStatus.msg

This file was deleted.

7 changes: 0 additions & 7 deletions msg/RoverDifferentialGuidanceStatus.msg

This file was deleted.

7 changes: 0 additions & 7 deletions msg/RoverMecanumGuidanceStatus.msg

This file was deleted.

3 changes: 0 additions & 3 deletions src/modules/logger/logged_topics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,10 @@ void LoggedTopics::add_default_topics()
add_topic("position_setpoint_triplet", 200);
add_optional_topic("px4io_status");
add_topic("radio_status");
add_optional_topic("rover_ackermann_guidance_status", 100);
add_optional_topic("rover_ackermann_setpoint", 100);
add_optional_topic("rover_ackermann_status", 100);
add_optional_topic("rover_differential_guidance_status", 100);
add_optional_topic("rover_differential_setpoint", 100);
add_optional_topic("rover_differential_status", 100);
add_optional_topic("rover_mecanum_guidance_status", 100);
add_optional_topic("rover_mecanum_setpoint", 100);
add_optional_topic("rover_mecanum_status", 100);
add_topic("rtl_time_estimate", 1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ using namespace time_literals;

RoverAckermannGuidance::RoverAckermannGuidance(ModuleParams *parent) : ModuleParams(parent)
{
_rover_ackermann_guidance_status_pub.advertise();
updateParams();
}

Expand Down Expand Up @@ -90,14 +89,9 @@ void RoverAckermannGuidance::computeGuidance(const float vehicle_forward_speed,

}

// Publish ackermann controller status (logging)
hrt_abstime timestamp = hrt_absolute_time();
_rover_ackermann_guidance_status.timestamp = timestamp;
_rover_ackermann_guidance_status_pub.publish(_rover_ackermann_guidance_status);

// Publish speed and steering setpoints
rover_ackermann_setpoint_s rover_ackermann_setpoint{};
rover_ackermann_setpoint.timestamp = timestamp;
rover_ackermann_setpoint.timestamp = hrt_absolute_time();
rover_ackermann_setpoint.forward_speed_setpoint = _desired_speed;
rover_ackermann_setpoint.forward_speed_setpoint_normalized = NAN;
rover_ackermann_setpoint.steering_setpoint = NAN;
Expand Down Expand Up @@ -288,10 +282,6 @@ float RoverAckermannGuidance::calcDesiredSteering(PurePursuit &pure_pursuit, con
desired_speed);
const float lookahead_distance = pure_pursuit.getLookaheadDistance();
const float heading_error = matrix::wrap_pi(desired_heading - vehicle_yaw);
// For logging
_rover_ackermann_guidance_status.lookahead_distance = lookahead_distance;
_rover_ackermann_guidance_status.heading_error = (heading_error * 180.f) / (M_PI_F);

float desired_steering{0.f};

if (!armed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
// uORB includes
#include <uORB/Publication.hpp>
#include <uORB/Subscription.hpp>
#include <uORB/topics/rover_ackermann_guidance_status.h>
#include <uORB/topics/rover_ackermann_setpoint.h>
#include <uORB/topics/position_setpoint_triplet.h>
#include <uORB/topics/vehicle_global_position.h>
Expand Down Expand Up @@ -167,9 +166,7 @@ class RoverAckermannGuidance : public ModuleParams

// uORB publications
uORB::Publication<rover_ackermann_setpoint_s> _rover_ackermann_setpoint_pub{ORB_ID(rover_ackermann_setpoint)};
uORB::Publication<rover_ackermann_guidance_status_s> _rover_ackermann_guidance_status_pub{ORB_ID(rover_ackermann_guidance_status)};
uORB::Publication<position_controller_status_s> _position_controller_status_pub{ORB_ID(position_controller_status)};
rover_ackermann_guidance_status_s _rover_ackermann_guidance_status{};

// Class instances
MapProjection _global_ned_proj_ref{}; // Transform global to NED coordinates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ RoverDifferentialGuidance::RoverDifferentialGuidance(ModuleParams *parent) : Mod
{
updateParams();
_max_forward_speed = _param_rd_max_speed.get();
_rover_differential_guidance_status_pub.advertise();
}

void RoverDifferentialGuidance::updateParams()
Expand Down Expand Up @@ -125,18 +124,9 @@ void RoverDifferentialGuidance::computeGuidance(const float vehicle_yaw, const f

}

// Publish differential guidance status (logging)
hrt_abstime timestamp = hrt_absolute_time();
rover_differential_guidance_status_s rover_differential_guidance_status{};
rover_differential_guidance_status.timestamp = timestamp;
rover_differential_guidance_status.lookahead_distance = _pure_pursuit.getLookaheadDistance();
rover_differential_guidance_status.heading_error_deg = M_RAD_TO_DEG_F * heading_error;
rover_differential_guidance_status.state_machine = (uint8_t) _currentState;
_rover_differential_guidance_status_pub.publish(rover_differential_guidance_status);

// Publish setpoints
rover_differential_setpoint_s rover_differential_setpoint{};
rover_differential_setpoint.timestamp = timestamp;
rover_differential_setpoint.timestamp = hrt_absolute_time();
rover_differential_setpoint.forward_speed_setpoint = desired_forward_speed;
rover_differential_setpoint.forward_speed_setpoint_normalized = NAN;
rover_differential_setpoint.yaw_rate_setpoint = NAN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <uORB/topics/mission_result.h>
#include <uORB/topics/home_position.h>
#include <uORB/topics/vehicle_status.h>
#include <uORB/topics/rover_differential_guidance_status.h>
#include <uORB/topics/rover_differential_setpoint.h>

// Standard libraries
Expand Down Expand Up @@ -114,7 +113,6 @@ class RoverDifferentialGuidance : public ModuleParams

// uORB publications
uORB::Publication<rover_differential_setpoint_s> _rover_differential_setpoint_pub{ORB_ID(rover_differential_setpoint)};
uORB::Publication<rover_differential_guidance_status_s> _rover_differential_guidance_status_pub{ORB_ID(rover_differential_guidance_status)};

// Variables
MapProjection _global_ned_proj_ref{}; // Transform global to ned coordinates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ RoverMecanumGuidance::RoverMecanumGuidance(ModuleParams *parent) : ModuleParams(
{
updateParams();
_max_velocity_magnitude = _param_rm_max_speed.get();
_rover_mecanum_guidance_status_pub.advertise();
}

void RoverMecanumGuidance::updateParams()
Expand Down Expand Up @@ -91,20 +90,9 @@ void RoverMecanumGuidance::computeGuidance(const float yaw, const int nav_state)
desired_velocity = desired_velocity_magnitude * Vector2f(cosf(heading_error), sinf(heading_error));
}

// Timestamp
hrt_abstime timestamp = hrt_absolute_time();

// Publish mecanum controller status (logging)
rover_mecanum_guidance_status_s rover_mecanum_guidance_status{};
rover_mecanum_guidance_status.timestamp = timestamp;
rover_mecanum_guidance_status.lookahead_distance = _pure_pursuit.getLookaheadDistance();
rover_mecanum_guidance_status.heading_error = heading_error;
rover_mecanum_guidance_status.desired_speed = desired_velocity_magnitude;
_rover_mecanum_guidance_status_pub.publish(rover_mecanum_guidance_status);

// Publish setpoints
rover_mecanum_setpoint_s rover_mecanum_setpoint{};
rover_mecanum_setpoint.timestamp = timestamp;
rover_mecanum_setpoint.timestamp = hrt_absolute_time();;
rover_mecanum_setpoint.forward_speed_setpoint = desired_velocity(0);
rover_mecanum_setpoint.forward_speed_setpoint_normalized = NAN;
rover_mecanum_setpoint.lateral_speed_setpoint = desired_velocity(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <uORB/topics/mission_result.h>
#include <uORB/topics/home_position.h>
#include <uORB/topics/vehicle_status.h>
#include <uORB/topics/rover_mecanum_guidance_status.h>
#include <uORB/topics/rover_mecanum_setpoint.h>

// Standard libraries
Expand Down Expand Up @@ -105,7 +104,6 @@ class RoverMecanumGuidance : public ModuleParams
uORB::Subscription _home_position_sub{ORB_ID(home_position)};

// uORB publications
uORB::Publication<rover_mecanum_guidance_status_s> _rover_mecanum_guidance_status_pub{ORB_ID(rover_mecanum_guidance_status)};
uORB::Publication<rover_mecanum_setpoint_s> _rover_mecanum_setpoint_pub{ORB_ID(rover_mecanum_setpoint)};

// Variables
Expand Down

0 comments on commit 04d6fda

Please sign in to comment.