Sunday, December 29, 2019

Getting camera pose data from the Intel RealSense T265 in LabView using the .NET wrapper

The c++ dll uses a class called pipline to manage the streaming data from the RealSense T265.  After struggling with the instantiation of the c++ class, I decided to to use the c# wrapper.
LabView isn't perfect at handling .NET dll's, but the .NET wrapper of the realsense2.dll works.

First off, you have to create two constructor nodes.  They instantiate the classes pipeline and config.  Pipeline controls the stream of data, and config defines the type of data stream.  When connecting to the T265, the stream type in a 6 Degree Of Freedom (6DOF).

Once created, a while loop needs to execute to read the pose data frames.  The frames contain the camera's translation and rotation/orientation quaternion relative to the location and rotation when the pipeline was started.  Every time the pipeline starts the translation is reset back to 0,0,0 (x,y,z), and the quaternion is 1,0,0,0 (w,x,y,z or  w+xi+yj+zk ).

Inside the loop, the pipeline method WaitForFrames returns a FrameSet from the frame queue.
The frameSet contains the PoseFrame property.
The PoseFrame contains a PoseData property.
The PoseData contains the Translation, Rotation properties, as well as others.
Inside the while loop the pose frame and frameSet must be disposed.  If not, the frame queue will be full in only 16 frames.   

Block diagram of  realsense .net wrapper as used with the T265.

Front panel


The core c++ code that is called by the .net wrapper is below:



edit 20200302
Look at this post for more info on using the quaternions:
https://lowtechllcblog.blogspot.com/2020/02/intel-realsense-t265-quaternion.html

Thursday, December 5, 2019

A thought: Photons come from the nucleus not the electron shells.

For decades I've understood the source of a photon to be an electron dropping an orbit.
Just google " where do photons come from? "

There's a nice picture that shows an electron dropping one orbital shell, and a photon being emitted.

This is the typical understanding:
    A photon is produced whenever an electron in a higher-than-normal orbit falls back to its normal orbit. During the fall from high energy to normal energy, the electron emits a photon -- a packet of energy -- with very specific characteristics.
From HowStuffWorks.com

This explanation implies that the electrons are creating the photon.

When a photon is destroyed the electron moves up to an excited orbital shell.  That sounds like the photon's energy is absorbed by the electron.

However... electrons can "float freely" in a conductive material, or better yet in a stream like inside a CRT (Cathode Ray Tube).  You can't see them.  And more importantly, you can't shine light (photon) through the stream and have the electrons absorb the photons. The magnetic field created by the flow of electrons will also not alter the photons.

So electrons by themselves don't "absorb" the photon.  It takes an atom, a nucleus with electrons in orbit to eliminate a photon.  It makes more sense to me that the photon's energy is "absorbed" by the nucleus.  This extra energy "pushes" the electron away from the nucleus.

It's the nucleus that interacts with the photon, and the electron shell hopping is a byproduct.

------
What are the ramifications of this thought?

Semiconductors:  All diodes are Light Emitting Diodes.  The P-N junction emits photons.  The "Holes" in the P-channel are covalently bonded molecules that have space for electrons.  Pushing electrons through the junction allows them to fill valance shells.  The electrons will leave the valence shell of the N-channel.  ? Does the N-channel material give off a photon? Does the P-Channel receive a photon to allow the electron to exist in its valance shell?  Is the nucleus able to absorb photon even if it has no electrons?  I need to ponder this...

Wavelength: The wavelength of a photon is defined by the atom that emits it.  The wavelength is defined by the energy lost by the atom, allowing the electron to drop one or more shells.  The more shells dropped the more energy was emitted as a photon.  The wavelength is smaller as more energy is given off.  That is, an electron of a hydrogen atom dropping from shell 3 to shell 2 emits a 656 nm photon, but an electron dropping from shell 5 to shell 2 emits a 434 nm photon.  Note it isn't the electron just moving through space creating the wavelength. (If it were, a photon would be created by current flow directly.)  It is linked to the type of atom.
Each atom has its own emission spectra.
see: https://www.ifa.hawaii.edu/users/mendez/ASTRO110LAB11/spectralab.html

Cool poster, check out the source: www.fieldtestedsystems.com/ptable.


Transparency:  Is it the energy state of a nucleus that determines if a material is transparent?

 Charge:  Can this be tested; Does a nucleus charge change after a photon is emitted or absorbed?

-- update 20191224
This Physics Video By Eugene Khutoryansky shows the difference between electrons and photons in terms of the phase velocities.   Electrons are a sum of waves.  The shorter wave length parts of the sum have a faster phase velocity.  Photons are also the result of a sum of waves, but all of the phase velocities are the same.  Is this another part of the answer for how electrons and photons interact?  In some way the energy of the photon just stops contributing to the sum of waves that defines the electron.  But this still requires the nucleus for the interaction.  Maybe the nucleus performs a phase lock loop (PLL) action on the waves to cause a photon to come into existence.

-- update 20200108
What if every electron in the universe was all the same exact particle?  The linked article talks about how every electron is identical and indistinguishable.  It goes on to describe and debunk the "One Electron Universe".  I'm not advocating that there is only one electron in the universe, but I would like to explore the idea of positrons inside protons.  Maybe this is a mechanism for altering phase velocity.