First Person View (new)
We also develop a FPV platform to improve user experience
Last updated
We also develop a FPV platform to improve user experience
Last updated
The Swarm in Blocks 2.0 FPV version it's entirely built on web using roslibjs
to interface the web content with ROS environment, as opposed to the 1.0 (2022) version, that was built using python wx
interface module. However, the older version is still there in case you want to check it out.
The development of sFPV (Swarm First Person View) is intended to allow drone pilots to control the flight in real time through a camera installed on the drone. We, the Atena Team, use the data published in a 'ROS Topic', which guarantees us the visualization of camera data. With this information, we made use of the JavaScript programming language for the purpose of interconnecting ROS data and publishing it in a Web interface developed in HTML and CSS, that the user can use to control de drone.
With this, it was possible to ensure the visualization of the drone image in real time with the possibility of handling it by computer keys, as well as drone data, such as battery, telemetry, CPU data and state, which provides the user with greater flight control of the drone, focusing on the importance of having greater safety when putting a drone to fly.
To be able to view a drone simply select the desired clover from the list box and it will automatically subscribe to the requested cloverID image topic. To Control, you only need to select the control panel and then the site will be listening to your computer keys.
Therefore, it is noted that the FPV is fundamental for the handling and control of the drone, since it provides the visualization of data in real time, in addition to automating its architecture, since the hardware information is obtained simultaneously.
To use the sFPV node of the swarm_in_blocks package, you need to have a simulation running on the gazebo, with at least one clover. Because sFPV has an automatic filter that only reads content that contains image_raw
data published by clovers, it is important to inform that the camera feature must be enabled (set to "true") in the startup script.
To start sFPV, open a terminal and run the following commands:
roslaunch swarm_in_blocks simulation.launch num:=2 formation:=line led:=true
camera:=true
With this command, we have the simulation in the gazebo for the establishment of connection with the drone image. If the connection is not established, it is necessary to execute the command roslaunch rosbridge_server rosbridge_websocket.launch port=9090
in order to obtain a simultaneous communication of the simulation with the web FPV.
After these commands, finally, it becomes necessary to run the fpv.hmtl code to obtain the FPV web interface. With these steps, we have the complete operation of FPV.
For that, just got to your localhost
page on your browser (we recommend using Firefox since it's been tested) and type localhost
on the address. If you correctly followed the installation process, you should be able to successfully open our homepage, and the click on the Swarm Station -> FPV, and play with it!
First, the user has to select the drone they are willing to fly based on its id. After that, they should click on the lower bar so it will start listening to the user inputs.
Now the user can press t
in order to take off, and it will start the process of arming the drone. Then, w
can be used to fly it up, while the keyboard arrows can control its translation on space.
The inputs work exactly as shown on the joystick above, with w a s d
being its left analog, and the arrow keys <- ↑ -> ↓ its right analog. Besides, there's the letter t
, that arms the selected drone, l
that lands it, and b
that returns it to initial position.
In the fpv_data.js code, made in JavaScript, algorithms were established to obtain drone data so that they can be viewed on web pages. In the code below, you can see the use of ROS to subscribe to a topic and capture the camera image.
In the fpv_Key_Listener.js
code, it is noted the execution of drone flight commands on the web page by keyboard command.
The fpv_Key_Listener.js
code brings with it the ability to provide the user with flight control in the x, y and z coordinates of the plane by means of keyboard keys, as well as allowing the rotation of the clover around its axis from the Cartesian coordinate chosen by the user.