diff --git a/robossembler/launch/task_planner.launch.py b/robossembler/launch/task_planner.launch.py index 56ed51d..fd9ea5c 100644 --- a/robossembler/launch/task_planner.launch.py +++ b/robossembler/launch/task_planner.launch.py @@ -98,7 +98,7 @@ def generate_launch_description(): 'bt_xml_file': pkg_dir + '/behavior_trees_xml/atomic_skills_xml/move.xml', } ]) - gz_get_entity_state = Node( + """gz_get_entity_state = Node( package='plansys2_bt_actions', executable='bt_action_node', name='get_part_state', @@ -111,25 +111,16 @@ def generate_launch_description(): 'bt_xml_file':pkg_dir + '/behavior_trees_xml/atomic_skills_xml/get_part_state.xml' } ] - ) - - # transport_1 = Node( - # package='robossembler', - # executable='move_action_node', - # name='transport_1', - # namespace=namespace, - # output='screen', - # parameters=[]) + )""" ld = LaunchDescription() ld.add_action(declare_namespace_cmd) #ld.add_action(declare_robot_description) - ld.add_action(gz_get_entity_state) + #ld.add_action(gz_get_entity_state) # Declare the launch options ld.add_action(plansys2_cmd) ld.add_action(move_1) - # ld.add_action(transport_1) return ld \ No newline at end of file diff --git a/robossembler/src/move_action_node.cpp b/robossembler/src/move_action_node.cpp deleted file mode 100644 index bad324e..0000000 --- a/robossembler/src/move_action_node.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019 Intelligent Robotics Lab -// -// 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 -#include - -#include "plansys2_executor/ActionExecutorClient.hpp" - -#include "rclcpp/rclcpp.hpp" -#include "rclcpp_action/rclcpp_action.hpp" - -#include "robot_bt/behavior_tree_nodes/atomic_skills/Move.hpp" - -using namespace std::chrono_literals; - -class MoveAction : public plansys2::ActionExecutorClient -{ -public: - MoveAction() - : plansys2::ActionExecutorClient("move", 500ms) - { - progress_ = 0.0; - } - -private: - void do_work() - { - if (progress_ < 1.0) { - progress_ += 0.05; - send_feedback(progress_, "Move running"); - } else { - finish(true, 1.0, "Move completed"); - - progress_ = 0.0; - std::cout << std::endl; - } - - std::cout << "\r\e[K" << std::flush; - std::cout << "Moving ... [" << std::min(100.0, progress_ * 100.0) << "%] " << - std::flush; - } - - float progress_; -}; - -int main(int argc, char ** argv) -{ - rclcpp::init(argc, argv); - auto node = std::make_shared(); - - node->set_parameter(rclcpp::Parameter("action_name", "move")); - node->trigger_transition(lifecycle_msgs::msg::Transition::TRANSITION_CONFIGURE); - - rclcpp::spin(node->get_node_base_interface()); - - rclcpp::shutdown(); - - return 0; -} \ No newline at end of file