Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
omniwheels_controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stevedan Ogochukwu Omodolor
omniwheels_controller
Commits
3e2060e8
Commit
3e2060e8
authored
3 years ago
by
Stevedan Ogochukwu Omodolor
Browse files
Options
Downloads
Patches
Plain Diff
velocity controller working, pid is needed
parent
83dd6bd1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/omniwheels_config.yaml
+1
-0
1 addition, 0 deletions
config/omniwheels_config.yaml
scripts/omni_wheel_controller_node.py
+6
-7
6 additions, 7 deletions
scripts/omni_wheel_controller_node.py
with
7 additions
and
7 deletions
config/omniwheels_config.yaml
+
1
−
0
View file @
3e2060e8
...
...
@@ -5,5 +5,6 @@ channel: 90 # change to the correct one
type
:
default
position_offset
:
0.11
# ofsset from crazyflie module to the cenyter of the omniwheels
R
:
0.0165
r
:
0.003
This diff is collapsed.
Click to expand it.
scripts/omni_wheel_controller_node.py
+
6
−
7
View file @
3e2060e8
...
...
@@ -52,10 +52,10 @@ class omniWheelvelocityController:
self
.
_current_pose
=
Pose
()
self
.
vel_callback_initiated
=
False
;
self
.
pose_callback_initiated
=
False
;
self
.
R
=
0.165
# Distance between center of robot and wheels
self
.
R
=
rospy
.
get_param
(
"
/R
"
)
# Distance between center of robot and wheels
self
.
a1
=
2
*
np
.
pi
/
3
# Angle between x axis and first wheel
self
.
a2
=
4
*
np
.
pi
/
3
# Angle between x axis and second wheel
self
.
r
=
0.027
# Wheel radius. Has been fudge-factored because the actual velocity of the wheels did not align with the set-points.
self
.
r
=
rospy
.
get_param
(
"
/r
"
)
# Wheel radius. Has been fudge-factored because the actual velocity of the wheels did not align with the set-points.
# get ros param value
...
...
@@ -93,10 +93,9 @@ class omniWheelvelocityController:
if
self
.
vel_cmd_arrived
==
True
and
self
.
vel_callback_initiated
==
True
and
self
.
pose_callback_initiated
==
True
:
# compute motor values from velocity command
roll
,
pitch
,
yaw
=
euler_from_quaternion
(
self
.
_current_pose
.
orientation
.
x
,
self
.
_current_pose
.
orientation
.
y
,
self
.
_current_pose
.
orientation
.
z
,
self
.
_current_pose
.
orientation
.
w
)
xdot
=
np
.
array
([
1
,
0
,
0
]);
#self._current_vel.linear.x, self._current_vel.linear.y, self._current_vel.angular.z])
ph
=
self
.
vel2motor
(
xdot
,
0
);
#print(ph)
print
(
yaw
)
xdot
=
np
.
array
([
self
.
vel_cmd
.
linear
.
x
,
self
.
vel_cmd
.
linear
.
y
,
self
.
vel_cmd
.
angular
.
z
])
ph
=
self
.
vel2motor
(
xdot
,
np
.
deg2rad
(
yaw
));
print
(
np
.
rad2deg
(
yaw
))
self
.
motor_command
[
0
]
=
ph
[
0
]
self
.
motor_command
[
1
]
=
ph
[
1
]
self
.
motor_command
[
2
]
=
ph
[
2
]
...
...
@@ -150,7 +149,7 @@ class omniWheelvelocityController:
self
.
_current_pose
=
data
;
self
.
pose_callback_initiated
=
True
;
def
vel2motor
(
self
,
xdot
,
ang
):
M
=
-
1
/
self
.
r
*
np
.
array
([[
-
np
.
sin
(
ang
),
np
.
cos
(
ang
),
self
.
R
],[
-
np
.
sin
(
ang
+
self
.
a1
),
np
.
cos
(
ang
+
self
.
a1
),
self
.
R
],[
-
np
.
sin
(
ang
+
self
.
a2
),
np
.
cos
(
ang
+
self
.
a2
),
self
.
R
]])
M
=
1
/
self
.
r
*
np
.
array
([[
-
np
.
sin
(
ang
),
np
.
cos
(
ang
),
self
.
R
],[
-
np
.
sin
(
ang
+
self
.
a1
),
np
.
cos
(
ang
+
self
.
a1
),
self
.
R
],[
-
np
.
sin
(
ang
+
self
.
a2
),
np
.
cos
(
ang
+
self
.
a2
),
self
.
R
]])
return
M
.
dot
(
xdot
)
#return M.dot(xdot)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment