Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal instruction(core dumped) error on Jetson Nano #5

Open
fghoussen opened this issue Dec 4, 2021 · 2 comments
Open

Illegal instruction(core dumped) error on Jetson Nano #5

fghoussen opened this issue Dec 4, 2021 · 2 comments

Comments

@fghoussen
Copy link
Contributor

fghoussen commented Dec 4, 2021

https://stackoverflow.com/questions/65631801/illegal-instructioncore-dumped-error-on-jetson-nano

https://forums.developer.nvidia.com/t/illegal-instruction-core-dumped-xavier/166278

numpy/numpy#18131 => Probléme spécifique sur ARM ?

OPENBLAS_CORETYPE=ARMV8 python3

@goldo31337
Copy link
Member

diff --git a/aruco_detection/cameraCalibration.py b/aruco_detection/cameraCalibration.py
index aec9d1e..8db433f 100644
--- a/aruco_detection/cameraCalibration.py
+++ b/aruco_detection/cameraCalibration.py
@@ -4,6 +4,8 @@ import sys
 import cv2
 import numpy as np
 import h5py
+import jetson.utils
+
 
 def calibrateCamera(obj, img, gray):
     # Camera calibration.
@@ -56,9 +58,25 @@ def cmdLineArgs():
 
     return args
 
+def gstreamerPipeline (capture_width=1280, capture_height=720, display_width=640, display_height=360, framerate=60, flip_method=0) :
+    return ('nvarguscamerasrc ! '
+    'video/x-raw(memory:NVMM), '
+    'width=(int)%d, height=(int)%d, '
+    'format=(string)NV12, framerate=(fraction)%d/1 ! '
+    'nvvidconv flip-method=%d ! '
+    'video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! '
+    'videoconvert ! '
+    'video/x-raw, format=(string)BGR ! appsink'  % (capture_width,capture_height,framerate,flip_method,display_width,display_height))
+
 def captureFrames(args):
-    # Get a video capture stream.
-    vid = cv2.VideoCapture(args.video)
+    # FIXME : DEBUG
+    # create video source & output
+    jetson_input = jetson.utils.videoSource("csi://0", "")
+    #output = jetson.utils.videoOutput("", "")
+
+    # FIXME : DEBUG
+    ## Get a video capture stream.
+    #vid = cv2.VideoCapture(gstreamerPipeline(flip_method=0), cv2.CAP_GSTREAMER)
 
     # Capture frames.
     print('Capturing frames... [c capture, q quit]')
@@ -71,7 +89,13 @@ def captureFrames(args):
         if info:
             print('  Capturing frame %s...' % len(frames))
             info = False
-        _, frame = vid.read()
+        # FIXME : DEBUG
+        #_, frame = vid.read()
+        rgb_img = jetson_input.Capture()
+        #output.Render(rgb_img)
+        bgr_img = jetson.utils.cudaAllocMapped(width=rgb_img.width,height=rgb_img.height,format='bgr8')
+        jetson.utils.cudaConvertColor(rgb_img, bgr_img)
+        frame = jetson.utils.cudaToNumpy(bgr_img)
 
         # Display the resulting frame.
@@ -93,8 +117,9 @@ def captureFrames(args):
         if key == ord('q'):
             break
 
-    # After the loop release the cap object.
-    vid.release()
+    # FIXME : DEBUG
+    ## After the loop release the cap object.
+    #vid.release()
     cv2.destroyAllWindows()
 
     return obj, img, gray


@goldo31337
Copy link
Member

Pour memoire (alias statique pour intf ethernet):

ifconfig eth0:1 192.168.0.42/24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants