Skip to content

Commit bdbfa04

Browse files
committed
feat: update
1 parent af0fa9b commit bdbfa04

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

include/resource_monitor/resource_status_class.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ class ResourceStatus
133133

134134
am::GpuInfo gpu_info_;
135135

136+
std::vector<std::string> sub_nets_add_;
137+
136138
std::map<std::string, std::string> ip_addresses_; //IPAddress, Name
137139

138140
/*ROS Infrastructure Checking tools*/

src/resource_monitor/resource_status_class.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ResourceStatus::ResourceStatus(std::shared_ptr<am::ResourceMonitorStats> stats)
1313
{
1414
transformer_ = std::make_shared<am::Transformer>();
1515

16+
sub_nets_add_ = getInetAddresses();
17+
1618
getParams();
1719

1820
timer_ = am::Node::node->create_wall_timer(am::toDuration(1.0), std::bind(&ResourceStatus::timerCB, this));
@@ -516,8 +518,8 @@ void ResourceStatus::checkSensorIPs()
516518
{
517519
//todo: this should be static and checked once or should be passed as argument depending on the architecture: for sim env this is false
518520
bool ips_should_exists = false;
519-
std::vector<std::string> sub_nets_add = getInetAddresses();
520-
for(const std::string &ip : sub_nets_add)
521+
522+
for(const std::string &ip : sub_nets_add_)
521523
{
522524
//ROS_INFO("subnet: %s", ip.c_str());
523525
if(ip == "192.168.1.1")

0 commit comments

Comments
 (0)