Skip to content

Commit

Permalink
Pass colcon test
Browse files Browse the repository at this point in the history
  • Loading branch information
david-dorf committed Feb 10, 2024
1 parent 9a3922f commit 830929b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions multidim_rrt_planner/rrt2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def __init__(self):

def rrt_callback(self, request, response):
"""Service callback for running the RRT."""

# Clear the markers and path
self.marker_array = MarkerArray()
clear_marker = Marker()
Expand All @@ -142,9 +141,11 @@ def rrt_callback(self, request, response):

# Publish the start and goal markers
self.marker_array.markers.append(create_marker(Marker.SPHERE, 0, [
1.0, 0.0, 0.0, 1.0], [0.2, 0.2, 0.2], [self.start_position[0], self.start_position[1], 0.0]))
1.0, 0.0, 0.0, 1.0], [0.2, 0.2, 0.2], [self.start_position[0],
self.start_position[1], 0.0]))
self.marker_array.markers.append(create_marker(Marker.SPHERE, 1, [
0.0, 0.0, 1.0, 1.0], [0.2, 0.2, 0.2], [self.goal_position[0], self.goal_position[1], 0.0]))
0.0, 0.0, 1.0, 1.0], [0.2, 0.2, 0.2], [self.goal_position[0],
self.goal_position[1], 0.0]))

# Run the RRT
self.node_list = [self.start_node]
Expand Down
10 changes: 6 additions & 4 deletions multidim_rrt_planner/rrt3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def __init__(self):

def rrt_callback(self, request, response):
"""Service callback for running the RRT."""

# Clear the markers and path
self.marker_array = MarkerArray()
clear_marker = Marker()
Expand All @@ -126,9 +125,11 @@ def rrt_callback(self, request, response):

# Publish the start and goal markers
self.marker_array.markers.append(create_marker(Marker.SPHERE, 0, [
1.0, 0.0, 0.0, 1.0], [0.2, 0.2, 0.2], [self.start_position[0], self.start_position[1], self.start_position[2]]))
1.0, 0.0, 0.0, 1.0], [0.2, 0.2, 0.2], [self.start_position[0], self.start_position[1],
self.start_position[2]]))
self.marker_array.markers.append(create_marker(Marker.SPHERE, 1, [
0.0, 0.0, 1.0, 1.0], [0.2, 0.2, 0.2], [self.goal_position[0], self.goal_position[1], self.goal_position[2]]))
0.0, 0.0, 1.0, 1.0], [0.2, 0.2, 0.2], [self.goal_position[0], self.goal_position[1],
self.goal_position[2]]))

# Run the RRT
self.node_list = [self.start_node]
Expand Down Expand Up @@ -201,7 +202,8 @@ def run_rrt_3D(self):
min_node.add_child(new_node)
self.node_list.append(new_node)
marker = create_marker(Marker.SPHERE, self.node_list.index(new_node) + 2, [
0.0, 1.0, 0.0, 1.0], [0.1, 0.1, 0.1], [new_node.val[0], new_node.val[1], new_node.val[2]])
0.0, 1.0, 0.0, 1.0], [0.1, 0.1, 0.1], [new_node.val[0], new_node.val[1],
new_node.val[2]])
self.marker_array.markers.append(marker)
self.marker_publisher.publish(self.marker_array)
self.get_logger().info('Path not found')
Expand Down

0 comments on commit 830929b

Please sign in to comment.