Commit 11f010a 1 parent 2ac6116 commit 11f010a Copy full SHA for 11f010a
File tree 6 files changed +21
-43
lines changed
localization/localization_error_monitor
include/localization_error_monitor
6 files changed +21
-43
lines changed Original file line number Diff line number Diff line change @@ -4,33 +4,34 @@ project(localization_error_monitor)
4
4
find_package (autoware_cmake REQUIRED)
5
5
autoware_package()
6
6
7
- ament_auto_add_library(localization_error_monitor_module SHARED
7
+ ament_auto_add_library(${PROJECT_NAME} SHARED
8
8
src/diagnostics.cpp
9
+ src/localization_error_monitor.cpp
9
10
)
10
11
11
- ament_auto_add_executable(localization_error_monitor
12
- src/main.cpp
13
- src/node.cpp
12
+ rclcpp_components_register_node(${PROJECT_NAME}
13
+ PLUGIN "LocalizationErrorMonitor"
14
+ EXECUTABLE ${PROJECT_NAME} _node
15
+ EXECUTOR SingleThreadedExecutor
14
16
)
15
- target_link_libraries (localization_error_monitor localization_error_monitor_module)
16
17
17
18
if (BUILD_TESTING)
18
19
function (add_testcase filepath )
19
20
get_filename_component (filename ${filepath} NAME )
20
21
string (REGEX REPLACE ".cpp" "" test_name ${filename} )
21
22
ament_add_gtest(${test_name} ${filepath} )
22
23
target_include_directories (${test_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} /include )
23
- target_link_libraries (${test_name} localization_error_monitor_module )
24
+ target_link_libraries (${test_name} ${PROJECT_NAME} )
24
25
ament_target_dependencies(${test_name} ${${PROJECT_NAME} _FOUND_BUILD_DEPENDS})
25
26
endfunction ()
26
27
27
-
28
28
find_package (ament_lint_auto REQUIRED)
29
29
ament_lint_auto_find_test_dependencies()
30
30
add_testcase(test /test_diagnostics.cpp)
31
31
endif ()
32
32
33
- ament_auto_package(INSTALL_TO_SHARE
33
+ ament_auto_package(
34
+ INSTALL_TO_SHARE
34
35
config
35
36
launch
36
37
)
Original file line number Diff line number Diff line change 12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- #ifndef LOCALIZATION_ERROR_MONITOR__NODE_HPP_
16
- #define LOCALIZATION_ERROR_MONITOR__NODE_HPP_
15
+ #ifndef LOCALIZATION_ERROR_MONITOR__LOCALIZATION_ERROR_MONITOR_HPP_
16
+ #define LOCALIZATION_ERROR_MONITOR__LOCALIZATION_ERROR_MONITOR_HPP_
17
17
18
18
#include < Eigen/Dense>
19
19
#include < rclcpp/rclcpp.hpp>
@@ -58,7 +58,7 @@ class LocalizationErrorMonitor : public rclcpp::Node
58
58
double measureSizeEllipseAlongBodyFrame (const Eigen::Matrix2d & Pinv, double theta);
59
59
60
60
public:
61
- LocalizationErrorMonitor ();
61
+ explicit LocalizationErrorMonitor (const rclcpp::NodeOptions & options );
62
62
~LocalizationErrorMonitor () = default ;
63
63
};
64
- #endif // LOCALIZATION_ERROR_MONITOR__NODE_HPP_
64
+ #endif // LOCALIZATION_ERROR_MONITOR__LOCALIZATION_ERROR_MONITOR_HPP_
Original file line number Diff line number Diff line change 2
2
<arg name =" input/odom" default =" /localization/kinematic_state" />
3
3
<arg name =" param_file" default =" $(find-pkg-share localization_error_monitor)/config/localization_error_monitor.param.yaml" />
4
4
5
- <node name =" localization_error_monitor" exec =" localization_error_monitor " pkg = " localization_error_monitor " output =" screen " >
5
+ <node pkg =" localization_error_monitor" exec =" localization_error_monitor_node " output =" both " >
6
6
<remap from =" input/odom" to =" $(var input/odom)" />
7
7
<param from =" $(var param_file)" />
8
8
</node >
Original file line number Diff line number Diff line change 23
23
<depend >diagnostic_msgs</depend >
24
24
<depend >diagnostic_updater</depend >
25
25
<depend >nav_msgs</depend >
26
+ <depend >rclcpp_components</depend >
26
27
<depend >tf2</depend >
27
28
<depend >tf2_geometry_msgs</depend >
28
29
<depend >tier4_autoware_utils</depend >
Original file line number Diff line number Diff line change 12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- #include " localization_error_monitor/node .hpp"
15
+ #include " localization_error_monitor/localization_error_monitor .hpp"
16
16
17
17
#include " localization_error_monitor/diagnostics.hpp"
18
18
32
32
#include < string>
33
33
#include < utility>
34
34
35
- LocalizationErrorMonitor::LocalizationErrorMonitor () : Node(" localization_error_monitor" )
35
+ LocalizationErrorMonitor::LocalizationErrorMonitor (const rclcpp::NodeOptions & options)
36
+ : Node(" localization_error_monitor" , options)
36
37
{
37
38
scale_ = this ->declare_parameter <double >(" scale" );
38
39
error_ellipse_size_ = this ->declare_parameter <double >(" error_ellipse_size" );
@@ -143,3 +144,6 @@ double LocalizationErrorMonitor::measureSizeEllipseAlongBodyFrame(
143
144
double d = std::sqrt ((e.transpose () * Pinv * e)(0 , 0 ) / Pinv.determinant ());
144
145
return d;
145
146
}
147
+
148
+ #include < rclcpp_components/register_node_macro.hpp>
149
+ RCLCPP_COMPONENTS_REGISTER_NODE (LocalizationErrorMonitor)
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments