Skip to content

Commit

Permalink
Correctif des paramètres du nav_node sur ROS2
Browse files Browse the repository at this point in the history
Le commit précédent incluant les paramètres n'est pas fonctionnel

Signed-off-by: Thomas Bonnefille <[email protected]>
  • Loading branch information
Taumille committed Sep 12, 2023
1 parent a58304c commit 806bc95
Showing 1 changed file with 21 additions and 29 deletions.
50 changes: 21 additions & 29 deletions src/nav_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,27 @@ Nav_node::Nav_node() : Node("nav_node"){
this->robot_goal.y = -1;

// Get parameters
std::string pic_action_topic = "/pic_action";
std::string result_topic = "/result";
std::string robot_data_topic = "/robot_data";
std::string position_goal_topic = "/position_goal";
std::string stop_topic = "/stop";
this->normal_radius = 0.15;
this->variation_obs = 0.10;
std::string map_file = "blank.txt";
this->goal_tolerance = 10;

this->declare_parameter("robot_id", -1);
this->declare_parameter("pic_action_topic", pic_action_topic);
this->declare_parameter("result_topic", result_topic);
this->declare_parameter("robot_data_topic", robot_data_topic);
this->declare_parameter("position_goal_topic", position_goal_topic);
this->declare_parameter("stop_topic", stop_topic);
this->declare_parameter("normal_radius", this->normal_radius);
this->declare_parameter("variation_obs", this->variation_obs);
this->declare_parameter("map_file", map_file);

this->get_parameter("robot_id", this->robot_number).as_int();
this->get_parameter("pic_action_topic", pic_action_topic).as_string();
this->get_parameter("result_topic", result_topic).as_string();
this->get_parameter("robot_data_topic", robot_data_topic).as_string();
this->get_parameter("position_goal_topic", position_goal_topic).as_string();
this->get_parameter("stop_topic", stop_topic).as_string();
this->get_parameter("normal_radius", this->normal_radius).as_double();
this->get_parameter("variation_obs", this->variation_obs).as_double();
this->get_parameter("map_file", this->map_file).as_string();
this->goal_tolerance = 0.1;

this->declare_parameter("robot_id", 0);
this->declare_parameter("pic_action_topic", "/pic_action");
this->declare_parameter("result_topic", "/result");
this->declare_parameter("robot_data_topic", "/robot_data");
this->declare_parameter("position_goal_topic", "/position_goal");
this->declare_parameter("stop_topic", "/stop");
this->declare_parameter("normal_radius", 0.15);
this->declare_parameter("variation_obs", 0.10);
this->declare_parameter("map_file", "blank.txt");

this->robot_number = this->get_parameter("robot_id").as_int();
std::string pic_action_topic = this->get_parameter("pic_action_topic").as_string();
std::string result_topic = this->get_parameter("result_topic").as_string();
std::string robot_data_topic = this->get_parameter("robot_data_topic").as_string();
std::string position_goal_topic = this->get_parameter("position_goal_topic").as_string();
std::string stop_topic = this->get_parameter("stop_topic").as_string();
this->normal_radius = this->get_parameter("normal_radius").as_double();
this->variation_obs = this->get_parameter("variation_obs").as_double();
this->map_file = this->get_parameter("map_file").as_string();


// Ros Pub and Sub
Expand Down

0 comments on commit 806bc95

Please sign in to comment.