Skip to content

Series leg - #151

Open
WiseL00k wants to merge 27 commits into
rm-controls:masterfrom
WiseL00k:series_leg
Open

Series leg#151
WiseL00k wants to merge 27 commits into
rm-controls:masterfrom
WiseL00k:series_leg

Conversation

@WiseL00k

Copy link
Copy Markdown

No description provided.

WiseL00k and others added 26 commits September 23, 2025 12:56
Copilot AI review requested due to automatic review settings July 12, 2026 12:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 into main.cpp robot selection.
  • Extend chassis behavior handling (e.g., FALLEN mode support) and apply speed_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");
Comment thread src/manual_base.cpp
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 thread src/balance_manual.cpp
Comment on lines +102 to +103
// if (!supply_)
// chassis_cmd_sender_->power_limit_->updateState(rm_common::PowerLimit::BURST);
Comment thread src/balance_manual.cpp
Comment on lines +120 to +121
// if (!supply_)
// chassis_cmd_sender_->power_limit_->updateState(rm_common::PowerLimit::BURST);
Copilot AI review requested due to automatic review settings July 18, 2026 13:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants