Skip to content
Snippets Groups Projects
Commit 12cb8452 authored by Alejandro Lopez Gestoso's avatar Alejandro Lopez Gestoso
Browse files

Fixed a typo and removed some commentaries

parent 506cd9a5
No related branches found
No related tags found
No related merge requests found
......@@ -405,7 +405,7 @@ class CTiagoArmModuleBT
* If inputs are missing or incorrect it also returns BT:NodeStatus::FAILURE.
*
*/
BT::NodeStatus syn_cancel_tiago_arm_action(void);
BT::NodeStatus sync_cancel_tiago_arm_action(void);
/**
* \brief Async stop TIAGo arm function.
......@@ -421,7 +421,7 @@ class CTiagoArmModuleBT
* it also returns BT:NodeStatus::FAILURE
*
*/
BT::NodeStatus asyn_cancel_tiago_arm_action(void);
BT::NodeStatus async_cancel_tiago_arm_action(void);
/**
* \brief Checks if the module is idle and there isn't any new movement request.
......
......@@ -12,8 +12,6 @@ void CTiagoArmModuleBT::init(IriBehaviorTreeFactory &factory)
//Definition of ports
BT::PortsList set_workspace_ports = {BT::InputPort<std::string>("frame_id"), BT::InputPort<double>("x_min"), BT::InputPort<double>("y_min"), BT::InputPort<double>("z_min"), BT::InputPort<double>("x_max"), BT::InputPort<double>("y_max"), BT::InputPort<double>("z_max")};
// BT::PortsList sync_arm_move_to_joints_ports = {BT::InputPort<std::vector<std::string> >("joint_names"), BT::InputPort<std::vector<double> >("joint_positions"), BT::InputPort<double>("joint_tol")};
// BT::PortsList async_arm_move_to_joints_ports = {BT::InputPort<std::vector<std::string> >("joint_names"), BT::InputPort<std::vector<double> >("joint_positions"), BT::InputPort<double>("joint_tol"), BT::BidirectionalPort<bool>("new_goal")};
BT::PortsList sync_arm_move_to_joints_ports = {BT::InputPort<sensor_msgs::JointState>("target_joints"), BT::InputPort<double>("joint_tol")};
BT::PortsList async_arm_move_to_joints_ports = {BT::InputPort<sensor_msgs::JointState>("target_joints"), BT::InputPort<double>("joint_tol"), BT::BidirectionalPort<bool>("new_goal")};
......@@ -57,8 +55,8 @@ void CTiagoArmModuleBT::init(IriBehaviorTreeFactory &factory)
//Registration of actions
factory.registerIriAsyncAction("async_is_tiago_arm_finished", std::bind(&CTiagoArmModuleBT::async_is_tiago_arm_finished, this));
factory.registerSimpleAction("syn_cancel_tiago_arm_action", std::bind(&CTiagoArmModuleBT::syn_cancel_tiago_arm_action, this));
factory.registerSimpleAction("asyn_cancel_tiago_arm_action", std::bind(&CTiagoArmModuleBT::asyn_cancel_tiago_arm_action, this));
factory.registerSimpleAction("sync_cancel_tiago_arm_action", std::bind(&CTiagoArmModuleBT::sync_cancel_tiago_arm_action, this));
factory.registerSimpleAction("async_cancel_tiago_arm_action", std::bind(&CTiagoArmModuleBT::async_cancel_tiago_arm_action, this));
factory.registerSimpleAction("set_tiago_arm_workspace", std::bind(&CTiagoArmModuleBT::set_tiago_arm_workspace, this, std::placeholders::_1), set_workspace_ports);
......@@ -134,23 +132,17 @@ BT::NodeStatus CTiagoArmModuleBT::set_tiago_arm_workspace(BT::TreeNode& self)
BT::NodeStatus CTiagoArmModuleBT::sync_tiago_arm_move_to_joints(BT::TreeNode& self)
{
ROS_DEBUG("CTiagoArmModuleBT::sync_tiago_arm_move_to_joints-> sync_tiago_arm_move_to_joints");
// BT::Optional<std::vector<std::string> > joint_names = self.getInput<std::vector<std::string> >("joint_names");
// BT::Optional<std::vector<double> > joint_positions = self.getInput<std::vector<double> >("joint_positions");
BT::Optional<sensor_msgs::JointState> target_joints = self.getInput<sensor_msgs::JointState>("target_joints");
BT::Optional<double> joint_tol = self.getInput<double>("joint_tol");
sensor_msgs::JointState target_joints_goal;
double joint_tol_goal;
// if (!joint_names || !joint_positions)
if (!target_joints)
{
// ROS_ERROR("CTiagoArmModuleBT::sync_tiago_arm_move_to_joints-> Incorrect or missing input. It needs the following input ports: joint_names(std::vector<std::string>), joint_positions(std::vector<double>) and [Optional] joint_tol(double)");
ROS_ERROR("CTiagoArmModuleBT::sync_tiago_arm_move_to_joints-> Incorrect or missing input. It needs the following input ports: target_joints(sensor_msgs::JointState) and [Optional] joint_tol(double)");
return BT::NodeStatus::FAILURE;
}
// target_joints_goal.name = joint_names.value();
// target_joints_goal.position = joint_positions.value();
target_joints_goal = target_joints.value();
if (!joint_tol)
{
......@@ -169,8 +161,6 @@ BT::NodeStatus CTiagoArmModuleBT::sync_tiago_arm_move_to_joints(BT::TreeNode& se
BT::NodeStatus CTiagoArmModuleBT::async_tiago_arm_move_to_joints(BT::TreeNode& self)
{
ROS_DEBUG("CTiagoArmModuleBT::sync_tiago_arm_move_to_joints-> sync_tiago_arm_move_to_joints");
// BT::Optional<std::vector<std::string> > joint_names = self.getInput<std::vector<std::string> >("joint_names");
// BT::Optional<std::vector<double> > joint_positions = self.getInput<std::vector<double> >("joint_positions");
BT::Optional<sensor_msgs::JointState> target_joints = self.getInput<sensor_msgs::JointState>("target_joints");
BT::Optional<double> joint_tol = self.getInput<double>("joint_tol");
BT::Optional<bool> new_goal_in = self.getInput<bool>("new_goal");
......@@ -185,16 +175,12 @@ BT::NodeStatus CTiagoArmModuleBT::async_tiago_arm_move_to_joints(BT::TreeNode& s
{
sensor_msgs::JointState target_joints_goal;
double joint_tol_goal;
// if (!joint_names || !joint_positions)
if (!target_joints)
{
// ROS_ERROR("CTiagoArmModuleBT::sync_tiago_arm_move_to_joints-> Incorrect or missing input. It needs the following input ports: joint_names(std::vector<std::string>), joint_positions(std::vector<double>) and [Optional] joint_tol(double)");
ROS_ERROR("CTiagoArmModuleBT::sync_tiago_arm_move_to_joints-> Incorrect or missing input. It needs the following input ports: target_joints(sensor_msgs::JointState) and [Optional] joint_tol(double)");
return BT::NodeStatus::FAILURE;
}
// target_joints_goal.name = joint_names.value();
// target_joints_goal.position = joint_positions.value();
target_joints_goal = target_joints.value();
if (!joint_tol)
{
......@@ -480,16 +466,16 @@ BT::NodeStatus CTiagoArmModuleBT::get_tiago_arm_velocity_scale_factor(BT::TreeNo
return BT::NodeStatus::SUCCESS;
}
BT::NodeStatus CTiagoArmModuleBT::syn_cancel_tiago_arm_action(void)
BT::NodeStatus CTiagoArmModuleBT::sync_cancel_tiago_arm_action(void)
{
ROS_DEBUG("CTiagoArmModuleBT::syn_cancel_tiago_arm_action-> syn_cancel_tiago_arm_action");
ROS_DEBUG("CTiagoArmModuleBT::sync_cancel_tiago_arm_action-> sync_cancel_tiago_arm_action");
this->tiago_arm_module.stop();
return BT::NodeStatus::SUCCESS;
}
BT::NodeStatus CTiagoArmModuleBT::asyn_cancel_tiago_arm_action(void)
BT::NodeStatus CTiagoArmModuleBT::async_cancel_tiago_arm_action(void)
{
ROS_DEBUG("CTiagoArmModuleBT::asyn_cancel_tiago_arm_action-> asyn_cancel_tiago_arm_action");
ROS_DEBUG("CTiagoArmModuleBT::async_cancel_tiago_arm_action-> async_cancel_tiago_arm_action");
this->tiago_arm_module.stop();
if (this->tiago_arm_module.is_finished())
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment