Optimizing Cleaning Robot's Navigation through Ray Casting Algorithms for Efficient Path Planning
 
Loading...
Searching...
No Matches
obstacle_avoid Namespace Reference

Classes

class  ObstacleAvoidance
 

Functions

 is_front_hazard_active (hazards)
 
 send_velocity_command (self, hazard_detected)
 
 hazard_callback (self, HazardDetectionVector hazards)
 hazard callback.
 
 main (args=None)
 Use spin() to continuously run the node.
 

Variables

str yaml_file_path = "room_map_save.yaml"
 
 yaml_data = yaml.safe_load(file)
 Open the YAML file and load its contents.
 
 cmd_vel_pub
 Twist publisher.
 
 hazard_sub
 Hazard subscriber.
 
 _start_time
 

Function Documentation

◆ hazard_callback()

obstacle_avoid.hazard_callback ( self,
HazardDetectionVector hazards )

hazard callback.

Parameters
self.
hazards:HazardDetectionVector.
See also
is_front_hazard_active()

◆ is_front_hazard_active()

obstacle_avoid.is_front_hazard_active ( hazards)
Note
This function uses the bumper to detect if it hit an object
Parameters
hazards
Returns
True or False

◆ main()

obstacle_avoid.main ( args = None)

Use spin() to continuously run the node.

◆ send_velocity_command()

obstacle_avoid.send_velocity_command ( self,
hazard_detected )
Parameters
self
hazard_detected

Variable Documentation

◆ _start_time

obstacle_avoid._start_time
protected
Parameters
double

◆ cmd_vel_pub

obstacle_avoid.cmd_vel_pub

Twist publisher.

 self.cmd_vel_pub = self.create_publisher(Twist, "/cmd_vel", 10)    

◆ hazard_sub

obstacle_avoid.hazard_sub

Hazard subscriber.

 self.hazard_sub = self.create_subscription(HazardDetectionVector, "/hazard_detection", self.hazard_callback, QoSProfile(depth=10, reliability=ReliabilityPolicy.BEST_EFFORT))
Warning
QoSProfile reliabilty has to be set to BEST EFFORT.

◆ yaml_data

obstacle_avoid.yaml_data = yaml.safe_load(file)

Open the YAML file and load its contents.

◆ yaml_file_path

str obstacle_avoid.yaml_file_path = "room_map_save.yaml"
Note
Can be changed to any .yaml file