Enhance UI and communication with recovery mode and debugging features#307
Enhance UI and communication with recovery mode and debugging features#3072194555 merged 15 commits intorm-controls:masterfrom
Conversation
# Conflicts: # rm_common/include/rm_common/decision/power_limit.h
✅ Deploy Preview for rm-control ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR appears to extend the RoboMaster stack with a new chassis recovery mode, add a generic debug-data message/publisher for runtime telemetry, and introduce a Gazebo “step_down” simulation scenario, alongside some control/limits tuning.
Changes:
- Add
RECOVERYmode torm_msgs/ChassisCmdand display it in the referee UI. - Introduce
rm_msgs/DebugDataplus a C++DebugDataPublisherhelper to publish named debug variables. - Add
step_downGazebo world + launch file and adjust some decision/filter behaviors (Kalman filter init, power/heat limit logic, serial handling inrm_refereemain).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| rm_referee/src/ui/trigger_change_ui.cpp | Maps chassis mode to UI strings; adds handling for RECOVERY. |
| rm_referee/src/main.cpp | Wraps main loop in try/catch for serial exceptions (currently introduces compile/behavior issues). |
| rm_msgs/msg/DebugData.msg | New message for publishing arrays of stamped named debug values. |
| rm_msgs/msg/ChassisCmd.msg | Adds RECOVERY = 6 chassis mode constant. |
| rm_msgs/CMakeLists.txt | Registers DebugData.msg for message generation. |
| rm_gazebo/worlds/step_down.world | New Gazebo world for step-down scenario (includes saved <state> snapshot). |
| rm_gazebo/launch/step_down.launch | New roslaunch entrypoint for the step-down world (currently invalid XML). |
| rm_common/include/rm_common/filters/kalman_filter.h | Adds clear(x, P0) and changes clear(x) covariance initialization (currently introduces a regression). |
| rm_common/include/rm_common/decision/power_limit.h | Extends “capacity online” window and adds a setter for burst power limit. |
| rm_common/include/rm_common/decision/heat_limit.h | Adds an early offline return in getShootFrequency(). |
| rm_common/include/rm_common/DebugDataPublisher.h | New helper class to accumulate/publish rm_msgs/DebugData. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Refactor main loop to simplify structure and remove exception handling.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| template <typename T1> | ||
| void clear(const Eigen::MatrixBase<T1>& x) | ||
| { | ||
| x_ = x; | ||
| inited = true; | ||
| K_ = DMat<T>::Zero(n_, m_); | ||
| P_ = DMat<T>::Zero(n_, m_); | ||
| P_new_ = DMat<T>::Zero(n_, n_); | ||
| P_.setIdentity(); | ||
| P_new_.setIdentity(); | ||
| } |
There was a problem hiding this comment.
clear(const Eigen::MatrixBase<T1>& x) now calls P_new_.setIdentity(), but P_new_ is never resized in the constructor (only P_ is). This leaves P_new_ as 0x0, and the next update() will hit Eigen dimension assertions / produce invalid math. Resize P_new_ to (n_, n_) in the ctor (or inside clear(x)) before setting it to identity.
| /** | ||
| * @brief Debug data publisher. Supports adding/updating named variables and batch publishing. | ||
| */ | ||
| class DebugDataPublisher | ||
| { | ||
| public: | ||
| /** |
There was a problem hiding this comment.
This public header introduces DebugDataPublisher into the global namespace. To avoid collisions for downstream users (and to match the pattern used by other non-template utility classes here, e.g. rm_common::LinearInterp / rm_common::PowerLimit), consider wrapping the class in namespace rm_common.
| </include> | ||
| 23 | ||
|
|
||
| <!-- push robot_description to factory an222322d spawn robot in gazebo --> |
There was a problem hiding this comment.
Typo in the XML comment: an222322d looks accidental. Replace it with and (or remove it) so the comment reads coherently.
| <!-- push robot_description to factory an222322d spawn robot in gazebo --> | |
| <!-- push robot_description to factory and spawn robot in gazebo --> |
No description provided.