瀏覽代碼

update gitignore

rparedis 3 年之前
父節點
當前提交
c1f4743ec3

+ 8 - 0
.gitignore

@@ -0,0 +1,8 @@
+/Vortex/
+/pythonDDS/
+/ROS/
+/dds-for-unity/
+*/__pycache__/
+*.unitypackage
+/ros2-windows/
+/.vs/

+ 7 - 1
ROS/linerobot/src/depthimage_view/scripts/depthimage_viewer.py

@@ -8,15 +8,18 @@ import numpy as np
 class ImageSubscriber(Node):
   def __init__(self):
     super().__init__('depthimage_subscriber')
+    print("sub")
     self.subscription = self.create_subscription(
       Image, 
       'depth_image', 
       self.listener_callback, 
       10)
     self.subscription # prevent unused variable warning
+    print("bridge")
     self.br = CvBridge()
 
   def listener_callback(self, data):
+    print("callback")
     # Convert ROS Image message to OpenCV image
     current_frame = self.br.imgmsg_to_cv2(data) #np.ndarray
    	#minVal, maxVal, min_loc, max_loc = cv2.minMaxLoc(current_frame)
@@ -36,10 +39,13 @@ class ImageSubscriber(Node):
 
   
 def main(args=None):
-  
+  print("init")
   rclpy.init(args=args)
+  print("subscribe")
   image_subscriber = ImageSubscriber()
+  print("spinning")
   rclpy.spin(image_subscriber)
+  print("teardown")
   image_subscriber.destroy_node()
   rclpy.shutdown()
   

+ 14 - 0
info.txt

@@ -0,0 +1,14 @@
+When installing ROS2, multicast needs to be opened as well:
+
+> sudo ufw allow in proto udp to 224.0.0.0/4
+> sudo ufw allow in proto udp from 224.0.0.0/4
+
+In /etc/ufw/before.rules, add (before the COMMIT):
+
+# allow IGMP
+-A ufw-before-input -p igmp -d 224.0.0.0/4 -j ACCEPT
+-A ufw-before-output -p igmp -d 224.0.0.0/4 -j ACCEPT
+
+NOTE:
+Disable Ubuntu firewall and it works!
+-> check which port the packages enter from

+ 0 - 57
ospl_vm.xml

@@ -1,57 +0,0 @@
-<OpenSplice>
-    <Domain>
-        <Name>ospl_sp_ddsi</Name>
-        <Id>0</Id>
-        <SingleProcess>true</SingleProcess>
-        <Description>Stand-alone 'single-process' deployment and standard DDSI networking.</Description>
-        <Service name="ddsi2">
-            <Command>ddsi2</Command>
-        </Service>
-        <Service enabled="false" name="durability">
-            <Command>durability</Command>
-        </Service>
-        <Service enabled="false" name="cmsoap">
-            <Command>cmsoap</Command>
-        </Service>
-    </Domain>
-    <DDSI2Service name="ddsi2">
-        <General>
-            <NetworkInterfaceAddress>192.168.0.17</NetworkInterfaceAddress><!-- VERANDERD, met alleen SPIN netwerk zou 192.168.0.100 (deze laptop) moeten werken -->
-            <AllowMulticast>spdp</AllowMulticast>
-           <EnableMulticastLoopback>true</EnableMulticastLoopback>
-            <CoexistWithNativeNetworking>false</CoexistWithNativeNetworking>
-			<FragmentSize>64000B</FragmentSize> 
-		</General>
-        <Compatibility>
-            <!-- see the release notes and/or the OpenSplice configurator on DDSI interoperability -->
-            <StandardsConformance>lax</StandardsConformance>
-            <!-- the following one is necessary only for TwinOaks CoreDX DDS compatibility -->
-            <!-- <ExplicitlyPublishQosSetToDefault>true</ExplicitlyPublishQosSetToDefault> -->
-        </Compatibility>
-    </DDSI2Service>
-    <DurabilityService name="durability">
-        <Network>
-            <Alignment>
-                <TimeAlignment>false</TimeAlignment>
-                <RequestCombinePeriod>
-                    <Initial>2.5</Initial>
-                    <Operational>0.1</Operational>
-                </RequestCombinePeriod>
-            </Alignment>
-            <WaitForAttachment maxWaitCount="100">
-                <ServiceName>ddsi2</ServiceName>
-            </WaitForAttachment>
-        </Network>
-        <NameSpaces>
-            <NameSpace name="defaultNamespace">
-                <Partition>*</Partition>
-            </NameSpace>
-            <Policy alignee="Initial" aligner="true" durability="Durable" nameSpace="defaultNamespace"/>
-        </NameSpaces>
-    </DurabilityService>
-    <TunerService name="cmsoap">
-        <Server>
-            <PortNr>Auto</PortNr>
-        </Server>
-    </TunerService>
-</OpenSplice>

二進制
pythonDDS/idlpython/builtin_interfaces/Time_/__pycache__/__init__.cpython-36.pyc


文件差異過大導致無法顯示
+ 213 - 3868
pythonDDS/ospl-info.log


+ 9 - 3
pythonDDS/start_read_colorsensor.bat

@@ -1,11 +1,17 @@
 @echo off
+REM echo Disabling Fast RTPS ..
+REM set FASTRTPS_DEFAULT_PROFILES_FILE=C:\Users\randy\Documents\git\linerobot\ROS\linerobot\src\depthimage_view\scripts\DEFAULT_FASTRTPS_PROFILES.xml
+REM set SKIP_DEFAULT_XML=1
 echo Setting paths for Vortex OpenSplice ..
 if "%SPLICE_ORB%"=="" set SPLICE_ORB=DDS_OpenFusion_1_6_1
-set OSPL_HOME=D:\HDE\x86_64.win64
-set PATH=%OSPL_HOME%\bin;%OSPL_HOME%\lib;%OSPL_HOME%\examples\lib;%PATH%
+set OSPL_HOME=C:/Users/randy/Documents/git/linerobot/Vortex/HDE/x86_64.win64
+set PATH=%OSPL_HOME%\bin;%OSPL_HOME%\lib;%OSPL_HOME%\examples;%PATH%
 set OSPL_TMPL_PATH=%OSPL_HOME%\etc\idlpp
 if "%OSPL_URI%"=="" set OSPL_URI=file://%OSPL_HOME%\etc\config\ospl_sp_ddsi_1gbps.xml
-python "read_colorsensor.py"
+echo Starting Python ..
+REM %OSPL_HOME%\tools\python\src\dist;%OSPL_HOME%\tools\python;%OSPL_HOME%\bin;
+set PYTHONPATH=%OSPL_HOME%\tools\python\src\dist\dds-6.9.181127OSS-py3.7-win-amd64.egg;%PYTHONPATH%
+py -3.7 "read_colorsensor.py"
 
 
 

+ 8 - 3
pythonDDS/start_read_image.bat

@@ -1,11 +1,16 @@
 @echo off
+echo Disabling Fast RTPS ..
+set FASTRTPS_DEFAULT_PROFILES_FILE=C:\Users\randy\Documents\git\linerobot\ROS\linerobot\src\depthimage_view\scripts\DEFAULT_FASTRTPS_PROFILES.xml
+set SKIP_DEFAULT_XML=1
 echo Setting paths for Vortex OpenSplice ..
 if "%SPLICE_ORB%"=="" set SPLICE_ORB=DDS_OpenFusion_1_6_1
-set OSPL_HOME=D:\HDE\x86_64.win64
+set OSPL_HOME=C:/Users/randy/Documents/git/linerobot/Vortex/HDE/x86_64.win64
 set PATH=%OSPL_HOME%\bin;%OSPL_HOME%\lib;%OSPL_HOME%\examples\lib;%PATH%
 set OSPL_TMPL_PATH=%OSPL_HOME%\etc\idlpp
-if "%OSPL_URI%"=="" set OSPL_URI=file://%OSPL_HOME%\etc\config\ospl_sp_ddsi_1gbps.xml
-python "read_depthimage.py"
+if "%OSPL_URI%"=="" set OSPL_URI=file://%OSPL_HOME%\etc\config\ospl.xml
+echo Starting Python ..
+set PYTHONPATH=%OSPL_HOME%\tools\python\src\dist\dds-6.9.181127OSS-py3.7-win-amd64.egg;.\idlpython;%PYTHONPATH%
+py -3.7 "read_depthimage.py"
 
 
 

+ 8 - 0
server.py

@@ -0,0 +1,8 @@
+import socket
+port = 7500
+s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+s.bind(("", port))
+print("waiting on port:", port)
+while True:
+	data, addr = s.recvfrom(1024)
+	print(data)