Add UI for low battery state and series legged world configuration - #313
Merged
Conversation
✅ 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 adds new referee UI elements for (1) a low-capacity/battery warning flash and (2) a legged chassis “leg theta” visualization, and introduces a new Gazebo world + launch file for a “series_legged” environment. It also changes the referee online/offline timeout behavior.
Changes:
- Add
LegThetaTimeChangeGroupUito render a 2-link leg visualization driven byrm_msgs/LeggedChassisStatus, including new subscription plumbing inRefereeBase. - Add
CapacityRunOutFlashUidriven byPowerManagementSampleAndStatusData, with hysteresis to reduce UI flicker. - Add
series_legged.worldandseries_legged_world.launchfor Gazebo simulation setup.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| rm_referee/src/ui/time_change_ui.cpp | Implements leg IK point calculation and graph updates for the new leg-theta UI group. |
| rm_referee/include/rm_referee/ui/time_change_ui.h | Declares/configures the LegThetaTimeChangeGroupUi and its YAML-driven parameters. |
| rm_referee/src/ui/flash_ui.cpp | Implements low-capacity flash UI update + display behavior. |
| rm_referee/include/rm_referee/ui/flash_ui.h | Declares/configures CapacityRunOutFlashUi thresholds and state tracking. |
| rm_referee/src/referee.cpp | Adjusts offline timeout used to mark referee data as online/offline. |
| rm_referee/src/referee_base.cpp | Adds legged chassis status subscription and hooks it into UI update flow; wires new flash UI into capacity callback. |
| rm_referee/include/rm_referee/referee_base.h | Adds new subscriber/callback and UI member pointers/containers. |
| rm_gazebo/worlds/series_legged.world | Adds a new Gazebo SDF world model for the “series_legged” environment. |
| rm_gazebo/launch/series_legged_world.launch | Adds a roslaunch entrypoint to bring up Gazebo with the new world and spawn the robot. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (d < 1e-6) | ||
| { | ||
| // Avoid division by zero; place foot a tiny bit below the hip. | ||
| v = Eigen::Vector2d(0.0, 1e-3); |
Comment on lines
+395
to
+397
| const Eigen::Vector2d A(origin_point_[0], origin_point_[1]); | ||
| const Eigen::Vector2d B(foot_point_[0], foot_point_[1]); | ||
|
|
Comment on lines
+9
to
+12
| #include <rm_msgs/LeggedChassisStatus.h> | ||
|
|
||
| #include <algorithm> | ||
|
|
| } | ||
| else | ||
| { | ||
| ROS_WARN("LegThetaTimeChangeGroupUi config 's member 'data' not defined."); |
| <include file="$(find gazebo_ros)/launch/empty_world.launch"> | ||
| <arg name="world_name" value="$(find rm_gazebo)/worlds/series_legged.world"/> | ||
| <arg name="paused" value="false"/> | ||
| <arg name="use_sim_time" value="true"/>r |
Comment on lines
+31
to
+34
| <model name='series_legged_world'> | ||
| <static>1</static> | ||
| <static>1</static> | ||
| <link name='series_legged_world_link'> |
Comment on lines
+70
to
+71
| <static>1</static> | ||
| </model> |
Comment on lines
+53
to
54
| if (ros::Time::now() - last_get_data_time_ > ros::Duration(5.0)) | ||
| base_.referee_data_is_online_ = false; |
| if (d < 1e-6) | ||
| { | ||
| // Avoid division by zero; place foot a tiny bit below the hip. | ||
| v = Eigen::Vector2d(0.0, 1e-3); |
Comment on lines
+423
to
+429
| void LegThetaTimeChangeGroupUi::updateConfig() | ||
| { | ||
| const Eigen::Vector2d A(origin_point_[0], origin_point_[1]); | ||
| const Eigen::Vector2d B(foot_point_[0], foot_point_[1]); | ||
|
|
||
| for (auto& it : graph_vector_) | ||
| { |
Comment on lines
+478
to
+486
| // Virtual rod is rendered as multiple short segments (dash effect). | ||
| XmlRpc::XmlRpcValue virtual_rod_config = line_config; | ||
| if (rpc_value.hasMember("config") && rpc_value["config"].hasMember("virtual_rod_color")) | ||
| virtual_rod_config["color"] = rpc_value["config"]["virtual_rod_color"]; | ||
| if (rpc_value.hasMember("config") && rpc_value["config"].hasMember("virtual_rod_width")) | ||
| virtual_rod_config["width"] = rpc_value["config"]["virtual_rod_width"]; | ||
| else | ||
| virtual_rod_config["width"] = 1; | ||
|
|
| } | ||
| else | ||
| { | ||
| ROS_WARN("LegThetaTimeChangeGroupUi config 's member 'data' not defined."); |
Comment on lines
+31
to
+36
| <model name='series_legged_world'> | ||
| <static>1</static> | ||
| <static>1</static> | ||
| <link name='series_legged_world_link'> | ||
| <pose>-2 -0.6 0.0 0 0 0</pose> | ||
| <visual name='visual'> |
Comment on lines
+68
to
+71
| <gravity>1</gravity> | ||
| </link> | ||
| <static>1</static> | ||
| </model> |
Comment on lines
+21
to
+25
| <include file="$(find gazebo_ros)/launch/empty_world.launch"> | ||
| <arg name="world_name" value="$(find rm_gazebo)/worlds/series_legged.world"/> | ||
| <arg name="paused" value="false"/> | ||
| <arg name="use_sim_time" value="true"/>r | ||
| <arg name="gui" value="true"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.