How to control a physical robot using a web interface - ubuntu-18.04

I would like to know how I could control the movement of a physical robot using a web interface. For example, I have created a web interface with four movement buttons (front, back, left, right) but do not know how to connect that interface to the physical robot and control its movements. I have experience in controlling a simulated Turtlebot (in Gazebo) with the interface locally on my laptop using ROSBRIDGE and SimpleHTTPServer. Would I have to use these as well to control a physical robot?
I'm running ROS2 Crystal, Ubuntu 18.04. Thank you!

Yes, The interface to control a physical robot would be the same as simulation.
You will need to to publish control command to /cmd_vel topic and then you can subscribe to the topic to convert those velocity commands to actual motor commands.
You can also look into using Robot Web Tools for the web interface.
Additionally if you could provide more detiails about your setup I could give more information.

You can also use existing tools that allow you to quickly connect to your robot without having to build the communication infrastructure yourself. An example of that is Freedom Robotics platform that includes a variety of teleop tools for ROS.
You can find more information here (a post from their Head of Robotics) or try out for free.
I used this for a few of my personal projects and it saved me from all the hassle of creating the web interface and the API communication with ROS.

Related

Use DroneKit to build a Ground Control Station for Windows

On the DroneKit.io page, it mentions using DroneKit Python when creating Ground Control Stations for Windows. However, there appears to be no documentation for this.
Is it meant to simply simulate a com port and act as a proxy for other Ground Control Stations, which just makes it easier hijack the MAVLink?
Also, it mentions Python being used for low-latency processes. This seems to be oxymoronic. Is there a reason that it would be better than just using C/C++ for the purpose of hijacking the MAVLink?
Thanks!
DroneKit-Python can be used either to create a python-based ground station or it can be run on a companion computer. There is no practical difference between the two except how you set up the connection to the vehicle from the computer running the script. The different ways of starting MAVProxy for the different connections are covered in the Getting Started documentation.
The reason that there is no "specific" documentation on using DK-Python for GCS is primarily "marketing". The far bigger market for ground station GCS software is in tablets/phones that will use DK-Android or a future iOS port. DK-Python has been positioned solely as for use in the air interface. Even though there is no "specific" documentation, in fact all the existing documentation is relevant.
Is it meant to simply simulate a com port and act as a proxy for other Ground Control Stations, which just makes it easier hijack the MAVLink?
No. See above.
Also, it mentions Python being used for low-latency processes. This seems to be oxymoronic. Is there a reason that it would be better than just using C/C++ for the purpose of hijacking the MAVLink?
It doesn't mention low-latency processes, so the answer is "invalid question".
You're probably misreading the text "that require a low-latency link". The point here is that if you have dronekit-python running on a companion computer and connected by a fast link you can do real time handling of incoming sensor data. This allows computer vision control of the UAV. However if you run DK-Python on a ground control station you will have a much slower link. You can still control movement of the UAV but the latency will be much higher.
Hope that helps!

Connect via bluetooth to an android device without a custom application

I would like to use an arduino with a bluetooth module to modify the volume and skip songs on my phone.
All the information I found was about how to code an application that would communicate with a device via bluetooth, which isn't what I am looking for. I want to know what protocol I should follow to connect to an android device via bluetooth like a car radio would do.
My goal is to be able to use my device as a remote to control the built-in music application.
I think you are looking for the AVRCP protocol. Please send more info about your hardware so I can digg a better answer (if you need more, anyways...).

Do we need drivers for micro controller which has to communicate with mobile phones?

I am planning to build a micro controller (a switch will be attached to the embedded system which contains this micro controller) and this embedded system will be connected through a wire to mobile phone. My objective is to dial a particular number through the connected mobile phone network when the user presses the switch on the embedded system. ( planning to use AT commands for dialing). After extensive search, I have found that it is possible to do this above task. Some of the questions I have on this :
a) Do we have to install any drivers on the micro controller to communicate with mobile phone (for sending AT commands) i.e., is it sufficient if we simply code the related AT commands in the micro-controller (in C++) ?
b) Many people were using F-bus protocol for this above objective. Is there any other general protocol similar to this which can help for communicating with all mobiles (samsung,nokia,sony..)
I have read extensively in SO also. But, I have not found any question regarding the drivers. I would appreciate any kind of help
Thanks
A driver is nothing more than a software that allows your system to interact other devices, and is usually associated with Operating Systems (the driver might provide an abstraction layer for your communication). Do you plan to use an Operating System at all?
In any case, it is quite obvious that if you want to communicate to another device you need the software to do so. The question is if you write it your self or if you get an "off the shelf" solution.
In many cases, particularly when a device uses a proprietary communication protocol, you have no option but to get a driver to communicate with it, and that most likely will require you to have an Operating System.
If cellular communication is all you need, there are MUCH easier solutions available (particularly if you intend of turning your project into a product). Search for "embedded modems" or M2M solutions. There are lots of available modems to which you connect using RS232, and can send the AT commands directly. Telit and Multitech are two providers I've worked with and are really easy to interface with.

Connect to digital camera from cellphone?

A customer (photographer) asked me, if it was possible to write some kind of software for cellphones, so he could physically connect it to his professional digital camera (Canon or Nikon) and transfer the pictures (or a subset) to the cellphone.
I am trying not to put constraints on cellphone platform (Symbian, Windows Mobile etc) from the beginning, so I am leaving that sort of constraints out on purpose.
Can anybody give me some hints?
You need a connection between the camera and the cellphone:
Some windows mobile devices got a USB-Host-Function, so you can connect either a cardreader or the camera itself via a usb-cable and read the files from the device. I never heard of a symbian-device which supports usb-host, but there might be some.
If the camera supports either bluetooth or ir, you could use these protocols to transfer the files as most mobile-phonse support this.
If you got a connection (and the protocol-support by your platform) it is easy to write a application to transfer the file from the device to you cellphone. You can write this application in any supported language (java for j2me, python (symbian), .net (windows mobile)
My digital camera saves photos to a memory card. I can simply take the memory card out of the camera and insert it into my Windows Mobile phone and view the photos on the phone.

What are some ways to control a device through an IP address?

I want to get some ideas on how I might control a video camera through an IP address. I have an API to control pan and tilt from a local machine. The code is going to be in C/C++ on Windows. I am still designing if I want multiple cameras controlled from one application or have a one camera to one application. Would SOA be a useful architecture to structure my messaging?
I think you could be well served by something like REST for a task like this. Executing a command towards a REST server is really intuitive and simple, which sounds just like what you need. I'd probably make some kind of application that would be running inside a web-server, since this would handle most of the infrastructure, including authentication if needed. I'm sure both apache and IIS could do this for you quite easily. Even though your API is coded in C you could also consider using some higher-level scripting language as a client to the API (inside the web server).
SOA sounds a little overkill for a task like this.
I did something similar for aproject in my university. What we had was the cameras connected to a LAN and with message passing was very easy to communicate with them, is the same that communicate with any PC. We had the same application to communicate them. You can use SOA or any architecture you consider convinient, that depens on your application.
For our case was just an ad hoc architecture, it was not a complex thing.
Hessian is nice. It is basically REST, but has a binary protocol which is more efficient than XML and it also lets you make calls from other languages quite easily. So, you could develop the client GUI applciation in C# and the server in C. There are free libraries for a few different languages available.
http://hessian.caucho.com/

Resources