How to transfer realsense data via ROS to other Device(s) - c++

I want to make the program under
" catkin_ws/src/realsense-ros-3.2.13/realsense2_camera "
directory from the "ros wrapper site" transfer realsense data to other devices.
I've chosen to use ".cpp file" since I've already made the program which uses C++ and realsense camera.
I want to know the relationships of the files inside " realsense2_camera/src " directory
and how and where the executable files appears after catkin_make etc., because I want to remodel that file(s),if it's able to transfer the realsense data to other Devices to do it.
I think it's related with roscpp_tutorials, rospy_tutorials and beginner_tutorials' Publisher and Subscriber Programs and I was able to make Publisher and Subscriber Programs communicating with different Devices, though I don't know about the theory of why they run. (how and where the executable files appears)
Environment
Device OS: ubuntu 18.04
Device HW: Jetson nano
rosdistro: melodic
python: Python 2.7.17
Realsense ROS Wrapper: 2.2.13
Realsense Viewer Version: 2.34.0
Camera: D435
D435 Firmware: 5.12.03.00

Thank you for your information.
I've been wandering why I couldn't get the D435's Data, but I solved it.
Starting "realsense-viewer" when "roslaunch" the ".launch file" and restarting the "Terminal" SEVERAL TIME can make "default .launch file" launch, so re-writing the "launch file" might be able to move the C++/Python file(s).
And I think your " include 'ing method" will make the problem simple to solve.

Related

Adding opengl to core-image-base in yocto

I am trying create a basic linux image with OpenGL support for a rpi3. I have succesfully created a bootable image and the sdk, but it doesn't contains OpenGL.
I have run
bitbake core-image-base
with the following changes/additions conf/local.conf without success.
MACHINE ??= "raspberrypi3
...
IMAGE_FEATURES += "ssh-server-dropbear"
MACHINE_FEATURES_append=" vc4graphics"
DISTRO_FEATURES_append = " opengl"
It correctly adds the ssh server, but when I log into the flashed rpi, I can't find any opengl libraries.
What is the correct way to add OpenGL to the image?

Arduino Makefile: How to save sensor data to file in the computer?

I am using a command-line interface package called Arduino Makefile on Linux. I set up a sensor on Arduino Uno to print temperature and humidity data to an LCD.
I have already searched for possible solutions such as Save to CSV file from Arduino, which has code that is repeated on different websites and forums such as researchgate.
I tried using their code. However, the code line:
import processing.serial.*;
gives me the error:
thermo.ino:3:1: error: ‘import’ does not name a type
import processing.serial.*;
^
How would this error be solved? Or is there another way to save the sensor data into a file stored in my computer?
By the way, my computer is directly connected to the Arduino Uno using a USB cable.
The problem is that you are running that code in the Arduino IDE but you have to run it in the Processing IDE.
Download processing from here.
Then download the libraries for Processing here.
Unzip the library and copy the "Arduino" folder into the "libraries" sub-folder of your Processing Sketchbook. In my case "C:\Users\Ricardo\Documents\Processing\libraries".
Now execute the first code that you get from the tutorial that you mentioned before in the Arduino IDE. Execute the second code from that page in the Processing IDE.
That should work!
Note:
This link is pretty useful

x11vnc on embedded raspberry QT5 app

I need to start a VNC server (x11vnc) in my Raspberry pi 3. It's running without X-server (Raspbian Lite). My app (C++ QT 5) writes directly to Linux framebuffer.
Following to some instructions in Qt creator forum, I've done some progress.
At this moment I can start a x11vnc server, connect to Raspberry via a regular VNC client and use my app with mouse and keyboard.
YES, IT'S WORKING.
BUT... If I change the Raspberry resolution (raspi-config) to something different from 1280x720, I don't know why, I can't see the screen perfectly. The VNC client shows a distorted display, like the image bellow.
(And, unfortunately I can't set a fixed resolution)
This is my actual settings to start x11vnc:
x11vnc -permitfiletransfer -nopw -rawfb +/dev/fb0 -forever -noxrecord -noxfixes -noxdamage -xrandr -bg -shared -pipeinput UINPUT:accel=0.7,reset=0 -cursor none -nodragging
I already tried to start with -clip 1280x720+0+0, -geometry 1280x720 and -scale 1280x720, (with other values too) but had the same problem. =/
And I start my application like this:
my-app -platform linuxfb
Both are started with root user.
If someone have an idea of how to fix this, please tell me know! Thanks!

How to flash stm32 using only Linux terminal?

So, threre are Archlinux distro, stm32 mc, and C code. How to flash stm32, without some IDE, only using console?
With Texane stlink
Install as described in the README
Convert your firmware to .bin if necessary
arm-none-eabi-objcopy -O binary firmware.elf firmware.bin
/opt/stlink/st-flash write firmware.bin 0x8000000
With OpenOCD, if your board is not supported by Texane
Get it from the link above and install (ignore the eclipse-specific parts)
Find your board description file in openocd/scripts/board, create one if necessary.
openocd -d0 -f board/yourboard.cfg -c "init;targets;halt;flash write_image erase firmware.hex;shutdown"
If you have USB to UART adapter, you can use stm32flash. Basically connect USART1 to the adapter, pull BOOT0 to high (there might be a jumper or button on the board) and power up / reset the board. Then you should be able to follow stm32flash -h to see what to do.
Some STM32 (e.g. STM32F042) has USB DFU bootloader built in, so you can also connect the MCU to USB directly and use dfu-utils.

Compiling on Vortex86: "Illegal instruction"

I'm using an embedded PC which has a Vortex86-SG CPU, Ubuntu 10.04 w/ kernel 2.6.34.10-vortex86-sg. Unfortunately we can't compile a new kernel, cause we don't have any source code, not even drivers or patches.
I have to run a small project written in C++ with OpenFrameworks. The framework compiles right each script in of_v0071_linux_release/scripts/linux/ubuntu/install_*.sh.
I noticed that in order to compile against Vortex86/Ubuntu 10.04, the following options must be added in every config.make file:
USER_CFLAGS = -march=i486
USER_LDFLAGS = -lGLEW
In effects, it compiles without errors, but the generated binary doesn't start at all:
root#jb:~/openframeworks/of_v0071_linux_release/apps/myApps/emptyExample/bin# ./emptyExample
Illegal instruction
root#jb:~/openframeworks/of_v0071_linux_release/apps/myApps/emptyExample/bin# echo $?
132
Strace last lines:
munmap(0xb77c3000, 4096) = 0
rt_sigprocmask(SIG_BLOCK, [PIPE], NULL, 8) = 0
--- SIGILL (Illegal instruction) # 0 (0) ---
+++ killed by SIGILL +++
Illegal instruction
root#jb:~/openframeworks/of_v0071_linux_release/apps/myApps/emptyExample/bin#
Any idea to solve this problem?
I know I am a bit late on this but I recently had my own issues trying to compile the kernel for the vortex86dx. I finally was able to build the kernel as well. Use these steps at your own risk as I am not a Linux guru and some settings you may have to change to your own preference/hardware:
Download and use a Linux distribution that runs on a similar kernel version that you plan on compiling. Since I will be compiling Linux 2.6.34.14, I downloaded and installed Debian 6 on virtual box with adequate ram and processor allocations. You could potentially compile on the Vortex86DX itself, but that would likely take forever.
Made sure I hade decencies: #apt-get install ncurses-dev kernel-package
Download kernel from kernel.org (I grabbed Linux-2.6.34.14.tar.xz). Extract files from package.
Grab Config file from dmp ftp site: ftp://vxmx:gc301#ftp.dmp.com.tw/Linux/Source/config-2.6.34-vortex86-sg-r1.zip. Please note vxmx user name. Copy the config file to freshly extracted Linux source folder.
Grab Patch and at ftp://vxdx:gc301#ftp.dmp.com.tw/Driver/Linux/config%26patch/patch-2.6.34-hda.zip. Please note vxdx user name. Copy to kernel source folder.
Patch Kernel: #patch -p1 < patchfilename
configure kernel with #make menuconfig
Load Alternate Configuration File
Enable generic x86 support
Enable Math Emulation
I disabled generic IDE support because I will using legacy mode(selectable in bios)
Under Device Drivers -> Ethernet (10 or 100Mbit) -> Make sure RDC R6040 Fast Ethernet Adapter Support is selected
USB support -> Select Support for Host-side USB, EHCI HCD (USB 2.0) support, OHCI HCD support
safe config as .config
check serial ports: edit .config manually make sure CONFIG_SERIAL_8250_NR_UARTS = 4 (or more if you have additional), CONFIG_SERIAL_8250_RUNTIME_UARTS = 4(or more if you have additional). If you are to use more that 4 serial ports make use config_serail_8250_MANY_PORTs is set.
compile kernel headers and source: #make-kpkg --initrd kernel_image kernel_source kernel_headers modules_image