Repository navigation
Expand file tree
/
Copy pathdds_bashrc
More file actions
94 lines (81 loc) · 2.58 KB
/
Copy pathdds_bashrc
File metadata and controls
94 lines (81 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# # # # # # # # # # # # # # # #
# Start of ADLINK DDS Setting #
# # # # # # # # # # # # # # # #
# You can bring the following argument while source.
# 0: Show Menu
# 1: Eclipse Cyclone DDS
# 2: OpenSplice
# 3: FastRTPS
if [ "$1" '==' "0" ]; then
# clear DDS env var #
unset dds_vendor
else
dds_vendor=$1
fi
function check_dds_installation()
{
if [ $(ros2 pkg list | grep $1) ];
then
echo "Source $2 successfully!"
else
pkg_name="ros-$ROS_DISTRO-`echo $1 | sed 's/_/-/g'`"
echo "You need to install $pkg_name first."
echo "Installation command: sudo apt install $pkg_name"
fi
}
# Prompt DDS Menu #
if [ -z $dds_vendor ]; then
echo "**** Choose DDS you want to use ****"
echo "1) Eclipse Cyclone DDS"
echo "2) OpenSplice CE"
echo "3) FastRTPS"
echo -n "Please choose an option 1-3: "
read dds_vendor
fi
if [ "$dds_vendor" '==' "1" ]; # Cyclone DDS
then
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
check_dds_installation "rmw_cyclonedds_cpp" "Eclipse Cyclone DDS"
elif [ "$dds_vendor" '==' "2" ]; # OpenSplice CE
then
export RMW_IMPLEMENTATION=rmw_opensplice_cpp
check_dds_installation "rmw_opensplice_cpp" "OpenSplice"
elif [ "$dds_vendor" '==' "3" ]; # FastRTPS
then
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
check_dds_installation "rmw_fastrtps_cpp" "FastRTPS"
fi
# Setup the config file of Cyclone DDS
function cyclone_config()
{
if [[ ! -f $PWD/cyclonedds.xml ]]; then
echo "There is no cyclonedds.xml, so we create one."
cat > $PWD/cyclonedds.xml << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
<Domain id="any">
<General>
<NetworkInterfaceAddress>auto</NetworkInterfaceAddress>
<AllowMulticast>default</AllowMulticast>
<MaxMessageSize>65500B</MaxMessageSize>
<FragmentSize>4000B</FragmentSize>
</General>
<Internal>
<Watermarks>
<WhcHigh>500kB</WhcHigh>
</Watermarks>
</Internal>
<Tracing>
<Verbosity>config</Verbosity>
<OutputFile>stdout</OutputFile>
</Tracing>
</Domain>
</CycloneDDS>
EOF
fi
export CYCLONEDDS_URI=file://$PWD/cyclonedds.xml
echo "CYCLONEDDS_URI=$CYCLONEDDS_URI"
}
# # # # # # # # # # # # # # # #
# END of ADLINK DDS Settings #
# # # # # # # # # # # # # # # #