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
151fa067
authored
Nov 30, 2018
by
Hideaki Tai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix packet recv err and set fps w/ whill comm
parent
2202fd10
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
include/global.h
+1
-1
include/main.h
+6
-3
lib/Whill/WhillOmni.cpp
+2
-2
src/main.cpp
+1
-0
No files found.
include/global.h
View file @
151fa067
...
...
@@ -10,7 +10,7 @@
static
constexpr
uint32_t
WHILL_SERIAL_BAUD
=
38400
;
static
constexpr
uint32_t
XBEE_SERIAL_BAUD
=
38400
;
static
constexpr
uint16_t
WHILL_INFO_INTERVAL_MS
=
1
00
;
static
constexpr
uint16_t
WHILL_INFO_INTERVAL_MS
=
5
00
;
static
constexpr
double
XBEE_COMMAND_TIMEOUT_MS
=
1000
.;
...
...
include/main.h
View file @
151fa067
...
...
@@ -21,6 +21,7 @@ MPU9250 mpu;
PCA9624
irled
(
0x60
);
RzmEepromMap
eepmap
;
StopWatch
stopwatch
;
FrameRateCounter
fps
(
30
);
void
printSpeedProfile
(
WhillOmni
::
LR
lr
)
{
...
...
@@ -254,14 +255,17 @@ void setVelocity()
vel
[
0
]
=
unpacker
.
velocityX
();
vel
[
1
]
=
unpacker
.
velocityY
();
vel
[
2
]
=
unpacker
.
velocityW
();
unpacker
.
pop
();
stopwatch
.
restart
();
}
unpacker
.
pop
();
}
if
(
stopwatch
.
isRunning
()
&&
(
stopwatch
.
ms
()
<
XBEE_COMMAND_TIMEOUT_MS
))
{
if
(
b_motor_active
)
whill
.
move
(
vel
[
0
],
vel
[
1
],
vel
[
2
]);
if
(
b_motor_active
)
{
if
(
fps
.
isNextFrame
())
whill
.
move
(
vel
[
0
],
vel
[
1
],
vel
[
2
]);
}
}
}
...
...
@@ -269,7 +273,6 @@ void sendStatus()
{
if
(
b_streaming
)
{
Serial
.
println
(
millis
());
packer
.
pack
(
HARDWARE_ID
,
whill
.
battery
(
WhillOmni
::
LR
::
L
),
whill
.
battery
(
WhillOmni
::
LR
::
R
),
whill
.
errorCode
(
WhillOmni
::
LR
::
L
),
whill
.
errorCode
(
WhillOmni
::
LR
::
R
));
XBEE_SERIAL
.
write
(
packer
.
data
(),
packer
.
size
());
}
...
...
lib/Whill/WhillOmni.cpp
View file @
151fa067
...
...
@@ -75,9 +75,9 @@ bool WhillOmni::move(float x, float y, float r) // [mm/s], [mm/s], [rad/s]
// calcurate whill's translation speed
whill_l
.
y
()
=
(
w_wheel
[
1
]
+
w_wheel
[
0
])
/
2.
f
*
model
.
getWheelRadius
();
whill_l
.
x
()
=
(
w_wheel
[
1
]
-
w_wheel
[
0
])
/
0.5
f
*
model
.
getWheelRadius
();
whill_l
.
x
()
=
(
w_wheel
[
1
]
-
w_wheel
[
0
])
/
1.
f
*
model
.
getWheelRadius
();
whill_r
.
y
()
=
(
w_wheel
[
3
]
+
w_wheel
[
2
])
/
2.
f
*
model
.
getWheelRadius
();
whill_r
.
x
()
=
(
w_wheel
[
3
]
-
w_wheel
[
2
])
/
0.5
f
*
model
.
getWheelRadius
();
whill_r
.
x
()
=
(
w_wheel
[
3
]
-
w_wheel
[
2
])
/
1.
f
*
model
.
getWheelRadius
();
// convert whill direction
whill_l
.
x
()
=
-
whill_l
.
x
();
...
...
src/main.cpp
View file @
151fa067
...
...
@@ -71,6 +71,7 @@ void setup()
attachInterrupt
(
digitalPinToInterrupt
(
PIN_EMERGENCY
),
disableMotor
,
FALLING
);
Serial
.
println
(
"start program"
);
fps
.
start
();
}
...
...
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