Skip to content

Added Github codeowners, issue template, CI. Also, fixed linting. #24

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

Merged
merged 1 commit into from
Apr 28, 2025
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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default all changes will request review from:
* @clearpathrobotics/clearpath-platform-team
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug Report
about: Provide a report for that the issue is
title: ''
labels: bug
assignees: clearpathrobotics/clearpath-platform-team

---

**Please provide the following information:**
- OS: (e.g. Ubuntu 24.04)
- ROS 2 Distro: (e.g. Jazzy)
- Built from source or installed:
- Package version: (if from repository, give version from `sudo dpkg -s ros-$ROS_VERSION-wireless-watcher`, if from source, give commit hash)


**Expected behaviour**
A clear and concise description of what you expected to happen.

**Actual behaviour**
A clear and concise description of what you encountered.

**To Reproduce**
Provide the steps to reproduce:
1. run something
2. launch something else
3. see the error


**Other notes**
Add anything else you thing is important.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Feature request
about: Provide context for the feature you are requesting
title: ''
labels: enhancement
assignees: clearpathrobotics/clearpath-platform-team

---

**Describe the the feature you would like**
A clear and concise description of what you want to happen.

**Other notes**
Add anything else you thing is important.
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: wireless_watcher_ci

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *" # every day at midnight

jobs:
wireless_watcher_osrf_industrial_ci_humble:
name: Humble OSRF Industrial
strategy:
matrix:
env:
- {ROS_REPO: testing, ROS_DISTRO: humble}
- {ROS_REPO: main, ROS_DISTRO: humble}
fail-fast: false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
wireless_watcher_cpr_ci_humble:
name: Humble Clearpath Release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: humble
- name: clearpath-package-server
run: |
sudo apt install wget
wget https://packages.clearpathrobotics.com/public.key -O - | sudo apt-key add -
sudo sh -c 'echo "deb https://packages.clearpathrobotics.com/stable/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/clearpath-latest.list'
sudo apt-get update
- uses: ros-tooling/action-ros-ci@v0.3
id: action_ros_ci_step
with:
target-ros2-distro: humble
package-name: |
wireless_watcher
wireless_watcher_src_ci_humble:
name: Humble Clearpath Source
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: humble
- uses: ros-tooling/action-ros-ci@v0.3
id: action_ros_ci_step
with:
target-ros2-distro: humble
package-name: |
wireless_watcher
wireless_watcher_osrf_industrial_ci_jazzy:
name: Jazzy OSRF Industrial
strategy:
matrix:
env:
- {ROS_REPO: testing, ROS_DISTRO: jazzy}
- {ROS_REPO: main, ROS_DISTRO: jazzy}
fail-fast: false
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
wireless_watcher_cpr_ci_jazzy:
name: Jazzy Clearpath Release
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: jazzy
- name: clearpath-package-server
run: |
sudo apt install wget
wget https://packages.clearpathrobotics.com/public.key -O - | sudo apt-key add -
sudo sh -c 'echo "deb https://packages.clearpathrobotics.com/stable/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/clearpath-latest.list'
sudo apt-get update
- uses: ros-tooling/action-ros-ci@v0.3
id: action_ros_ci_step
with:
target-ros2-distro: jazzy
package-name: |
wireless_watcher
wireless_watcher_src_ci_jazzy:
name: Jazzy Clearpath Source
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: jazzy
- uses: ros-tooling/action-ros-ci@v0.3
id: action_ros_ci_step
with:
target-ros2-distro: jazzy
package-name: |
wireless_watcher
6 changes: 3 additions & 3 deletions wireless_msgs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<version>1.1.4</version>
<description>Messages for describing a wireless network such as bitrate, essid, and link quality.</description>

<author>Mike Purvis</author>

<maintainer email="rkreinin@clearpathrobotics.com">Roni Kreinin</maintainer>
<maintainer email="tbaltovski@clearpathrobotics.com">Tony Baltovski</maintainer>

<license>BSD</license>

<author email="mpurvis@clearpathrobotics.com">Mike Purvis</author>

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>std_msgs</depend>
Expand Down
2 changes: 1 addition & 1 deletion wireless_watcher/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ Changelog for package wireless_watcher

0.0.1 (2013-10-17)
------------------
* Catkinize wireless_watcher
* Catkinize wireless_watcher
10 changes: 10 additions & 0 deletions wireless_watcher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,15 @@ install(FILES package.xml
DESTINATION share/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
list(APPEND AMENT_LINT_AUTO_EXCLUDE
ament_cmake_copyright
ament_cmake_cpplint
ament_cmake_uncrustify
)
ament_lint_auto_find_test_dependencies()
endif()

# Specify install targets
ament_package()
48 changes: 25 additions & 23 deletions wireless_watcher/include/wireless_watcher/wireless_watcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
*
*/

#ifndef WIRELESS_WATCHER_HPP
#define WIRELESS_WATCHER_HPP
#ifndef WIRELESS_WATCHER__WIRELESS_WATCHER_HPP_
#define WIRELESS_WATCHER__WIRELESS_WATCHER_HPP_

#include <string>
#include <vector>

#include "diagnostic_updater/diagnostic_updater.hpp"
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/bool.hpp"
#include "wireless_msgs/msg/connection.hpp"
Expand All @@ -48,31 +49,32 @@
#define SIGNAL_STRENGTH_WEAK -67
#define SIGNAL_STRENGTH_VERY_WEAK -75

class WirelessWatcher : public rclcpp::Node {
class WirelessWatcher : public rclcpp::Node
{
public:
WirelessWatcher();
WirelessWatcher();

private:
// Parameters
double hz;
std::string dev;
std::string connected_topic;
std::string connection_topic;
// Parameters
double hz;
std::string dev;
std::string connected_topic;
std::string connection_topic;

// Other Variables
rclcpp::TimerBase::SharedPtr timer_;
rclcpp::Publisher<std_msgs::msg::Bool>::SharedPtr connected_pub_;
rclcpp::Publisher<wireless_msgs::msg::Connection>::SharedPtr connection_pub_;
std_msgs::msg::Bool connected_msg_;
wireless_msgs::msg::Connection connection_msg_;
diagnostic_updater::Updater updater_;
// Other Variables
rclcpp::TimerBase::SharedPtr timer_;
rclcpp::Publisher<std_msgs::msg::Bool>::SharedPtr connected_pub_;
rclcpp::Publisher<wireless_msgs::msg::Connection>::SharedPtr connection_pub_;
std_msgs::msg::Bool connected_msg_;
wireless_msgs::msg::Connection connection_msg_;
diagnostic_updater::Updater updater_;

// Methods
void timer_callback();
std::string exec_cmd(const std::string& cmd);
std::vector<std::string> split(const std::string& s, const std::string& delimiter);
void diagnostic(diagnostic_updater::DiagnosticStatusWrapper & stat);
void ip_address_diag(std::string dev, diagnostic_updater::DiagnosticStatusWrapper & stat);
// Methods
void timer_callback();
std::string exec_cmd(const std::string& cmd);
std::vector<std::string> split(const std::string& s, const std::string& delimiter);
void diagnostic(diagnostic_updater::DiagnosticStatusWrapper & stat);
void ip_address_diag(std::string dev, diagnostic_updater::DiagnosticStatusWrapper & stat);
};

#endif // WIRELESS_WATCHER_HPP
#endif // WIRELESS_WATCHER__WIRELESS_WATCHER_HPP_
82 changes: 43 additions & 39 deletions wireless_watcher/launch/watcher.launch.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# Copyright 2022 Clearpath Robotics, Inc.
#
# Software License Agreement (BSD)
#
# @author Roni Kreinin <rkreinin@clearpathrobotics.com>
# @copyright (c) 2022, Clearpath Robotics, Inc., All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that
# the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the
# following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
# following disclaimer in the documentation and/or other materials provided with the distribution.
# * Neither the name of Clearpath Robotics nor the names of its contributors may be used to endorse or
# promote products derived from this software without specific prior written permission.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Clearpath Robotics nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.


Expand All @@ -31,34 +34,35 @@
from launch_ros.actions import Node

ARGUMENTS = [
DeclareLaunchArgument('hz', default_value='1.0',
description='Update frequency'),
DeclareLaunchArgument('dev', default_value="''",
description='Wireless device'),
DeclareLaunchArgument('connected_topic', default_value='connected',
description='Connected status topic'),
DeclareLaunchArgument('connection_topic', default_value='connection',
description='Connection information topic'),
DeclareLaunchArgument('namespace', default_value='',
description='Namespace'),
DeclareLaunchArgument('hz', default_value='1.0', description='Update frequency'),
DeclareLaunchArgument('dev', default_value='', description='Wireless device'),
DeclareLaunchArgument(
'connected_topic', default_value='connected', description='Connected status topic'
),
DeclareLaunchArgument(
'connection_topic', default_value='connection', description='Connection information topic'
),
DeclareLaunchArgument('namespace', default_value='', description='Namespace'),
]


def generate_launch_description():

watcher = Node(
package='wireless_watcher',
executable='wireless_watcher',
name='wireless_watcher',
namespace=LaunchConfiguration('namespace'),
output='screen',
parameters=[{
'hz': LaunchConfiguration('hz'),
'dev': LaunchConfiguration('dev'),
'connected_topic': LaunchConfiguration('connected_topic'),
'connection_topic': LaunchConfiguration('connection_topic')
}],
)
package='wireless_watcher',
executable='wireless_watcher',
name='wireless_watcher',
namespace=LaunchConfiguration('namespace'),
output='screen',
parameters=[
{
'hz': LaunchConfiguration('hz'),
'dev': LaunchConfiguration('dev'),
'connected_topic': LaunchConfiguration('connected_topic'),
'connection_topic': LaunchConfiguration('connection_topic'),
}
],
)

ld = LaunchDescription(ARGUMENTS)
ld.add_action(watcher)
Expand Down
11 changes: 7 additions & 4 deletions wireless_watcher/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@
<name>wireless_watcher</name>
<version>1.1.4</version>
<description>A node which publishes connection information about a linux wireless interface.</description>

<author>Mike Purvis</author>

<maintainer email="rkreinin@clearpathrobotics.com">rkreinin</maintainer>

<maintainer email="rkreinin@clearpathrobotics.com">Roni Kreinin</maintainer>
<maintainer email="tbaltovski@clearpathrobotics.com">Tony Baltovski</maintainer>

<license>BSD</license>

<author email="mpurvis@clearpathrobotics.com">Mike Purvis</author>

<depend>diagnostic_updater</depend>
<depend>rclcpp</depend>
<depend>wireless_msgs</depend>
<depend>wireless-tools</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
Loading