# ROS

[ROS](http://www.ros.org/) is a general purpose robotics library that can be used with PX4 for drone application development.

ROS benefits from an active ecosystem of developers solving common robotics problems, and access to other software libraries written for Linux. It has been used, for example, as part of the PX4 [computer vision](https://px4.gitbook.io/px4-user-guide/drone_parts/companion_computer/computer_vision) solutions, including [obstacle avoidance](https://px4.gitbook.io/px4-user-guide/drone_parts/companion_computer/computer_vision/obstacle_avoidance) and [collision prevention](https://px4.gitbook.io/px4-user-guide/drone_parts/companion_computer/computer_vision/collision_prevention).

:::warning tip [ROS 2](https://px4.gitbook.io/px4-user-guide/robotics/ros/ros2) is the "latest and greatest" version of ROS. The PX4 development team recommend that all users [upgrade to ROS 2](https://px4.gitbook.io/px4-user-guide/robotics/ros/ros2)! :::

## ROS Setups

PX4 supports both ROS 2 and ROS 1, with the following configurations:

* [**ROS 2**](https://px4.gitbook.io/px4-user-guide/robotics/ros/ros2)**: (Recommended)** PX4 and ROS 2 communicate over the [PX4-ROS 2 bridge](https://px4.gitbook.io/px4-user-guide/robotics/ros/ros2/ros2_comm), an interface that provides a direct bridge between PX4 uORB messages and ROS 2 DDS messages/types. This effectively allows direct access to PX4 internals from ROS 2 workflows and nodes in realtime.
* [**ROS 1 via MAVROS**](https://px4.gitbook.io/px4-user-guide/robotics/ros/ros1)**:** PX4 and ROS 1 communicate over [MAVLink](https://px4.gitbook.io/px4-user-guide/development/middleware/mavlink), using the [MAVROS](https://px4.gitbook.io/px4-user-guide/robotics/ros/ros1/mavros_installation) package to bridge ROS topics to MAVLink.

:::note ROS 2 can also connect with PX4 using [MAVROS](https://github.com/mavlink/mavros/tree/ros2/mavros) (instead of XRCE-DDS). This option is supported by the MAVROS project. :::

Note that ROS 2 can be installed on Ubuntu Linux, macOS, Windows, while ROS 1 is only available on Linux. Although it might work on the other platforms, PX4 primarily tests and documents ROS on *Linux*.

## ROS Support Roadmap

Unveiled at the [PX4 Developer Summit 2020](https://www.youtube.com/watch?v=lZ8crGI16qA) (and [ROS World 2020](https://www.youtube.com/watch?v=8XRkzHqQSf0)), the PX4 Development team, announced the plans to support microROS.

* microRTPS: microRTPS bridge with Fast DDS (The ROS 2 interface in PX4 v1.13 and earlier)
* micro XRCE-DDS: DDS on PX4 (The ROS 2 interface for releases after PX4 v1.13 and in mainline)
* micro ROS: ROS 2 running in PX4 - "microROS" (Our Target!)
