Skip to content

Commit

Permalink
Revert "Merge rm_manual of 2024 engineer and engineer2."
Browse files Browse the repository at this point in the history
  • Loading branch information
cc0h authored Sep 30, 2024
1 parent 6f75aa3 commit 9267aa6
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 1,405 deletions.
193 changes: 0 additions & 193 deletions include/rm_manual/engineer2_manual.h

This file was deleted.

31 changes: 8 additions & 23 deletions include/rm_manual/engineer_manual.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <rm_msgs/MultiDofCmd.h>
#include <rm_msgs/GpioData.h>
#include <rm_msgs/EngineerUi.h>
#include <stack>

namespace rm_manual
{
Expand Down Expand Up @@ -49,13 +48,6 @@ class EngineerManual : public ChassisGimbalManual
EXCHANGE
};

enum ServoOrientation
{
MID,
RIGHT,
LEFT
};

EngineerManual(ros::NodeHandle& nh, ros::NodeHandle& nh_referee);
void run() override;

Expand Down Expand Up @@ -130,47 +122,40 @@ class EngineerManual : public ChassisGimbalManual
void shiftBPress();
void shiftBRelease();
void shiftCPress();
void shiftEPress();
void shiftFPress();
void shiftGPress();
void shiftQPress();
void shiftRPress();
void shiftRRelease();
void shiftVPress();
void shiftVRelease();
void shiftXPress();
void shiftZPress();
void shiftZRelease();

void mouseLeftRelease();
void mouseRightRelease();

// Servo

bool change_flag_{}, ore_rotator_pos_{ false }, shift_z_pressed_{ false }, ore_lifter_on_{ false },
v_pressed_{ false };

bool change_flag_{};
double angular_z_scale_{}, gyro_scale_{}, fast_gyro_scale_{}, low_gyro_scale_{}, normal_gyro_scale_{},
exchange_gyro_scale_{}, fast_speed_scale_{}, low_speed_scale_{}, normal_speed_scale_{}, exchange_speed_scale_{};

std::string prefix_{}, root_{}, reversal_state_{}, drag_state_{ "off" }, gripper_state_{ "off" }, last_ore_{};

int operating_mode_{}, servo_mode_{}, servo_orientation_{ 0 }, gimbal_mode_{}, gimbal_height_{ 0 },
gimbal_direction_{ 0 }, ore_lifter_pos_{ 0 };

std::stack<std::string> stone_num_{};
std::string prefix_{}, root_{}, reversal_state_{}, drag_state_{ "off" }, gripper_state_{ "off" };
int operating_mode_{}, servo_mode_{}, gimbal_mode_{}, stone_num_{ 0 }, gimbal_height_{ 0 };

ros::Time last_time_;
ros::Subscriber stone_num_sub_, gripper_state_sub_;
ros::Publisher engineer_ui_pub_;

rm_msgs::GpioData gpio_state_;
rm_msgs::EngineerUi engineer_ui_, old_ui_;
rm_msgs::EngineerUi engineer_ui_;

rm_common::Vel3DCommandSender* servo_command_sender_;
rm_common::ServiceCallerBase<std_srvs::Empty>* servo_reset_caller_;

rm_common::CalibrationQueue *calibration_gather_{}, *pitch_calibration_, *ore_bin_lifter_calibration_{};
rm_common::JointPositionBinaryCommandSender *extend_arm_a_command_sender_, *extend_arm_b_command_sender_;
rm_common::JointPointCommandSender *ore_bin_lifter_command_sender_, *ore_bin_rotate_command_sender_,
*gimbal_lifter_command_sender_;
rm_common::CalibrationQueue *calibration_gather_{}, *pitch_calibration_;

actionlib::SimpleActionClient<rm_msgs::EngineerAction> action_client_;

Expand Down
2 changes: 1 addition & 1 deletion include/rm_manual/manual_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class ManualBase
ros::NodeHandle nh_;

ros::Time referee_last_get_stamp_;
bool remote_is_open_{ false }, referee_is_online_ = false;
bool remote_is_open_{}, referee_is_online_ = false;
int state_ = PASSIVE;
int robot_id_, chassis_power_;
int chassis_output_on_ = 0, gimbal_output_on_ = 0, shooter_output_on_ = 0;
Expand Down
2 changes: 1 addition & 1 deletion launch/load.launch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<launch>
<arg name="robot_type" default="$(env ROBOT_TYPE)" doc="Robot type [standard, hero, engineer, engineer2]"/>
<arg name="robot_type" default="$(env ROBOT_TYPE)" doc="Robot type [standard, hero, engineer]"/>

<rosparam file="$(find rm_config)/config/rm_controllers/$(arg robot_type).yaml" command="load"/>
<rosparam file="$(find rm_manual)/config/$(arg robot_type).yaml" command="load"/>
Expand Down
8 changes: 4 additions & 4 deletions src/chassis_gimbal_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ void ChassisGimbalManual::checkKeyboard(const rm_msgs::DbusData::ConstPtr& dbus_
ManualBase::checkKeyboard(dbus_data);
if (robot_id_ == rm_msgs::GameRobotStatus::RED_ENGINEER || robot_id_ == rm_msgs::GameRobotStatus::BLUE_ENGINEER)
{
w_event_.update((!dbus_data->key_ctrl) && dbus_data->key_w);
s_event_.update((!dbus_data->key_ctrl) && dbus_data->key_s);
a_event_.update((!dbus_data->key_ctrl) && dbus_data->key_a);
d_event_.update((!dbus_data->key_ctrl) && dbus_data->key_d);
w_event_.update((!dbus_data->key_ctrl) && (!dbus_data->key_shift) && dbus_data->key_w);
s_event_.update((!dbus_data->key_ctrl) && (!dbus_data->key_shift) && dbus_data->key_s);
a_event_.update((!dbus_data->key_ctrl) && (!dbus_data->key_shift) && dbus_data->key_a);
d_event_.update((!dbus_data->key_ctrl) && (!dbus_data->key_shift) && dbus_data->key_d);
}
else
{
Expand Down
Loading

0 comments on commit 9267aa6

Please sign in to comment.