Coder Social home page Coder Social logo

free-dog-cpp-sdk's Introduction

Unitree Go1 Free-Dog SDK C++

This repository is CPP port built on the commendable work of https://github.com/Bin4ry and team in free-dog-sdk. The code has a number of improvements, but it only has low level control.

Installation Guide

Use the standard process of cloning this repository, making the build folder, running cmake, running make, and installing.

Configuration of the dog and the SDK

Execute the following code on the robot's Raspberry Pi:

sudo vi /etc/sysctl.conf

Remove the comment in front of net.ipv4.ip_forward=1

sudo sysctl -p
sudo iptables -F
sudo iptables -t nat -F
sudo iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i wlan1 -o eth0 -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o wlan1 -j ACCEPT

Do the following on the PC running this code:

sudo route add default gw 192.168.12.1

Configure the connection

You must establish a unitreeConnection object to get data. This takes in a tuple of the following:

  • listenPort -- What port you should reserve for listening to connections. Arbitrary.
  • addr -- The address of the robot. This should be 192.168.123.10 if you are connected via Ethernet.
  • sendPort -- The port to send to. This should be 8007.
  • localIP -- The IP of the computer running the code. It is recommended that this is set as 192.168.123.14.

Lowlevel Example

See example/example_position_lowlevel.cpp for an example.

Run the Lowlevel Position Example

Elevate the dog using a box so its feet are not touching the ground and the front right leg is free to move.

Then run

./free_dog_sdk_cpp_example_position_lowlevel

The dog's front right leg should do a sin motion.

Warnings

Absolutely NO warranty. This is not intentionally designed to but may inadvertently destroy your robot.

Network data for further development and analysis

Packet data is available here: https://drive.google.com/drive/folders/1sj5RmSSMArtuQ0Jn5zo_W-naarSg7qQg

LICENSE

MIT

free-dog-cpp-sdk's People

Contributors

bin4ry avatar echogee avatar ex3ndr avatar jackpittenger avatar mavproxyuser avatar

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.