This repository has been archived by the owner on Mar 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/fix-ndt-matching-runtime-error-in-debug-mode' in…
…to 'master' Fix ndt_matching's runtime error in debug mode See merge request autowarefoundation/autoware.ai/core_perception!57
- Loading branch information
Showing
6 changed files
with
105 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright 2019 Autoware Foundation. All rights reserved. | ||
* | ||
* 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. | ||
* | ||
* Authors: Kenji Miyake | ||
*/ | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include <ros/ros.h> | ||
|
||
class TestSuite : public ::testing::Test | ||
{ | ||
public: | ||
TestSuite() = default; | ||
~TestSuite() = default; | ||
}; | ||
|
||
bool isNodeFound() | ||
{ | ||
std::vector<std::string> node_names; | ||
while (true) | ||
{ | ||
// Get node names | ||
ros::master::getNodes(node_names); | ||
|
||
// Wait for ndt_matching node | ||
const auto itr = std::find(std::begin(node_names), std::end(node_names), "/ndt_matching"); | ||
|
||
// Break if found | ||
if (itr != std::end(node_names)) | ||
{ | ||
break; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
TEST_F(TestSuite, launch_ndt_matching) | ||
{ | ||
ASSERT_TRUE(isNodeFound()); | ||
} | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
testing::InitGoogleTest(&argc, argv); | ||
ros::init(argc, argv, "TestNode"); | ||
return RUN_ALL_TESTS(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<launch> | ||
<param name="tf_x" value="1.2" /> | ||
<param name="tf_y" value="0.0" /> | ||
<param name="tf_z" value="2.0" /> | ||
<param name="tf_yaw" value="0.0" /> | ||
<param name="tf_pitch" value="0.0" /> | ||
<param name="tf_roll" value="0.0" /> | ||
<param name="localizer" value="velodyne" /> | ||
|
||
<node pkg="lidar_localizer" type="ndt_matching" name="ndt_matching" /> | ||
<test pkg="lidar_localizer" type="test_launch_ndt_matching" test-name="test_launch_ndt_matching" /> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# ndt_cpu | ||
|
||
CPU version of NDT matching | ||
|
||
## Known issues | ||
|
||
Currently, this package contains a workaround for preventing runtime error in debug mode. | ||
This should be fixed in the future release. | ||
See [this MR](https://gitlab.com/autowarefoundation/autoware.ai/core_perception/merge_requests/57) for more details. |