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
625102d3
authored
Dec 10, 2018
by
Hideaki Tai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adapt to new whill firmware (fb is also acc ctrl)
parent
b937055d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
lib/Whill/Whill.cpp
+4
-3
lib/Whill/WhillOmni.cpp
+13
-5
src/main.cpp
+1
-1
No files found.
lib/Whill/Whill.cpp
View file @
625102d3
...
@@ -78,14 +78,15 @@ bool WhillModelC::stop()
...
@@ -78,14 +78,15 @@ bool WhillModelC::stop()
bool
WhillModelC
::
speed
(
SPEEDMODE
mode
,
char
f_m1
,
char
f_a1
,
char
f_d1
,
char
r_m1
,
char
r_a1
,
char
r_d1
,
char
t_m1
,
char
t_a1
,
char
t_d1
)
bool
WhillModelC
::
speed
(
SPEEDMODE
mode
,
char
f_m1
,
char
f_a1
,
char
f_d1
,
char
r_m1
,
char
r_a1
,
char
r_d1
,
char
t_m1
,
char
t_a1
,
char
t_d1
)
{
{
// WHILL New Firmware
f_m1
=
constrain
(
f_m1
,
8
,
60
);
// less than 60 is better
f_m1
=
constrain
(
f_m1
,
8
,
60
);
// less than 60 is better
f_a1
=
constrain
(
f_a1
,
10
,
90
);
f_a1
=
constrain
(
f_a1
,
10
,
90
);
f_d1
=
constrain
(
f_d1
,
40
,
160
);
f_d1
=
constrain
(
f_d1
,
40
,
160
);
r_m1
=
constrain
(
r_m1
,
8
,
60
);
// less than 60 is better
r_m1
=
constrain
(
r_m1
,
8
,
60
);
// less than 60 is better
r_a1
=
constrain
(
r_a1
,
10
,
5
0
);
r_a1
=
constrain
(
r_a1
,
10
,
9
0
);
r_d1
=
constrain
(
r_d1
,
40
,
8
0
);
r_d1
=
constrain
(
r_d1
,
40
,
16
0
);
t_m1
=
constrain
(
t_m1
,
8
,
60
);
// less than 60 is better
t_m1
=
constrain
(
t_m1
,
8
,
60
);
// less than 60 is better
t_a1
=
constrain
(
t_a1
,
10
,
6
0
);
t_a1
=
constrain
(
t_a1
,
10
,
9
0
);
t_d1
=
constrain
(
t_d1
,
40
,
160
);
t_d1
=
constrain
(
t_d1
,
40
,
160
);
// save speed as [m/s]
// save speed as [m/s]
...
...
lib/Whill/WhillOmni.cpp
View file @
625102d3
...
@@ -74,17 +74,25 @@ bool WhillOmni::move(float x, float y, float r) // [mm/s], [mm/s], [rad/s]
...
@@ -74,17 +74,25 @@ bool WhillOmni::move(float x, float y, float r) // [mm/s], [mm/s], [rad/s]
w_wheel
[
2
]
=
-
w_wheel
[
2
];
w_wheel
[
2
]
=
-
w_wheel
[
2
];
// calcurate whill's translation speed
// 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
])
/
1.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
])
/
1.1
f
*
model
.
getWheelRadius
();
// true?
// true for previous whill (fb: jerk control, lr: acc control)
// whill_l.y() = (w_wheel[1] + w_wheel[0]) / 2.f * model.getWheelRadius();
// whill_l.x() = (w_wheel[1] - w_wheel[0]) / 1.1f * model.getWheelRadius();
// whill_r.y() = (w_wheel[3] + w_wheel[2]) / 2.f * model.getWheelRadius();
// whill_r.x() = (w_wheel[3] - w_wheel[2]) / 1.1f * model.getWheelRadius();
// true for kinematics (not suitable for whill)
// whill_l.y() = (w_wheel[1] + w_wheel[0]) / 2.f * model.getWheelRadius();
// whill_l.y() = (w_wheel[1] + w_wheel[0]) / 2.f * model.getWheelRadius();
// whill_l.x() = (w_wheel[1] - w_wheel[0]) / 2.f * model.getWheelRadius();
// whill_l.x() = (w_wheel[1] - w_wheel[0]) / 2.f * model.getWheelRadius();
// whill_r.y() = (w_wheel[3] + w_wheel[2]) / 2.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]) / 2.f * model.getWheelRadius();
// whill_r.x() = (w_wheel[3] - w_wheel[2]) / 2.f * model.getWheelRadius();
// true for whill (for new firmware)
whill_l
.
y
()
=
(
w_wheel
[
1
]
+
w_wheel
[
0
])
/
2.
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
])
/
1.
f
*
model
.
getWheelRadius
();
// convert whill direction
// convert whill direction
whill_l
.
x
()
=
-
whill_l
.
x
();
whill_l
.
x
()
=
-
whill_l
.
x
();
whill_r
.
x
()
=
-
whill_r
.
x
();
whill_r
.
x
()
=
-
whill_r
.
x
();
...
...
src/main.cpp
View file @
625102d3
...
@@ -54,7 +54,7 @@ void setup()
...
@@ -54,7 +54,7 @@ void setup()
// WHILL setting
// WHILL setting
Serial
.
println
(
"set speed profile"
);
Serial
.
println
(
"set speed profile"
);
whill
.
speed
(
SPEEDMODE
::
RS232C
,
60
,
45
,
80
,
60
,
45
,
80
,
60
,
60
,
80
);
whill
.
speed
(
SPEEDMODE
::
RS232C
,
60
,
90
,
90
,
60
,
90
,
90
,
60
,
90
,
90
);
// for new whill firmware
delay
(
1000
);
delay
(
1000
);
Serial
.
println
(
"check speed profile"
);
Serial
.
println
(
"check speed profile"
);
...
...
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