Skip to content

Commit d03152b

Browse files
feat: apply autoware_ prefix for bluetooth_monitor (autowarefoundation#9960)
* feat(bluetooth_monitor): apply `autoware_` prefix (see below): * In this commit, I did not organize a folder structure. The folder structure will be organized in the next some commits. * The changes will follow the Autoware's guideline as below: - https://autowarefoundation.github.io/autoware-documentation/main/contributing/coding-guidelines/ros-nodes/directory-structure/#package-folder Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * rename(bluetooth_monitor): move headers under `include/autoware`: * Fixes due to this changes for .hpp/.cpp files will be applied in the next commit Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * fix(bluetooth_monitor): fix include paths * To follow the previous commit Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug(bluetooth_monitor): fix a missing prefix bug Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * rename: `bluetooth_monitor` => `autoware_bluetooth_monitor` Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * style(pre-commit): autofix * bug(autoware_bluetooth_monitor): revert wrongly updated copyrights Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug(autoware_bluetooth_monitor): `autoware_` prefix is not needed here Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * update: `CODEOWNERS` Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * update(autoware_bluetooth_monitor): `README.md` Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> --------- Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 4f3aad2 commit d03152b

18 files changed

+76
-40
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ simulator/vehicle_door_simulator/** isamu.takagi@tier4.jp
210210
system/autoware_component_monitor/** baris@leodrive.ai memin@leodrive.ai yavuz@leodrive.ai
211211
system/autoware_default_adapi/** isamu.takagi@tier4.jp ryohsuke.mitsudome@tier4.jp yukihiro.saito@tier4.jp
212212
system/autoware_processing_time_checker/** kosuke.takeuchi@tier4.jp takayuki.murooka@tier4.jp
213-
system/bluetooth_monitor/** fumihito.ito@tier4.jp
213+
system/autoware_bluetooth_monitor/** fumihito.ito@tier4.jp junya.sasaki@tier4.jp
214214
system/component_state_monitor/** isamu.takagi@tier4.jp
215215
system/default_ad_api_helpers/ad_api_adaptors/** isamu.takagi@tier4.jp ryohsuke.mitsudome@tier4.jp yukihiro.saito@tier4.jp
216216
system/default_ad_api_helpers/ad_api_visualizers/** isamu.takagi@tier4.jp ryohsuke.mitsudome@tier4.jp yukihiro.saito@tier4.jp

system/bluetooth_monitor/CMakeLists.txt system/autoware_bluetooth_monitor/CMakeLists.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
cmake_minimum_required(VERSION 3.5)
2-
project(bluetooth_monitor)
2+
project(autoware_bluetooth_monitor)
33

44
### Dependencies
55
find_package(autoware_cmake REQUIRED)
66
autoware_package()
77

8-
ament_auto_add_library(bluetooth_monitor_lib SHARED
8+
ament_auto_add_library(${PROJECT_NAME} SHARED
99
src/bluetooth_monitor.cpp
1010
)
1111

@@ -21,12 +21,12 @@ find_package(Boost REQUIRED COMPONENTS
2121
)
2222

2323
## Specify libraries to link a library or executable target against
24-
target_link_libraries(bluetooth_monitor_lib ${Boost_LIBRARIES})
24+
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
2525
target_link_libraries(l2ping_service ${Boost_LIBRARIES})
2626

27-
rclcpp_components_register_node(bluetooth_monitor_lib
28-
PLUGIN "BluetoothMonitor"
29-
EXECUTABLE bluetooth_monitor
27+
rclcpp_components_register_node(${PROJECT_NAME}
28+
PLUGIN "autoware::bluetooth_monitor::BluetoothMonitor"
29+
EXECUTABLE ${PROJECT_NAME}_node
3030
)
3131

3232
ament_auto_package(INSTALL_TO_SHARE

system/bluetooth_monitor/README.md system/autoware_bluetooth_monitor/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ L2ping is only allowed for root by default, so this package provides the followi
4646

4747
## Parameters
4848

49-
{{ json_to_markdown("system/bluetooth_monitor/schema/bluetooth_monitor.schema.json") }}
49+
{{ json_to_markdown("system/autoware_bluetooth_monitor/schema/bluetooth_monitor.schema.json") }}
5050

5151
- `rtt_warn`
5252

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

7272
```sh
7373
./build/bluetooth_monitor/l2ping_service
74-
ros2 launch bluetooth_monitor bluetooth_monitor.launch.xml
74+
ros2 launch autoware_bluetooth_monitor bluetooth_monitor.launch.xml
7575
```
7676

7777
## Known limitations and issues

system/bluetooth_monitor/include/bluetooth_monitor/bluetooth_monitor.hpp system/autoware_bluetooth_monitor/include/autoware/bluetooth_monitor/bluetooth_monitor.hpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_
16-
#define BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_
15+
#ifndef AUTOWARE__BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_
16+
#define AUTOWARE__BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_
1717

18-
#include "bluetooth_monitor/service/l2ping_interface.hpp"
18+
#include "autoware/bluetooth_monitor/service/l2ping_interface.hpp"
1919

2020
#include <diagnostic_updater/diagnostic_updater.hpp>
2121
#include <rclcpp/rclcpp.hpp>
@@ -24,6 +24,9 @@
2424
#include <string>
2525
#include <vector>
2626

27+
namespace autoware::bluetooth_monitor
28+
{
29+
2730
class BluetoothMonitor : public rclcpp::Node
2831
{
2932
public:
@@ -109,4 +112,6 @@ class BluetoothMonitor : public rclcpp::Node
109112
{StatusCode::FUNCTION_ERROR, DiagStatus::ERROR}};
110113
};
111114

112-
#endif // BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_
115+
} // namespace autoware::bluetooth_monitor
116+
117+
#endif // AUTOWARE__BLUETOOTH_MONITOR__BLUETOOTH_MONITOR_HPP_

system/bluetooth_monitor/include/bluetooth_monitor/service/l2ping.hpp system/autoware_bluetooth_monitor/include/autoware/bluetooth_monitor/service/l2ping.hpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_
16-
#define BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_
15+
#ifndef AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_
16+
#define AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_
1717

18-
#include "bluetooth_monitor/service/l2ping_interface.hpp"
18+
#include "autoware/bluetooth_monitor/service/l2ping_interface.hpp"
1919

2020
#include <mutex>
2121
#include <string>
2222
#include <thread>
2323
#include <vector>
2424

25+
namespace autoware::bluetooth_monitor
26+
{
27+
2528
class L2ping
2629
{
2730
public:
@@ -92,4 +95,6 @@ class L2ping
9295
bool stop_; //!< @brief Flag to stop thread
9396
};
9497

95-
#endif // BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_
98+
} // namespace autoware::bluetooth_monitor
99+
100+
#endif // AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_HPP_

system/bluetooth_monitor/include/bluetooth_monitor/service/l2ping_interface.hpp system/autoware_bluetooth_monitor/include/autoware/bluetooth_monitor/service/l2ping_interface.hpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_
16-
#define BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_
15+
#ifndef AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_
16+
#define AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_
1717

1818
#include <boost/serialization/serialization.hpp>
1919
#include <boost/serialization/string.hpp>
@@ -23,6 +23,9 @@
2323
#include <tuple>
2424
#include <vector>
2525

26+
namespace autoware::bluetooth_monitor
27+
{
28+
2629
// 7634-7647 Unassigned
2730
static constexpr int DEFAULT_PORT = 7640;
2831
static constexpr int DEFAULT_DELAY = 1;
@@ -171,4 +174,6 @@ struct L2pingStatus
171174
*/
172175
typedef std::vector<L2pingStatus> L2pingStatusList;
173176

174-
#endif // BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_
177+
} // namespace autoware::bluetooth_monitor
178+
179+
#endif // AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_INTERFACE_HPP_

system/bluetooth_monitor/include/bluetooth_monitor/service/l2ping_service.hpp system/autoware_bluetooth_monitor/include/autoware/bluetooth_monitor/service/l2ping_service.hpp

+10-5
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
16-
#define BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
15+
#ifndef AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
16+
#define AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
1717

18-
#include "bluetooth_monitor/service/l2ping.hpp"
19-
#include "bluetooth_monitor/service/l2ping_interface.hpp"
18+
#include "autoware/bluetooth_monitor/service/l2ping.hpp"
19+
#include "autoware/bluetooth_monitor/service/l2ping_interface.hpp"
2020

2121
#include <map>
2222
#include <memory>
2323
#include <string>
2424
#include <thread>
2525
#include <vector>
2626

27+
namespace autoware::bluetooth_monitor
28+
{
29+
2730
class L2pingService
2831
{
2932
public:
@@ -85,4 +88,6 @@ class L2pingService
8588
L2pingStatusList status_list_; //!< @brief List of l2ping status
8689
};
8790

88-
#endif // BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
91+
} // namespace autoware::bluetooth_monitor
92+
93+
#endif // AUTOWARE__BLUETOOTH_MONITOR__SERVICE__L2PING_SERVICE_HPP_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<launch>
2+
<arg name="bluetooth_monitor_param_file" default="$(find-pkg-share autoware_bluetooth_monitor)/config/bluetooth_monitor.param.yaml"/>
3+
<node pkg="autoware_bluetooth_monitor" exec="autoware_bluetooth_monitor_node" output="log" respawn="true">
4+
<param from="$(var bluetooth_monitor_param_file)"/>
5+
</node>
6+
</launch>

system/bluetooth_monitor/package.xml system/autoware_bluetooth_monitor/package.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0"?>
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
4-
<name>bluetooth_monitor</name>
4+
<name>autoware_bluetooth_monitor</name>
55
<version>0.40.0</version>
66
<description>Bluetooth alive monitoring</description>
77
<maintainer email="fumihito.ito@tier4.jp">Fumihito Ito</maintainer>
8+
<maintainer email="junya.sasaki@tier4.jp">Junya Sasaki</maintainer>
89
<license>Apache License 2.0</license>
910

1011
<buildtool_depend>ament_cmake_auto</buildtool_depend>

system/bluetooth_monitor/service/l2ping.cpp system/autoware_bluetooth_monitor/service/l2ping.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
//
1515

16-
#include "bluetooth_monitor/service/l2ping.hpp"
16+
#include "autoware/bluetooth_monitor/service/l2ping.hpp"
1717

1818
#include <boost/process.hpp>
1919

@@ -25,6 +25,9 @@
2525
#define FMT_HEADER_ONLY
2626
#include <fmt/format.h>
2727

28+
namespace autoware::bluetooth_monitor
29+
{
30+
2831
namespace bp = boost::process;
2932

3033
L2ping::L2ping(const std::string & address, const L2pingConfig & config)
@@ -189,3 +192,5 @@ const std::string & L2ping::getAddress() const
189192
{
190193
return status_.address;
191194
}
195+
196+
} // namespace autoware::bluetooth_monitor

system/bluetooth_monitor/service/l2ping_service.cpp system/autoware_bluetooth_monitor/service/l2ping_service.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "bluetooth_monitor/service/l2ping_service.hpp"
15+
#include "autoware/bluetooth_monitor/service/l2ping_service.hpp"
1616

1717
#include <boost/archive/text_iarchive.hpp>
1818
#include <boost/archive/text_oarchive.hpp>
@@ -30,6 +30,9 @@
3030
#define FMT_HEADER_ONLY
3131
#include <fmt/format.h>
3232

33+
namespace autoware::bluetooth_monitor
34+
{
35+
3336
namespace bp = boost::process;
3437

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

253256
return true;
254257
}
258+
259+
} // namespace autoware::bluetooth_monitor

system/bluetooth_monitor/service/main.cpp system/autoware_bluetooth_monitor/service/main.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "bluetooth_monitor/service/l2ping_interface.hpp"
16-
#include "bluetooth_monitor/service/l2ping_service.hpp"
15+
#include "autoware/bluetooth_monitor/service/l2ping_interface.hpp"
16+
#include "autoware/bluetooth_monitor/service/l2ping_service.hpp"
1717

1818
#include <boost/lexical_cast.hpp>
1919

@@ -47,7 +47,7 @@ int main(int argc, char ** argv)
4747
// Parse command-line options
4848
int c = 0;
4949
int option_index = 0;
50-
int port = DEFAULT_PORT;
50+
int port = autoware::bluetooth_monitor::DEFAULT_PORT;
5151
while ((c = getopt_long(argc, argv, "hp:", long_options, &option_index)) != -1) {
5252
switch (c) {
5353
case 'h':
@@ -78,7 +78,7 @@ int main(int argc, char ** argv)
7878
openlog(nullptr, LOG_PID, LOG_DAEMON);
7979

8080
// Initialize l2ping service
81-
L2pingService service(port);
81+
autoware::bluetooth_monitor::L2pingService service(port);
8282

8383
if (!service.initialize()) {
8484
service.shutdown();

system/bluetooth_monitor/src/bluetooth_monitor.cpp system/autoware_bluetooth_monitor/src/bluetooth_monitor.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "bluetooth_monitor/bluetooth_monitor.hpp"
15+
#include "autoware/bluetooth_monitor/bluetooth_monitor.hpp"
1616

1717
#include <boost/archive/text_iarchive.hpp>
1818
#include <boost/archive/text_oarchive.hpp>
@@ -28,6 +28,9 @@
2828
#define FMT_HEADER_ONLY
2929
#include <fmt/format.h>
3030

31+
namespace autoware::bluetooth_monitor
32+
{
33+
3134
BluetoothMonitor::BluetoothMonitor(const rclcpp::NodeOptions & options)
3235
: Node("bluetooth_monitor", options),
3336
updater_(this),
@@ -199,5 +202,7 @@ void BluetoothMonitor::checkConnection(diagnostic_updater::DiagnosticStatusWrapp
199202
setErrorLevel(stat);
200203
}
201204

205+
} // namespace autoware::bluetooth_monitor
206+
202207
#include <rclcpp_components/register_node_macro.hpp>
203-
RCLCPP_COMPONENTS_REGISTER_NODE(BluetoothMonitor)
208+
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::bluetooth_monitor::BluetoothMonitor)

system/bluetooth_monitor/launch/bluetooth_monitor.launch.xml

-6
This file was deleted.

0 commit comments

Comments
 (0)