You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This cause the engine_command the be reset each time the ai send a command to any robots. The path is also reset every time and never kept in memory. This mean that the AI need to resend the path everytime for each robot that move.
The path_smoothing computing a smooth path and a target speed. The smoothed path should only be computed once if the AI resend the path every frame anyway. Also, since it affected directly the robot object, it could be a instance method.
The position regulator could possibly be remove since the velocity regulator has stopped shaking when arriving at the target (with the PID deadzone of the derivative gain). Also, each regulator are reset every frame, which is useless except on transition.
Also, commands[robot.id] = robot.position_regulator.execute(robot, self.dt) generate a command from to robot's regulator, which is already contains in the robot. the regulator can have a reference to the robot when create the robot object. This could be simplify to: commands[robot.id] = robot.controller.execute(self.dt). But, we need to take care since each call to this function will cause an updated of the PID state (integration of error). We also need to decide if each robot object control themselve or if an external class should modify their internal states.
The method _put_in_robots_referential could be in the robot object.
The dt should be given in the execute call, not the update call:
We should make sure the following code is correct in the Controller:
StrategyAI/Engine/controller.py
Lines 48 to 54 in 256101c
This cause the
engine_command
the be reset each time the ai send a command to any robots. The path is also reset every time and never kept in memory. This mean that the AI need to resend the path everytime for each robot that move.StrategyAI/Engine/controller.py
Line 60 in 256101c
The
path_smoothing
computing a smooth path and a target speed. The smoothed path should only be computed once if the AI resend the path every frame anyway. Also, since it affected directly the robot object, it could be a instance method.StrategyAI/Engine/controller.py
Lines 62 to 67 in 256101c
The position regulator could possibly be remove since the velocity regulator has stopped shaking when arriving at the target (with the PID deadzone of the derivative gain). Also, each regulator are reset every frame, which is useless except on transition.
Also,
commands[robot.id] = robot.position_regulator.execute(robot, self.dt)
generate a command from to robot's regulator, which is already contains in the robot. the regulator can have a reference to the robot when create the robot object. This could be simplify to:commands[robot.id] = robot.controller.execute(self.dt)
. But, we need to take care since each call to this function will cause an updated of the PID state (integration of error). We also need to decide if each robot object control themselve or if an external class should modify their internal states.The method
_put_in_robots_referential
could be in the robot object.The dt should be given in the
execute
call, not the updatecall
:https://github.com/RoboCupULaval/StrategyAI/blob/dev/Engine/engine.py#L132-L133
became:
The text was updated successfully, but these errors were encountered: