Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions src/am_super/am_super.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class AMSuper : AMLifeCycle
ros::Publisher super_status_pub_;
ros::Publisher led_pub_;
ros::Subscriber node_state_sub_;
ros::Subscriber node_status_sub_;
ros::Subscriber operator_command_sub_;
ros::Subscriber controller_state_sub;
ros::Subscriber diagnostics_sub;
Expand Down Expand Up @@ -214,10 +213,6 @@ class AMSuper : AMLifeCycle
* node status via LifeCycle
*/
node_state_sub_ = nh_.subscribe("/node_state", 100, &AMSuper::nodeStateCB, this);
/**
* legacy node status
*/
node_status_sub_ = nh_.subscribe("/process/status", 100, &AMSuper::statusCB, this);

/**
* commands from operator
Expand Down Expand Up @@ -264,24 +259,6 @@ class AMSuper : AMLifeCycle
LOG_MSG("/node_state", rmsg, SU_LOG_LEVEL);
}

/**
* process legacy messages from nodes
* TODO: mark deprecated due to legacy. use nodeStateCB.
*/
void statusCB(const ros::MessageEvent<brain_box_msgs::NodeStatus const>& event)
{
const brain_box_msgs::NodeStatus::ConstPtr& rmsg = event.getMessage();

/*
* legacy messages don't carry any state or status info so just process as ACTIVE/OK
*/
processState(rmsg->node_name, LifeCycleState::INACTIVE, LifeCycleStatus::OK, rmsg->status, rmsg->value,
rmsg->process_id, event.getReceiptTime());

// TODO: topic name should come from vb_util_lib::topics.
LOG_MSG("/process/status", rmsg, SU_LOG_LEVEL);
}

void controllerStateCB(const ros::MessageEvent<brain_box_msgs::ControllerState const>& event)
{
const brain_box_msgs::ControllerState::ConstPtr& rmsg = event.getMessage();
Expand Down Expand Up @@ -514,7 +491,7 @@ class AMSuper : AMLifeCycle
{
std::stringstream ss;
genSystemState(ss);
ROS_INFO_STREAM(ss.str());
ROS_INFO_STREAM_THROTTLE(LOG_THROTTLE_S,ss.str());
}

/**
Expand Down
7 changes: 1 addition & 6 deletions src/am_super/super_node_mediator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,7 @@ bool SuperNodeMediator::forceTransition(const SuperState& to_state)

bool SuperNodeMediator::lifeCycleNotYetImplemented(string node_name)
{
string stripped = SuperNodeMediator::nodeNameStripped(node_name);
return
stripped == "flight_controller" ||
stripped == "locator" ||
stripped == "dji_sdk" ||
stripped == "can_node";
return false;
}

bool SuperNodeMediator::checkReadyToArm(SuperNodeMediator::SuperNodeInfo& nr, SuperNodeMediator& node_mediator)
Expand Down
9 changes: 0 additions & 9 deletions test/super_node_mediator_unit_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,6 @@ TEST_F(SuperNodeMediatorTest, allManifestedNodesCheck_ErrorStatusReturnsTrueButH
assertAllManifestedNodesCheck(true, node, true, "[AA0A]");
}

TEST_F(SuperNodeMediatorTest, allManifestedNodesCheck_FlightControllerLifeCycleNotYetImplementedSkipsCheck)
{
SuperNodeMediator::SuperNodeInfo node;
node.manifested = true;
node.online = true;
node.name = "flight_controller";
bool expected_success, check_result;
assertAllManifestedNodesCheck(expected_success = true, node, check_result = false, "[WCK2]");
}

TEST_F(SuperNodeMediatorTest, allManifestedNodesCheck_MultipleNodes_FirstNodeFails)
{
Expand Down