From 38bc7eb332f3f2ee99fbe1c8662e7d995dd4c3ed Mon Sep 17 00:00:00 2001 From: Anastasiia Bilinska Date: Fri, 1 Nov 2024 15:15:35 +0100 Subject: [PATCH 1/8] docu --- .../paf24/planning/Unstuck_Overtake Behavior | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 doc/research/paf24/planning/Unstuck_Overtake Behavior diff --git a/doc/research/paf24/planning/Unstuck_Overtake Behavior b/doc/research/paf24/planning/Unstuck_Overtake Behavior new file mode 100644 index 00000000..8a8e5d70 --- /dev/null +++ b/doc/research/paf24/planning/Unstuck_Overtake Behavior @@ -0,0 +1,90 @@ +This dicument analyze current unstuck/overtake behavior and reveal several critical issues with the current implementation + +1. Unstuck Behavior: + The "unstuck" behavior is designed to address situations where the vehicle becomes stuck, perhaps due to obstacles or other vehicles blocking its path. + 1.1 Key components: + self.unstuck_distance: Tracks the distance to the object causing the blockage, helping the algorithm to determine if an alternative route (overtaking) might be required. + self.unstuck_overtake_flag: Prevents repeated or "spam" overtakes by ensuring that the unstuck overtake only happens once within a specified distance (UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE). + self.init_overtake_pos: Saves the position where the unstuck behavior is initiated to prevent excessive overtaking within a short range. + Overtaking Logic: The method overtake_fallback is called within __get_speed_unstuck, where a new trajectory is created by offsetting the path to one side, allowing the vehicle to bypass the obstacle and get "unstuck." + + + 1.2 How Unstuck is Triggered: + The method __get_speed_unstuck checks the current behavior (e.g., us_unstuck), adjusting speed accordingly and invoking overtake_fallback if an obstacle is detected and the vehicle is in an "unstuck" situation. + UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE ensures that once an unstuck maneuver is initiated, it won't be repeated until a certain distance is cleared + +2. Overtake Behavior: + The overtake behavior allows the vehicle to safely overtake a slower-moving or stationary vehicle ahead by modifying its trajectory. + 2.1 Key components: + self.__overtake_status: Manages the status of overtaking, where 1 indicates an active overtake, while -1 signals that overtaking isn't required. + change_trajectory: Initiates the overtake by calling overtake_fallback when it detects a collision point or slow-moving vehicle within a certain range. This method also publishes the updated __overtake_status to signal other systems of the change. + overtake_fallback: Calculates a new trajectory path that offsets the vehicle by a certain distance (normal_x_offset) to safely pass the obstacle. The adjusted path uses the Rotation library to align the offset with the vehicle’s heading, creating a smooth path around the obstacle. + + 2.3 How Overtake is Triggered: + The method __set_curr_behavior monitors the vehicle’s behavior, triggering an overtake when ot_enter_init behavior is detected and if an obstacle or collision point is near. It then calls change_trajectory to modify the route. + Speed adjustments specific to overtaking are handled in __get_speed_overtake, where the vehicle might slow down (e.g., ot_enter_slow) or proceed at normal speed after overtaking (e.g., ot_leave). + +3. Relevant rostopics + overtake_success + unstuck_distance + ... + #TODO:need to continue + + + +4. Methods overview + 4.1 How the function def __set_curr_behavior(self, data: String) works: + + If beggins overtake manuever: + if no obsticle to overtake: + unsuccessfull or canceled overtake + publish abandonment of the overtake attempt. + else: + change trajectory + + Infinity as "No Collision Detected": Setting self.__collision_point to infinity (np.inf) would mean "no collision detected." So, checking if np.isinf(self.__collision_point) effectively asks, "Is there no obstacle or point that necessitates an overtake?" (??? not sure abou it) + + Questions: + 1. who tells the function the behaviour status? + 2. If the function has already become an overtake status, why should we check if there is actually an object to overtake? + + 4.2 How the function change_trajectory(self, distynce_obj) works: + update trajectory for overtaking and convert it to a new Path message. Args:distance_obj (float): distance to overtake object + Publish overate success status + + Questions: + 1. What does the success status for overtake mean? It seems like it oublishs than an overtake takes place but does not notify that the overtake manoeuvre was successful. + + 4.3 How the function def overtake_fallback(self, distance, pose_list, unstuck=False) works: + This method constructs a temporary path around an obstacle based on the current location, intended distance to overtake, and a choice between two different lateral offsets depending on whether the vehicle is in an “unstuck” situation. + + Pick Path Points Around the Obstacle: It selects a section of the path around the vehicle’s current position and the obstacle it needs to overtake. If the vehicle is stuck, it picks a larger section to give it more room to maneuver. + Shift Path to the Side: It moves this section of the path slightly to the side (left or right, depending on the vehicle's heading) to avoid the obstacle. If the vehicle is in a “stuck” situation, it shifts it a bit more to give it extra clearance. + Create the New Path: It converts the shifted points into a path format that the vehicle’s navigation system can understand and follow. + Combine with Original Path: it merges this temporary bypass with the original path, so the vehicle can return to its route after it passes the obstacle. + +5. Overtake Behavior Issues + 5.1 Aggressive Lane Changes: The vehicle exhibits aggressive lane changes, leading to emergency stops to avoid oncoming traffic. This behavior suggests that the decision-making logic for overtaking does not adequately assess the surrounding traffic conditions before executing maneuvers. + + 5.2 Inadequate Collision Detection: The vehicle fails to avoid obstacles, such as open car doors or stationary vehicles, indicating that the collision detection mechanisms are either insufficient or not effectively integrated into the overtaking logic. + + 5.3 Improper Trajectory Planning: The trajectory generated for overtaking often leads to incorrect paths, such as attempting to overtake trees or parked cars without considering oncoming traffic. A better filtering and validation of potential overtaking targets is needed. + +6. Unstuck Behavior Issues + 6.1 The vehicle gets stuck multiple times and exhibits erratic behavior when trying to get unstuck, + 6.2 The vehicle's aggressive lane-holding behavior after being unstuck + 6.3 After collisions, the vehicle often fails to resume movement, indicating a lack of recovery logic post-collision + + +7. Potential improvements + + 7.1 'def change trajektory' : consider implementing a more sophisticated trajectory planning algorithm that takes into account dynamic obstacles and traffic conditions rather than relying on a fallback method. Verify that the area into which the vehicle is moving is clear of obstacles and oncoming traffic. + 7.2 'def overtake_fallback' : instead of fixed offsets for unstuck and normal situations, consider dynamically calculating offsets based on current speed, vehicle dimensions, and surrounding traffic conditions. + 7.3 '__get_speed_unstuck' : includ checks for nearby vehicles and their speeds. Make UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE dynamic. + 7.4 '__check_emergency' : Now it only considers whether the vehicle is in a parking behavior state. Expand this method to evaluate various emergency conditions (e.g., obstacles detected by sensors) and initiate appropriate responses (e.g., stopping or rerouting). + 7.5 'get_speed_by_behavior' : consider feedback from sensors regarding current traffic conditions. + 7.6 '__calc_corner_points' : thinking about somathing smarter rather than a simple angle thresholds. + + + + From f3ddad048c40a32d6fcb41ba1c7d8dfc51c6a15d Mon Sep 17 00:00:00 2001 From: Anastasiia Bilinska Date: Sat, 2 Nov 2024 21:47:21 +0100 Subject: [PATCH 2/8] syntax --- .../src/local_planner/motion_planning.py | 29 +++--- .../paf24/planning/Unstuck_Overtake Behavior | 96 ++++++++++++------- 2 files changed, 76 insertions(+), 49 deletions(-) diff --git a/code/planning/src/local_planner/motion_planning.py b/code/planning/src/local_planner/motion_planning.py index 48abf69b..583a64b9 100755 --- a/code/planning/src/local_planner/motion_planning.py +++ b/code/planning/src/local_planner/motion_planning.py @@ -232,15 +232,16 @@ def change_trajectory(self, distance_obj): Args: distance_obj (float): distance to overtake object """ - pose_list = self.trajectory.poses + pose_list = self.trajectory.poses #vehicle's planned path. # Only use fallback - self.overtake_fallback(distance_obj, pose_list) - self.__overtake_status = 1 + self.overtake_fallback(distance_obj, pose_list) #likely implements a simpler, predefined maneuver for overtaking, which adjusts the trajectory if more sophisticated planning is unavailable or as a safety fallback option. + self.__overtake_status = 1 #overtake successfully planed self.overtake_success_pub.publish(self.__overtake_status) return - def overtake_fallback(self, distance, pose_list, unstuck=False): + def overtake_fallback(self, distance, pose_list, unstuck=False): #his method constructs a temporary path around an obstacle based on the current location, intended distance to overtake, and a choice between two different lateral offsets depending on whether the vehicle is in an “unstuck” situation. + #codepart for overtake behaviour currentwp = self.current_wp normal_x_offset = 2 unstuck_x_offset = 3 # could need adjustment with better steering @@ -280,6 +281,8 @@ def overtake_fallback(self, distance, pose_list, unstuck=False): pos.header.frame_id = "global" pos.pose = pose result.append(pos) + + #code part for returning back on the lane path = Path() path.header.stamp = rospy.Time.now() path.header.frame_id = "global" @@ -440,10 +443,10 @@ def __set_acc_speed(self, data: Float32): def __set_curr_behavior(self, data: String): self.__curr_behavior = data.data - if data.data == bs.ot_enter_init.name: - if np.isinf(self.__collision_point): - self.__overtake_status = -1 - self.overtake_success_pub.publish(self.__overtake_status) + if data.data == bs.ot_enter_init.name: #is beggins overtake manuever + if np.isinf(self.__collision_point): # if no obsticle to overtake + self.__overtake_status = -1 #unsuccessfull or canceled overtake + self.overtake_success_pub.publish(self.__overtake_status) #abandonment of the overtake attempt. return self.change_trajectory(self.__collision_point) @@ -479,6 +482,7 @@ def get_speed_by_behavior(self, behavior: str) -> float: speed = self.__get_speed_cruise() return speed + #manage the speed of the vehicle when it encounters situations where it becomes "stuck" def __get_speed_unstuck(self, behavior: str) -> float: global UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE speed = 0.0 @@ -488,7 +492,7 @@ def __get_speed_unstuck(self, behavior: str) -> float: speed = bs.us_stop.speed elif behavior == bs.us_overtake.name: pose_list = self.trajectory.poses - if self.unstuck_distance is None: + if self.unstuck_distance is None: # Without knowing the distance to the obstacle, the vehicle cannot safely plan an overtake trajectory. self.logfatal("Unstuck distance not set") return speed @@ -498,16 +502,16 @@ def __get_speed_unstuck(self, behavior: str) -> float: ) # self.logfatal(f"Unstuck Distance in mp: {distance}") # clear distance to last unstuck -> avoid spamming overtake - if distance > UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE: + if distance > UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE: #The method checks if the vehicle has moved a significant distance (UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE) since the last overtake. This prevents repeated overtake attempts when they are unnecessary or unsafe. self.unstuck_overtake_flag = False self.logwarn("Unstuck Overtake Flag Cleared") # to avoid spamming the overtake_fallback - if self.unstuck_overtake_flag is False: + if self.unstuck_overtake_flag is False: # create overtake trajectory starting 6 meteres before # the obstacle # 6 worked well in tests, but can be adjusted - self.overtake_fallback(self.unstuck_distance, pose_list, unstuck=True) + self.overtake_fallback(self.unstuck_distance, pose_list, unstuck=True) #A fallback overtaking path is created to move around the obstacle when necessary. self.logfatal("Overtake Trajectory while unstuck!") self.unstuck_overtake_flag = True self.init_overtake_pos = self.current_pos[:2] @@ -661,3 +665,4 @@ def loop(timer_event=None): pass finally: roscomp.shutdown() + diff --git a/doc/research/paf24/planning/Unstuck_Overtake Behavior b/doc/research/paf24/planning/Unstuck_Overtake Behavior index 8a8e5d70..d2e89a11 100644 --- a/doc/research/paf24/planning/Unstuck_Overtake Behavior +++ b/doc/research/paf24/planning/Unstuck_Overtake Behavior @@ -1,39 +1,60 @@ -This dicument analyze current unstuck/overtake behavior and reveal several critical issues with the current implementation - -1. Unstuck Behavior: +# Unstuck/Overtake Behavio + +**Summary:** This document analyze current unstuck/overtake behavior and reveal several critical issues with the current implementation +- [Unstuck behavior](#unstuck-behavior) + -[Key components](#key-components) + -[How unstuck is triggered](#how-unstuck-is-triggered) +-[Overtake behavior](#overtake-behavior) + -[Key components](#key-components) + -[How overtake is triggered](#how-overtake-is-triggered) +- [Relevant rostopics](#relevant-rostopics) +- [Methods overview](#methods-overview) + -[def __set_curr_behavior](#__set_curr_behavior) + -[def change_trajectory](#change_trajectory) + -[def overtake_fallback](#overtake_fallback) +- [Overtake behavior issues](#overtake-behavior-issues) + -[Aggressive lane changes](#aggressive-lane-changes) + -[Inadequate collision detection](#inadequate-collision-detection) + -[Improper trajectory planning](#improper-trajectory-planning) +- [Unstuck behavior issues](#unstuck-behavior-issues) +- [Potential improvements](#potential-improvements) + + + +## Unstuck behavior: The "unstuck" behavior is designed to address situations where the vehicle becomes stuck, perhaps due to obstacles or other vehicles blocking its path. - 1.1 Key components: + ### Key components: self.unstuck_distance: Tracks the distance to the object causing the blockage, helping the algorithm to determine if an alternative route (overtaking) might be required. self.unstuck_overtake_flag: Prevents repeated or "spam" overtakes by ensuring that the unstuck overtake only happens once within a specified distance (UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE). self.init_overtake_pos: Saves the position where the unstuck behavior is initiated to prevent excessive overtaking within a short range. Overtaking Logic: The method overtake_fallback is called within __get_speed_unstuck, where a new trajectory is created by offsetting the path to one side, allowing the vehicle to bypass the obstacle and get "unstuck." - 1.2 How Unstuck is Triggered: + ### How unstuck is triggered: The method __get_speed_unstuck checks the current behavior (e.g., us_unstuck), adjusting speed accordingly and invoking overtake_fallback if an obstacle is detected and the vehicle is in an "unstuck" situation. UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE ensures that once an unstuck maneuver is initiated, it won't be repeated until a certain distance is cleared -2. Overtake Behavior: +## Overtake behavior: The overtake behavior allows the vehicle to safely overtake a slower-moving or stationary vehicle ahead by modifying its trajectory. - 2.1 Key components: + ### Key components: self.__overtake_status: Manages the status of overtaking, where 1 indicates an active overtake, while -1 signals that overtaking isn't required. change_trajectory: Initiates the overtake by calling overtake_fallback when it detects a collision point or slow-moving vehicle within a certain range. This method also publishes the updated __overtake_status to signal other systems of the change. overtake_fallback: Calculates a new trajectory path that offsets the vehicle by a certain distance (normal_x_offset) to safely pass the obstacle. The adjusted path uses the Rotation library to align the offset with the vehicle’s heading, creating a smooth path around the obstacle. - 2.3 How Overtake is Triggered: + ### How overtake is triggered: The method __set_curr_behavior monitors the vehicle’s behavior, triggering an overtake when ot_enter_init behavior is detected and if an obstacle or collision point is near. It then calls change_trajectory to modify the route. Speed adjustments specific to overtaking are handled in __get_speed_overtake, where the vehicle might slow down (e.g., ot_enter_slow) or proceed at normal speed after overtaking (e.g., ot_leave). -3. Relevant rostopics - overtake_success +## Relevant rostopics + overtake_success unstuck_distance ... #TODO:need to continue -4. Methods overview - 4.1 How the function def __set_curr_behavior(self, data: String) works: +## Methods overview + ## How the function def __set_curr_behavior(self, data: String) works: If beggins overtake manuever: if no obsticle to overtake: @@ -42,48 +63,49 @@ This dicument analyze current unstuck/overtake behavior and reveal several criti else: change trajectory - Infinity as "No Collision Detected": Setting self.__collision_point to infinity (np.inf) would mean "no collision detected." So, checking if np.isinf(self.__collision_point) effectively asks, "Is there no obstacle or point that necessitates an overtake?" (??? not sure abou it) + Infinity as "No Collision Detected": Setting self.__collision_point to infinity (np.inf) would mean "no collision detected." So, checking if np.isinf(self.__collision_point) effectively asks, "Is there no obstacle or point that needs an overtake?" (??? not sure about it) + self.__overtake_status = -1 #unsuccessfull or canceled overtake + self.__overtake_status = 1 #overtake should take place - Questions: + **Questions:** 1. who tells the function the behaviour status? 2. If the function has already become an overtake status, why should we check if there is actually an object to overtake? - 4.2 How the function change_trajectory(self, distynce_obj) works: + ## How the function change_trajectory(self, distynce_obj) works: update trajectory for overtaking and convert it to a new Path message. Args:distance_obj (float): distance to overtake object Publish overate success status - Questions: + **Questions:** 1. What does the success status for overtake mean? It seems like it oublishs than an overtake takes place but does not notify that the overtake manoeuvre was successful. - 4.3 How the function def overtake_fallback(self, distance, pose_list, unstuck=False) works: + ## How the function def overtake_fallback(self, distance, pose_list, unstuck=False) works: This method constructs a temporary path around an obstacle based on the current location, intended distance to overtake, and a choice between two different lateral offsets depending on whether the vehicle is in an “unstuck” situation. - Pick Path Points Around the Obstacle: It selects a section of the path around the vehicle’s current position and the obstacle it needs to overtake. If the vehicle is stuck, it picks a larger section to give it more room to maneuver. - Shift Path to the Side: It moves this section of the path slightly to the side (left or right, depending on the vehicle's heading) to avoid the obstacle. If the vehicle is in a “stuck” situation, it shifts it a bit more to give it extra clearance. - Create the New Path: It converts the shifted points into a path format that the vehicle’s navigation system can understand and follow. - Combine with Original Path: it merges this temporary bypass with the original path, so the vehicle can return to its route after it passes the obstacle. + **Pick Path Points Around the Obstacle:** It selects a section of the path around the vehicle’s current position and the obstacle it needs to overtake. If the vehicle is stuck, it picks a larger section to give it more room to maneuver. + **Shift Path to the Side:** It moves this section of the path slightly to the side (left or right, depending on the vehicle's heading) to avoid the obstacle. If the vehicle is in a “stuck” situation, it shifts it a bit more to give it extra clearance. + **Create the New Path:** It converts the shifted points into a path format that the vehicle’s navigation system can understand and follow. + **Combine with Original Path:** it merges this temporary bypass with the original path, so the vehicle can return to its route after it passes the obstacle. -5. Overtake Behavior Issues - 5.1 Aggressive Lane Changes: The vehicle exhibits aggressive lane changes, leading to emergency stops to avoid oncoming traffic. This behavior suggests that the decision-making logic for overtaking does not adequately assess the surrounding traffic conditions before executing maneuvers. +## Overtake behavior issues + ### Aggressive lane changes: The vehicle exhibits aggressive lane changes, leading to emergency stops to avoid oncoming traffic. This behavior suggests that the decision-making logic for overtaking does not adequately assess the surrounding traffic conditions before executing maneuvers. - 5.2 Inadequate Collision Detection: The vehicle fails to avoid obstacles, such as open car doors or stationary vehicles, indicating that the collision detection mechanisms are either insufficient or not effectively integrated into the overtaking logic. + ### Inadequate collision detection: The vehicle fails to avoid obstacles, such as open car doors or stationary vehicles, indicating that the collision detection mechanisms are either insufficient or not effectively integrated into the overtaking logic. - 5.3 Improper Trajectory Planning: The trajectory generated for overtaking often leads to incorrect paths, such as attempting to overtake trees or parked cars without considering oncoming traffic. A better filtering and validation of potential overtaking targets is needed. + ### Improper trajectory planning: The trajectory generated for overtaking often leads to incorrect paths, such as attempting to overtake trees or parked cars without considering oncoming traffic. A better filtering and validation of potential overtaking targets is needed. -6. Unstuck Behavior Issues - 6.1 The vehicle gets stuck multiple times and exhibits erratic behavior when trying to get unstuck, - 6.2 The vehicle's aggressive lane-holding behavior after being unstuck - 6.3 After collisions, the vehicle often fails to resume movement, indicating a lack of recovery logic post-collision +## Unstuck behavior issues + The vehicle gets stuck multiple times and exhibits erratic behavior when trying to get unstuck, + The vehicle's aggressive lane-holding behavior after being unstuck + After collisions, the vehicle often fails to resume movement, indicating a lack of recovery logic post-collision -7. Potential improvements - - 7.1 'def change trajektory' : consider implementing a more sophisticated trajectory planning algorithm that takes into account dynamic obstacles and traffic conditions rather than relying on a fallback method. Verify that the area into which the vehicle is moving is clear of obstacles and oncoming traffic. - 7.2 'def overtake_fallback' : instead of fixed offsets for unstuck and normal situations, consider dynamically calculating offsets based on current speed, vehicle dimensions, and surrounding traffic conditions. - 7.3 '__get_speed_unstuck' : includ checks for nearby vehicles and their speeds. Make UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE dynamic. - 7.4 '__check_emergency' : Now it only considers whether the vehicle is in a parking behavior state. Expand this method to evaluate various emergency conditions (e.g., obstacles detected by sensors) and initiate appropriate responses (e.g., stopping or rerouting). - 7.5 'get_speed_by_behavior' : consider feedback from sensors regarding current traffic conditions. - 7.6 '__calc_corner_points' : thinking about somathing smarter rather than a simple angle thresholds. +## Potential improvements + 'def change trajektory' : consider implementing a more sophisticated trajectory planning algorithm that takes into account dynamic obstacles and traffic conditions rather than relying on a fallback method. Verify that the area into which the vehicle is moving is clear of obstacles and oncoming traffic. + 'def overtake_fallback' : instead of fixed offsets for unstuck and normal situations, consider dynamically calculating offsets based on current speed, vehicle dimensions, and surrounding traffic conditions. + '__get_speed_unstuck' : includ checks for nearby vehicles and their speeds. Make UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE dynamic. + '__check_emergency' : Now it only considers whether the vehicle is in a parking behavior state. Expand this method to evaluate various emergency conditions (e.g., obstacles detected by sensors) and initiate appropriate responses (e.g., stopping or rerouting). + 'get_speed_by_behavior' : consider feedback from sensors regarding current traffic conditions. + '__calc_corner_points' : thinking about somathing smarter rather than a simple angle thresholds. From 2215fd0080fe147e4058aa52f3267f3dbc732cb0 Mon Sep 17 00:00:00 2001 From: Anastasiia Bilinska Date: Sat, 2 Nov 2024 21:49:02 +0100 Subject: [PATCH 3/8] syntax --- .../{Unstuck_Overtake Behavior => Unstuck_Overtake Behavior.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/research/paf24/planning/{Unstuck_Overtake Behavior => Unstuck_Overtake Behavior.md} (100%) diff --git a/doc/research/paf24/planning/Unstuck_Overtake Behavior b/doc/research/paf24/planning/Unstuck_Overtake Behavior.md similarity index 100% rename from doc/research/paf24/planning/Unstuck_Overtake Behavior rename to doc/research/paf24/planning/Unstuck_Overtake Behavior.md From 8ff02f12a0d673eee8ad6d1bcb6c515e0879bdeb Mon Sep 17 00:00:00 2001 From: Anastasiia Bilinska Date: Sat, 2 Nov 2024 21:53:07 +0100 Subject: [PATCH 4/8] syntax .md --- .../planning/Unstuck_Overtake Behavior.md | 201 ++++++++++-------- 1 file changed, 118 insertions(+), 83 deletions(-) diff --git a/doc/research/paf24/planning/Unstuck_Overtake Behavior.md b/doc/research/paf24/planning/Unstuck_Overtake Behavior.md index d2e89a11..513376cf 100644 --- a/doc/research/paf24/planning/Unstuck_Overtake Behavior.md +++ b/doc/research/paf24/planning/Unstuck_Overtake Behavior.md @@ -1,112 +1,147 @@ -# Unstuck/Overtake Behavio +# Unstuck/Overtake Behavior + +**Summary:** This document analyzes the current unstuck/overtake behavior and reveals several critical issues with the existing implementation. -**Summary:** This document analyze current unstuck/overtake behavior and reveal several critical issues with the current implementation - [Unstuck behavior](#unstuck-behavior) - -[Key components](#key-components) - -[How unstuck is triggered](#how-unstuck-is-triggered) --[Overtake behavior](#overtake-behavior) - -[Key components](#key-components) - -[How overtake is triggered](#how-overtake-is-triggered) + - [Key components](#key-components) + - [How unstuck is triggered](#how-unstuck-is-triggered) +- [Overtake behavior](#overtake-behavior) + - [Key components](#key-components) + - [How overtake is triggered](#how-overtake-is-triggered) - [Relevant rostopics](#relevant-rostopics) - [Methods overview](#methods-overview) - -[def __set_curr_behavior](#__set_curr_behavior) - -[def change_trajectory](#change_trajectory) - -[def overtake_fallback](#overtake_fallback) + - [def \_\_set_curr_behavior](#def-set_curr_behavior) + - [def change_trajectory](#def-change_trajectory) + - [def overtake_fallback](#def-overtake_fallback) - [Overtake behavior issues](#overtake-behavior-issues) - -[Aggressive lane changes](#aggressive-lane-changes) - -[Inadequate collision detection](#inadequate-collision-detection) - -[Improper trajectory planning](#improper-trajectory-planning) + - [Aggressive lane changes](#aggressive-lane-changes) + - [Inadequate collision detection](#inadequate-collision-detection) + - [Improper trajectory planning](#improper-trajectory-planning) - [Unstuck behavior issues](#unstuck-behavior-issues) - [Potential improvements](#potential-improvements) +--- + +## Unstuck behavior + +The "unstuck" behavior is designed to address situations where the vehicle becomes stuck, perhaps due to obstacles or other vehicles blocking its path. + +### Key components + +- `self.unstuck_distance`: Tracks the distance to the object causing the blockage, helping the algorithm to determine if an alternative route (overtaking) might be required. +- `self.unstuck_overtake_flag`: Prevents repeated or "spam" overtakes by ensuring that the unstuck overtake only happens once within a specified distance (`UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE`). +- `self.init_overtake_pos`: Saves the position where the unstuck behavior is initiated to prevent excessive overtaking within a short range. +- **Overtaking Logic**: The method `overtake_fallback` is called within `__get_speed_unstuck`, where a new trajectory is created by offsetting the path to one side, allowing the vehicle to bypass the obstacle and get "unstuck." + +### How unstuck is triggered + +The method `__get_speed_unstuck` checks the current behavior (e.g., `us_unstuck`), adjusting speed accordingly and invoking `overtake_fallback` if an obstacle is detected and the vehicle is in an "unstuck" situation. `UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE` ensures that once an unstuck maneuver is initiated, it won't be repeated until a certain distance is cleared. + +--- + +## Overtake behavior +The overtake behavior allows the vehicle to safely overtake a slower-moving or stationary vehicle ahead by modifying its trajectory. -## Unstuck behavior: - The "unstuck" behavior is designed to address situations where the vehicle becomes stuck, perhaps due to obstacles or other vehicles blocking its path. - ### Key components: - self.unstuck_distance: Tracks the distance to the object causing the blockage, helping the algorithm to determine if an alternative route (overtaking) might be required. - self.unstuck_overtake_flag: Prevents repeated or "spam" overtakes by ensuring that the unstuck overtake only happens once within a specified distance (UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE). - self.init_overtake_pos: Saves the position where the unstuck behavior is initiated to prevent excessive overtaking within a short range. - Overtaking Logic: The method overtake_fallback is called within __get_speed_unstuck, where a new trajectory is created by offsetting the path to one side, allowing the vehicle to bypass the obstacle and get "unstuck." +### Key components +- `self.__overtake_status`: Manages the status of overtaking, where `1` indicates an active overtake, while `-1` signals that overtaking isn't required. +- `change_trajectory`: Initiates the overtake by calling `overtake_fallback` when it detects a collision point or slow-moving vehicle within a certain range. This method also publishes the updated `__overtake_status` to signal other systems of the change. +- `overtake_fallback`: Calculates a new trajectory path that offsets the vehicle by a certain distance (`normal_x_offset`) to safely pass the obstacle. The adjusted path uses the Rotation library to align the offset with the vehicle’s heading, creating a smooth path around the obstacle. - ### How unstuck is triggered: - The method __get_speed_unstuck checks the current behavior (e.g., us_unstuck), adjusting speed accordingly and invoking overtake_fallback if an obstacle is detected and the vehicle is in an "unstuck" situation. - UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE ensures that once an unstuck maneuver is initiated, it won't be repeated until a certain distance is cleared +### How overtake is triggered -## Overtake behavior: - The overtake behavior allows the vehicle to safely overtake a slower-moving or stationary vehicle ahead by modifying its trajectory. - ### Key components: - self.__overtake_status: Manages the status of overtaking, where 1 indicates an active overtake, while -1 signals that overtaking isn't required. - change_trajectory: Initiates the overtake by calling overtake_fallback when it detects a collision point or slow-moving vehicle within a certain range. This method also publishes the updated __overtake_status to signal other systems of the change. - overtake_fallback: Calculates a new trajectory path that offsets the vehicle by a certain distance (normal_x_offset) to safely pass the obstacle. The adjusted path uses the Rotation library to align the offset with the vehicle’s heading, creating a smooth path around the obstacle. +The method `__set_curr_behavior` monitors the vehicle’s behavior, triggering an overtake when `ot_enter_init` behavior is detected and if an obstacle or collision point is near. It then calls `change_trajectory` to modify the route. Speed adjustments specific to overtaking are handled in `__get_speed_overtake`, where the vehicle might slow down (e.g., `ot_enter_slow`) or proceed at normal speed after overtaking (e.g., `ot_leave`). - ### How overtake is triggered: - The method __set_curr_behavior monitors the vehicle’s behavior, triggering an overtake when ot_enter_init behavior is detected and if an obstacle or collision point is near. It then calls change_trajectory to modify the route. - Speed adjustments specific to overtaking are handled in __get_speed_overtake, where the vehicle might slow down (e.g., ot_enter_slow) or proceed at normal speed after overtaking (e.g., ot_leave). - -## Relevant rostopics - overtake_success - unstuck_distance - ... - #TODO:need to continue +--- +## Relevant rostopics +- `overtake_success` +- `unstuck_distance` +- _#TODO: need to continue_ + +--- ## Methods overview - ## How the function def __set_curr_behavior(self, data: String) works: - - If beggins overtake manuever: - if no obsticle to overtake: - unsuccessfull or canceled overtake - publish abandonment of the overtake attempt. - else: - change trajectory - - Infinity as "No Collision Detected": Setting self.__collision_point to infinity (np.inf) would mean "no collision detected." So, checking if np.isinf(self.__collision_point) effectively asks, "Is there no obstacle or point that needs an overtake?" (??? not sure about it) - self.__overtake_status = -1 #unsuccessfull or canceled overtake - self.__overtake_status = 1 #overtake should take place - - **Questions:** - 1. who tells the function the behaviour status? - 2. If the function has already become an overtake status, why should we check if there is actually an object to overtake? - - ## How the function change_trajectory(self, distynce_obj) works: - update trajectory for overtaking and convert it to a new Path message. Args:distance_obj (float): distance to overtake object - Publish overate success status - - **Questions:** - 1. What does the success status for overtake mean? It seems like it oublishs than an overtake takes place but does not notify that the overtake manoeuvre was successful. - - ## How the function def overtake_fallback(self, distance, pose_list, unstuck=False) works: - This method constructs a temporary path around an obstacle based on the current location, intended distance to overtake, and a choice between two different lateral offsets depending on whether the vehicle is in an “unstuck” situation. - - **Pick Path Points Around the Obstacle:** It selects a section of the path around the vehicle’s current position and the obstacle it needs to overtake. If the vehicle is stuck, it picks a larger section to give it more room to maneuver. - **Shift Path to the Side:** It moves this section of the path slightly to the side (left or right, depending on the vehicle's heading) to avoid the obstacle. If the vehicle is in a “stuck” situation, it shifts it a bit more to give it extra clearance. - **Create the New Path:** It converts the shifted points into a path format that the vehicle’s navigation system can understand and follow. - **Combine with Original Path:** it merges this temporary bypass with the original path, so the vehicle can return to its route after it passes the obstacle. + +### `def __set_curr_behavior(self, data: String)` + +**How it works:** + +- **If beginning an overtake maneuver:** + - If no obstacle to overtake: + - Unsuccessful or canceled overtake + - Publish abandonment of the overtake attempt. + - Otherwise: + - Change trajectory + +- **Infinity as "No Collision Detected"**: Setting `self.__collision_point` to infinity (`np.inf`) means "no collision detected." So, checking if `np.isinf(self.__collision_point)` effectively asks, "Is there no obstacle or point that needs an overtake?" + + - `self.__overtake_status = -1`: Unsuccessful or canceled overtake + - `self.__overtake_status = 1`: Overtake should take place + +**Questions:** + +1. Who tells the function the behavior status? +2. If the function has already become an overtake status, why should we check if there is actually an object to overtake? + +--- + +### `def change_trajectory(self, distance_obj)` + +**Description**: Updates trajectory for overtaking and converts it to a new `Path` message. + +- **Args**: `distance_obj` (float): Distance to overtake object +- **Outcome**: Publishes overtake success status + +**Questions:** + +1. What does the success status for overtake mean? It seems like it publishes that an overtake takes place but does not notify if the maneuver was successful. + +--- + +### `def overtake_fallback(self, distance, pose_list, unstuck=False)` + +**Description**: Constructs a temporary path around an obstacle based on the current location, intended distance to overtake, and a choice between two different lateral offsets depending on whether the vehicle is in an "unstuck" situation. + +1. **Pick Path Points Around the Obstacle**: Selects a section of the path around the vehicle’s current position and the obstacle it needs to overtake. If the vehicle is stuck, it picks a larger section to give it more room to maneuver. +2. **Shift Path to the Side**: Moves this section of the path slightly to the side (left or right, depending on the vehicle's heading) to avoid the obstacle. If the vehicle is in a “stuck” situation, it shifts it a bit more to give it extra clearance. +3. **Create the New Path**: Converts the shifted points into a path format that the vehicle’s navigation system can understand and follow. +4. **Combine with Original Path**: Merges this temporary bypass with the original path, so the vehicle can return to its route after it passes the obstacle. + +--- ## Overtake behavior issues - ### Aggressive lane changes: The vehicle exhibits aggressive lane changes, leading to emergency stops to avoid oncoming traffic. This behavior suggests that the decision-making logic for overtaking does not adequately assess the surrounding traffic conditions before executing maneuvers. - ### Inadequate collision detection: The vehicle fails to avoid obstacles, such as open car doors or stationary vehicles, indicating that the collision detection mechanisms are either insufficient or not effectively integrated into the overtaking logic. +### Aggressive lane changes + +The vehicle exhibits aggressive lane changes, leading to emergency stops to avoid oncoming traffic. This behavior suggests that the decision-making logic for overtaking does not adequately assess the surrounding traffic conditions before executing maneuvers. + +### Inadequate collision detection + +The vehicle fails to avoid obstacles, such as open car doors or stationary vehicles, indicating that the collision detection mechanisms are either insufficient or not effectively integrated into the overtaking logic. - ### Improper trajectory planning: The trajectory generated for overtaking often leads to incorrect paths, such as attempting to overtake trees or parked cars without considering oncoming traffic. A better filtering and validation of potential overtaking targets is needed. +### Improper trajectory planning + +The trajectory generated for overtaking often leads to incorrect paths, such as attempting to overtake trees or parked cars without considering oncoming traffic. A better filtering and validation of potential overtaking targets is needed. + +--- ## Unstuck behavior issues - The vehicle gets stuck multiple times and exhibits erratic behavior when trying to get unstuck, - The vehicle's aggressive lane-holding behavior after being unstuck - After collisions, the vehicle often fails to resume movement, indicating a lack of recovery logic post-collision - -## Potential improvements - 'def change trajektory' : consider implementing a more sophisticated trajectory planning algorithm that takes into account dynamic obstacles and traffic conditions rather than relying on a fallback method. Verify that the area into which the vehicle is moving is clear of obstacles and oncoming traffic. - 'def overtake_fallback' : instead of fixed offsets for unstuck and normal situations, consider dynamically calculating offsets based on current speed, vehicle dimensions, and surrounding traffic conditions. - '__get_speed_unstuck' : includ checks for nearby vehicles and their speeds. Make UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE dynamic. - '__check_emergency' : Now it only considers whether the vehicle is in a parking behavior state. Expand this method to evaluate various emergency conditions (e.g., obstacles detected by sensors) and initiate appropriate responses (e.g., stopping or rerouting). - 'get_speed_by_behavior' : consider feedback from sensors regarding current traffic conditions. - '__calc_corner_points' : thinking about somathing smarter rather than a simple angle thresholds. +- The vehicle gets stuck multiple times and exhibits erratic behavior when trying to get unstuck. +- The vehicle's aggressive lane-holding behavior after being unstuck. +- After collisions, the vehicle often fails to resume movement, indicating a lack of recovery logic post-collision. +--- +## Potential improvements +- `def change_trajectory`: Consider implementing a more sophisticated trajectory planning algorithm that considers dynamic obstacles and traffic conditions rather than relying on a fallback method. Verify that the area into which the vehicle is moving is clear of obstacles and oncoming traffic. +- `def overtake_fallback`: Instead of fixed offsets for unstuck and normal situations, consider dynamically calculating offsets based on current speed, vehicle dimensions, and surrounding traffic conditions. +- `__get_speed_unstuck`: Include checks for nearby vehicles and their speeds. Make `UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE` dynamic. +- `__check_emergency`: Currently, it only considers whether the vehicle is in a parking behavior state. Expand this method to evaluate various emergency conditions (e.g., obstacles detected by sensors) and initiate appropriate responses (e.g., stopping or rerouting). +- `get_speed_by_behavior`: Consider feedback from sensors regarding current traffic conditions. +- `__calc_corner_points`: Consider a more intelligent approach rather than relying on simple angle thresholds. From cff40c8b271568247818dd2d9d7242b6893ed387 Mon Sep 17 00:00:00 2001 From: Anastasiia Bilinska Date: Sat, 2 Nov 2024 22:10:10 +0100 Subject: [PATCH 5/8] .md length --- .../src/local_planner/motion_planning.py | 26 +++++++------------ .../planning/Unstuck_Overtake Behavior.md | 9 ++++--- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/code/planning/src/local_planner/motion_planning.py b/code/planning/src/local_planner/motion_planning.py index 87ff244e..c57e8dd9 100755 --- a/code/planning/src/local_planner/motion_planning.py +++ b/code/planning/src/local_planner/motion_planning.py @@ -233,13 +233,11 @@ def change_trajectory(self, distance_obj): Args: distance_obj (float): distance to overtake object """ - pose_list = self.trajectory.poses #vehicle's planned path. + pose_list = self.trajectory.poses # Only use fallback self.generate_overtake_trajectory(distance_obj, pose_list) self.__overtake_status = 1 - self.overtake_fallback(distance_obj, pose_list) #likely implements a simpler, predefined maneuver for overtaking, which adjusts the trajectory if more sophisticated planning is unavailable or as a safety fallback option. - self.__overtake_status = 1 #overtake successfully planed self.overtake_success_pub.publish(self.__overtake_status) return @@ -263,8 +261,6 @@ def generate_overtake_trajectory(self, distance, pose_list, unstuck=False): Returns: None: The method updates the self.trajectory attribute with the new path. """ - def overtake_fallback(self, distance, pose_list, unstuck=False): #his method constructs a temporary path around an obstacle based on the current location, intended distance to overtake, and a choice between two different lateral offsets depending on whether the vehicle is in an “unstuck” situation. - #codepart for overtake behaviour currentwp = self.current_wp normal_x_offset = 2 unstuck_x_offset = 3 # could need adjustment with better steering @@ -304,8 +300,6 @@ def overtake_fallback(self, distance, pose_list, unstuck=False): #his method con pos.header.frame_id = "global" pos.pose = pose result.append(pos) - - #code part for returning back on the lane path = Path() path.header.stamp = rospy.Time.now() path.header.frame_id = "global" @@ -504,10 +498,10 @@ def __set_curr_behavior(self, data: String): If the behavior is an overtake behavior, a trajectory change is triggered. """ self.__curr_behavior = data.data - if data.data == bs.ot_enter_init.name: #is beggins overtake manuever - if np.isinf(self.__collision_point): # if no obsticle to overtake - self.__overtake_status = -1 #unsuccessfull or canceled overtake - self.overtake_success_pub.publish(self.__overtake_status) #abandonment of the overtake attempt. + if data.data == bs.ot_enter_init.name: + if np.isinf(self.__collision_point): + self.__overtake_status = -1 + self.overtake_success_pub.publish(self.__overtake_status) return self.change_trajectory(self.__collision_point) @@ -543,7 +537,6 @@ def get_speed_by_behavior(self, behavior: str) -> float: speed = self.__get_speed_cruise() return speed - #manage the speed of the vehicle when it encounters situations where it becomes "stuck" def __get_speed_unstuck(self, behavior: str) -> float: # TODO check if this 'global' is necessary global UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE @@ -554,7 +547,7 @@ def __get_speed_unstuck(self, behavior: str) -> float: speed = bs.us_stop.speed elif behavior == bs.us_overtake.name: pose_list = self.trajectory.poses - if self.unstuck_distance is None: # Without knowing the distance to the obstacle, the vehicle cannot safely plan an overtake trajectory. + if self.unstuck_distance is None: self.logfatal("Unstuck distance not set") return speed @@ -564,12 +557,12 @@ def __get_speed_unstuck(self, behavior: str) -> float: ) # self.logfatal(f"Unstuck Distance in mp: {distance}") # clear distance to last unstuck -> avoid spamming overtake - if distance > UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE: #The method checks if the vehicle has moved a significant distance (UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE) since the last overtake. This prevents repeated overtake attempts when they are unnecessary or unsafe. + if distance > UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE: self.unstuck_overtake_flag = False self.logwarn("Unstuck Overtake Flag Cleared") # to avoid spamming the overtake_fallback - if self.unstuck_overtake_flag is False: + if self.unstuck_overtake_flag is False: # create overtake trajectory starting 6 meteres before # the obstacle # 6 worked well in tests, but can be adjusted @@ -724,5 +717,4 @@ def loop(timer_event=None): except KeyboardInterrupt: pass finally: - roscomp.shutdown() - + roscomp.shutdown() \ No newline at end of file diff --git a/doc/research/paf24/planning/Unstuck_Overtake Behavior.md b/doc/research/paf24/planning/Unstuck_Overtake Behavior.md index 513376cf..5e5e2c9e 100644 --- a/doc/research/paf24/planning/Unstuck_Overtake Behavior.md +++ b/doc/research/paf24/planning/Unstuck_Overtake Behavior.md @@ -35,7 +35,8 @@ The "unstuck" behavior is designed to address situations where the vehicle becom ### How unstuck is triggered -The method `__get_speed_unstuck` checks the current behavior (e.g., `us_unstuck`), adjusting speed accordingly and invoking `overtake_fallback` if an obstacle is detected and the vehicle is in an "unstuck" situation. `UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE` ensures that once an unstuck maneuver is initiated, it won't be repeated until a certain distance is cleared. +The method `__get_speed_unstuck` checks the current behavior (e.g., `us_unstuck`), adjusting speed accordingly and invoking `overtake_fallback` if an obstacle is detected and the vehicle is in an "unstuck" situation. +`UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE` ensures that once an unstuck maneuver is initiated, it won't be repeated until a certain distance is cleared. --- @@ -51,7 +52,8 @@ The overtake behavior allows the vehicle to safely overtake a slower-moving or s ### How overtake is triggered -The method `__set_curr_behavior` monitors the vehicle’s behavior, triggering an overtake when `ot_enter_init` behavior is detected and if an obstacle or collision point is near. It then calls `change_trajectory` to modify the route. Speed adjustments specific to overtaking are handled in `__get_speed_overtake`, where the vehicle might slow down (e.g., `ot_enter_slow`) or proceed at normal speed after overtaking (e.g., `ot_leave`). +The method `__set_curr_behavior` monitors the vehicle’s behavior, triggering an overtake when `ot_enter_init` behavior is detected and if an obstacle or collision point is near. It then calls `change_trajectory` to modify the route. +Speed adjustments specific to overtaking are handled in `__get_speed_overtake`, where the vehicle might slow down (e.g., `ot_enter_slow`) or proceed at normal speed after overtaking (e.g., `ot_leave`). --- @@ -143,5 +145,4 @@ The trajectory generated for overtaking often leads to incorrect paths, such as - `__get_speed_unstuck`: Include checks for nearby vehicles and their speeds. Make `UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE` dynamic. - `__check_emergency`: Currently, it only considers whether the vehicle is in a parking behavior state. Expand this method to evaluate various emergency conditions (e.g., obstacles detected by sensors) and initiate appropriate responses (e.g., stopping or rerouting). - `get_speed_by_behavior`: Consider feedback from sensors regarding current traffic conditions. -- `__calc_corner_points`: Consider a more intelligent approach rather than relying on simple angle thresholds. - +- `__calc_corner_points`: Consider a more intelligent approach rather than relying on simple angle thresholds. \ No newline at end of file From 8ac5f90aec8f010583125d91e4b1bb80d66b5a25 Mon Sep 17 00:00:00 2001 From: Anastasiia Bilinska Date: Sat, 2 Nov 2024 22:14:58 +0100 Subject: [PATCH 6/8] syntax --- doc/research/paf24/planning/Unstuck_Overtake Behavior.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/research/paf24/planning/Unstuck_Overtake Behavior.md b/doc/research/paf24/planning/Unstuck_Overtake Behavior.md index 5e5e2c9e..8228c4e1 100644 --- a/doc/research/paf24/planning/Unstuck_Overtake Behavior.md +++ b/doc/research/paf24/planning/Unstuck_Overtake Behavior.md @@ -36,6 +36,9 @@ The "unstuck" behavior is designed to address situations where the vehicle becom ### How unstuck is triggered The method `__get_speed_unstuck` checks the current behavior (e.g., `us_unstuck`), adjusting speed accordingly and invoking `overtake_fallback` if an obstacle is detected and the vehicle is in an "unstuck" situation. + +--- + `UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE` ensures that once an unstuck maneuver is initiated, it won't be repeated until a certain distance is cleared. --- @@ -53,6 +56,9 @@ The overtake behavior allows the vehicle to safely overtake a slower-moving or s ### How overtake is triggered The method `__set_curr_behavior` monitors the vehicle’s behavior, triggering an overtake when `ot_enter_init` behavior is detected and if an obstacle or collision point is near. It then calls `change_trajectory` to modify the route. + +--- + Speed adjustments specific to overtaking are handled in `__get_speed_overtake`, where the vehicle might slow down (e.g., `ot_enter_slow`) or proceed at normal speed after overtaking (e.g., `ot_leave`). --- From ce40a7eaea54884f6ca03b7977c1c5ad6f2e413c Mon Sep 17 00:00:00 2001 From: Anastasiia Bilinska Date: Sat, 2 Nov 2024 22:21:55 +0100 Subject: [PATCH 7/8] formatter --- code/planning/src/local_planner/motion_planning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/planning/src/local_planner/motion_planning.py b/code/planning/src/local_planner/motion_planning.py index c57e8dd9..8c1514cb 100755 --- a/code/planning/src/local_planner/motion_planning.py +++ b/code/planning/src/local_planner/motion_planning.py @@ -717,4 +717,4 @@ def loop(timer_event=None): except KeyboardInterrupt: pass finally: - roscomp.shutdown() \ No newline at end of file + roscomp.shutdown() From 968ad94a3c7414095a9aa1ea71fbcb527ce4c731 Mon Sep 17 00:00:00 2001 From: Anastasiia Bilinska Date: Sat, 2 Nov 2024 22:23:56 +0100 Subject: [PATCH 8/8] formatter --- doc/research/paf24/planning/Unstuck_Overtake Behavior.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/research/paf24/planning/Unstuck_Overtake Behavior.md b/doc/research/paf24/planning/Unstuck_Overtake Behavior.md index 8228c4e1..76104bf7 100644 --- a/doc/research/paf24/planning/Unstuck_Overtake Behavior.md +++ b/doc/research/paf24/planning/Unstuck_Overtake Behavior.md @@ -35,7 +35,7 @@ The "unstuck" behavior is designed to address situations where the vehicle becom ### How unstuck is triggered -The method `__get_speed_unstuck` checks the current behavior (e.g., `us_unstuck`), adjusting speed accordingly and invoking `overtake_fallback` if an obstacle is detected and the vehicle is in an "unstuck" situation. +The method `__get_speed_unstuck` checks the current behavior (e.g., `us_unstuck`), adjusting speed accordingly and invoking `overtake_fallback` if an obstacle is detected and the vehicle is in an "unstuck" situation. --- @@ -55,7 +55,7 @@ The overtake behavior allows the vehicle to safely overtake a slower-moving or s ### How overtake is triggered -The method `__set_curr_behavior` monitors the vehicle’s behavior, triggering an overtake when `ot_enter_init` behavior is detected and if an obstacle or collision point is near. It then calls `change_trajectory` to modify the route. +The method `__set_curr_behavior` monitors the vehicle’s behavior, triggering an overtake when `ot_enter_init` behavior is detected and if an obstacle or collision point is near. It then calls `change_trajectory` to modify the route. --- @@ -151,4 +151,6 @@ The trajectory generated for overtaking often leads to incorrect paths, such as - `__get_speed_unstuck`: Include checks for nearby vehicles and their speeds. Make `UNSTUCK_OVERTAKE_FLAG_CLEAR_DISTANCE` dynamic. - `__check_emergency`: Currently, it only considers whether the vehicle is in a parking behavior state. Expand this method to evaluate various emergency conditions (e.g., obstacles detected by sensors) and initiate appropriate responses (e.g., stopping or rerouting). - `get_speed_by_behavior`: Consider feedback from sensors regarding current traffic conditions. -- `__calc_corner_points`: Consider a more intelligent approach rather than relying on simple angle thresholds. \ No newline at end of file +- `__calc_corner_points`: Consider a more intelligent approach rather than relying on simple angle thresholds. + +---