Skip to content

Commit

Permalink
removing useless remapping + commentaries on teb_obstacles functions
Browse files Browse the repository at this point in the history
  • Loading branch information
PhileasL committed Feb 12, 2021
1 parent 803b68d commit df97f05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/modules/robot/robot/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ def generate_robot_launch_description(robot_namespace: str, simulation=False):
package='teb_obstacles',
executable='teb_obstacles',
output='screen',
parameters=[],
remappings=remappings
parameters=[]
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand Down
3 changes: 3 additions & 0 deletions src/navigation/teb_obstacles/teb_obstacles/teb_obstacles.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ def initObstaclesArray(self):
self.previous_obstacles = copy.deepcopy(self.obstacles)

def get_diff_time(self, t1, t2):
"""Returns the nb of seconds between the two Time object"""
return float(t1.sec - t2.sec + (t1.nanosec - t2.nanosec)*1e-9)

def set_obstacle(self, index, marker):
"""Set the marker as obstacle in ObstacleArrayMsg at the given index,
compute the linear velocities relative to the previous state"""
self.previous_obstacles.obstacles[index] = copy.deepcopy(self.obstacles.obstacles[index])
self.obstacles.obstacles[index].header = marker.header
self.obstacles.obstacles[index].polygon.points[0].x = marker.pose.position.x
Expand Down

0 comments on commit df97f05

Please sign in to comment.