Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Hideaki Tai
/
omni_main
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
37ebe67a
authored
Nov 28, 2018
by
Hideaki Tai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ID bug
parent
a460f700
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
include/global.h
+0
-1
include/main.h
+3
-3
No files found.
include/global.h
View file @
37ebe67a
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
#define WHILL_SERIAL_R Serial3
#define WHILL_SERIAL_R Serial3
#define XBEE_SERIAL Serial1
#define XBEE_SERIAL Serial1
static
constexpr
uint8_t
MY_ID
=
0
;
static
constexpr
uint32_t
WHILL_SERIAL_BAUD
=
38400
;
static
constexpr
uint32_t
WHILL_SERIAL_BAUD
=
38400
;
static
constexpr
uint32_t
XBEE_SERIAL_BAUD
=
38400
;
static
constexpr
uint32_t
XBEE_SERIAL_BAUD
=
38400
;
static
constexpr
uint16_t
WHILL_INFO_INTERVAL_MS
=
1000
;
static
constexpr
uint16_t
WHILL_INFO_INTERVAL_MS
=
1000
;
...
...
include/main.h
View file @
37ebe67a
...
@@ -236,7 +236,7 @@ void setVelocity()
...
@@ -236,7 +236,7 @@ void setVelocity()
unpacker.parse();
unpacker.parse();
while (unpacker.available())
while (unpacker.available())
{
{
if (unpacker.id() ==
MY
_ID)
if (unpacker.id() ==
HARDWARE
_ID)
{
{
whill.move(unpacker.velocityX(), unpacker.velocityY(), unpacker.velocityW());
whill.move(unpacker.velocityX(), unpacker.velocityY(), unpacker.velocityW());
}
}
...
@@ -263,7 +263,7 @@ void setVelocity()
...
@@ -263,7 +263,7 @@ void setVelocity()
while
(
unpacker
.
available
())
while
(
unpacker
.
available
())
{
{
if
(
unpacker
.
id
()
==
MY
_ID
)
if
(
unpacker
.
id
()
==
HARDWARE
_ID
)
{
{
vel
[
0
]
=
unpacker
.
velocityX
();
vel
[
0
]
=
unpacker
.
velocityX
();
vel
[
1
]
=
unpacker
.
velocityY
();
vel
[
1
]
=
unpacker
.
velocityY
();
...
@@ -287,7 +287,7 @@ void sendStatus(WhillOmni::LR lr)
...
@@ -287,7 +287,7 @@ void sendStatus(WhillOmni::LR lr)
{
{
while
(
whill
.
available
(
lr
))
while
(
whill
.
available
(
lr
))
{
{
packer
.
pack
(
MY
_ID
,
(
uint8_t
)
lr
,
whill
.
battery
(
lr
),
whill
.
errorCode
(
lr
));
packer
.
pack
(
HARDWARE
_ID
,
(
uint8_t
)
lr
,
whill
.
battery
(
lr
),
whill
.
errorCode
(
lr
));
XBEE_SERIAL
.
write
(
packer
.
data
(),
packer
.
size
());
XBEE_SERIAL
.
write
(
packer
.
data
(),
packer
.
size
());
#ifdef DEBUG_INFO
#ifdef DEBUG_INFO
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment