Skip to content

Commit 181f07c

Browse files
committed
Clean dependencies, simple install
1 parent 1d5e9cc commit 181f07c

File tree

14 files changed

+70
-46
lines changed

14 files changed

+70
-46
lines changed

INSTALL.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Installation
22

3-
## Dependencies
4-
53
```
6-
sudo apt-get install socat
4+
rosdep install --from-paths src --ignore-src -r -y
75
8-
#sudo apt-get install python-pip
9-
sudo pip install catkin_tools mavproxy pymavlink
6+
# MAVProxy and QGroundControl will automatically be installed when calling
7+
# rosrun bluerov_launch mavproxy.sh
8+
# rosrun bluerov_launch qgc.sh
109
```
1110

12-
## Build workspace
11+
# Build workspace
1312

1413
```
1514
$ mkdir -p WORKSPACE/src
@@ -19,6 +18,18 @@ $ catkin config --merge-devel
1918
$ catkin config --cmake-args -DCMAKE_BUILD_TYPE=Releas
2019
```
2120

21+
# Manual installation
22+
23+
## Dependencies
24+
25+
```
26+
#sudo apt-get install python-pip
27+
sudo pip install catkin_tools mavproxy pymavlink scipy
28+
29+
# install ROS dependencies
30+
sudo apt-get install ros-DISTRO-joy ros-DISTRO-cv-bridge
31+
```
32+
2233
## QGroundControl
2334

2435
Before installing QGroundControl for the first time:

bar30_depth/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ project(bar30_depth)
44
find_package(catkin REQUIRED COMPONENTS
55
rospy
66
std_msgs
7+
bluerov_bridge
78
message_generation
89
)
910

bar30_depth/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
<buildtool_depend>catkin</buildtool_depend>
1111

1212
<depend>rospy</depend>
13+
<depend>bluerov_bridge</depend>
1314
</package>

bar30_depth/scripts/bar30_depth_node.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env python
22
import sys
33
import socket
4-
from pymavlink import mavutil
54
import rospy
65
from bar30_depth.msg import Depth
76

7+
from bluerov_bridge import Bridge
8+
89
FLUID_DENSITY = {'fresh': 9.97, 'salt': 10.29}
910

1011
if __name__ == '__main__':
@@ -14,8 +15,7 @@
1415

1516
while not rospy.is_shutdown():
1617
try:
17-
conn = mavutil.mavlink_connection(
18-
device, write=False, autoreconnect=True)
18+
bridge = Bridge(device, write=False)
1919
except socket.error:
2020
rospy.logerr(
2121
'Failed to make mavlink connection to device {}'.format(
@@ -26,20 +26,12 @@
2626
if rospy.is_shutdown():
2727
sys.exit(-1)
2828

29-
while not rospy.is_shutdown():
30-
msg = conn.recv_match()
31-
if msg is not None:
32-
rospy.loginfo('Connected to device {}'.format(device))
33-
break
34-
else:
35-
rospy.sleep(1.0)
36-
if rospy.is_shutdown():
37-
sys.exit(-1)
29+
bridge.update()
3830

3931
depth_pub = rospy.Publisher('/bar30/depth/raw', Depth, queue_size=10)
4032
rate = rospy.Rate(100)
4133
while not rospy.is_shutdown():
42-
msg = conn.recv_match(type='SCALED_PRESSURE2')
34+
msg = bridge.get_msg(type='SCALED_PRESSURE2')
4335
if msg is not None:
4436
d = Depth()
4537
d.header.stamp = rospy.Time.now()

bluerov/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
<url type="repository">https://github.com/RobustFieldAutonomyLab/bluerov</url>
1313

1414
<buildtool_depend>catkin</buildtool_depend>
15+
<depend>python-catkin-tools</depend>
1516
</package>

bluerov_bridge/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99

1010
<buildtool_depend>catkin</buildtool_depend>
1111
<depend>rospy</depend>
12+
<depend>python-pymavlink</depend>
1213
</package>

bluerov_bridge/src/bluerov_bridge/bridge.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ def get_data(self):
2626
TYPE: Dict
2727
"""
2828
return self.data
29+
30+
def get_msg(self, type):
31+
""" Return msg
32+
33+
Returns:
34+
TYPE: Dict
35+
"""
36+
return self.conn.recv_match(type)
2937

3038
def get_all_msgs(self):
3139
""" Return all mavlink messages

bluerov_launch/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ cmake_minimum_required(VERSION 2.8.3)
22
project(bluerov_launch)
33

44
find_package(catkin REQUIRED COMPONENTS
5-
bar30_depth
6-
bluerov_control
7-
rti_dvl
8-
sonar_oculus
9-
imu_vn_100
105
)
116

127
catkin_package()

bluerov_launch/package.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@
1313
<depend>sonar_oculus</depend>
1414
<depend>rti_dvl</depend>
1515
<depend>imu_vn_100</depend>
16+
17+
<depend>socat</depend>
18+
<!-- <depend>python-MAVProxy</depend> -->
19+
<depend>python-pymavlink</depend>
20+
<depend>cv_bridge</depend>
1621
</package>

bluerov_launch/scripts/mavproxy.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@
55
# 14553 - control
66
# 14554 - dashboard
77

8+
if [ ! -f "/usr/local/bin/mavproxy.py" ]; then
9+
echo "MAVProxy not found..."
10+
echo "Install MAVProxy..."
11+
sudo pip install MAVProxy
12+
fi
13+
814
python /usr/local/bin/mavproxy.py --master=udp:192.168.2.1:14550 --out=udp:192.168.2.1:14551 --out=udp:192.168.2.1:14552 --out=udp:192.168.2.1:14553 --out=udp:192.168.2.1:14554 --speech

0 commit comments

Comments
 (0)