Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autonomous_offboard
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
jennifer david
autonomous_offboard
Commits
16664220
Commit
16664220
authored
7 years ago
by
pateman16
Browse files
Options
Downloads
Patches
Plain Diff
minor
parent
5416119a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
action/takeoff_curr.action
+8
-0
8 additions, 0 deletions
action/takeoff_curr.action
src/launch/Untitled Document
+2
-0
2 additions, 0 deletions
src/launch/Untitled Document
src/scripts/takeoff_curr_server.py
+57
-0
57 additions, 0 deletions
src/scripts/takeoff_curr_server.py
with
67 additions
and
0 deletions
action/takeoff_curr.action
0 → 100644
+
8
−
0
View file @
16664220
#goal definition
geometry_msgs/PoseStamped destination
---
#result definition
std_msgs/String data
---
#feedback
geometry_msgs/PoseStamped current_position
This diff is collapsed.
Click to expand it.
src/launch/Untitled Document
0 → 100644
+
2
−
0
View file @
16664220
2 meter = barro 0.2
This diff is collapsed.
Click to expand it.
src/scripts/takeoff_curr_server.py
0 → 100755
+
57
−
0
View file @
16664220
#!/usr/bin/env python
import
rospy
import
actionlib
import
autonomous_offboard.msg
from
std_msgs.msg
import
Bool
,
String
from
geometry_msgs.msg
import
PoseStamped
class
takeoff_curr_server
():
def
__init__
(
self
):
#variables
self
.
target_reached
=
False
#publishers
self
.
pose_control
=
rospy
.
Publisher
(
'
/position_control/set_position
'
,
PoseStamped
,
queue_size
=
10
)
self
.
mode_control
=
rospy
.
Publisher
(
'
/position_control/set_mode
'
,
String
,
queue_size
=
10
)
#subscribers
rospy
.
Subscriber
(
'
/position_control/distance
'
,
Bool
,
self
.
distance_reached_cb
)
self
.
local_pose
=
PoseStamped
()
self
.
take_off_pose
=
PoseStamped
()
rospy
.
Subscriber
(
'
/mavros/local_position/pose
'
,
PoseStamped
,
self
.
_local_pose_callback
)
self
.
rate
=
rospy
.
Rate
(
20
)
#self.result = simulation_control.msg.goto_positionResult()
self
.
action_server
=
actionlib
.
SimpleActionServer
(
'
takeoff_curr
'
,
autonomous_offboard
.
msg
.
takeoff_currAction
,
execute_cb
=
self
.
execute_cb
,
auto_start
=
False
)
self
.
action_server
.
start
()
def
_local_pose_callback
(
self
,
data
):
self
.
local_pose
=
data
def
execute_cb
(
self
,
goal
):
self
.
take_off_pose
.
pose
.
position
.
x
=
self
.
local_pose
.
position
.
pose
.
x
self
.
take_off_pose
.
pose
.
position
.
y
=
self
.
local_pose
.
position
.
pose
.
y
self
.
take_off_pose
.
pose
.
position
.
z
=
goal
.
destination
.
pose
.
position
.
z
self
.
mode_control
.
publish
(
'
posctr
'
)
self
.
pose_control
.
publish
(
self
.
take_off_pose
)
rospy
.
sleep
(
0.1
)
print
(
self
.
target_reached
)
while
not
self
.
target_reached
:
self
.
rate
.
sleep
()
rospy
.
loginfo
(
"
Destination reached
"
)
self
.
action_server
.
set_succeeded
()
def
distance_reached_cb
(
self
,
data
):
self
.
target_reached
=
data
.
data
if
__name__
==
'
__main__
'
:
try
:
rospy
.
init_node
(
'
takeoff_curr_server
'
)
takeoff_curr_server
()
except
rospy
.
ROSInterruptException
:
pass
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