Improbable-AI / walk-these-ways

Sim-to-real RL training and deployment tools for the Unitree Go1 robot.
https://gmargo11.github.io/walk-these-ways/
Other
488 stars 129 forks source link

LCM for GO1 camera #51

Closed muye1202 closed 8 months ago

muye1202 commented 9 months ago

Hi!

Thanks for making your amazing work open source! I'm trying to adapt the go1_gym_deploy code and use the images received from go1's on-board camera, but I'm having difficulty finding the LCM publisher for the camera images on Go1; to my knowledge Go1's camera SDK uses ROS for communication instead of LCM, do you mind pointing out what is the lcm camera subscriber subscribing to in the code? Specifically the _camera_cb in cheetah_state_estimator.py:

def _camera_cb(self, channel, data):
        msg = camera_message_lcmt.decode(data)

        img = np.fromstring(msg.data, dtype=np.uint8)
        img = img.reshape((3, 200, 464)).transpose(1, 2, 0)

        cam_id = int(channel[-1])
        if cam_id == 1:
            self.camera_image_front = img
        elif cam_id == 2:
            self.camera_image_bottom = img
        elif cam_id == 3:
            self.camera_image_left = img
        elif cam_id == 4:
            self.camera_image_right = img
        elif cam_id == 5:
            self.camera_image_rear = img
        else:
            print("Image received from camera with unknown ID#!")

The image decoded is empty, and this happens after I start running the default policy provided.

Thanks!

gmargo11 commented 8 months ago

Hi @muye1202,

The camera message passing via LCM was experimental and the publisher isn't included in this repo because I found that your mileage may vary when using this technique with the UnitreeCameraSDK. So the image message will be empty by default unless you implement your own publisher in LCM.

-Gabe