Series leg - #151
Open
WiseL00k wants to merge 27 commits into
Open
Conversation
…or revive functionality
There was a problem hiding this comment.
Pull request overview
This PR introduces a new SeriesLeggedManual control mode for a "series_legged" robot type, integrating leg-length/jump control, TOF-based behaviors, and motor-online sit-down handling into the existing manual-control framework.
Changes:
- Add
SeriesLeggedManual(header + implementation) and wire it intomain.cpprobot selection. - Extend chassis behavior handling (e.g.,
FALLENmode support) and applyspeed_change_scale_to RC linear velocity inputs. - Adjust power/referee-related behaviors (referee online timeout and some power-limit logic in balance mode).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/series_legged_manual.cpp | Adds the new series-legged manual controller implementation (leg length, jump, TOF, motor-online logic). |
| include/rm_manual/series_legged_manual.h | Declares the new SeriesLeggedManual class and its ROS interfaces/state. |
| src/main.cpp | Registers the new "series_legged" robot type to instantiate SeriesLeggedManual. |
| src/manual_base.cpp | Changes referee online timeout logic used by downstream subsystems. |
| src/chassis_gimbal_shooter_manual.cpp | Applies speed_change_scale_ to RC linear movement when not in gyro mode. |
| src/chassis_gimbal_manual.cpp | Adds explicit handling for rm_msgs::ChassisCmd::FALLEN in setChassisMode. |
| src/balance_manual.cpp | Adjusts power-limit/safety power behavior; leaves commented-out logic in input handlers. |
| include/rm_manual/balance_manual.h | Changes member visibility to allow derived classes (like SeriesLeggedManual) to access reverse_. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+354
to
+361
| void SeriesLeggedManual::tofSensorMsgCallback(const sensor_msgs::RangeConstPtr& msg) | ||
| { | ||
| if (msg->header.frame_id == "left_tof_link") | ||
| left_tof_len_ = msg->range; | ||
| else | ||
| right_tof_len = msg->range; | ||
| total_tof_len_ = (left_tof_len_ + right_tof_len) / 2.0; | ||
| } |
Comment on lines
+539
to
+545
| void SeriesLeggedManual::vPress() | ||
| { | ||
| std_srvs::Trigger srv; | ||
| down_5cm_stair_client_.call(srv); | ||
| speed_change_scale_ = 0.2f; | ||
| down_5cm_stair_flag_ = true; | ||
| } |
Comment on lines
+451
to
+468
| void SeriesLeggedManual::reviveMotorOnlineCallback(const rm_ecat_msgs::RmEcatStandardSlaveReadingsConstPtr& msg) | ||
| { | ||
| for (const auto& reading : msg->readings) | ||
| { | ||
| for (uint32_t i = 0; i < reading.names.size(); ++i) | ||
| { | ||
| if (reading.names[i] == "left_wheel_joint_motor") | ||
| { | ||
| left_wheel_online_ = reading.isOnline[i]; | ||
| } | ||
| else if (reading.names[i] == "right_wheel_joint_motor") | ||
| { | ||
| right_wheel_online_ = reading.isOnline[i]; | ||
| } | ||
| } | ||
| } | ||
| revive_motor_online_check_event_.update(left_wheel_online_ && right_wheel_online_); | ||
| } |
| double target_leg_length_{ 0.20 }, current_leg_length_{}; | ||
| ros::Time last_upstairs_time_{}; | ||
| double total_tof_len_{}, left_tof_len_{}, right_tof_len{}; | ||
| bool left_wheel_online_, right_wheel_online_; |
| { | ||
| is_die_flag_ = false; | ||
| setChassisMode(rm_msgs::ChassisCmd::FOLLOW); | ||
| ROS_INFO("exit sit down mode for motor offline"); |
| gimbal_power_on_event_.update(gimbal_output_on_); | ||
| shooter_power_on_event_.update(shooter_output_on_); | ||
| referee_is_online_ = (ros::Time::now() - referee_last_get_stamp_ < ros::Duration(0.3)); | ||
| referee_is_online_ = (ros::Time::now() - referee_last_get_stamp_ < ros::Duration(5.0)); |
Comment on lines
+102
to
+103
| // if (!supply_) | ||
| // chassis_cmd_sender_->power_limit_->updateState(rm_common::PowerLimit::BURST); |
Comment on lines
+120
to
+121
| // if (!supply_) | ||
| // chassis_cmd_sender_->power_limit_->updateState(rm_common::PowerLimit::BURST); |
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.