Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Goal Setting Algorithm

Zach Ghera edited this page Feb 10, 2022 · 1 revision

Purpose

The goal setting algorithm is needed to navigate around the track without an existing map (during lap 1). This node takes 2D laser scans (/top/scan) then constructs a goal message and creates an ActionClient to sends the goal as ROS actions to SimpleActionServer on move_base.

Note: /move_base_simple/goal is a non-action topic that move_base subscribes to in case users don't want to use the ActionServer but all of our goals go through the action server. When looking at an rqt_graph or visualizing the connections of nodes, you can think of slam_mode_goal publishing to /move_base_simple/goal which move_base subscribes to. But know that in actuality, slam_mode_goal node is sending ROS Actions to the move_base ActionAPI to send move_base new goals to pursue (move_base will get these from move_base/goal Action Topic). For more info see http://wiki.ros.org/move_base#Action_API.

Requirements

...

Algorithms

Weighted Resultant Vector (WRV)

Description

Calculates the goal vector relative to the karts position based on wall shape in the front 180 deg view frame.

The goal vector is calculated by taking the weighted average from a set of 90 angles. Each angle is calculated by taking the tangent of the resultant vector created from the sum of the positive and its corresponding negative laser scans in the set of laser scans (e.g. the sum of the pi/4 and -pi/4 angle vectors). The vector created from the average theta is a unit vector. When the kart gets too close to a wall, the x and y are scaled so that it is able to take a sharper turn while minimizing the chance that the goal is placed into a wall. As of now, each of these thetas added to 'theta_tot' has the same weighting (but this may be adjusted in the future).

Issues

-For one of the issues mentioned ("The kart stops , backs up, and resumes driving"), one solution I thought of was modifying the step size of the kart so that there's more time for the kart to process its surroundings and set a new goal. Of course, the main caveat of this fix (assuming it will resolve the issue) is that the kart won't be going as fast and move in a more jerky fashion.

-One other issue that I think is crucial to solve our issues outlined above is to find a way to make the Lidar make a much more accurate image of its surroundings. This issue is evident starting from 0:25 in the video that's mentioned by Zach in Issue #18. Despite there being plenty of space in the bottom right part of the autocross map, for some reason, the kart thinks that there is a wall instead, so it tries to squeeze between the narrow gap.

New Alg to Replace WRV ??

...