Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble Transferring Image Data to Onboard Raspberry Pi on Unitree Go1 Edu #12

Open
pannatorn6395 opened this issue Aug 29, 2023 · 2 comments

Comments

@pannatorn6395
Copy link

pannatorn6395 commented Aug 29, 2023

I'm currently working on transferring image data from multiple Jetson units to the onboard Raspberry Pi of the Unitree Go1 Edu robot. I've been following the guide available here, specifically Step 7, using ./bins/example_putImagetrans for sending the image data.

The data transfer works well between the Jetson units (with IPs: 192.168.123.13, 192.168.123.14, and 192.168.123.15). However, I've encountered issues when attempting to transfer this image data to the Go1 Edu's onboard Raspberry Pi (IP: 192.168.123.161) using the following Python script to receive the data.

`
import cv2

class camera:

def __init__(self, cam_id=None, width=640, height=480):
    self.width = 640
    self.cam_id = cam_id
    self.width = width
    self.height = height
def get_img(self):
    IpLastSegment = "161"
    cam = self.cam_id
    udpstrPrevData = "udpsrc address=192.168.123." + IpLastSegment + " port="
    udpPORT = [9201, 9202, 9203, 9204, 9205]
    udpstrBehindData = " ! application/x-rtp,media=video,encoding-name=H264 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! appsink"
    udpSendIntegratedPipe_0 = udpstrPrevData + str(udpPORT[cam - 1]) + udpstrBehindData
    print(udpSendIntegratedPipe_0)
    self.cap = cv2.VideoCapture(udpSendIntegratedPipe_0)

def demo(self):
    self.get_img()
    while True:
        self.ret, self.frame = self.cap.read()
        self.frame = cv2.resize(self.frame, (self.width, self.height))
        if self.cam_id == 1:
            self.frame = cv2.flip(self.frame, -1)
        if self.frame is not None:
            cv2.imshow("video0", self.frame)
        if cv2.waitKey(2) & 0xFF == ord('q'):
            break
    self.cap.release()
    cv2.destroyAllWindows()

`
Despite adjusting the destination IP to the onboard Raspberry Pi's, the image data doesn't seem to get through as expected.

Any guidance or troubleshooting steps would be highly appreciated.

@libazhahei
Copy link

libazhahei commented Aug 31, 2023

I really don't know what happened in your situation, but you may try replace IpLastSegment = "161" to the IpLastSegment you sended img for example 13 for face image. Hopefully, this may help you.
Btw, I'm still troubling with sending img, even among nanos. I always got "Segmentation fault (core dumped)"...
There seems to be a lot of ambiguity about this project and their sdk. I'm currently developing a cv program as well at uni, If you want to work together, could I have your email for further discussion.

@iwayato
Copy link

iwayato commented Nov 16, 2023

@pannatorn6395 did you install opencv for python from source or used pip?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants