Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
air_navigation_examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tdde05_ros2
air_navigation_examples
Commits
94981942
Commit
94981942
authored
2 years ago
by
Cyrille Berger
Browse files
Options
Downloads
Patches
Plain Diff
add examples for trajectory generators
parent
320a3122
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
air_navigation_examples/__init__.py
+50
-10
50 additions, 10 deletions
air_navigation_examples/__init__.py
with
50 additions
and
10 deletions
air_navigation_examples/__init__.py
+
50
−
10
View file @
94981942
...
...
@@ -4,32 +4,72 @@ import sys
class
TestController
(
air_navigation
.
Controller
):
def
__init__
(
self
):
super
().
__init__
()
self
.
print
(
"
Constructed
"
)
def
configure
(
self
,
name
):
self
.
print
(
"
Configured
"
+
name
)
pass
def
cleanup
(
self
):
self
.
print
(
"
Cleanedup
"
)
pass
def
activate
(
self
):
self
.
print
(
"
Activated
"
)
pass
def
deactivate
(
self
):
self
.
print
(
"
Deactivated
"
)
pass
def
computeVelocityCommands
(
self
,
pose
,
velocity
):
# self.print("computeVelocityCommands")
def
computeVelocityCommands
(
self
,
pose
,
velocity
,
goal
):
t
=
air_navigation
.
TwistStamped
()
t
.
twist
.
linear
.
x
=
1.0
t
.
twist
.
angular
.
z
=
2.0
# self.print("computeVelocityCommands" + str(t))
return
t
def
setPlan
(
self
,
path
):
self
.
print
(
"
setPlan
"
)
pass
def
setSpeedLimit
(
self
,
speed_limit
,
percentage
):
self
.
print
(
"
setSpeedLimit
"
)
pass
class
TrajectoryCritic
(
air_navigation
.
TrajectoryCritic
):
def
__init__
(
self
):
super
().
__init__
()
def
onInit
(
self
):
pass
def
reset
(
self
):
pass
def
prepare
(
self
,
pose
,
vel
,
goal
,
global_plan
):
return
False
def
scoreTrajectory
(
self
,
traj
):
return
1.0
def
debrief
(
self
,
vel
):
pass
class
TrajectoryGenerator
(
air_navigation
.
TrajectoryCritic
):
def
__init__
(
self
):
super
().
__init__
()
def
initialize
(
self
,
name
):
pass
def
reset
(
self
):
pass
def
startNewIteration
(
self
,
current_velocity
):
pass
def
hasMoreTwists
(
self
):
return
False
def
nextTwist
(
self
):
return
air_navigation
.
Twist2D
()
def
generateTrajectory
(
self
,
start_pose
,
start_vel
,
cmd_vel
):
return
air_navigation
.
Trajectory2D
()
def
setSpeedLimit
(
self
,
speed_limit
,
percentage
):
pass
\ No newline at end of file
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