Skip to content

Commit

Permalink
Merge pull request #109 from UoA-CARES/ftg-fix
Browse files Browse the repository at this point in the history
Fixed ftg
  • Loading branch information
retinfai authored Sep 3, 2023
2 parents 3f532cd + 97a374f commit 8979870
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/controllers/controllers/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sensor_msgs.msg import LaserScan
from nav_msgs.msg import Odometry

from environments.util import process_lidar, process_odom
from environments.util import process_lidar, process_odom, reduce_lidar

class Controller(Node):
def __init__(self, node_name, car_name, step_length):
Expand Down Expand Up @@ -68,7 +68,8 @@ def message_filter_callback(self, odom: Odometry, lidar: LaserScan):
def get_observation(self):
odom, lidar = self.get_data()
odom = process_odom(odom)
lidar, _ = process_lidar(lidar)
#lidar, _ = process_lidar(lidar)
lidar = reduce_lidar(lidar)

return odom + lidar

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/controllers/ftg_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def select_action(self, state):

obstacles_angles = []
obstacles_ranges = []
obstacle_max_val = 2
obstacle_max_val = 4
for i in range(10):
if (state[8+i] > min_lidar_range) & (state[8+i]<obstacle_max_val):
obstacles_ranges.append(state[8+i])
Expand Down

0 comments on commit 8979870

Please sign in to comment.