Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
arsh09 committed Jul 12, 2024
1 parent cfec811 commit 02f0d9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions topological_navigation/topological_navigation/manager2.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,17 @@ def ignore_aliases(self, data):
# for float-type [x,y,z,w] keys.
class CustomSafeLoader(yaml.SafeLoader):
def construct_mapping(self, node, deep=False):
# Call the parent class's construct_mapping method
mapping = super().construct_mapping(node, deep=deep)

# Iterate over the keys and convert as needed
# this can be extended to test the validity of the tmap2
# as well at load time (or add missing keys)
for key in ['x', 'y', 'z', 'w']:
if key in mapping and isinstance(mapping[key], int):
mapping[key] = float(mapping[key])

return mapping


#########################################################################################################
class map_manager_2(rclpy.node.Node):

Expand Down

0 comments on commit 02f0d9d

Please sign in to comment.