Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ros-coordination-card
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CdF
CdF 2020-2021
modules
coordination-card
ros-coordination-card
Commits
dbd54d56
Commit
dbd54d56
authored
4 years ago
by
Charles Javerliat
Browse files
Options
Downloads
Patches
Plain Diff
Use sleep
parent
6a06de06
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Add/camera node
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
actions_manager/src/robot.py
+3
-2
3 additions, 2 deletions
actions_manager/src/robot.py
actions_manager/src/tasks/swing_windsocks.py
+30
-0
30 additions, 0 deletions
actions_manager/src/tasks/swing_windsocks.py
with
33 additions
and
2 deletions
actions_manager/src/robot.py
+
3
−
2
View file @
dbd54d56
from
time
import
sleep
from
position
import
Position
from
math
import
pi
from
utils
import
compare_distance
,
compare_theta
...
...
@@ -44,7 +45,7 @@ class Robot():
# We check that we approximately run the distance we wanted, if not, we continue to go forward
while
not
compare_distance
(
start_position
,
self
.
position
,
distance
):
self
.
send_vel
(
LINEAR_SPEED
,
0
)
self
.
sleep
(
SLEEP_INTERVAL
)
sleep
(
SLEEP_INTERVAL
)
def
backward
(
self
,
distance
):
...
...
@@ -53,4 +54,4 @@ class Robot():
# We check that we approximately run the distance we wanted, if not, we continue to go forward
while
not
compare_distance
(
start_position
,
self
.
position
,
distance
):
self
.
send_vel
(
-
LINEAR_SPEED
,
0
)
self
.
sleep
(
SLEEP_INTERVAL
)
sleep
(
SLEEP_INTERVAL
)
This diff is collapsed.
Click to expand it.
actions_manager/src/tasks/swing_windsocks.py
0 → 100644
+
30
−
0
View file @
dbd54d56
from
time
import
sleep
from
task
import
Task
from
utils
import
compare_distance
,
compare_theta
from
math
import
pi
TRAVEL_DISTANCE
=
0.5
# meters
class
SwingWindsocks
(
Task
):
def
__init__
(
self
,
robot
,
state
):
self
.
robot
=
robot
self
.
state
=
state
self
.
start_pos
=
None
def
run
(
self
):
self
.
start_pos
=
self
.
robot
.
position
# Lower the arm and wait for it to complete
# Ensure we are at the right rotation
# Go forward TRAVEL_DISTANCE meters
# Raise up the arm
# Wait for the arm to be completely up
self
.
robot
.
lower_arm
()
sleep
(
0.5
)
self
.
robot
.
rotate_to
(
-
pi
)
self
.
robot
.
forward
(
TRAVEL_DISTANCE
)
self
.
robot
.
raise_arm
()
sleep
(
0.5
)
This diff is collapsed.
Click to expand it.
Preview
0%
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