Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
Drone ROS Packages
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Larkin Heintzman
Drone ROS Packages
Commits
1f96d6f8
Commit
1f96d6f8
authored
Sep 30, 2021
by
Larkin Heintzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cube testing updates
parent
0f61d212
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
261 additions
and
179 deletions
+261
-179
bus_driver.h
Onboard-SDK-ROS/include/dji_osdk_ros/bus_driver.h
+5
-1
local_test.launch
Onboard-SDK-ROS/launch/local_test.launch
+10
-9
tools.cpython-38.pyc
Onboard-SDK-ROS/scripts/__pycache__/tools.cpython-38.pyc
+0
-0
poseFeedbackConversion.py
Onboard-SDK-ROS/scripts/poseFeedbackConversion.py
+12
-28
qualisysFeedback.py
Onboard-SDK-ROS/scripts/qualisysFeedback.py
+7
-7
waypointGeneratorRemote.py
Onboard-SDK-ROS/scripts/waypointGeneratorRemote.py
+3
-3
bus_driver.cpp
Onboard-SDK-ROS/src/dji_osdk_ros/samples/bus_driver.cpp
+216
-127
play.py
audio_common/sound_play/scripts/play.py
+2
-2
playSound.sh
audio_common/sound_play/scripts/playSound.sh
+4
-0
soundplay_node.py
audio_common/sound_play/scripts/soundplay_node.py
+2
-2
No files found.
Onboard-SDK-ROS/include/dji_osdk_ros/bus_driver.h
View file @
1f96d6f8
...
@@ -123,14 +123,18 @@ bool stopMotion();
...
@@ -123,14 +123,18 @@ bool stopMotion();
bool
goHome
();
bool
goHome
();
void
calibratePositionReference
();
void
calibratePositionReference
(
std
::
vector
<
float
>
requestedPosition
,
std
::
vector
<
float
>
actualPosition
);
void
updateMagnitudeScaler
(
float
newValue
);
std
::
vector
<
float
>
applyRotationMatrixScaling
(
std
::
vector
<
float
>
inputVec
);
std
::
vector
<
float
>
applyRotationMatrixScaling
(
std
::
vector
<
float
>
inputVec
);
bool
overwatchFunction
(
dji_osdk_ros
::
Overwatch
::
Request
&
req
,
dji_osdk_ros
::
Overwatch
::
Response
&
res
);
bool
overwatchFunction
(
dji_osdk_ros
::
Overwatch
::
Request
&
req
,
dji_osdk_ros
::
Overwatch
::
Response
&
res
);
std
::
vector
<
float
>
DoCalibrationMove
(
std
::
vector
<
float
>
calibrationVec
);
void
gpsPosCallback
(
const
sensor_msgs
::
NavSatFix
::
ConstPtr
&
msg
);
void
gpsPosCallback
(
const
sensor_msgs
::
NavSatFix
::
ConstPtr
&
msg
);
void
posFeedbackCallback
(
const
geometry_msgs
::
Transform
::
ConstPtr
&
msg
);
void
posFeedbackCallback
(
const
geometry_msgs
::
Transform
::
ConstPtr
&
msg
);
void
posTrackingCallback
(
const
geometry_msgs
::
Transform
::
ConstPtr
&
msg
);
#endif // MISSION_NODE_H
#endif // MISSION_NODE_H
Onboard-SDK-ROS/launch/local_test.launch
View file @
1f96d6f8
...
@@ -16,23 +16,24 @@
...
@@ -16,23 +16,24 @@
<param name="base_speed" type="double" value="0.5"/>
<param name="base_speed" type="double" value="0.5"/>
<param name="min_speed" type="double" value="0.1"/>
<param name="min_speed" type="double" value="0.1"/>
<param name="speed_scalar" type="double" value="0.
01
"/>
<param name="speed_scalar" type="double" value="0.
5
"/>
<!-- max yaw rate in deg/s -->
<!-- max yaw rate in deg/s -->
<param name="max_yaw_speed" type="double" value="30.0"/>
<param name="max_yaw_speed" type="double" value="30.0"/>
<param name="position_playback" type="bool" value="false"/>
<param name="position_playback" type="bool" value="false"/>
<param name="drone_id" type="int" value="0"/>
<param name="drone_id" type="int" value="0"/>
<param name="camera_type" type="int" value="1"/>
<param name="camera_type" type="int" value="1"/>
<
!-- <param name="angle_offset" type="double" value="-33"/> --
>
<
param name="std_move_dist" type="double" value="1.0"/
>
<node pkg="dji_osdk_ros" type="bus_driver" name="bus_driver" output="screen"/>
<node pkg="dji_osdk_ros" type="bus_driver" name="bus_driver" output="screen"/>
<!-- <node pkg="dji_osdk_ros" type="poseFeedbackConversion.py" name="poseFeedbackConversion" output="screen">
<!-- gps feedback node version -->
<rosparam command="load" param="angleOffset">
<node pkg="dji_osdk_ros" type="poseFeedbackConversion.py" name="poseFeedbackConversion" output="screen">
0.0
<rosparam command="load" param="angleOffset"> 0.0 </rosparam>
</rosparam>
<rosparam command="load" param="anchorPoint"> [37.196986, -80.578257, 100.0] </rosparam>
</node> -->
<node pkg="dji_osdk_ros" type="qualisysFeedback.py" name="qualisysFeedback" output="screen">
<param name="trackName" type="string" value="M100_CarbonFiber"/>
</node>
</node>
<!-- qualisys feedback node version -->
<!-- <node pkg="dji_osdk_ros" type="qualisysFeedback.py" name="qualisysFeedback" output="screen">
<param name="trackName" type="string" value="M100_CarbonFiber"/>
</node> -->
<node name="waypointGenerator" type="waypointGeneratorRemote.py" pkg="dji_osdk_ros">
<node name="waypointGenerator" type="waypointGeneratorRemote.py" pkg="dji_osdk_ros">
<rosparam command="load" param="anchorPoint"> [37.196986, -80.578257] </rosparam>
<rosparam command="load" param="anchorPoint"> [37.196986, -80.578257] </rosparam>
...
...
Onboard-SDK-ROS/scripts/__pycache__/tools.cpython-38.pyc
View file @
1f96d6f8
No preview for this file type
Onboard-SDK-ROS/scripts/poseFeedbackConversion.py
View file @
1f96d6f8
...
@@ -15,10 +15,11 @@ from tools import lat_lon2meters, meters2lat_lon
...
@@ -15,10 +15,11 @@ from tools import lat_lon2meters, meters2lat_lon
import
math
import
math
homeSetFlag
=
False
homeSetFlag
=
False
# homePoint = PointStamped()
homePoint
=
NavSatFix
()
homePoint
=
NavSatFix
()
transform
=
Transform
()
transform
=
Transform
()
quat
=
Quaternion
()
quat
=
Quaternion
()
translation
=
Vector3
()
posePublisher
=
rospy
.
Publisher
(
"pose_feedback"
,
Transform
,
queue_size
=
1
)
angleOffset
=
0.0
angleOffset
=
0.0
def
point_rotation
(
origin
,
pt
,
ang
):
def
point_rotation
(
origin
,
pt
,
ang
):
...
@@ -35,51 +36,34 @@ def point_rotation(origin, pt, ang):
...
@@ -35,51 +36,34 @@ def point_rotation(origin, pt, ang):
def
rotCallback
(
data
):
def
rotCallback
(
data
):
global
quat
global
quat
quat
=
data
.
orientation
;
quat
=
data
.
quaternion
;
# # FINE ill DO it MYself all ALONE
def
posCallback
(
data
):
def
posCallback
(
data
):
global
homeSetFlag
global
quat
global
homePoint
global
transform
if
not
homeSetFlag
:
# mildly hacky, depends on position format we're using for feedback. might build into bus driver and pub from there
# set up home point in yee pee es
homePoint
=
data
homeSetFlag
=
True
rospy
.
loginfo
(
"setting home point..."
)
# convert and compare against home point
# convert and compare against home point
translation
=
Vector3
()
homePoint
=
rospy
.
get_param
(
"~anchorPoint"
)
rotation
=
Quaternion
()
homePointMeters
=
lat_lon2meters
([
homePoint
[
0
],
homePoint
[
1
]])
# rotate the xy plane by angle
homePointMeters
=
lat_lon2meters
([
homePoint
.
latitude
,
homePoint
.
longitude
])
currentPointMeters
=
lat_lon2meters
([
data
.
latitude
,
data
.
longitude
])
currentPointMeters
=
lat_lon2meters
([
data
.
latitude
,
data
.
longitude
])
currentOffset
=
[
currentPointMeters
[
0
]
-
homePointMeters
[
0
],
currentPointMeters
[
1
]
-
homePointMeters
[
1
]]
currentOffset
=
[
currentPointMeters
[
0
]
-
homePointMeters
[
0
],
currentPointMeters
[
1
]
-
homePointMeters
[
1
]]
angleOffset
=
rospy
.
get_param
(
"~angleOffset"
)
angleOffset
=
rospy
.
get_param
(
"~angleOffset"
)
currentRotatedOffset
=
point_rotation
([
0
,
0
],
currentOffset
,
angleOffset
)
currentRotatedOffset
=
point_rotation
([
0
,
0
],
currentOffset
,
angleOffset
)
# performing dark magics
# performing dark magics
translation
=
Vector3
()
translation
.
x
=
currentRotatedOffset
[
1
]
translation
.
x
=
currentRotatedOffset
[
1
]
translation
.
y
=
currentRotatedOffset
[
0
]
translation
.
y
=
currentRotatedOffset
[
0
]
translation
.
z
=
data
.
altitude
-
homePoint
.
altitude
translation
.
z
=
data
.
altitude
-
homePoint
[
2
]
transform
.
translation
=
translation
transform
.
translation
=
translation
transform
.
rotation
=
quat
transform
.
rotation
=
quat
posePublisher
.
publish
(
transform
)
def
main
():
def
main
():
global
transform
rospy
.
init_node
(
"poseFeedbackConversion"
)
rospy
.
init_node
(
"poseFeedbackConversion"
)
rospy
.
Subscriber
(
"dji_osdk_ros/gps_position"
,
NavSatFix
,
posCallback
,
queue_size
=
1
)
rospy
.
Subscriber
(
"dji_osdk_ros/gps_position"
,
NavSatFix
,
posCallback
,
queue_size
=
1
)
rospy
.
Subscriber
(
"dji_osdk_ros/imu"
,
Imu
,
rotCallback
,
queue_size
=
1
)
rospy
.
Subscriber
(
"dji_osdk_ros/attitude"
,
QuaternionStamped
,
rotCallback
,
queue_size
=
1
)
posePublisher
=
rospy
.
Publisher
(
"pose_feedback"
,
Transform
,
queue_size
=
1
)
rospy
.
spin
()
while
not
rospy
.
is_shutdown
():
# get anchor point from params
posePublisher
.
publish
(
transform
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
main
()
main
()
Onboard-SDK-ROS/scripts/qualisysFeedback.py
View file @
1f96d6f8
...
@@ -10,21 +10,21 @@ def callback(data):
...
@@ -10,21 +10,21 @@ def callback(data):
# save the pose date in transform
# save the pose date in transform
transform
.
rotation
=
data
.
pose
.
orientation
transform
.
rotation
=
data
.
pose
.
orientation
# we must remapp
# we must remapp
# transform.translation = data.pose.position
#transform.translation = data.pose.position
transform
.
translation
.
x
=
data
.
pose
.
position
.
z
transform
.
translation
.
x
=
data
.
pose
.
position
.
x
transform
.
translation
.
y
=
data
.
pose
.
position
.
z
transform
.
translation
.
z
=
data
.
pose
.
position
.
y
transform
.
translation
.
z
=
data
.
pose
.
position
.
y
transform
.
translation
.
y
=
data
.
pose
.
position
.
x
def
main
():
def
main
():
global
transform
global
transform
rospy
.
init_node
(
"qualisysFeedback"
)
rospy
.
init_node
(
"qualisysFeedback"
,
anonymous
=
True
)
name
=
rospy
.
get_param
(
"~trackName"
)
name
=
rospy
.
get_param
(
"~trackName"
)
namespace
=
rospy
.
get_param
(
"~qualisysName"
)
rospy
.
loginfo
(
"looking for track of name "
+
str
(
name
)
+
" ..."
)
rospy
.
loginfo
(
"looking for track of name "
+
str
(
name
)
+
" ..."
)
rospy
.
Subscriber
(
"/qualisys/"
+
name
+
"/pose"
,
PoseStamped
,
callback
,
queue_size
=
1
)
rospy
.
Subscriber
(
"/
"
+
namespace
+
"/
qualisys/"
+
name
+
"/pose"
,
PoseStamped
,
callback
,
queue_size
=
1
)
pub
=
rospy
.
Publisher
(
"
pose_feedback"
,
Transform
,
queue_size
=
1
)
pub
=
rospy
.
Publisher
(
namespace
+
"/
pose_feedback"
,
Transform
,
queue_size
=
1
)
while
not
rospy
.
is_shutdown
():
while
not
rospy
.
is_shutdown
():
pub
.
publish
(
transform
)
pub
.
publish
(
transform
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
main
()
main
()
Onboard-SDK-ROS/scripts/waypointGeneratorRemote.py
View file @
1f96d6f8
...
@@ -20,9 +20,9 @@ def generateWaypoints():
...
@@ -20,9 +20,9 @@ def generateWaypoints():
# musical drones trajectory is convient test case, but general path is possible
# musical drones trajectory is convient test case, but general path is possible
# ring sizes
# ring sizes
big
=
10
big
=
5
med
=
5
med
=
3
sml
=
3
sml
=
1
apMeters
=
lat_lon2meters
(
anchorPoint
)
apMeters
=
lat_lon2meters
(
anchorPoint
)
...
...
Onboard-SDK-ROS/src/dji_osdk_ros/samples/bus_driver.cpp
View file @
1f96d6f8
This diff is collapsed.
Click to expand it.
audio_common/sound_play/scripts/play.py
View file @
1f96d6f8
...
@@ -53,10 +53,10 @@ if __name__ == '__main__':
...
@@ -53,10 +53,10 @@ if __name__ == '__main__':
soundhandle
=
SoundClient
()
soundhandle
=
SoundClient
()
rospy
.
sleep
(
1
)
#
rospy.sleep(1)
rospy
.
loginfo
(
'Playing "
%
s".'
%
argv
[
1
])
rospy
.
loginfo
(
'Playing "
%
s".'
%
argv
[
1
])
volume
=
float
(
argv
[
2
])
if
len
(
argv
)
==
3
else
1.0
volume
=
float
(
argv
[
2
])
if
len
(
argv
)
==
3
else
1.0
soundhandle
.
playWave
(
argv
[
1
],
volume
)
soundhandle
.
playWave
(
argv
[
1
],
volume
)
rospy
.
sleep
(
1
)
#
rospy.sleep(1)
audio_common/sound_play/scripts/playSound.sh
0 → 100755
View file @
1f96d6f8
#!/bin/bash
source
~/.bashrc
echo
"trying to play sound"
rosrun sound_play play.py /home/larkin/musical_drones_audio_files/
'04-musicaldrones_25 or 6 to 4.wav'
audio_common/sound_play/scripts/soundplay_node.py
View file @
1f96d6f8
...
@@ -182,8 +182,8 @@ class soundtype:
...
@@ -182,8 +182,8 @@ class soundtype:
position
=
0
position
=
0
duration
=
0
duration
=
0
try
:
try
:
position
=
self
.
sound
.
query_position
(
Gst
.
Format
.
TIME
)[
0
]
position
=
self
.
sound
.
query_position
(
Gst
.
Format
.
TIME
)[
1
]
duration
=
self
.
sound
.
query_duration
(
Gst
.
Format
.
TIME
)[
0
]
duration
=
self
.
sound
.
query_duration
(
Gst
.
Format
.
TIME
)[
1
]
except
Exception
as
e
:
except
Exception
as
e
:
position
=
0
position
=
0
duration
=
0
duration
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment