he objective of this assignment is to autonomously plan and execute a path for a robot in the Stage simulator
The objective of this assignment is to autonomously plan and execute a path for a robot in the Stage simulator from a start location to a goal location, given a map. The global plan is given by A* and the local planning is done using a modified Vector Field Histogram (VFH) (Refer Section IV.6).
The ros_pa2.tar.gz compressed file contains three files:
Stage is a 2(.5)D robotics standalone simulator. It provides a virtual world populated by mobile robots and sensors, along with various objects for the robots to sense and manipulate. The stageros node wraps the Stage 2-D multi-robot simulator, via libstage for ROS. Stage simulates a world as defined in the playground.world file, present inside the world sub-folder. This file tells stage everything about the world, from obstacles (usually represented via a bitmap to be used as a kind of background), to robots and other objects.Robotic Algorithms代写
You can change the view in the simulator and move the robot in stageros. You can addsome basic visualizations such as the laser scanner range data or the robot footprints for debugging from the View menu in stageros.
The robot in stageros simulates a 2 wheeled differential drive robot that drives over a smoothground plane. In order to move the robot in the simulator, we need to send velocity commands tothe robot. This is done by publishing command geometry_msgs/Twist messages to the topic/cmd_vel. The robot can only respond to linear velocities in the x axis and angular velocities in thez axis. So, to move forward, publish Twist messages with non-zero linear.x velocities and to turn, publish Twist messages with non-zero angular.z values.
A simple behaviour to move your robot without using the more complicated differential model isto always have only an angular or linear velocity at a specific time to turn or move forward, respectively.Robotic Algorithms代写
To know the pose of the robot, you can subscribe to /base_pose_ground_truth of typenav_msgs/Odometry and retrieve the position and orientation from the pose member variable. Orientations are expressed as quaternions in ROS. Please refer to section VII.3 for conversion between quaternion and euler angles.
In order to make sense of its environment, the robot needs to get data from its sensors. The robot is equipped with a planar laser range-finder that gives information about obstacles around the robot. The sensor has 361 lines of lasers allowing the robot to perceive 180 degrees of the worldaround it at a maximum range of 3m. In your stageros simulator, you can view the robot sensing range by clicking on View -> Data or pressing the key ‘D’.
The sensor data is published to a topic /base_scan which is of type sensor_msgs/LaserScan. Use the ranges[i] member variable to get the range information of a particular laser line i. If there isan obstacle between range_min and range_max, range will be the distance of the sensedobstacle from the sensor. If an obstacle is outside its range values, the range will be equal torange_max. Move the robot around by clicking and dragging it in the simulator and visualize theoutput of the sensor in rviz to understand how the sensor works. Subscribe to the topic and readthe messages to get the values of range_max, range_min, each range data, etc.Robotic Algorithms代写
Global planners require a map for operation. The map of the robot workspace in the simulator isgiven as an occupancy grid, a grid representation with 1s and 0s, with 1 indicating an obstacle inthat cell and 0 representing an empty cell. The map has 20 rows and 18 columns. The map isdescribed as a 1D array with 0s and 1s in map.txt. You should include this into your program asthe map. You can simply paste the array into your code and read it appropriately as a 2D matrix with dimensions of (20, 18).
A* is an informed search technique used to search for a path from a start location to a goal location in a map. The total cost of a node n is given by:
f(n) = g(n) + ε.h(n)
where g(n) is the exact cost of the path from the start node to the node n and h(n) is the heuristic function which estimates a cost from node n to the goal node.Robotic Algorithms代写
Figure 1 depicts the movement cost from a node n (shown in green) in the occupancy grid to its 8 neighbours (shown in blue). The movement costs to the non-diagonal neighbours is 1 and the movement costs to the diagonal neighbours is √2 = 1.4. Using these movement costs and keepingtrack of the path taken, the exact cost of the path from the start to any node n in the occupancygrid can be calculated by the sum of the movement costs along the path taken.
Fig.1: Movement Cost
Given the current node and the goal node, you can use the Euclidean distance (L2 Norm) between them as the heuristic cost.
The A* algorithm essentials outputs a global path from the start node to the goal node. The globalpath essentially contains a list of nodes/checkpoints, such that when the robot moves to each oneof them in succession it will eventually reach the final goal location. ε is the coefficient of theheuristic function, used to scale the heuristic cost. You can start with ε=1, and tune only ifrequired, based on the paths returned by your A* algorithm.
You may refer to this video for a walkthrough of the A* algorithm.