Download experiments/pid_los_controller/src/controller.py from cccat6/FlowMo-WM: direct link, hf CLI and curl.
- Browser
- Download file 540 Bytes
-
https://huggingface.co/cccat6/FlowMo-WM/resolve/dd3258b67d055ee2ef6d024c562dab46d4d25f1a/experiments/pid_los_controller/src/controller.py
- Command line
-
hf download hf://cccat6/FlowMo-WM@dd3258b67d055ee2ef6d024c562dab46d4d25f1a/experiments/pid_los_controller/src/controller.py
-
curl -L -o controller.py https://huggingface.co/cccat6/FlowMo-WM/resolve/dd3258b67d055ee2ef6d024c562dab46d4d25f1a/experiments/pid_los_controller/src/controller.py
540 Bytes
| """PID / line-of-sight controller.""" | |
| import numpy as np | |
| from experiments.shared.src.control.geometric import goal_action | |
| from experiments.shared.src.vision.pose_from_image import estimate_pose_from_clean_image | |
| def compute_action(observation, task_state, config): | |
| """Compute one controller action.""" | |
| pose = estimate_pose_from_clean_image(observation) | |
| goal = np.asarray(task_state["goal"], dtype=np.float32) | |
| return goal_action(pose, goal, int(config["action_dim"]), float(config["forward"]), float(config["kp_heading"])) | |