-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
69 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package chassis | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/brunoga/robomaster/module/chassis" | ||
) | ||
|
||
func TestSetPosition(t *testing.T) { | ||
err := chassisModule.SetPosition(chassis.ModeAngularVelocity, 1, 0, 0) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
time.Sleep(5 * time.Second) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package value | ||
|
||
import "github.com/brunoga/robomaster/unitybridge/unity/task" | ||
|
||
type ChassisPosition struct { | ||
TaskID uint8 `json:"taskId"` | ||
IsCancel uint8 `json:"isCancel"` | ||
ControlMode uint8 `json:"controlMode"` | ||
X float32 `json:"positionX"` | ||
Y float32 `json:"positionY"` | ||
Z float32 `json:"positionYaw"` | ||
TaskType task.Type `json:"taskId"` | ||
IsCancel uint8 `json:"isCancel"` | ||
ControlMode uint8 `json:"controlMode"` | ||
X float32 `json:"positionX"` | ||
Y float32 `json:"positionY"` | ||
Z float32 `json:"positionYaw"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package value | ||
|
||
import "github.com/brunoga/robomaster/unitybridge/unity/task" | ||
|
||
type TaskStatus struct { | ||
TaskType task.Type `json:"taskId"` // JSON name seems mismatched. Check. | ||
Percent float64 `json:"percent"` | ||
Status task.Status `json:"status"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package task | ||
|
||
type Status int8 | ||
|
||
const ( | ||
StatusRunning Status = iota | ||
StatusSuccess | ||
StatusFailure | ||
StatusCount | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package task | ||
|
||
type Type int8 | ||
|
||
const ( | ||
TypeUnknown Type = iota | ||
TypeChassisPosition | ||
TypeGimbalReset | ||
TypeGimbalAngle | ||
TypeCount | ||
) |