Skip to content

Commit

Permalink
Make RCLCPP::Node as the first argument of constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
RoboticsYY committed Jan 10, 2020
1 parent 6aa9bfd commit 3d56cf1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,12 @@ class TrajectoryExecutionManager
};

/// Load the controller manager plugin, start listening for events on a topic.
TrajectoryExecutionManager(const robot_model::RobotModelConstPtr& robot_model,
const planning_scene_monitor::CurrentStateMonitorPtr& csm,
const rclcpp::Node::SharedPtr& node);
TrajectoryExecutionManager(const rclcpp::Node::SharedPtr& node, const robot_model::RobotModelConstPtr& robot_model,
const planning_scene_monitor::CurrentStateMonitorPtr& csm);

/// Load the controller manager plugin, start listening for events on a topic.
TrajectoryExecutionManager(const robot_model::RobotModelConstPtr& robot_model,
const planning_scene_monitor::CurrentStateMonitorPtr& csm, bool manage_controllers,
const rclcpp::Node::SharedPtr& node);
TrajectoryExecutionManager(const rclcpp::Node::SharedPtr& node, const robot_model::RobotModelConstPtr& robot_model,
const planning_scene_monitor::CurrentStateMonitorPtr& csm, bool manage_controllers);

/// Destructor. Cancels all running trajectories (if any)
~TrajectoryExecutionManager();
Expand Down Expand Up @@ -307,9 +305,9 @@ class TrajectoryExecutionManager
// Name of this class for logging
const std::string name_ = "trajectory_execution_manager";

rclcpp::Node::SharedPtr node_;
robot_model::RobotModelConstPtr robot_model_;
planning_scene_monitor::CurrentStateMonitorPtr csm_;
rclcpp::Node::SharedPtr node_;
rclcpp::Subscription<std_msgs::msg::String>::SharedPtr event_topic_subscriber_;
std::map<std::string, ControllerInformation> known_controllers_;
bool manage_controllers_;
Expand All @@ -322,6 +320,7 @@ class TrajectoryExecutionManager

boost::mutex execution_state_mutex_;
boost::mutex continuous_execution_mutex_;
boost::mutex execution_thread_mutex_;

boost::condition_variable continuous_execution_condition_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,21 @@ class TrajectoryExecutionManager::DynamicReconfigureImpl
// dynamic_reconfigure::Server<TrajectoryExecutionDynamicReconfigureConfig> dynamic_reconfigure_server_;
};

TrajectoryExecutionManager::TrajectoryExecutionManager(const robot_model::RobotModelConstPtr& robot_model,
const planning_scene_monitor::CurrentStateMonitorPtr& csm,
const rclcpp::Node::SharedPtr& node)
: robot_model_(robot_model), csm_(csm), node_(node)
TrajectoryExecutionManager::TrajectoryExecutionManager(const rclcpp::Node::SharedPtr& node,
const robot_model::RobotModelConstPtr& robot_model,
const planning_scene_monitor::CurrentStateMonitorPtr& csm)
: node_(node), robot_model_(robot_model), csm_(csm)
{
if (!node_->get_parameter("moveit_manage_controllers", manage_controllers_))
manage_controllers_ = false;
initialize();
}

TrajectoryExecutionManager::TrajectoryExecutionManager(const robot_model::RobotModelConstPtr& robot_model,
TrajectoryExecutionManager::TrajectoryExecutionManager(const rclcpp::Node::SharedPtr& node,
const robot_model::RobotModelConstPtr& robot_model,
const planning_scene_monitor::CurrentStateMonitorPtr& csm,
bool manage_controllers, const rclcpp::Node::SharedPtr& node)
: robot_model_(robot_model), csm_(csm), node_(node), manage_controllers_(manage_controllers)
bool manage_controllers)
: node_(node), robot_model_(robot_model), csm_(csm), manage_controllers_(manage_controllers)
{
initialize();
}
Expand Down

0 comments on commit 3d56cf1

Please sign in to comment.