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: apply autoware_ prefix for bluetooth_monitor #9960

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: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ simulator/vehicle_door_simulator/** [email protected]
system/autoware_component_monitor/** [email protected] [email protected] [email protected]
system/autoware_default_adapi/** [email protected] [email protected] [email protected]
system/autoware_processing_time_checker/** [email protected] [email protected]
system/bluetooth_monitor/** [email protected]
system/autoware_bluetooth_monitor/** fumihito.ito@tier4.jp junya.sasaki@tier4.jp
system/component_state_monitor/** [email protected]
system/default_ad_api_helpers/ad_api_adaptors/** [email protected] [email protected] [email protected]
system/default_ad_api_helpers/ad_api_visualizers/** [email protected] [email protected] [email protected]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.5)
project(bluetooth_monitor)
project(autoware_bluetooth_monitor)

### Dependencies
find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(bluetooth_monitor_lib SHARED
ament_auto_add_library(${PROJECT_NAME} SHARED
src/bluetooth_monitor.cpp
)

Expand All @@ -21,12 +21,12 @@ find_package(Boost REQUIRED COMPONENTS
)

## Specify libraries to link a library or executable target against
target_link_libraries(bluetooth_monitor_lib ${Boost_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
target_link_libraries(l2ping_service ${Boost_LIBRARIES})

rclcpp_components_register_node(bluetooth_monitor_lib
PLUGIN "BluetoothMonitor"
EXECUTABLE bluetooth_monitor
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "autoware::bluetooth_monitor::BluetoothMonitor"
EXECUTABLE ${PROJECT_NAME}_node
)

ament_auto_package(INSTALL_TO_SHARE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ L2ping is only allowed for root by default, so this package provides the followi

## Parameters

{{ json_to_markdown("system/bluetooth_monitor/schema/bluetooth_monitor.schema.json") }}
{{ json_to_markdown("system/autoware_bluetooth_monitor/schema/bluetooth_monitor.schema.json") }}

- `rtt_warn`

Expand All @@ -71,7 +71,7 @@ L2ping is only allowed for root by default, so this package provides the followi

```sh
./build/bluetooth_monitor/l2ping_service
ros2 launch bluetooth_monitor bluetooth_monitor.launch.xml
ros2 launch autoware_bluetooth_monitor bluetooth_monitor.launch.xml
```

## Known limitations and issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_
#define BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_
#ifndef AUTOWARE__BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_
#define AUTOWARE__BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_

#include "bluetooth_monitor/service/l2ping_interface.hpp"
#include "autoware/bluetooth_monitor/service/l2ping_interface.hpp"

#include <diagnostic_updater/diagnostic_updater.hpp>
#include <rclcpp/rclcpp.hpp>
Expand All @@ -24,6 +24,9 @@
#include <string>
#include <vector>

namespace autoware::bluetooth_monitor
{

class BluetoothMonitor : public rclcpp::Node
{
public:
Expand Down Expand Up @@ -109,4 +112,6 @@ class BluetoothMonitor : public rclcpp::Node
{StatusCode::FUNCTION_ERROR, DiagStatus::ERROR}};
};

#endif // BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_
} // namespace autoware::bluetooth_monitor

#endif // AUTOWARE__BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_
#define BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_
#ifndef AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_
#define AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_

#include "bluetooth_monitor/service/l2ping_interface.hpp"
#include "autoware/bluetooth_monitor/service/l2ping_interface.hpp"

#include <mutex>
#include <string>
#include <thread>
#include <vector>

namespace autoware::bluetooth_monitor
{

class L2ping
{
public:
Expand Down Expand Up @@ -92,4 +95,6 @@ class L2ping
bool stop_; //!< @brief Flag to stop thread
};

#endif // BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_
} // namespace autoware::bluetooth_monitor

#endif // AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_
#define BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_
#ifndef AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_
#define AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_

#include <boost/serialization/serialization.hpp>
#include <boost/serialization/string.hpp>
Expand All @@ -23,6 +23,9 @@
#include <tuple>
#include <vector>

namespace autoware::bluetooth_monitor
{

// 7634-7647 Unassigned
static constexpr int DEFAULT_PORT = 7640;
static constexpr int DEFAULT_DELAY = 1;
Expand Down Expand Up @@ -171,4 +174,6 @@ struct L2pingStatus
*/
typedef std::vector<L2pingStatus> L2pingStatusList;

#endif // BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_
} // namespace autoware::bluetooth_monitor

#endif // AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
#define BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
#ifndef AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
#define AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_

#include "bluetooth_monitor/service/l2ping.hpp"
#include "bluetooth_monitor/service/l2ping_interface.hpp"
#include "autoware/bluetooth_monitor/service/l2ping.hpp"
#include "autoware/bluetooth_monitor/service/l2ping_interface.hpp"

#include <map>
#include <memory>
#include <string>
#include <thread>
#include <vector>

namespace autoware::bluetooth_monitor
{

class L2pingService
{
public:
Expand Down Expand Up @@ -85,4 +88,6 @@ class L2pingService
L2pingStatusList status_list_; //!< @brief List of l2ping status
};

#endif // BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
} // namespace autoware::bluetooth_monitor

#endif // AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<launch>
<arg name="bluetooth_monitor_param_file" default="$(find-pkg-share autoware_bluetooth_monitor)/config/bluetooth_monitor.param.yaml"/>
<node pkg="autoware_bluetooth_monitor" exec="autoware_bluetooth_monitor_node" output="log" respawn="true">
<param from="$(var bluetooth_monitor_param_file)"/>
</node>
</launch>
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>bluetooth_monitor</name>
<name>autoware_bluetooth_monitor</name>
<version>0.40.0</version>
<description>Bluetooth alive monitoring</description>
<maintainer email="[email protected]">Fumihito Ito</maintainer>
<maintainer email="[email protected]">Junya Sasaki</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.
//

#include "bluetooth_monitor/service/l2ping.hpp"
#include "autoware/bluetooth_monitor/service/l2ping.hpp"

#include <boost/process.hpp>

Expand All @@ -25,6 +25,9 @@
#define FMT_HEADER_ONLY
#include <fmt/format.h>

namespace autoware::bluetooth_monitor
{

namespace bp = boost::process;

L2ping::L2ping(const std::string & address, const L2pingConfig & config)
Expand Down Expand Up @@ -189,3 +192,5 @@ const std::string & L2ping::getAddress() const
{
return status_.address;
}

} // namespace autoware::bluetooth_monitor
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "bluetooth_monitor/service/l2ping_service.hpp"
#include "autoware/bluetooth_monitor/service/l2ping_service.hpp"

#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
Expand All @@ -30,6 +30,9 @@
#define FMT_HEADER_ONLY
#include <fmt/format.h>

namespace autoware::bluetooth_monitor
{

namespace bp = boost::process;

L2pingService::L2pingService(const int port) : port_(port), socket_(-1)
Expand Down Expand Up @@ -252,3 +255,5 @@ bool L2pingService::buildDeviceList()

return true;
}

} // namespace autoware::bluetooth_monitor
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "bluetooth_monitor/service/l2ping_interface.hpp"
#include "bluetooth_monitor/service/l2ping_service.hpp"
#include "autoware/bluetooth_monitor/service/l2ping_interface.hpp"
#include "autoware/bluetooth_monitor/service/l2ping_service.hpp"

#include <boost/lexical_cast.hpp>

Expand Down Expand Up @@ -47,7 +47,7 @@
// Parse command-line options
int c = 0;
int option_index = 0;
int port = DEFAULT_PORT;
int port = autoware::bluetooth_monitor::DEFAULT_PORT;
while ((c = getopt_long(argc, argv, "hp:", long_options, &option_index)) != -1) {
switch (c) {
case 'h':
Expand Down Expand Up @@ -78,7 +78,7 @@
openlog(nullptr, LOG_PID, LOG_DAEMON);

// Initialize l2ping service
L2pingService service(port);
autoware::bluetooth_monitor::L2pingService service(port);

Check warning on line 81 in system/autoware_bluetooth_monitor/service/main.cpp

View check run for this annotation

Codecov / codecov/patch

system/autoware_bluetooth_monitor/service/main.cpp#L81

Added line #L81 was not covered by tests

if (!service.initialize()) {
service.shutdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "bluetooth_monitor/bluetooth_monitor.hpp"
#include "autoware/bluetooth_monitor/bluetooth_monitor.hpp"

#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
Expand All @@ -28,6 +28,9 @@
#define FMT_HEADER_ONLY
#include <fmt/format.h>

namespace autoware::bluetooth_monitor
{

BluetoothMonitor::BluetoothMonitor(const rclcpp::NodeOptions & options)
: Node("bluetooth_monitor", options),
updater_(this),
Expand Down Expand Up @@ -199,5 +202,7 @@
setErrorLevel(stat);
}

} // namespace autoware::bluetooth_monitor

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(BluetoothMonitor)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::bluetooth_monitor::BluetoothMonitor)

Check warning on line 208 in system/autoware_bluetooth_monitor/src/bluetooth_monitor.cpp

View check run for this annotation

Codecov / codecov/patch

system/autoware_bluetooth_monitor/src/bluetooth_monitor.cpp#L208

Added line #L208 was not covered by tests
6 changes: 0 additions & 6 deletions system/bluetooth_monitor/launch/bluetooth_monitor.launch.xml

This file was deleted.

Loading