1 2 Previous Next 18 Replies Latest reply on Apr 17, 2018 4:07 PM by MartyG

    Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)

    toshII

      hello all,

      i would like find a tutorial for beginner to use my D435 in vb.net or C#.
      i've  downloaded & install SDK 2.0 from  librealsense/distribution_windows.md at master · IntelRealSense/librealsense · GitHub (last release).

      i can use my camera with viewer downloaded, but when i want use by the Cs-tutorial-1-deph from wrappers directoy, i can't.

       

      in first, i've compiled  the LibrealsenseWrapper.dll in BIN\x64\DEBUG from the intel.Realsense.csproject.

      And i've found in the directory the copy (automatic) of realsense2.dll from (SDK)

       

      Now, when i open a tutorial project like CS-tutorial-1-deph, the project doesn't find reference of "Intel.Realsense".

      i try different method to resolve this :

      • delete this old reference (unknow Intel.Realsense) to add LibrealsenseWrapper.dll and realsense2.dll. But realsense2.dll can't be added because i've a message : "Please make sure that the file is accessible, and that is a valid assembly or COM component."
      • So i try to undersant why i can't insert this reference, and i try put it in system32 + regsvr32 => doesn't work
      • in project, i insert code in post build event : xcopy/y "$(ProgramFiles)\Intel Realsense SDK 2.0\bin\x64$(PlatformShortName)Realsense2.dll" "$Outdir)"

       

      i don't know how can i reference realsense2.dll in the project.

      i've no idea to continue...can you help me, please?

      thank's a lot.

        • 1. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
          MartyG

          Once you have obtained realsense2.dll by downloading the SDK 2.0, the next stage in the instructions is:

           

          "Next navigate to /wrappers/csharp and open Intel.RealSense.SDK.sln with Visual Studio.  Press Ctrl + Shift + B to build the solution."

           

          Have you done this, please?

          • 2. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
            toshII

            Thank you Marty to help me

             

            In first, it's possible we don't have same files downloaded because the in the directories wrappers/csharp/ (from librealsense-master i've found in Github), i' haven't got the file Intel.RealSense.SDK.sln.

            I've just a project file and not a solution project like you. Actualy with my files downloaded, i can just open the intel.Realsense.csproj and generate the lirealsenseWrapper with a copy (automatic) of realsense2.dll in bin/x64/Debug.

            Can you confirm me where you have find Intel.RealSense.SDK.sln ?

            i know just this link to access wrapper/csharp for Realsense D435 : GitHub - IntelRealSense/librealsense: Intel® RealSense™ SDK

            i hope it's just a problem of files.

            Thank's

             

            • 3. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
              toshII

              i've found another package librealsense-2.10.0.
              With this, i happy to find the same file .sln like you.

               

               

              I've build the solution and open tutorial 1 or 2, both projects have found all reference.
              But when i build, and debug that stop at lign 13: NativeMethods.rs2_keep_frame(m_instance.handle);

              with message in french : impossible de trouver le point d'entree 'rs2_keep_frame' dans la dll 'realsense2

               

              with my first package, i've also this error when i've replaced the Intel.Realsense (without reference) by the librealsenseWrapper.dll generated.

               

              have you an idea about?

              Thanks

              • 4. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                MartyG

                I had just written a guide to explain about how to find the file in the latest SDK version's source code package, but you got there first before I could post the message.  I'm just happy you found it. 

                 

                I don't know about those errors, so will have to do further research.

                • 5. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                  MartyG

                  The documentation says this about rs2_keep_frame:

                   

                  "This function can be used to preserve specific frame for longer processing.  Calling it signals the intention to not return this frame to the pool within next 100ms."

                   

                  The rs2_keep_frame was only added to the SDK a couple of versions ago.  So I would make sure that you are using the realsense2.dll from the latest SDK version to make sure that the rs2_keep_frames instruction is supported in the dll you are using.

                  1 of 1 people found this helpful
                  • 6. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                    toshII

                    Thank you really Marty

                    my version of SDK was dowloaded last month and a release is avalaible now.
                    Sorry for the derrangement, and 1000 merci
                    the Bird can fly itself now !

                    • 7. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                      MartyG

                      I was glad to be able to help.  Bonne chance! 

                      • 8. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                        VCS_5

                        Hi to everyone,

                         

                        I'm trying to build the c# wrapper from the GitHub c# wrapper project but with no success.

                        I get the following errors:

                        Severity Code Description Project File Line Suppression State
                        Error  The command "C:\Users\User_Lab\Desktop\Intel RealSense C#\librealsense\wrappers\csharp\\copy_dependencies.bat x64 Debug "C:\Users\User_Lab\Desktop\Intel RealSense C#\librealsense\wrappers\csharp\" "C:\Users\User_Lab\Desktop\Intel RealSense C#\librealsense\wrappers\csharp\bin\x64\Debug\"" exited with code 9009. Intel.RealSense   
                        

                        I already installed the most recent sdk (2.10.1). I've found the realsense2.dll.

                         

                        Any help?

                        Thanks

                        Vinícius

                        • 9. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                          MartyG

                          Your problem sounds similar to the user above who had trouble when they compiled x64/ debug.  The procedure I recommend following is:

                           

                          1.  Downloading the latest RealSense SDK to get RealSense2.dll.  You have already done this step.

                           

                          2.  Navigate to /wrappers/csharp and open Intel.RealSense.SDK.sln with Visual Studio.  Press Ctrl + Shift + B to build the solution.

                          • 10. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                            VCS_5

                            Hi,

                             

                            I did both steps but in the last one I can't build the project.

                            Severity Code Description Project File Line Suppression State
                            Error  The command "C:\Users\User_Lab\Desktop\Intel RealSense C#\librealsense\wrappers\csharp\\copy_dependencies.bat x64 Debug "C:\Users\User_Lab\Desktop\Intel RealSense C#\librealsense\wrappers\csharp\" "C:\Users\User_Lab\Desktop\Intel RealSense C#\librealsense\wrappers\csharp\bin\x64\Debug\"" exited with code 9009. Intel.RealSense   
                            
                            Severity Code Description Project File Line Suppression State
                            Error CS0006 Metadata file 'C:\Users\User_Lab\Desktop\Intel RealSense C#\librealsense\wrappers\csharp\bin\x64\Debug\LibrealsenseWrapper.dll' could not be found cs-tutorial-2-capture C:\Users\User_Lab\Desktop\Intel RealSense C#\librealsense\wrappers\csharp\cs-tutorial-2-capture\CSC 1 Active
                            
                            Severity Code Description Project File Line Suppression State
                            Error CS0006 Metadata file 'C:\Users\User_Lab\Desktop\Intel RealSense C#\librealsense\wrappers\csharp\bin\x64\Debug\LibrealsenseWrapper.dll' could not be found cs-tutorial-1-depth C:\Users\User_Lab\Desktop\Intel RealSense C#\librealsense\wrappers\csharp\cs-tutorial-1-depth\CSC 1 Active
                            

                             

                            Thanks,

                            Vinícius

                            • 11. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                              MartyG

                              The severity error is generated by Visual Studio, and Error 9009 means that a file's path cannot be found by Visual Studio.    The error can sometimes be caused by having a space somewhere in the path name.

                              • 12. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                                VCS_5

                                Hi,

                                 

                                I managed to build it.

                                I removed the following pre-build command that run the batch file.

                                Then I copied the realsense2.dll to the bin/x64/Debug folder.

                                Finally Ctrl+Shift+B command on VS.

                                 

                                Thanks,

                                Vinícius

                                • 13. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                                  MartyG

                                  Awesome news!  Thanks so much for the feedback in case others have a similar problem.  Have a great day! 

                                  • 14. Re: Cs-tutorial-1-deph from SKD 2.0 D435 (realsense2.dll)
                                    DvdZmd

                                    Hello, i can run successful the cs-tutorial-1-depth, but for the cs-tutorial-2-capture VS give me this exception

                                     

                                    Frame didn't arrived within 5000 rs2_pipeline_wait_for_frames

                                     

                                    Can anyone help me? Thanks

                                    1 2 Previous Next