-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7c09ca
commit e63ff36
Showing
2 changed files
with
64 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* Copyright (c) 2021, United States Government, as represented by the | ||
* Administrator of the National Aeronautics and Space Administration. | ||
* | ||
* All rights reserved. | ||
* | ||
* The "ISAAC - Integrated System for Autonomous and Adaptive Caretaking | ||
* platform" software is 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 <ros/ros.h> | ||
|
||
#include <plansys2_executor/ActionExecutorClient.hpp> | ||
|
||
#include <string> | ||
|
||
namespace plansys2_actions { | ||
|
||
class MoveAction : public plansys2::ActionExecutorClient { | ||
public: | ||
MoveAction(ros::NodeHandle nh, const std::string& action, const std::chrono::nanoseconds& rate) | ||
: ActionExecutorClient(nh, action, rate) {} | ||
|
||
protected: | ||
void do_work() { | ||
ROS_ERROR_STREAM("Executing [MOVE]"); | ||
// std::string from, towards; | ||
// from = get_arguments()[1]; | ||
// towards = get_arguments()[2]; | ||
} | ||
}; | ||
} // namespace plansys2_actions | ||
|
||
|
||
// Main entry point for application | ||
int main(int argc, char *argv[]) { | ||
// Initialize a ros node | ||
ros::init(argc, argv, "move_action"); | ||
ros::NodeHandle nh(name); | ||
|
||
// Start action node | ||
// We could actually add multiple action nodes here being aware that we might need a ros::AsyncSpinner | ||
// (https://github.com/Bckempa/ros2_planning_system/blob/noetic-devel/plansys2_bt_actions/src/bt_action_node.cpp#L41) | ||
auto action_node = std::make_shared<plansys2::MoveAction>(nh, name, std::chrono_literals::1s); | ||
action_node->trigger_transition(ros::lifecycle::CONFIGURE); | ||
|
||
// Synchronous mode | ||
ros::spin(); | ||
// Make for great success | ||
return 0; |