Safety in controlling the drone dji m100 with raspberry and ROS - ros

I have a question regarding the safety of the raspberry usage to control the drone m100.
I wrote a simple program in c++ for the takeoff and landing of the drone m100. I want to execute this program on the real drone using ROS. Therefore I put this program on the raspberry (along with the dji libraries) and via ssh i can execute it and control the drone. But if someone goes wrong during the execution, can the user regain the control of the drone using the remote controller?

In our experience, if something goes wrong, you should be able to move the switch on the controller to 'P' and get control of the drone.

Related

ROS Bridge Server

I am an intern in charge of improving the gazebo simulation for my internship. Currently, I managed to successfully drive my virtual buggy in the gazebo world smoothly as shown in the video link.
https://youtu.be/uS5PXshZZTU
Right now, I am tasked by my supervisor to connect my virtual buggy's movements to the movement of the real buggy that we have, so for example, when the real buggy moves 1 metre, the virtual buggy also moves 1 metre in its virtual world. I was told to use ROS Bridge Server to do this task but I do not have an idea on how to start this task at all. So I would appreciate it if someone who is knowledgable in this area help me out.
Mostly, it is really simple to change from simulation to real world application. The most ROS driver for robots have the roslaunch flag simulation and setting it on false causes ROS to launch the real controllers to.
I do not know if you created your gazebo package from scratch but if not there must be a possibility to launch the launch file with a sim:=false flag. Look into thr rviz support and in the demo.launch file.

Is it possible to access a Chromebook via ssh through USB?

My employer has asked me to prepare for testing several thousand Chromebooks (mix of models/manufacturers) to refurb/flip. This may be a recurring thing.
Most or all of these will be old enough that CCD will not be available. I'd like to connect a widget such as a Raspberry Pi to the USB and have it automate testing as much as possible.
I know I can use keyboard emulation to inject commands, but I'd like to get a crosh session running over USB so that I can read info from the DUT besides just controlling it.
Google shows bazillions of returns about using a Chromebook as an ssh terminal but what I'm looking for is the opposite. I'm prepared for the answer to be a simple "no" but I'm concerned because I can't find that anyone else has asked this question. I don't think I'm that creative, so I suspect my Goog-fu is weak.
The answer appears to be "no". However I solved it another way; using "gadget mode" I have a Raspberry Pi ZW enumerate as a keyboard and a serial port. I put the Chromebook into Developer mode, open a developer shell with ctrl/alt/F2, or on a PC/linux or Mac system open a terminal window and type "sudo su" (these have to be done manually). Then I have the RPi issue this bash command to identify the serial port "in the blind":
SERPORT=/dev/serial/by-id/$(ls /dev/serial/by-id) # Chromebook or PC/linux
(or)
SERPORT=$(ls /dev/cu.usbmodem*) # Mac
Now I can have the RPi inject commands via the keyboard, put ">$SERPORT" on the end of each command, and the output comes in the RPi gadget serial port. The RPi then packages the data and forwards it over WiFi to our CRM. It's working nicely for Chromebooks, PCs booted into linux, Mac desktops and Macbooks.
Edit:
The company I work for has actually turned this into a product and so I'm not sure how much detail I should share, but...
I learned my way around gadget mode on the RPi from this link. There are examples for setting up a keyboard and a serial port. Using the templates in that link, I made a device called /dev/hidg0 which emits keyboard scancodes from the RPi to the Chromebook. I also made a device called /dev/ttyGS0 which the Chromebook sees as a serial port.
So I send keystrokes with some python like:
with open("/dev/hidg0","bw") as hid:
hid.write(blah)
and then have the Chromebook send text to the serial port, which I then read by looking at /dev/ttyGS0
Hopefully this will be enough to get you started. I found the isticktoit link very helpful.

Working with PiCAN + raspberry pi 3 running windows IoT Core

I want to connect the PiCAN with my raspberry pi3 running windows IoT Core. I think I need a universal driver for the mcp2515 to work with the windows in Pi. I already tried using the instructions given in https://developer.microsoft.com/en-us/windows/iot/docs/driverdeployment to deploy the driver given in https://github.com/AustinWise/Mcp2515Can . But I got stuck in the instructions. I hope someone has already done this and maybe can help me with it? Did anyone successfully use this CAN board with Raspberry Pi (windows iot core)?
Thank you :)
Is a driver required in the first place?
Short answer is No.
Although a device driver is preferred, such work is not officially or community done yet.
The benefit you get from developing a device driver might include:
Native OS support for PiCAN board.
Create your create the custom IoT image, and deploy it to Microsoft store.
Possible performance improvements
others…
However, in order to develop an device driver, you need to follow the WDK framework. If you are comfortable with picking up new stuff, go ahead and try it out. You might need to refer to the linux source driver code for WDK driver developing.
If your purpose is to get the board working, you don’t need to get yourself into all these troubles.
In fact, you only need to get the SPI controller and GPIO controller, open the SPI device and initialize GPIO interrupt pin like Mcp2515Can does.
But, even after enabling the SPI, I couldn't receive anything on the
Raspberry Pi.
First, you can use Raspbian and turn on the CAN driver support to verify that you got all the wirings right. Here is the user guide you can reference.
If you can rule out the possibility of hardware failures, step into your C# code to troubleshoot the software.
Good luck.

Windows 10 IoT - Raspberry pi 2

I have to build a rover which has a camera on it and through webcam samples i am able to view the preview of it. I also came up with another app with has controls for the rover's motors. It works fine when i connect this device to a monitor and work with it, but for my purpose it needs to be headless. Is there any way i could remotely access the application. I am stuck up with so many different solutions like duplicating the entire project as webpage or could open the same application is the development machine that they communicate with each other. All i have to do is remotely control the rover with a video preview and even lower fps is acceptable.
There are a lot of ways to do this. (As #BerndGit implies.)
The easiest (IMHO) is to SSH in to the RPi from another computer and forward X11. That second computer will need to be configured for accepting X11 sessions.
Look for "SSH X11 Display Forwarding" for details on how to make this work on your setup.

How can I control the arduino interface using lua

I have an arduino galileo board, which I'm running using Intel's image on a micro-sd card.
I already manage to run basic Lua scripts on it.
I want to run a Lua script on the board (Intel's image) and interact with the arduino interface - for example be able to turn on a led or read sensor data. This is very simple to do when using sketch directly, where you have straight forward API to turn on specific pin that is connected to a led. Same goes for reading input from a pin (check if sensor is sending data).
Is there a Lua library that has such access to the pins? or should I somehow connect the Lua script to the Arduino API?
The script will already run on the board.
Thanks.
what you want to do is similar to the Firmdata; it is a processing and arduino sketch that will use arduino as a mere "executor" of a pseudo language over serial.
That means many arduino command are mapped to a specific serial command, for example 'aX' may means do a digitalRead, where X is the pin number, 'bX' do an analogRead and so, obviusly arduino will then send back the reading to your host.
Drawback are that you are limited by serial (or any other bus) throughput. That means, if you want to just fast-prototipe something, it it a good solution, but when you need to code time-sensistive (or specialized) code, then you need to create your own function, called by your own command, witch probabily as a custom response.. pratically you are writing a custom program, and the ardiuno (and LUA) sketch become a mere string parser.
On galileo, the arduino is connected by serial port, as it is needed for sketch upload, so as long as LUA give you some library to manipulate serial port, you are good to go for this solution.

Resources