Skip to content

Commit

Permalink
Merge pull request #6 from dbaldwin/hotfix/docs-for-0.1.4
Browse files Browse the repository at this point in the history
init call necessary for v0.1.4+
  • Loading branch information
dbaldwin authored May 15, 2023
2 parents 0de0ac7 + 70cd592 commit 5818d30
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions examples/avoid-obstacle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions examples/dance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ let dog: Go1;

async function main() {
dog = new Go1();
dog.init();

await dog.wait(3000);

Expand Down
1 change: 1 addition & 0 deletions examples/move-forward.ts
Original file line number Diff line number Diff line change
@@ -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);
1 change: 1 addition & 0 deletions examples/move-joints.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Go1, Go1Mode } from "../src/go1";

let dog = new Go1();
dog.init();
dog.setMode(Go1Mode.stand);

async function run() {
Expand Down
1 change: 1 addition & 0 deletions examples/move-square.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5818d30

Please sign in to comment.