GithubHelp home page GithubHelp logo

yl7094 / humanoid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chinaheyu/humanoid

0.0 0.0 0.0 9.78 MB

Humanoid robot ros2 package

License: MIT License

Shell 1.10% C++ 48.02% Python 26.86% C 20.79% CMake 2.87% Dockerfile 0.37%

humanoid's Introduction

humanoid

Humanoid robot ros2 package

  • humanoid_interface: Definition of message types;
  • humanoid_base: Driver package for head and leg;
  • humanoid_arm: Driver package for arm;
  • humanoid_chat: Chat with LLM;
  • humanoid_web: Restful api for frontend.

Quick Start (docker)

The fastest way to start the whole robot is using docker image.

# launch ros package
docker run --name humanoid \
--restart unless-stopped \
--privileged --device=/dev:/dev \
-p 5000:5000 \
-e AZURE_SPEECH_KEY=$AZURE_SPEECH_KEY \
-e AZURE_SPEECH_REGION=$AZURE_SPEECH_REGION \
-e IFLYTEK_APP_ID=$IFLYTEK_APP_ID \
-e IFLYTEK_APP_KEY=$IFLYTEK_APP_KEY \
-e IFLYTEK_APP_SECRET=$IFLYTEK_APP_SECRET \
-d chinaheyu/humanoid

# launch web frontend
docker run --name humanoid_frontend --restart unless-stopped -p 80:80 -d chinaheyu/humanoid_frontend

Update the container.

# Update once
docker run --rm --volume /var/run/docker.sock:/var/run/docker.sock -d containrrr/watchtower --run-once --cleanup humanoid humanoid_frontend

# (Optional: Automatic update container)
docker run --name watchtower \
--volume /var/run/docker.sock:/var/run/docker.sock \
-d containrrr/watchtower --cleanup humanoid humanoid_frontend

Quick Start (source)

Create a ros2 workspace.

mkdir -p ~/ros2_ws/src

Clone git Repository.

cd ~/ros2_ws/src
git clone https://github.com/chinaheyu/humanoid.git

Install dependency.

cd ~/ros2_ws/src/humanoid
./install_dependency.sh

Build workspace.

cd ~/ros2_ws
colcon build --symlink-install

Setup UDEV rule and scheduler permission.

cd ~/ros2_ws/src/humanoid/humanoid_base/scripts
sudo ./setup_udev_rules.sh
./setup_scheduler_permission.sh
cd ~/ros2_ws/src/humanoid/humanoid_arm/scripts
sudo ./setup_udev_rules.sh

Note that the scheduler permission settings will take effect after a reboot. You can check if the ulimit -r command outputs 98.

Finally, start all ros packages.

source "~/ros2_ws/install/setup.bash"
ros2 launch humanoid_bringup bringup.py

Optionally, you can use systemd to create a upstart service. This involves the following steps.

  1. Create environment file.

~/.config/environment.d/humanoid.conf

AZURE_SPEECH_KEY=
AZURE_SPEECH_REGION=
IFLYTEK_APP_ID=
IFLYTEK_APP_KEY=
IFLYTEK_APP_SECRET=
ROS_DOMAIN_ID=1
  1. Create service file.

~/.config/systemd/user/humanoid.service

[Unit]
After=network-online.target
Description="Humanoid launch"

[Service]
ExecStart=<path-to-launch.sh>
RemainAfterExit=no
Restart=on-failure
RestartSec=2s

[Install]
WantedBy=default.target
  1. Enable unit
systemctl --user enable humanoid.service
systemctl --user start humanoid.service
  1. Check service output
journalctl -f --user-unit humanoid.service

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.