Skip to content
Snippets Groups Projects
Commit 6fdbadb1 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added the rate parameter.

parent ab38865a
No related branches found
No related tags found
1 merge request!2Adc
...@@ -39,7 +39,8 @@ gen = ParameterGenerator() ...@@ -39,7 +39,8 @@ gen = ParameterGenerator()
ackermann = gen.add_group("ackermann") ackermann = gen.add_group("ackermann")
# Name Type Reconfiguration level Description Default Min Max # Name Type Reconfiguration level Description Default Min Max
gen.add("safety_distance", double_t, 0, "Safety distance to possible obstacles",0.5, 0.0, 2.0) gen.add("rate", double_t, 0, "Main loop rate (Hz)", 10.0, 0.1, 1000.0)
gen.add("safety_distance", double_t, 0, "Safety distance to possible obstacles",0.5, 0.0, 10.0)
gen.add("traj_sim_distance", double_t, 0, "Distance for the trajectory computation", 1.0, 0.1, 5.0) gen.add("traj_sim_distance", double_t, 0, "Distance for the trajectory computation", 1.0, 0.1, 5.0)
gen.add("traj_sim_time", double_t, 0, "Time for the trajectory computation", 1.0, 0.1, 5.0) gen.add("traj_sim_time", double_t, 0, "Time for the trajectory computation", 1.0, 0.1, 5.0)
gen.add("traj_sim_step", double_t, 0, "Distance/Time increment for the trajectory computation", 0.1, 0.01, 0.5) gen.add("traj_sim_step", double_t, 0, "Distance/Time increment for the trajectory computation", 0.1, 0.01, 0.5)
......
rate: 10
footprint: [[0.7,0.15],[0.7,-0.15],[-0.35,-0.15],[-0.35,0.15]] footprint: [[0.7,0.15],[0.7,-0.15],[-0.35,-0.15],[-0.35,0.15]]
safety_distance: 0.2 safety_distance: 0.2
traj_sim_distance: 2.0 traj_sim_distance: 2.0
......
...@@ -12,7 +12,12 @@ SafeCmdAlgNode::SafeCmdAlgNode(void) : ...@@ -12,7 +12,12 @@ SafeCmdAlgNode::SafeCmdAlgNode(void) :
tf2_listener(tf2_buffer) tf2_listener(tf2_buffer)
{ {
//init class attributes if necessary //init class attributes if necessary
this->setRate(30);//in [Hz] if(!this->private_node_handle_.getParam("rate", this->config.rate))
{
ROS_WARN("SafeCmdAlgNode::SafeCmdAlgNode: param 'rate' not found");
}
else
this->setRate(this->config.rate);
// [init publishers] // [init publishers]
this->collision_points_publisher_ = this->private_node_handle_.advertise<sensor_msgs::PointCloud2>("collision_points", 1); this->collision_points_publisher_ = this->private_node_handle_.advertise<sensor_msgs::PointCloud2>("collision_points", 1);
......
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