diff --git a/docker/Dockerfile b/docker/Dockerfile index 78fa56c..98a7af0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -42,7 +42,8 @@ FROM pre-dev AS dep-ros2 ARG MICRO_XRCE_DDS_AGENT_VERSION=v2.4.2 ARG PX4_MSGS_VERSION=release/1.16 ARG PX4_ROS2_INTERFACE_LIB_VERSION=release/1.16 -RUN --mount=type=bind,source=./docker/scripts/build_ros_deps.sh,target=/root/scripts/build_ros_deps.sh /root/scripts/build_ros_deps.sh ${MICRO_XRCE_DDS_AGENT_VERSION} ${PX4_MSGS_VERSION} ${PX4_ROS2_INTERFACE_LIB_VERSION} +ARG PX4_ROS_COM_VERSION=release/1.16 +RUN --mount=type=bind,source=./docker/scripts/build_ros_deps.sh,target=/root/scripts/build_ros_deps.sh /root/scripts/build_ros_deps.sh ${MICRO_XRCE_DDS_AGENT_VERSION} ${PX4_MSGS_VERSION} ${PX4_ROS2_INTERFACE_LIB_VERSION} ${PX4_ROS_COM_VERSION} ######################################## ## BUILD PX4 ## diff --git a/docker/scripts/build_ros_deps.sh b/docker/scripts/build_ros_deps.sh index 1a3ee42..9526e09 100755 --- a/docker/scripts/build_ros_deps.sh +++ b/docker/scripts/build_ros_deps.sh @@ -4,11 +4,13 @@ set -eo pipefail MICRO_XRCE_DDS_AGENT_VERSION=$1 PX4_MSGS_VERSION=$2 PX4_ROS2_INTERFACE_LIB_VERSION=$3 +PX4_ROS_COM_VERSION=$4 mkdir -p /root/px4_ros_ws/src && cd /root/px4_ros_ws/src && \ git clone --depth 1 -b ${MICRO_XRCE_DDS_AGENT_VERSION} https://github.com/eProsima/Micro-XRCE-DDS-Agent.git && \ git clone --depth 1 -b ${PX4_MSGS_VERSION} https://github.com/PX4/px4_msgs.git && \ git clone --depth 1 -b ${PX4_ROS2_INTERFACE_LIB_VERSION} https://github.com/Auterion/px4-ros2-interface-lib.git && \ +git clone --depth 1 -b ${PX4_ROS_COM_VERSION} https://github.com/PX4/px4_ros_com.git && \ git clone --depth 1 -b humble https://github.com/ros-perception/vision_opencv.git && \ git clone --depth 1 -b humble https://github.com/ros-perception/image_common.git && \ git clone --depth 1 -b humble https://github.com/ros-perception/image_transport_plugins.git && \ diff --git a/docs/setup.md b/docs/setup.md index a6534af..6a8487a 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -298,6 +298,29 @@ For example, you can check the PX4 vehicle status with ros2 topic echo /fmu/out/vehicle_status_v1 ``` +You can also try the `sensor_combined_listener` node from the [px4_ros_com](https://github.com/PX4/px4_ros_com) package and get a user friendly visualization of PX4 accelerometer and gyroscope data: + +```sh +ros2 run px4_ros_com sensor_combined_listener --ros-args -p use_sim_time:=true +``` + +It will output something like: + +```sh +RECEIVED SENSOR COMBINED DATA +============================= +ts: 93380000 +gyro_rad[0]: -0.000287732 +gyro_rad[1]: -0.000181083 +gyro_rad[2]: -0.00105683 +gyro_integral_dt: 4000 +accelerometer_timestamp_relative: 0 +accelerometer_m_s2[0]: -0.00764366 +accelerometer_m_s2[1]: 6.15756e-05 +accelerometer_m_s2[2]: -9.79929 +accelerometer_integral_dt: 4000 +``` + ### Foxglove visualization You can use the [px4_tf](../px4_roscon_25/px4_tf/README.md) packages, in conjunction with `foxglove_bridge` to visualize in 3D the drone `base_link`.