{"id":13800267,"url":"https://github.com/eProsima/px4_to_ros","last_synced_at":"2025-05-13T09:31:28.265Z","repository":{"id":76916784,"uuid":"92181929","full_name":"eProsima/px4_to_ros","owner":"eProsima","description":"ROS2/ROS packages for communicate PX4 with ROS","archived":false,"fork":false,"pushed_at":"2017-06-09T12:19:32.000Z","size":367,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-12T01:47:53.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eProsima.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-05-23T14:23:27.000Z","updated_at":"2024-08-12T19:30:04.000Z","dependencies_parsed_at":"2023-03-11T23:24:53.999Z","dependency_job_id":null,"html_url":"https://github.com/eProsima/px4_to_ros","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eProsima%2Fpx4_to_ros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eProsima%2Fpx4_to_ros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eProsima%2Fpx4_to_ros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eProsima%2Fpx4_to_ros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eProsima","download_url":"https://codeload.github.com/eProsima/px4_to_ros/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253913085,"owners_count":21983255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:01:10.915Z","updated_at":"2025-05-13T09:31:26.603Z","avatar_url":"https://github.com/eProsima.png","language":"C++","funding_links":[],"categories":["Packages"],"sub_categories":["Driver layer"],"readme":"PX4-FastRTPS-ROS\n================\n\n.. image:: doc/PX4-to-ros.png\n\nThis proof of concept aims to extend the `bridge PX4-FastRTPS \u003chttps://github.com/eProsima/Firmware.git\u003e`_ to **ROS** and test how the exchange of information works between nodes of PX4 and ROS. The PoC has been implemented and tested in a **PIXracer** for the PX4 side and a couple of **PC running Ubuntu 16.04** for micro RTPS agent, ROS2-ROS bridge and the ROS node.\n\nThe PoC has been performed over a single message **sensor combined** for the sake of simplicity.\n\nScheme\n------\n\n.. image:: doc/complete_loop.png\n\nThe scheme has 5 nodes involved as shown in the image above:\n\n- **uORB**: This node is the representation of the publisher(s) that send, in this case, sensor combined messages through uORB protocol.\n- **micrortps_client** is the node that get the information from uORB world, translate it and transmit to the next node in a serialization format understandable for the micro RTPS side of wich is part.\n- **micrortps_agent** as a full member of the DDS world inject the received information publishing the message in the **sensor_combined_topic**.\n- **static_bridge** is the node of ROS2 (part of the ros1_bridge package) that listen directly whitout previous translation the topic (taking advantage of use of the same RTPS protocol internally) and pass it from ROS 2 to ROS 1.\n- **sc_ros1_listener** a very simple ROS node that listen to the well formed ROS topic, print the info on the screen and publish back into a new topic **sensor_combined_topic_back**.\n\n**NOTE**: The same path is followed in reverse from ROS to PX4 for latency estimation.\n\nRequierements\n-------------\n\n- **PX4-Fast RTPS brigde**: its necessary work with the `eProsima PX4/Firmware fork \u003chttps://github.com/eProsima/Firmware.git\u003e`_, please see the `README \u003chttps://github.com/eProsima/Firmware/blob/micrortps/README_eprosima.rst\u003e`_\n- **ROS2**: Install `ROS2 \u003chttps://github.com/ros2/ros2/wiki/Linux-Development-Setup\u003e`_ with the latest update of its packages from the master branch of `this repository \u003chttps://github.com/ros2/ros2\u003e`_.\n- **ROS from sources**: Install `ROS \u003chttp://wiki.ros.org/Installation/Source\u003e`_ from sources (we use **kinetic** distro).\n\nPX4 side: micro RTPS client\n---------------------------\n\nThe code of the application that will run in to PX4 side will be found in **microRTPS_client** folder. To use this code replaces the original one from the client, please see the **PX4 Firmware** section in the `README \u003chttps://github.com/eProsima/Firmware/blob/micrortps/README_eprosima.rst\u003e`_ in case of doubt.\n\nFast RTPS side: micro RTPS agent\n--------------------------------\n\nThe code of the application that will run as micro RTPS agent will be found in **microRTPS_agent** folder. To use this code replaces the original one from the agent, please see the **Fast RTPS (Raspberry PI application)** section in the `README \u003chttps://github.com/eProsima/Firmware/blob/micrortps/README_eprosima.rst\u003e`_ in case of doubt.\n\nROS side\n--------\n\nWe need to add two packages to our ROS workspace. For that copy them:\n\n.. code-block:: bash\n\n    $ cd /path/to/px4_to_ros\n    $ cp -r px4_msgs_ros1 /path/to/ros1/workspace/src/px4_msgs\n    $ cp -r sensor_combined_ros1 /path/to/ros1/workspace/src/\n\nCompile the packages using:\n\n.. code-block:: bash\n\n    $ catkin_make_isolated --pkg px4_msgs --install -DCMAKE_BUILD_TYPE=Release\n    $ catkin_make_isolated --pkg sensor_combined_ros1 --install -DCMAKE_BUILD_TYPE=Release\n\nFor launch the application we need to launch in first place **roscore** in a separate shell:\n\n.. code-block:: bash\n\n    $ source /path/to/ros1/workspace/install_folder/setup.bash\n    $ roscore\n\nNow, you can run the listener application with:\n\n.. code-block:: bash\n\n    $ source /path/to/ros1/workspace/install_folder/setup.bash\n    $ rosrun sensor_combined_ros1 sc_ros1_listener\n\nROS2 side\n---------\n\nIn order to run the ROS2 to ROS1 bridge, you have to add one package and modify other (**ros1_bridge** package) in your ROS2 worskpace. The package **px4_msgs** generates all the PX4 messages that are actually supported. To use, copy in this way:\n\n.. code-block:: bash\n\n    $ cd /path/to/px4_to_ros\n    $ cp -r px4_msgs_ros2 /path/to/ros2/workspace/src/ros2/px4_msgs\n    $ cp -r ros1_bridge /path/to/ros2/workspace/src/ros2/\n\nCompile the package px4_msgs with ament using:\n\n.. code-block:: bash\n\n    $ ament build --symlink-install --only px4_msgs\n\ncompile the bridge, please see `Building the bridge from source \u003chttps://github.com/ros2/ros1_bridge/blob/master/README.md#build-the-bridge-from-source\u003e`_\n\nNow, you can run the bridge application with:\n\n.. code-block:: bash\n\n    $ source /path/to/ros1/workspace/install_folder/setup.bash\n    $ source /path/to/ros2/workspace/install_folder/setup.bash\n    $ static_bridge\n\nRoscore: working in several machines\n------------------------------------\n\nIn due we only need one instance of *roscore* runnig we need to make some adjustenments to work in separate machines:\n\nMachine that runs *roscore* need to define:\n\n.. code-block:: bash\n\n    $ export ROS_MASTER_URI=http://localhost:11311\n    $ export ROS_HOSTNAME=\u003cLOCAL_IP\u003e\n\nMachine that **NOT** run *roscore* need to define:\n\n.. code-block:: bash\n\n    $ export ROS_MASTER_URI=http://\u003cROSCORE_MACHINE_IP\u003e:11311\n    $ export ROS_HOSTNAME=\u003cLOCAL_IP\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeProsima%2Fpx4_to_ros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FeProsima%2Fpx4_to_ros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeProsima%2Fpx4_to_ros/lists"}