Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
480 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#ifndef LOCAL_PLANNER_H | ||
#define LOCAL_PLANNER_H | ||
|
||
#include <iostream> | ||
#include <fstream> | ||
#include <string> | ||
#include "ros/ros.h" | ||
#include <ros/console.h> | ||
#include "geometry_msgs/Twist.h" | ||
#include "sensor_msgs/LaserScan.h" | ||
#include "nav_msgs/Odometry.h" | ||
#include "std_msgs/Int16.h" | ||
#include "std_srvs/Empty.h" | ||
#include <ctime> | ||
|
||
#define TARGET_DISTANCE 0.20 | ||
|
||
class LocalPlanner { | ||
|
||
private: | ||
|
||
// Node handle | ||
ros::NodeHandle n; | ||
|
||
// Publishers | ||
ros::Publisher cmd_vel_pub; | ||
|
||
// Subscribers | ||
ros::Subscriber front_ir_sub; | ||
ros::Subscriber left_ir_sub; | ||
ros::Subscriber right_ir_sub; | ||
ros::Subscriber odom_sub; | ||
ros::Subscriber key_sub; | ||
|
||
// External Parameters | ||
bool left; | ||
bool right; | ||
|
||
// Global variables | ||
float front_distance; | ||
float left_distance; | ||
float right_distance; | ||
|
||
// PID control | ||
float old_prop_error; | ||
float integral_error; | ||
float KP = 10; | ||
float KI = 0.0; | ||
float KD = 0.0; | ||
float time_interval = 0.1; | ||
|
||
// Helper variables | ||
bool robot_lost; | ||
int lost_counter; | ||
bool robot_stop; | ||
float robot_x, robot_y; | ||
|
||
geometry_msgs::Twist calculateCommand(); | ||
void frontIRCallback(const sensor_msgs::LaserScan::ConstPtr& msg); | ||
void leftIRCallback(const sensor_msgs::LaserScan::ConstPtr& msg); | ||
void rightIRCallback(const sensor_msgs::LaserScan::ConstPtr& msg); | ||
void keyCallback( std_msgs::Int16 key_msg ); | ||
float calculateGain(float value); | ||
void calculateRobotLost(); | ||
|
||
void saveMap(); | ||
void saveRobotPose(); | ||
void odomCallback(const nav_msgs::Odometry::ConstPtr &msg); | ||
public: | ||
BasicSolver(); | ||
void run(); | ||
}; | ||
|
||
|
||
#endif |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,96 @@ | ||
11111111111111111111111111111 | ||
10000000001000000001000000001 | ||
-10000000001000000001000000001 | ||
10000000001000000001000000001 | ||
11111100001111100001000000001 | ||
11000100001111100001000100001 | ||
11000100000000000000000100001 | ||
11000100000000000000000100001 | ||
11000100000000000000000100001 | ||
11000011110000011111111100001 | ||
11000000000000000001000000001 | ||
11000000000000000001000000001 | ||
11000000000000000001000000011 | ||
11111111111111111111000000011 | ||
11000000000000100110000111111 | ||
11000000000000100000000111111 | ||
11000000000000100000000111111 | ||
11000000000000100000000111111 | ||
11000111110000000011111111111 | ||
11000100000000000011111111111 | ||
11000100000000000011111111111 | ||
11000100000000000011111111111 | ||
11000111110000000011111111111 | ||
11000000010000000000111111111 | ||
11000000010000000000011111111 | ||
10000000010000000000001111111 | ||
111110-20010000000000000111111 | ||
11101000011111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111000000000100000000100000000111111111111111111111111111111111111111111111111111111 | ||
111111111111111-100000000100000000100000000111111111111111111111111111111111111111111111111111111 | ||
111111111111111000000000100000000100000000111111111111111111111111111111111111111111111111111111 | ||
111111111111111111110000111110000100000000111111111111111111111111111111111111111111111111111111 | ||
111111111111111100010000000000000100010000111111111111111111111111111111111111111111111111111111 | ||
111111111111111100010000000000000000010000111111111111111111111111111111111111111111111111111111 | ||
111111111111111100010000000000000000010000111111111111111111111111111111111111111111111111111111 | ||
111111111111111100010000000000000000010000111111111111111111111111111111111111111111111111111111 | ||
111111111111111100001111000001111111110000111111111111111111111111111111111111111111111111111111 | ||
111111111111111100000000000000000100000000111111111111111111111111111111111111111111111111111111 | ||
111111111111111100000000000000000100000000111111111111111111111111111111111111111111111111111111 | ||
111111111111111100000000000000000100000000111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111100011111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111100000011111111111111111111111111111111111111111111111111111111111 | ||
11111111111111111111111111111000-2000011111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111110000000011111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111110000000011111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111110000111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111000000011111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111110000000011111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111100010000111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111100110000111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111101110000111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111110000111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111110001111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111110001111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 | ||
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 |
Oops, something went wrong.