Commit 4791bc58 authored by Capp's avatar Capp

[node] add param to set velocity

parent 126e8df5
......@@ -8,10 +8,16 @@ int main(int argc, char **argv)
ros::NodeHandle nh;
ros::NodeHandle pnh("~");
double vel_val;
pnh.param("velocity", vel_val, 1.0);
if(!pnh.hasParam("velocity"))
ROS_INFO("Velocity not set. Using default value 1.0 rad.s-1");
ros::Rate rate(1);
ros::Publisher pub = nh.advertise<std_msgs::Float64>("/laser_velocity_controller/command", 10);
std_msgs::Float64 vel; vel.data = 1.0;
std_msgs::Float64 vel; vel.data = vel_val;
while(ros::ok()){
pub.publish(vel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment