Giter Club home page Giter Club logo

ros2_px4_offboard_example's Issues

Publish PX4 uorb messages to standard ROS2 topics

We want to take PX4 uorb topics coming in on DDS and publish them to standard ROS2 topics. Here is a non exhaustive list of some of the corresponding messages.

@dagar

https://github.com/ros2/common_interfaces/tree/humble
https://github.com/PX4/PX4-Autopilot/tree/main/msg

DebugArray.msg -> DiagnosticArray.msg
DebugValue.msg -> DiagnosticStatus.msg

VehicleAcceleration.msg -> Accel.msg

BatteryStatus.msg -> BatteryState.msg
VehicleImu.msg -> Imu.msg
VehicleMagnetometer.msg -> MagneticField.msg
vehicle_gps_position(SensorGps.msg) -> NavSatFix.msg
vehicle_gps_position(SensorGps.msg) -> NavSatStatus.msg ?
vehicle_gps_position(SensorGps.msg) -> TimeReference.msg ?
DistanceSensor.msg -> Range.msg
SensorHygrometer.msg -> RelativeHumidity.msg ?
VehicleAirData.msg -> Temperature.msg

Rover control in gazebo classic

Hi, first of all - thanks a lot for your astonishing work!
I have a question - what should I change to be able to control a rover?

Using a custom Gazebo world

How do I add my own world file? I'm relatively new to ROS2 - Gazebo, and looking over the code it's not immediately obvious to me.

Gazebo Sim Blank Screen

My program launches perfectly fine, and the colcon build is successful. However, when Gazebo Sim launches, I get a blank screen. When I scroll I can see a silhouette of the drone appear, however, when resting the Sim is simply a blank.

RViz works perfectly, and I can see the drone fly arround using the key-controls, but again, Gazebo Sim does not seem to be working appropriately.

Has anyone come across this issue or have any suggestions?

Also, does anyone know if this simulation would work in Gazebo11 or Gazebo9 instead of Gazebo Sim?

image

multi vehicle error

Thank you for your offboard control example.
I tried your example in ROS2 humble & gazebo garden environment.
And I want to use your example for multi drones with instances like picture below.

Screenshot from 2024-01-18 23-29-26
It successfully spawn the drone and the codes.
And I changes the topic names with uav instances below.

Screenshot from 2024-01-18 23-23-19

Screenshot from 2024-01-18 23-22-36

But I tried to arm and control the velocity of the drone, but it doesn't move and arm.
Screenshot from 2024-01-18 23-26-19

So I checked rqt_graph, but node publisher and subscriber is connected like below.

Screenshot from 2024-01-18 23-34-24
So could you help how can i fix it?

Process has died error

Tried running the launch file but the logging terminal shows the process has died error:

[INFO] [launch]: All log files can be found below /home/USERNAME/.ros/log/2023-09-04-19-45-35-649660-USERNAME-22502
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [visualizer-1]: process started with pid [22503]
[INFO] [gnome-terminal-2]: process started with pid [22505]
[INFO] [gnome-terminal-3]: process started with pid [22507]
[INFO] [velocity_control-4]: process started with pid [22509]
[INFO] [rviz2-5]: process started with pid [22511]
[INFO] [gnome-terminal-2]: process has finished cleanly [pid 22505]
[rviz2-5] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[INFO] [gnome-terminal-3]: process has finished cleanly [pid 22507]
[visualizer-1] /opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/qos.py:307: UserWarning: ReliabilityPolicy.RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT is deprecated. Use ReliabilityPolicy.BEST_EFFORT instead.
[visualizer-1]   warnings.warn(
[visualizer-1] /opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/qos.py:307: UserWarning: HistoryPolicy.RMW_QOS_POLICY_HISTORY_KEEP_LAST is deprecated. Use HistoryPolicy.KEEP_LAST instead.
[visualizer-1]   warnings.warn(
[velocity_control-4] /opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/qos.py:307: UserWarning: ReliabilityPolicy.RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT is deprecated. Use ReliabilityPolicy.BEST_EFFORT instead.
[velocity_control-4]   warnings.warn(
[velocity_control-4] /opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead.
[velocity_control-4]   warnings.warn(
[velocity_control-4] /opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/qos.py:307: UserWarning: HistoryPolicy.RMW_QOS_POLICY_HISTORY_KEEP_LAST is deprecated. Use HistoryPolicy.KEEP_LAST instead.
[velocity_control-4]   warnings.warn(
[velocity_control-4] Traceback (most recent call last):
[velocity_control-4]   File "/home/USERNAME/px4_ros2_ws/install/px4_offboard/lib/px4_offboard/velocity_control", line 33, in <module>
[velocity_control-4]     sys.exit(load_entry_point('px4-offboard==0.0.0', 'console_scripts', 'velocity_control')())
[velocity_control-4]   File "/home/USERNAME/px4_ros2_ws/install/px4_offboard/lib/python3.10/site-packages/px4_offboard/velocity_control.py", line 309, in main
[velocity_control-4]     offboard_control = OffboardControl()
[velocity_control-4]   File "/home/USERNAME/px4_ros2_ws/install/px4_offboard/lib/python3.10/site-packages/px4_offboard/velocity_control.py", line 110, in __init__
[velocity_control-4]     self.arm_state = VehicleStatus.ARMING_STATE_MAX
[velocity_control-4] AttributeError: type object 'VehicleStatus' has no attribute 'ARMING_STATE_MAX'. Did you mean: 'ARMING_STATE_ARMED'?
[rviz2-5] [INFO] [1693836936.665989450] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-5] [INFO] [1693836936.666187427] [rviz2]: OpenGl version: 4.5 (GLSL 4.5)
[ERROR] [velocity_control-4]: process has died [pid 22509, exit code 1, cmd '/home/USERNAME/px4_ros2_ws/install/px4_offboard/lib/px4_offboard/velocity_control --ros-args -r __node:=velocity -r __ns:=/px4_offboard'].
[rviz2-5] [INFO] [1693836936.765787542] [rviz2]: Stereo is NOT SUPPORTED

The simulation is running, every node is running but the simulation is not entering offboard mode (hovering) when armed (pressing the space key).

I'm using Ubuntu 22.04, Python 3.10.12, ROS2 Humble and all the other default supported dependencies and environment.

colcon build command executed in wrong directory

According to the official docs of ROS2, the colcon build command must be run in the root directory of the workspace not src in this case colcon build must be run in ~/ros2_px4_offboard_example_ws/ directory not ~/ros2_px4_offboard_example_ws/src

Attribute Error VehicleStatus.ARMING_STATE_MAX

Hello,

I'm having an issue running this. I get to the ros2 launch px4_offboard offboard_velocity_control.launch.py command, and everything launches, but the teleop window seems to be disconnected from the simulation. I see in the main terminal this error:

[velocity_control-4] AttributeError: type object 'VehicleStatus' has no attribute 'ARMING_STATE_MAX'. Did you mean: 'ARMING_STATE_ARMED'?

I checked the file ~/ros2_px4_offboard_example_ws/src/px4_msgs/msg/VehivleStatus.msg, and indeed there is nothing named ARMING_STATE_MAX defined in it. What do you think the fix is for this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.