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
2202fd10
authored
Nov 30, 2018
by
Hideaki Tai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix whill communication error report
parent
f2cb86d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
lib/Whill/Whill.cpp
+2
-13
lib/Whill/Whill.h
+2
-0
No files found.
lib/Whill/Whill.cpp
View file @
2202fd10
...
@@ -63,11 +63,6 @@ bool WhillModelC::moveVel(float y, float x) // [m/s]
...
@@ -63,11 +63,6 @@ bool WhillModelC::moveVel(float y, float x) // [m/s]
lr
=
constrain
(
lr
,
-
100
,
100
);
lr
=
constrain
(
lr
,
-
100
,
100
);
}
}
// Serial.println("move 0-100 (y, x)");
// Serial.print(fb);
// Serial.print(", ");
// Serial.println(lr);
return
this
->
move
((
int8_t
)
fb
,
(
int8_t
)
lr
);
return
this
->
move
((
int8_t
)
fb
,
(
int8_t
)
lr
);
}
}
...
@@ -109,11 +104,9 @@ bool WhillModelC::streaming(bool b, uint16_t interval, DATASET n, SPEEDMODE mode
...
@@ -109,11 +104,9 @@ bool WhillModelC::streaming(bool b, uint16_t interval, DATASET n, SPEEDMODE mode
void
WhillModelC
::
parse
()
void
WhillModelC
::
parse
()
{
{
static
uint32_t
prev_ms
=
millis
();
if
(
streaming_info
.
is_streaming
)
if
(
streaming_info
.
is_streaming
)
{
{
if
((
millis
()
-
prev_ms
)
>
STATUS_RECEIVE_TIMEOUT
)
if
((
millis
()
-
prev_
streaming_
ms
)
>
STATUS_RECEIVE_TIMEOUT
)
{
{
status
.
info
.
battery
.
percent
=
0
;
status
.
info
.
battery
.
percent
=
0
;
status
.
info
.
error_code
=
253
;
status
.
info
.
error_code
=
253
;
...
@@ -122,7 +115,7 @@ void WhillModelC::parse()
...
@@ -122,7 +115,7 @@ void WhillModelC::parse()
while
(
serial
->
available
()
>
0
)
while
(
serial
->
available
()
>
0
)
{
{
prev_ms
=
millis
();
prev_
streaming_
ms
=
millis
();
char
data
=
serial
->
read
();
char
data
=
serial
->
read
();
unpacker
.
feed
(
data
);
unpacker
.
feed
(
data
);
...
@@ -131,8 +124,6 @@ void WhillModelC::parse()
...
@@ -131,8 +124,6 @@ void WhillModelC::parse()
{
{
if
(
unpacker
.
dataset
()
==
(
uint8_t
)
DATASET
::
SPEED_PROFILE
)
if
(
unpacker
.
dataset
()
==
(
uint8_t
)
DATASET
::
SPEED_PROFILE
)
{
{
Serial
.
print
(
"Speed Profile buffer is changed : "
);
Serial
.
println
(
millis
());
#ifdef DEBUG_INFO
#ifdef DEBUG_INFO
printSpeedProfile
();
printSpeedProfile
();
#endif
#endif
...
@@ -149,8 +140,6 @@ void WhillModelC::parse()
...
@@ -149,8 +140,6 @@ void WhillModelC::parse()
}
}
else
if
(
unpacker
.
dataset
()
==
(
uint8_t
)
DATASET
::
SENSOR_INFO
)
else
if
(
unpacker
.
dataset
()
==
(
uint8_t
)
DATASET
::
SENSOR_INFO
)
{
{
Serial
.
print
(
"Sensor Info buffer is changed : "
);
Serial
.
println
(
millis
());
#ifdef DEBUG_INFO
#ifdef DEBUG_INFO
printSensorInfo
();
printSensorInfo
();
#endif
#endif
...
...
lib/Whill/Whill.h
View file @
2202fd10
...
@@ -155,6 +155,8 @@ private:
...
@@ -155,6 +155,8 @@ private:
SpeedProfile
spd_profile
;
SpeedProfile
spd_profile
;
Status
status
;
Status
status
;
StreamingInfo
streaming_info
;
StreamingInfo
streaming_info
;
uint32_t
prev_streaming_ms
;
};
};
WHILL_NAMESPACE_END
WHILL_NAMESPACE_END
...
...
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