Skip to content

Refactoring code & features#3

Open
Juancams wants to merge 18 commits intohumble-develfrom
refactoring-features
Open

Refactoring code & features#3
Juancams wants to merge 18 commits intohumble-develfrom
refactoring-features

Conversation

@Juancams
Copy link
Member

@Juancams Juancams commented Feb 21, 2025

Description

This PR contains new features such as:

  • Camera support
  • TTS support
  • Vui support
  • Services support
  • Others

All of this will be explained well in this issue

Checklist

  • I have formatted the code to pass the CI.
  • Extend the test.

Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Juancams and others added 12 commits March 4, 2025 15:10
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
Signed-off-by: Jose Miguel <josemiguel.guerrero@urjc.es>
Signed-off-by: Juancams <jc.manzanares.serrano@gmail.com>
@AngeLoGa
Copy link

AngeLoGa commented Apr 3, 2025

Greetings @Juancams, we are interested in knowing where will this feature be able to use, as we tried to download the code from the branch refactoring-features but failed to make it work. I have to admit that I lack experience using composable nodes, and seems it might be the problem, since after the lifecycle activates every module, the container just exits prompting an error code. Thanks in advance!

@Juancams
Copy link
Member Author

Juancams commented Apr 3, 2025

Hi!

I hope to have it finished soon.

As for new implementations, I'd like to have the lidar decompression already built into the robot. Also, I want to modify the driver a bit to turn it into a library and be able to use it in other packages, since when implementing an RVIZ plugin, I had to repeat some code, and it turned out pretty ugly. I think the rest is ready.

To make it work, you need to have everything in humble-devel, and so far it's only been tested by running everything from my own computer.

I hope to merge soon ^^

kbrameld pushed a commit to traclabs/go2_driver that referenced this pull request Jul 18, 2025
…devel

Merge pull request Unitree-Go2-Robot#2 from Unitree-Go2-Robot/humble
@AlexWUrobot
Copy link

AlexWUrobot commented Aug 27, 2025

Dear Developers,

May I ask how to subscribe to the image_raw topic from the Unitree Go2?

I have installed and sourced the following package:
https://github.com/unitreerobotics/unitree_ros2

Currently, I can see the following:

ros2 topic info /frontvideostream
Type: unitree_go/msg/Go2FrontVideoData
Publisher count: 25
Subscription count: 1

And the message structure:

ros2 interface show unitree_go/msg/Go2FrontVideoData
uint64 time_frame
uint8[] video720p
uint8[] video360p
uint8[] video180p

I also checked the topic frequency:

ros2 topic hz /frontvideostream
average rate: 33.777
    min: 0.000s max: 0.113s std dev: 0.03392s window: 34
average rate: 31.029
    min: 0.000s max: 0.113s std dev: 0.03367s window: 64

However, when I run my Python script, I am not receiving any messages:

python3 go2_camera_viewer.py
running the code......

Could you please advise on the correct way to subscribe to the image_raw feed from the Go2 camera?

Thank you so much !

Here is my code (go2_camera_viewer.py)

import rclpy
from rclpy.node import Node
from unitree_go.msg import Go2FrontVideoData
import cv2
import numpy as np

class FrontVideoSubscriber(Node):
    def __init__(self):
        super().__init__('front_video_subscriber')
        self.subscription = self.create_subscription(
            Go2FrontVideoData,
            '/frontvideostream',
            self.listener_callback,
            10
        )

    def listener_callback(self, msg: Go2FrontVideoData):
        print("receive msg ")
        # Pick the resolution you want
        if len(msg.video720p) > 0:
            np_arr = np.frombuffer(msg.video720p, dtype=np.uint8)
            frame = cv2.imdecode(np_arr, cv2.IMREAD_COLOR)
            if frame is not None:
                cv2.imshow("Go2 Front Camera (720p)", frame)
                cv2.waitKey(1)
            else:
                self.get_logger().warn("Failed to decode 720p frame")
        else:
            self.get_logger().warn("Empty video frame received")

def main(args=None):
    print("running the code ...... ")
    rclpy.init(args=args)
    node = FrontVideoSubscriber()
    rclpy.spin(node)
    node.destroy_node()
    rclpy.shutdown()
    cv2.destroyAllWindows()

if __name__ == '__main__':
    main()

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

Successfully merging this pull request may close these issues.

4 participants