Monday, November 5, 2018

SITL Gazebo camera stream

SITL Gazebo camera stream

Prerequisites

sudo apt-get install $(apt-cache --names-only search ^gstreamer1.0-* | awk '{ print $1 }' | grep -v gstreamer1.0-hybris) -y

Enable GStreamer Plugin

  • Changed line at file <Framework>/Tools/sitl_gazebo/CMakeLists.txt

    option(BUILD_GSTREAMER_PLUGIN "enable gstreamer plugin" "ON")
  • Run

    posix_sitl_default gazebo_typhoon_h480

View stream

  • Run gstream
gst-launch-1.0 -v udpsrc port=5600 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink fps-update-interval=1000 sync=false

View From Ground control

  • Config GSC

  • Stream view (bottom left smiley

Opt flow

make posix_sitl_default gazebo_iris_opt_flow
gz topic -l /gazebo/default/iris_opt_flow/px4flow/link/opticalFlow /gazebo/default/iris_opt_flow/px4flow/link/px4flow/cmd /gazebo/default/iris_opt_flow/px4flow/link/px4flow/image /gazebo/default/iris_opt_flow/px4flow/link/px4flow/imu /gazebo/default/iris_opt_flow/px4flow/link/wrench
gz topic -i /gazebo/default/iris_opt_flow/px4flow/link/px4flow/image Type: gazebo.msgs.ImageStamped Publishers: 192.168.2.200:45849

read image from gazebo

No comments: