dbg(robots): check sent action wheels lekiwi

This commit is contained in:
Steven Palma 2025-04-07 11:18:34 +02:00
parent 48e47e97df
commit a74345bf53
No known key found for this signature in database
4 changed files with 7 additions and 5 deletions

View File

@ -85,9 +85,7 @@ def main():
keyboard = KeyboardTeleop(keyboard_config)
logging.info("Configuring LeKiwi Client")
robot_config = LeKiwiClientConfig(
id="daemonlekiwi", calibration_dir=".cache/calibration/lekiwi", robot_mode=RobotMode.TELEOP
)
robot_config = LeKiwiClientConfig(id="lekiwi", robot_mode=RobotMode.TELEOP)
robot = LeKiwiClient(robot_config)
logging.info("Creating LeRobot Dataset")

View File

@ -186,7 +186,9 @@ class LeKiwi(Robot):
if not self.is_connected:
raise DeviceNotConnectedError(f"{self} is not connected.")
obs_dict = {}
# TODO(Steven): remove hard-coded cam name
# This is needed at init for when there's no comms
obs_dict = {OBS_IMAGES: {}}
# Read actuators position for arm and vel for base
start = time.perf_counter()

View File

@ -246,6 +246,7 @@ class LeKiwiClient(Robot):
# Convert each wheels angular speed (deg/s) to a raw integer.
wheel_raw = [LeKiwiClient._degps_to_raw(deg) for deg in wheel_degps]
# TODO(Steven): remove hard-coded names
return {"left_wheel": wheel_raw[0], "back_wheel": wheel_raw[1], "right_wheel": wheel_raw[2]}
# Copied from robot_lekiwi MobileManipulator class
@ -396,7 +397,6 @@ class LeKiwiClient(Robot):
frame = np.zeros((480, 640, 3), dtype=np.uint8)
obs_dict[OBS_IMAGES][cam_name] = torch.from_numpy(frame)
print("obs_dict", obs_dict)
return obs_dict
def _from_keyboard_to_wheel_action(self, pressed_keys: np.ndarray):

View File

@ -71,7 +71,9 @@ def main():
try:
msg = remote_agent.zmq_cmd_socket.recv_string(zmq.NOBLOCK)
data = dict(json.loads(msg))
print("Received command:", data)
_action_sent = robot.send_action(data)
print("Sent action:", _action_sent)
last_cmd_time = time.time()
except zmq.Again:
logging.warning("No command available")