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 #9

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

Comments

@pannatorn6395
Copy link

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.

@MAVProxyUser
Copy link
Owner

I got tired of all that noise and wrote this. https://github.com/MAVProxyUser/YushuTechUnitreeGo1/blob/main/StreamCamCross.py

@pannatorn6395
Copy link
Author

I've SSH'd into each Jetson machine and navigated to the following files:

/home/unitree/Unitree/autostart/imageai/mLComSystemFrame/config/mqMNConfig.yaml:udpHost: "192.168.123.96"
/home/unitree/Unitree/autostart/imageai/mLComSystemFrame/config/mqSNNLConfig.yaml:udpHost: "192.168.123.96"
/home/unitree/Unitree/autostart/imageai/mLComSystemFrame/config/mqSNNRConfig.yaml:udpHost: "192.168.123.96"
I have a couple of questions:

I couldn't find udpHost in these files. Is this the variable MNAAddress instead?

If I want to stream the video to an RPi and capture the feed using Python code, should I be modifying udpstrPrevData = "udpsrc address=192.168.123.161" to point to the RPi's IP address?

Sorry for the confusion.

@MAVProxyUser
Copy link
Owner

Are you on current firmware? What was the last .zip file applied to your system?
find / -name "*.zip" on the RasPi

@pannatorn6395
Copy link
Author

Hi , this is result
S__39673859

@MAVProxyUser
Copy link
Owner

there are versions of firmware newer than this. you can either look in #go1firmware for them on slack, or ask unitree support for a newer binary that has the streaming enabled.

@pannatorn6395
Copy link
Author

Okay, I will download it through Slack. Do you have a guide or steps on how to update the firmware?

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

2 participants