diff --git a/README.md b/README.md index 3a7a97c..61e30f2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,14 @@ # go1-js -Node JS Library for Unitree Go1 + +## Node JS Library for Unitree Go1 + +### Note: users upgrading to version 0.1.4 or newer you must initialize Go1 like the following: + +``` +let dog = new Go1(); +dog.init(); // version 0.1.4+ requirement +dog.setMode(Go1Mode.walk); +dog.goForward(0.25, 2000); +``` + +Take a look at the examples directory for more details. diff --git a/examples/avoid-obstacle.ts b/examples/avoid-obstacle.ts index b9431d1..14de463 100644 --- a/examples/avoid-obstacle.ts +++ b/examples/avoid-obstacle.ts @@ -20,6 +20,7 @@ function handleCollisionDetection(state: Go1State): void { async function main() { dog = new Go1(); + dog.init(); dog.setLedColor(0, 255, 0); dog.on("go1StateChange", (state) => { diff --git a/examples/dance.ts b/examples/dance.ts index 4a3a5c9..d1eddad 100644 --- a/examples/dance.ts +++ b/examples/dance.ts @@ -4,6 +4,7 @@ let dog: Go1; async function main() { dog = new Go1(); + dog.init(); await dog.wait(3000); diff --git a/examples/move-forward.ts b/examples/move-forward.ts index ca00dbf..58b9cb6 100644 --- a/examples/move-forward.ts +++ b/examples/move-forward.ts @@ -1,6 +1,7 @@ import { Go1, Go1Mode } from "../src/go1"; let dog = new Go1(); +dog.init(); dog.setMode(Go1Mode.walk); dog.goForward(0.25, 2000); //dog.go(0, -0.25, -0.25, 1000); diff --git a/examples/move-joints.ts b/examples/move-joints.ts index e439276..9066ad3 100644 --- a/examples/move-joints.ts +++ b/examples/move-joints.ts @@ -1,6 +1,7 @@ import { Go1, Go1Mode } from "../src/go1"; let dog = new Go1(); +dog.init(); dog.setMode(Go1Mode.stand); async function run() { diff --git a/examples/move-square.ts b/examples/move-square.ts index 63d0c5d..4782ecf 100644 --- a/examples/move-square.ts +++ b/examples/move-square.ts @@ -2,6 +2,7 @@ import { Go1, Go1Mode } from "../src/go1"; async function run() { let dog = new Go1(); + dog.init(); dog.setMode(Go1Mode.walk); await dog.goForward(0.1, 2000); await dog.goRight(0.1, 2000);