mirror of
https://github.com/westonrobot/scout_ros.git
synced 2026-01-12 03:15:01 +08:00
Merge pull request #1 from westonrobot/feature-light_control
light: added light control
This commit is contained in:
@@ -118,58 +118,33 @@ class ScoutMessenger {
|
|||||||
|
|
||||||
void LightCmdCallback(const scout_msgs::ScoutLightCmd::ConstPtr &msg) {
|
void LightCmdCallback(const scout_msgs::ScoutLightCmd::ConstPtr &msg) {
|
||||||
if (!simulated_robot_) {
|
if (!simulated_robot_) {
|
||||||
// if (msg->cmd_ctrl_allowed) {
|
if (msg->cmd_ctrl_allowed) {
|
||||||
// ScoutLightCmd cmd;
|
AgxLightMode f_mode;
|
||||||
|
uint8_t f_value;
|
||||||
|
|
||||||
// switch (msg->front_mode) {
|
switch (msg->front_mode) {
|
||||||
// case scout_msgs::ScoutLightCmd::LIGHT_CONST_OFF: {
|
case scout_msgs::ScoutLightCmd::LIGHT_CONST_OFF: {
|
||||||
// cmd.front_mode = CONST_OFF;
|
f_mode = AgxLightMode::CONST_OFF;
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// case scout_msgs::ScoutLightCmd::LIGHT_CONST_ON: {
|
case scout_msgs::ScoutLightCmd::LIGHT_CONST_ON: {
|
||||||
// cmd.front_mode = CONST_ON;
|
f_mode = AgxLightMode::CONST_ON;
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// case scout_msgs::ScoutLightCmd::LIGHT_BREATH: {
|
case scout_msgs::ScoutLightCmd::LIGHT_BREATH: {
|
||||||
// cmd.front_mode = BREATH;
|
f_mode = AgxLightMode::BREATH;
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// case scout_msgs::ScoutLightCmd::LIGHT_CUSTOM: {
|
case scout_msgs::ScoutLightCmd::LIGHT_CUSTOM: {
|
||||||
// cmd.front_mode = CUSTOM;
|
f_mode = AgxLightMode::CUSTOM;
|
||||||
// cmd.front_custom_value = msg->front_custom_value;
|
f_value = msg->front_custom_value;
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// // not meant to be controlled by user for now
|
scout_->SetLightCommand(f_mode, f_value, AgxLightMode::CONST_ON, 0);
|
||||||
// // switch (msg->rear_mode)
|
} else {
|
||||||
// // {
|
scout_->DisableLightControl();
|
||||||
// // case scout_msgs::ScoutLightCmd::LIGHT_CONST_OFF:
|
}
|
||||||
// // {
|
|
||||||
// // cmd.rear_mode = CONST_OFF;
|
|
||||||
// // break;
|
|
||||||
// // }
|
|
||||||
// // case scout_msgs::ScoutLightCmd::LIGHT_CONST_ON:
|
|
||||||
// // {
|
|
||||||
// // cmd.rear_mode = CONST_ON;
|
|
||||||
// // break;
|
|
||||||
// // }
|
|
||||||
// // case scout_msgs::ScoutLightCmd::LIGHT_BREATH:
|
|
||||||
// // {
|
|
||||||
// // cmd.rear_mode = BREATH;
|
|
||||||
// // break;
|
|
||||||
// // }
|
|
||||||
// // case scout_msgs::ScoutLightCmd::LIGHT_CUSTOM:
|
|
||||||
// // {
|
|
||||||
// // cmd.rear_mode = CUSTOM;
|
|
||||||
// // cmd.rear_custom_value = msg->rear_custom_value;
|
|
||||||
// // break;
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// cmd.cmd_ctrl_allowed = true;
|
|
||||||
// scout_->SetLightCommand(cmd);
|
|
||||||
// } else {
|
|
||||||
// scout_->DisableLightControl();
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
std::cout << "simulated robot received light control cmd" << std::endl;
|
std::cout << "simulated robot received light control cmd" << std::endl;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user