Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Robomaster_pi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emil Harlan
Robomaster_pi
Commits
52b5a227
Commit
52b5a227
authored
1 year ago
by
Emil Harlan
Browse files
Options
Downloads
Patches
Plain Diff
qa
parent
ed512f09
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
robomaster_pi/nav_commander.py
+1
-25
1 addition, 25 deletions
robomaster_pi/nav_commander.py
with
1 addition
and
25 deletions
robomaster_pi/nav_commander.py
+
1
−
25
View file @
52b5a227
...
...
@@ -74,7 +74,7 @@ from action_msgs.msg import GoalStatus
from
geometry_msgs.msg
import
Pose
from
geometry_msgs.msg
import
PoseWithCovarianceStamped
from
lifecycle_msgs.srv
import
GetState
from
nav2_msgs.action
import
NavigateThroughPoses
,
NavigateToPose
from
nav2_msgs.action
import
NavigateToPose
import
rclpy
...
...
@@ -100,9 +100,6 @@ class BasicNavigator(Node):
depth
=
1
)
self
.
initial_pose_received
=
False
self
.
nav_through_poses_client
=
ActionClient
(
self
,
NavigateThroughPoses
,
'
navigate_through_poses
'
)
self
.
nav_to_pose_client
=
ActionClient
(
self
,
NavigateToPose
,
'
navigate_to_pose
'
)
self
.
model_pose_sub
=
self
.
create_subscription
(
PoseWithCovarianceStamped
,
'
amcl_pose
'
,
...
...
@@ -117,27 +114,6 @@ class BasicNavigator(Node):
self
.
initial_pose
=
initial_pose
self
.
_setInitialPose
()
def
goThroughPoses
(
self
,
poses
):
# Sends a `NavToPose` action request and waits for completion
self
.
debug
(
"
Waiting for
'
NavigateToPose
'
action server
"
)
while
not
self
.
nav_through_poses_client
.
wait_for_server
(
timeout_sec
=
1.0
):
self
.
info
(
"'
NavigateToPose
'
action server not available, waiting...
"
)
goal_msg
=
NavigateThroughPoses
.
Goal
()
goal_msg
.
poses
=
poses
self
.
info
(
'
Navigating with
'
+
str
(
len
(
poses
))
+
'
goals.
'
+
'
...
'
)
send_goal_future
=
self
.
nav_through_poses_client
.
send_goal_async
(
goal_msg
,
self
.
_feedbackCallback
)
rclpy
.
spin_until_future_complete
(
self
,
send_goal_future
)
self
.
goal_handle
=
send_goal_future
.
result
()
if
not
self
.
goal_handle
.
accepted
:
self
.
error
(
'
Goal with
'
+
str
(
len
(
poses
))
+
'
poses was rejected!
'
)
return
False
self
.
result_future
=
self
.
goal_handle
.
get_result_async
()
return
True
def
goToPose
(
self
,
pose
):
# Sends a `NavToPose` action request and waits for completion
...
...
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