Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(system_monitor):adding a node for CMOS battery monitoring #1447

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
23f96c0
Merge pull request #1 from autowarefoundation/tier4/proposal
kenji-miyake Jan 24, 2022
a0fe549
Merge pull request #3 from autowarefoundation/tier4/proposal
kenji-miyake Jan 26, 2022
33549de
ci: add sync-upstream.yaml (#4)
kenji-miyake Jan 29, 2022
355609b
Merge pull request #5 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Feb 8, 2022
b6beeec
Merge pull request #11 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Feb 15, 2022
f371839
Merge pull request #13 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Feb 28, 2022
acf26ea
ci(sync-upstream): update settings (#19)
kenji-miyake Mar 3, 2022
f92e938
Merge pull request #17 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Mar 4, 2022
26c6541
Merge pull request #20 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Mar 18, 2022
8082bea
Merge pull request #27 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Mar 18, 2022
d065ddd
Merge pull request #29 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 4, 2022
4c1d0cb
Merge pull request #30 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 5, 2022
4a3e529
chore: sync files (#629)
awf-autoware-bot[bot] Apr 5, 2022
3dea07d
chore: sync files (#637)
awf-autoware-bot[bot] Apr 6, 2022
f037c18
fix(dummy_diag_publisher): use anon to make unique node name instead …
h-ohta Apr 6, 2022
0c2022a
Merge pull request #32 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 6, 2022
a4e7e2f
Merge branch 'tier4/main' into sync-upstream
yn-mrse Apr 8, 2022
b9fb070
Merge pull request #33 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 8, 2022
840d3e9
Merge pull request #35 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 8, 2022
3a37242
chore: sync files (#648)
awf-autoware-bot[bot] Apr 9, 2022
a827200
fix(autoware_state_panel): fix message type for /api/autoware/get/eng…
h-ohta Apr 11, 2022
cc39553
Merge pull request #36 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 11, 2022
75b9e2d
Merge pull request #37 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 18, 2022
8278cce
Merge pull request #39 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 26, 2022
e0ad67a
Merge pull request #41 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 26, 2022
6174d32
Merge pull request #42 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 8, 2022
65e6d7b
Merge pull request #43 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 9, 2022
9f5837f
fix(behavior_velocity): avoid insert same point on trajectory utils (…
taikitanaka3 May 9, 2022
69fc674
refactor(behavior_velocity_planner): simplify CMakeLists.txt (#855)
kenji-miyake May 9, 2022
063a95d
fix(system_monitor): fix build error on tegra platform (#869)
Sharrrrk May 9, 2022
35a1f0a
feat(ad_service_state_monitor): limit odometry buffer size (#514)
takayuki5168 May 9, 2022
82c6ad8
docs: fix 404 error caused by typo in url (#871)
Shin-kyoto May 9, 2022
a7118b6
fix(image_projection_based_fusion): set imagebuffersize (#820)
storrrrrrrrm May 9, 2022
8809673
chore(avoidance_module): fix spell check (#732)
zulfaqar-azmi-t4 May 9, 2022
cc43203
feat: isolate gtests in all packages (#693)
maxime-clem May 9, 2022
0786fa1
docs(virtual traffic light): add documentation (#245)
taikitanaka3 May 9, 2022
4f4644f
feat(surround_obstacle_checker): separate surround_obstacle_checker f…
satoshi-ota May 9, 2022
1f5ade6
feat: remove deprecated package in prediction launch (#875)
yukkysaito May 10, 2022
399c133
fix(surround_obstacle_checker): fix ego footprint polygon (#877)
satoshi-ota May 10, 2022
eca2944
fix: update nvinfer api (#863)
wep21 May 10, 2022
3e5e6db
fix(avoidance_module): ignore object instead of creating zero shift (…
zulfaqar-azmi-t4 May 10, 2022
7b81507
fix(motion_velocity_smoother): curve deceleration not working with a …
TakaHoribe May 10, 2022
6668873
test(autoware_testing): fix smoke_test (#479)
KeisukeShima May 10, 2022
31147a2
feat(rviz_plugins): add velocity limit to autoware state panel (#879)
taikitanaka3 May 11, 2022
da41a37
fix(dummy_perception_publisher): publish multiple layers of pointclou…
HiroIshida May 11, 2022
e2e557d
feat(vehicle_info_util): add max_steer_angle (#740)
takayuki5168 May 11, 2022
952510b
ci(deploy-docs): remove mdx_unimoji (#883)
shmpwk May 11, 2022
b2727f0
chore: sync files (#884)
awf-autoware-bot[bot] May 11, 2022
ae80db9
fix(lidar_centerpoint): fix google drive url to avoid 404 (#889)
h-ohta May 12, 2022
c396b9d
chore: fix typos (#886)
badai-nguyen May 12, 2022
ffb0553
feat(state_rviz_plugin): add GateMode and PathChangeApproval Button (…
h-ohta May 13, 2022
80f3f1c
feat(map_tf_generator): accelerate the 'viewer' coordinate calculatio…
IshitaTakeshi May 13, 2022
ef37953
docs(obstacle_stop_planner): update documentation (#880)
satoshi-ota May 13, 2022
9470442
docs(tier4_traffic_light_rviz_plugin): update documentation (#905)
satoshi-ota May 16, 2022
e1e81b3
fix(accel_brake_map_calibrator): rviz panel type (#895)
soblin May 16, 2022
55d807e
fix(behavior velocity planner): skipping emplace back stop reason if …
TakumiKozaka-T4 May 17, 2022
f1d2b9e
feat(behavior_path_planner): weakened noise filtering of drivable are…
takayuki5168 May 17, 2022
0621852
Merge pull request #44 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 18, 2022
db25a76
Merge branch 'tier4/main' into sync-upstream
YoheiMishina May 24, 2022
fefdd4d
Merge pull request #47 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 24, 2022
ef98592
Merge pull request #49 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 25, 2022
f97557e
first commit
nobuotakamasa May 25, 2022
e79a765
Merge branch 'tier4/main' into sync-upstream
naokimatsunawa May 27, 2022
fe49f69
Merge pull request #50 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 27, 2022
b4bea5a
Merge pull request #51 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 30, 2022
7fe260b
Merge pull request #52 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 31, 2022
8f41322
Merge pull request #54 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 1, 2022
8de82e6
Merge pull request #55 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 8, 2022
a7c5a03
Merge branch 'tier4/main' into sync-upstream
yn-mrse Jun 10, 2022
79f8f88
Merge pull request #61 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 10, 2022
266adbc
Merge pull request #63 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 10, 2022
c8021d4
Merge pull request #64 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 13, 2022
ab73b5a
fix comment
nobuotakamasa Jun 17, 2022
4645a80
Merge pull request #65 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 17, 2022
cb13c5d
fix diff
nobuotakamasa Jun 19, 2022
e911915
fix comment
nobuotakamasa Jun 19, 2022
1bf0329
Merge pull request #68 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jul 7, 2022
815d9e2
Merge pull request #81 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jul 8, 2022
dc37962
Merge pull request #82 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jul 10, 2022
f49d0fc
Merge pull request #83 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jul 11, 2022
5364fa2
Merge pull request #85 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jul 11, 2022
7052540
Merge branch 'tier4/main' into sync-upstream
tkimura4 Jul 11, 2022
286ce56
Merge pull request #87 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jul 11, 2022
484ab6d
Merge branch 'T4PB-12150' into T4PB-12150-PR
nobuotakamasa Jul 25, 2022
be9bc6f
fix: using "cat /proc/driver/rtc" to get the status of CMOS battery.
nobuotakamasa Jul 26, 2022
6b044a0
fix include files
nobuotakamasa Jul 26, 2022
c421ebb
fix class and node names : ecu_monitor -> hardware_monitor
nobuotakamasa Jul 28, 2022
8aaaa6d
fix default : "in7:" -> ""
nobuotakamasa Jul 28, 2022
e321738
add param file
nobuotakamasa Jul 28, 2022
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
28 changes: 28 additions & 0 deletions .github/workflows/sync-upstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: sync-upstream

on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:

jobs:
sync-upstream:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Run sync-branches
uses: autowarefoundation/autoware-github-actions/sync-branches@v1
with:
token: ${{ steps.generate-token.outputs.token }}
base-branch: tier4/main
sync-pr-branch: sync-upstream
sync-target-repository: https://github.com/autowarefoundation/autoware.universe.git
sync-target-branch: main
pr-title: "chore: sync upstream"
auto-merge-method: merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**:
ros__parameters:
cmos_battery_warn: 2.90
cmos_battery_error: 2.70
1 change: 1 addition & 0 deletions launch/tier4_system_launch/launch/system.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<push-ros-namespace namespace="system_monitor"/>
<include file="$(find-pkg-share system_monitor)/launch/system_monitor.launch.py">
<arg name="cpu_monitor_config_file" value="$(find-pkg-share tier4_system_launch)/config/system_monitor/cpu_monitor.param.yaml"/>
<arg name="hardware_monitor_config_file" value="$(find-pkg-share tier4_system_launch)/config/system_monitor/hardware_monitor.param.yaml"/>
<arg name="hdd_monitor_config_file" value="$(find-pkg-share tier4_system_launch)/config/system_monitor/hdd_monitor.param.yaml"/>
<arg name="mem_monitor_config_file" value="$(find-pkg-share tier4_system_launch)/config/system_monitor/mem_monitor.param.yaml"/>
<arg name="net_monitor_config_file" value="$(find-pkg-share tier4_system_launch)/config/system_monitor/net_monitor.param.yaml"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

<!-- debug -->
<arg name="debug_mode" default="false"/>

<arg name="filter_scope_minx" default="-100"/>
<arg name="filter_scope_maxx" default="100"/>
<arg name="filter_scope_miny" default="-100"/>
Expand Down
16 changes: 16 additions & 0 deletions system/system_monitor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ else()
endif()
endif()


message(STATUS "HOST_SYSTEM_VERSION: " ${CMAKE_HOST_SYSTEM_VERSION})
message(STATUS "SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR})
message(STATUS "CPU PLATFORM: " ${CMAKE_CPU_PLATFORM})
message(STATUS "GPU PLATFORM: " ${CMAKE_GPU_PLATFORM})
message(STATUS "HARDWARE PLATFORM: " ${CMAKE_HARDWARE_PLATFORM})

ament_auto_add_library(hardware_monitor_lib SHARED
src/hardware_monitor/hardware_monitor.cpp
)

set(CPU_MONITOR_SOURCE
src/cpu_monitor/cpu_monitor_base.cpp
Expand Down Expand Up @@ -129,6 +135,7 @@ find_package(Boost REQUIRED COMPONENTS
)

## Specify libraries to link a library or executable target against
target_link_libraries(hardware_monitor_lib ${Boost_LIBRARIES} ${LIBRARIES})
target_link_libraries(cpu_monitor_lib ${Boost_LIBRARIES} ${LIBRARIES})
target_link_libraries(hdd_monitor_lib ${Boost_LIBRARIES} ${LIBRARIES})
target_link_libraries(mem_monitor_lib ${LIBRARIES})
Expand Down Expand Up @@ -175,6 +182,11 @@ rclcpp_components_register_node(gpu_monitor_lib
EXECUTABLE gpu_monitor
)

rclcpp_components_register_node(hardware_monitor_lib
PLUGIN "HardwareMonitor"
EXECUTABLE hardware_monitor
)

# TODO(yunus.caliskan): Port the tests to ROS2, robustify the tests.
if(BUILD_TESTING)
# ament_add_ros_isolated_gtest(test_cpu_monitor
Expand Down Expand Up @@ -293,6 +305,10 @@ if(BUILD_TESTING)

endif()

#############
## Install ##
#############

ament_auto_package(INSTALL_TO_SHARE
launch
config
Expand Down
4 changes: 4 additions & 0 deletions system/system_monitor/config/hardware_monitor.param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**:
ros__parameters:
cmos_battery_warn: 2.90
cmos_battery_error: 2.70
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Copyright 2020 Tier IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
* @file hardware_monitor.h
* @brief hardware monitor class
*/

#ifndef SYSTEM_MONITOR__HARDWARE_MONITOR__ADLINK_EHARDWARE_MONITOR_HPP_
#define SYSTEM_MONITOR__HARDWARE_MONITOR__ADLINK_EHARDWARE_MONITOR_HPP_

#include <diagnostic_updater/diagnostic_updater.hpp>

#include <climits>
#include <string>

class HardwareMonitor : public rclcpp::Node
{
public:
/**
* @brief constructor
* @param [in] options Options associated with this node.
*/
explicit HardwareMonitor(const rclcpp::NodeOptions & options);

/**
* @brief Update the diagnostic state.
*/
void update();

protected:
using DiagStatus = diagnostic_msgs::msg::DiagnosticStatus;

diagnostic_updater::Updater updater_; //!< @brief Updater class which advertises to /diagnostics

char hostname_[HOST_NAME_MAX + 1]; //!< @brief host name

/**
* @brief check CMOS Battey
* @param [out] stat diagnostic message passed directly to diagnostic publish calls
* @note NOLINT syntax is needed since diagnostic_updater asks for a non-const reference
* to pass diagnostic message updated in this function to diagnostic publish calls.
*/
void checkVoltage(
diagnostic_updater::DiagnosticStatusWrapper & stat); // NOLINT(runtime/references)
/**
* @brief check CMOS Battey
* @param [out] stat diagnostic message passed directly to diagnostic publish calls
* @note NOLINT syntax is needed since diagnostic_updater asks for a non-const reference
* to pass diagnostic message updated in this function to diagnostic publish calls.
*/
void checkBatteryStatus(
diagnostic_updater::DiagnosticStatusWrapper & stat); // NOLINT(runtime/references)


bool sensors_exists_; //!< @brief flag if sensors exists
float voltage_warn_;
float voltage_error_;
std::string voltage_string_;
};

#endif // SYSTEM_MONITOR__HARDWARE_MONITOR__ADLINK_EHARDWARE_MONITOR_HPP_
15 changes: 15 additions & 0 deletions system/system_monitor/launch/system_monitor.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ def launch_setup(context, *args, **kwargs):
gpu_monitor_config,
],
)
with open(LaunchConfiguration("hardware_monitor_config_file").perform(context), "r") as f:
hardware_monitor_config = yaml.safe_load(f)["/**"]["ros__parameters"]
hardware_monitor = ComposableNode(
package="system_monitor",
plugin="HardwareMonitor",
name="hardware_monitor",
parameters=[
hardware_monitor_config,
],
)

# set container to run all required components in the same process
container = ComposableNodeContainer(
Expand All @@ -104,6 +114,7 @@ def launch_setup(context, *args, **kwargs):
package="rclcpp_components",
executable="component_container_mt",
composable_node_descriptions=[
hardware_monitor,
cpu_monitor,
hdd_monitor,
mem_monitor,
Expand Down Expand Up @@ -151,6 +162,10 @@ def generate_launch_description():
"gpu_monitor_config_file",
default_value=os.path.join(system_monitor_path, "gpu_monitor.param.yaml"),
),
DeclareLaunchArgument(
"hardware_monitor_config_file",
default_value=os.path.join(system_monitor_path, "hardware_monitor.param.yaml"),
),
OpaqueFunction(function=launch_setup),
]
)
8 changes: 8 additions & 0 deletions system/system_monitor/launch/system_monitor.launch.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
<launch>
<arg name="cpu_monitor_config_file" default="$(find-pkg-share system_monitor)/config/cpu_monitor.param.yaml"/>
<arg name="hardware_monitor_config_file" default="$(find-pkg-share system_monitor)/config/hardware_monitor.param.yaml"/>
<arg name="hdd_monitor_config_file" default="$(find-pkg-share system_monitor)/config/hdd_monitor.param.yaml"/>
<arg name="mem_monitor_config_file" default="$(find-pkg-share system_monitor)/config/mem_monitor.param.yaml"/>
<arg name="net_monitor_config_file" default="$(find-pkg-share system_monitor)/config/net_monitor.param.yaml"/>
<arg name="ntp_monitor_config_file" default="$(find-pkg-share system_monitor)/config/ntp_monitor.param.yaml"/>
<arg name="process_monitor_config_file" default="$(find-pkg-share system_monitor)/config/process_monitor.param.yaml"/>
<arg name="gpu_monitor_config_file" default="$(find-pkg-share system_monitor)/config/gpu_monitor.param.yaml"/>
<arg name="hardware_monitor_config_file" default="$(find-pkg-share system_monitor)/config/hardware_monitor.param.yaml"/>

<group>
<node pkg="system_monitor" exec="cpu_monitor" name="cpu_monitor" output="log" respawn="true">
<param from="$(var cpu_monitor_config_file)"/>
</node>
<node pkg="system_monitor" exec="hardware_monitor" name="hardware_monitor" output="log" respawn="true">
<param from="$(var hardware_monitor_config_file)"/>
</node>
<node pkg="system_monitor" exec="hdd_monitor" name="hdd_monitor" output="log" respawn="true">
<param from="$(var hdd_monitor_config_file)"/>
</node>
Expand All @@ -29,5 +34,8 @@
<node pkg="system_monitor" exec="gpu_monitor" name="gpu_monitor" output="log" respawn="true">
<param from="$(var gpu_monitor_config_file)"/>
</node>
<node pkg="system_monitor" exec="hardware_monitor" name="hardware_monitor" output="log" respawn="true">
<param from="$(var hardware_monitor_config_file)"/>
</node>
</group>
</launch>
Loading