Skip to content

use laser data from a mobile robot base to move parallel to an obstacle by sending velocity commands.

Notifications You must be signed in to change notification settings

engr-sas/wall_follow-ROS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wall_follow-ROS

use laser data from a mobile robot base to move parallel to an obstacle by sending velocity commands.
Params will require tunning based on robot and environment; rate, max vel

Example Usage

#include <ros/ros.h> #include <sensor_msgs/LaserScan.h> #include <geometry_msgs/Twist.h> #include "/home/sas2/cws/src/wall_follow/src/wall_follow.cpp"

sensor_msgs::LaserScan l_scans; sensor_msgs::LaserScan* pl_scans = &l_scans;

void laserCallback(const sensor_msgs::LaserScan msg){ *pl_scans = msg; ros::spinOnce(); }

int main(int argc, char** argv) { std::cout<<"start"; ros::init(argc, argv, "wall_f"); ros::NodeHandle n;

ros::Publisher lsp = n.advertise<geometry_msgs::Twist>("cmd_vel", 500);
ros::Subscriber laser_sub= n.subscribe("scan", 500 ,laserCallback);

WallFollow wf("left", 2.2, 6, 1, 0.5, 0.5, pl_scans, &lsp);
ros::Rate loop_rate(30);	
while (ros::ok){
	wf.start();
	ros::spinOnce();
	loop_rate.sleep();
}
return 0;

}

About

use laser data from a mobile robot base to move parallel to an obstacle by sending velocity commands.

Resources

Stars

Watchers

Forks

Packages

No packages published