-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alberto Tudela <[email protected]>
- Loading branch information
Showing
13 changed files
with
84 additions
and
7 deletions.
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
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
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,10 @@ | ||
find_package(dsr_util REQUIRED) | ||
|
||
# Test for tf agent node | ||
ament_add_gtest(test_tf_agent test_tf_agent.cpp) | ||
target_link_libraries(test_tf_agent | ||
|
||
${fastrtps_LIBRARIES} | ||
tf_agent | ||
ament_index_cpp::ament_index_cpp | ||
) |
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,53 @@ | ||
// Copyright (c) 2024 Alberto J. Tudela Roldán | ||
// Copyright (c) 2024 Grupo Avispa, DTE, Universidad de Málaga | ||
// | ||
// 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. | ||
|
||
#include "gtest/gtest.h" | ||
#include "dsr_agents/tf_agent.hpp" | ||
#include "dsr_util/utils/test_dsr_setup.hpp" | ||
#include "lifecycle_msgs/msg/state.hpp" | ||
|
||
class TFAgentFixture : public dsr_agents::TFAgent | ||
{ | ||
public: | ||
TFAgentFixture() | ||
: dsr_agents::TFAgent() | ||
{ | ||
} | ||
~TFAgentFixture() = default; | ||
}; | ||
|
||
TEST_F(DsrUtilTest, tfAgentConfigure) { | ||
// Create the node | ||
auto agent_node = std::make_shared<TFAgentFixture>(); | ||
agent_node->declare_parameter("dsr_input_file", rclcpp::ParameterValue(test_file_)); | ||
|
||
const auto state_after_configure = agent_node->configure(); | ||
ASSERT_EQ(state_after_configure.id(), lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE); | ||
|
||
agent_node->activate(); | ||
agent_node->deactivate(); | ||
agent_node->cleanup(); | ||
agent_node->shutdown(); | ||
} | ||
|
||
int main(int argc, char ** argv) | ||
{ | ||
QCoreApplication app(argc, argv); | ||
testing::InitGoogleTest(&argc, argv); | ||
rclcpp::init(argc, argv); | ||
bool success = RUN_ALL_TESTS(); | ||
rclcpp::shutdown(); | ||
return success; | ||
} |
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
File renamed without changes.
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