def get_max_scaled_value()

in deepracer_navigation_pkg/deepracer_navigation_pkg/deepracer_navigation_node.py [0:0]


    def get_max_scaled_value(self, action_value, action_key):
        """Helper method that scales the action value based on the maximum value in the
           action space.

        Args:
            action_value (float): steering angle or speed value
            action_key (string): steering_angle or speed

        Returns:
            float: scaled action value between [0.0, 1.0]
        """
        try:
            max_value = self.max_action_space_values[action_key]
            if max_value <= 0.0:
                self.get_logger().error(f"Invalid {action_key} value {max_value}")
                return 0.0
            return float(action_value) / float(max_value)
        except Exception as ex:
            self.get_logger().error(f"Unable to scale the action value {action_key}: {ex}")
            return 0.0