-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add container for Opentera webrtc ros #91
base: ros2
Are you sure you want to change the base?
add container for Opentera webrtc ros #91
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing to the repository. I have left some comments for improving your contribution.
update-ca-certificates | ||
|
||
# run bash file | ||
CMD ["/bin/bash", "-c", "chmod +x ./opentera_teleop_startup.sh && ./opentera_teleop_startup.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing blank line
update-ca-certificates | ||
|
||
# run bash file | ||
CMD ["/bin/bash", "-c", "chmod +x ./opentera_teleop_startup.sh && ./opentera_teleop_startup.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe put "chmod +x ./opentera_teleop_startup.sh" in a run statement.
docker/certificate/cert.pem
Outdated
@@ -0,0 +1,19 @@ | |||
-----BEGIN CERTIFICATE----- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove all certificate files from the repository? You can replace them by a bash script for creating them. Make sure you add a .gitignore file containing the certificates. You can add a step in the readme file for generating them.
I would suggest you generate new certificates for your application since these have been exposed on the Internet.
<static>1</static> | ||
<allow_auto_disable>1</allow_auto_disable> | ||
</model> | ||
</sdf> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing blank line.
docker/opentera_teleop_startup.sh
Outdated
|
||
echo $ROS_DISTRO | ||
ros2 launch startup_opentera_demos.launch.py | ||
#ros2 run rviz2 rviz2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an option to run rviz or remove the line.
Add the missing blank line.
<!-- Front camera --> | ||
<!--group><include file="/opt/ros/OPENTERA_WS/ros_stream_client.launch.xml"> | ||
<arg name="name" value="topic_streamer1"/> | ||
<arg name="is_stand_alone" value="$(var is_stand_alone)"/> | ||
<arg name="can_send_audio_stream" value="true"/> | ||
<arg name="can_receive_audio_stream" value="false"/> | ||
<arg name="can_send_video_stream" value="true"/> | ||
<arg name="can_receive_video_stream" value="false"/> | ||
<arg name="is_screen_cast" value="false"/> | ||
<arg name="needs_denoising" value="false"/> | ||
<arg name="server_url" value="http://$(var signaling_server_hostname):$(var signaling_server_port)"/> | ||
<arg name="client_name" value="Robot Camera 1"/> | ||
<arg name="room_name" value="VideoConf"/> | ||
<arg name="room_password" value="$(var signaling_server_password)"/> | ||
<arg name="input_camera_topic" value="$(var input_camera_topic_based_on_face_cropping)"/> | ||
<arg name="force_gstreamer_video_hardware_acceleration" value="$(var force_gstreamer_video_hardware_acceleration)"/> | ||
</include></group--> | ||
|
||
<!-- Bottom camera --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
<!-- Front camera --> | |
<!--group><include file="/opt/ros/OPENTERA_WS/ros_stream_client.launch.xml"> | |
<arg name="name" value="topic_streamer1"/> | |
<arg name="is_stand_alone" value="$(var is_stand_alone)"/> | |
<arg name="can_send_audio_stream" value="true"/> | |
<arg name="can_receive_audio_stream" value="false"/> | |
<arg name="can_send_video_stream" value="true"/> | |
<arg name="can_receive_video_stream" value="false"/> | |
<arg name="is_screen_cast" value="false"/> | |
<arg name="needs_denoising" value="false"/> | |
<arg name="server_url" value="http://$(var signaling_server_hostname):$(var signaling_server_port)"/> | |
<arg name="client_name" value="Robot Camera 1"/> | |
<arg name="room_name" value="VideoConf"/> | |
<arg name="room_password" value="$(var signaling_server_password)"/> | |
<arg name="input_camera_topic" value="$(var input_camera_topic_based_on_face_cropping)"/> | |
<arg name="force_gstreamer_video_hardware_acceleration" value="$(var force_gstreamer_video_hardware_acceleration)"/> | |
</include></group--> | |
<!-- Bottom camera --> | |
<!-- Camera --> |
<launch> | ||
|
||
<!-- Arguments --> | ||
<arg name="name" default="topic_streamer"/> | ||
<arg name="is_stand_alone" default="true"/> | ||
<arg name="video_queue_size" default="1"/> | ||
<arg name="audio_queue_size" default="1"/> | ||
|
||
<!-- Video --> | ||
<arg name="can_send_video_stream" default="false"/> | ||
<arg name="can_receive_video_stream" default="false"/> | ||
<arg name="is_screen_cast" default="false"/> | ||
<arg name="needs_denoising" default="false"/> | ||
|
||
<!-- Codec --> | ||
<arg name="forced_video_codecs" default="['']"/> <!-- "[]" is bugged (https://github.com/ros2/rclcpp/issues/1955), using "['']" and filtering empty strings in the node --> | ||
<arg name="force_gstreamer_video_hardware_acceleration" default="false"/> | ||
<arg name="use_gstreamer_video_software_encoder_decoder" default="false"/> | ||
|
||
<!-- Audio --> | ||
<arg name="can_send_audio_stream" default="false"/> | ||
<arg name="can_receive_audio_stream" default="false"/> | ||
<arg name="sound_card_total_delay_ms" default="40"/> | ||
<arg name="echo_cancellation" default="true"/> | ||
<arg name="auto_gain_control" default="true"/> | ||
<arg name="noise_suppression" default="true"/> | ||
<arg name="high_pass_filter" default="false"/> | ||
<arg name="stereo_swapping" default="false"/> | ||
<arg name="transient_suppression" default="true"/> | ||
|
||
<!-- Signaling --> | ||
<arg name="server_url" default="http://localhost:8080"/> | ||
<arg name="client_name" default="streamer"/> | ||
<arg name="room_name" default="chat"/> | ||
<arg name="room_password" default="abc"/> | ||
<arg name="verify_ssl" default="false"/> | ||
|
||
<!-- Topics --> | ||
<arg name="input_camera_topic" default="ros_image"/> | ||
<arg name="output_webrtc_image_topic" default="webrtc_image"/> | ||
<arg name="input_audio_topic" default="audio_in"/> | ||
<arg name="output_audio_mixed_topic" default="audio_mixed"/> | ||
<arg name="output_webrtc_audio_topic" default="webrtc_audio"/> | ||
|
||
<node name="$(var name)" pkg="opentera_webrtc_ros" exec="topic_streamer" respawn="true"> <!--launch-prefix="xterm -e gdb -ex run args" --> | ||
<!-- Enable debug log level --> | ||
<param name="log_level" value="debug"/> | ||
<param name="is_stand_alone" value="$(var is_stand_alone)"/> | ||
<param name="video_queue_size" value="$(var video_queue_size)"/> | ||
<param name="audio_queue_size" value="$(var audio_queue_size)"/> | ||
|
||
<param name="video_stream"> | ||
<param name="can_send_video_stream" value="$(var can_send_video_stream)"/> <!-- Can send video stream to the signaling server --> | ||
<param name="can_receive_video_stream" value="$(var can_receive_video_stream)"/> <!-- Can receive video stream from the signaling server --> | ||
<param name="is_screen_cast" value="$(var is_screen_cast)"/> <!-- Is the image source a screen capture? --> | ||
<param name="needs_denoising" value="$(var needs_denoising)"/> <!-- Does the image source needs denoising? --> | ||
</param> | ||
|
||
<param name="video_codecs"> | ||
<param name="forced_codecs" value="$(var forced_video_codecs)"/> | ||
<param name="force_gstreamer_hardware_acceleration" value="$(var force_gstreamer_video_hardware_acceleration)"/> | ||
<param name="use_gstreamer_software_encoder_decoder" value="$(var use_gstreamer_video_software_encoder_decoder)"/> | ||
</param> | ||
|
||
<param name="audio_stream"> | ||
<param name="can_send_audio_stream" value="$(var can_send_audio_stream)"/> <!-- Can send audio stream to the signaling server --> | ||
<param name="can_receive_audio_stream" value="$(var can_receive_audio_stream)"/> <!-- Can receive audio stream from the signaling server --> | ||
<param name="sound_card_total_delay_ms" value="$(var sound_card_total_delay_ms)"/> | ||
<param name="echo_cancellation" value="$(var echo_cancellation)"/> | ||
<param name="auto_gain_control" value="$(var auto_gain_control)"/> | ||
<param name="noise_suppression" value="$(var noise_suppression)"/> | ||
<param name="high_pass_filter" value="$(var high_pass_filter)"/> | ||
<param name="stereo_swapping" value="$(var stereo_swapping)"/> | ||
<param name="transient_suppression" value="$(var transient_suppression)"/> | ||
</param> | ||
|
||
<param name="signaling"> | ||
<param name="server_url" value="$(var server_url)"/> <!-- Signaling server URL used in stand_alone mode only --> | ||
<param name="client_name" value="$(var client_name)"/> <!-- Peer name as which to join the room --> | ||
<param name="room_name" value="$(var room_name)"/> <!-- Room name to join --> | ||
<param name="room_password" value="$(var room_password)"/> <!-- Room password used in stand_alone_mode only --> | ||
<param name="verify_ssl" value="$(var verify_ssl)"/> <!-- SSL peer verification --> | ||
</param> | ||
<!-- Add GStreamer debug environment variable --> | ||
<env name="GST_DEBUG" value="4"/> | ||
<remap from="ros_image" to="$(var input_camera_topic)"/> | ||
<remap from="webrtc_image" to="$(var output_webrtc_image_topic)"/> | ||
<remap from="audio_in" to="$(var input_audio_topic)"/> | ||
<remap from="audio_mixed" to="$(var output_audio_mixed_topic)"/> | ||
<remap from="webrtc_audio" to="$(var output_webrtc_audio_topic)"/> | ||
</node> | ||
|
||
</launch> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you duplicated the file?
Also, don't wory about the CI failing for now: we are still waiting on an update to the tf2 ROS package in the ROS repositories for Ubuntu 22.04, the bug is on their side. |
…sary lines and files. added missing blank spaces.
Co-authored-by: Marc-Antoine Maheux <[email protected]>
I have added the changes you requested. @mamaheux let me know if there is more changes required. |
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
ros-humble-rviz2 \ | ||
libxcb-cursor0 \ | ||
libx11-xcb-dev \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate with line 54?
RUN git clone https://github.com/elFarto/nvidia-vaapi-driver.git | ||
|
||
# Build and install nvidia-vaapi-driver | ||
WORKDIR /opt/ros/OPENTERA_WS/nvidia-vaapi-driver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could colcon later try to build it again since it's in the workspace?
# Clone and build other packages | ||
RUN git clone https://github.com/introlab/audio_utils.git --recurse-submodules -b ros2 && \ | ||
cd audio_utils && \ | ||
git reset --hard fcc404a84fdec9bcb0c9963f394e4e29d5a9653a && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git checkout
instead of reset --hard
seems more appropriate?
|
||
COPY opentera_teleop_startup.sh . | ||
|
||
COPY launch . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be placed with other launch files? They will get in the container via the git clone
in either case, we don't need to copy them like this. Why is this done?
export LIBVA_DRIVER_NAME=nvidia | ||
|
||
# Add the signaling server to PATH | ||
export PATH=/opt/ros/OPENTERA_WS/opentera-webrtc-ros/install/opentera_webrtc_ros/local/bin:$PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be in PATH already after line 3, where we source the workspace setup file.
export GAZEBO_MODEL_PATH=/opt/ros/OPENTERA_WS/opentera-webrtc-ros/install/opentera_webrtc_demos/share/opentera_webrtc_demos/models:$GAZEBO_MODEL_PATH | ||
export GAZEBO_MODEL_PATH=/opt/ros/OPENTERA_WS/models:$GAZEBO_MODEL_PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are they not in the MODEL_PATH after sourcing the workspace? We export it here: https://github.com/introlab/opentera-webrtc-ros/blob/ros2/opentera_webrtc_demos/package.xml#L30
If it does not work, this is a bug with the package and should be fixed directly (using ament_environment_hooks
in cmake?)
sudo sysctl -w net.core.rmem_max=2147483647 | ||
|
||
echo $ROS_DISTRO | ||
ros2 launch startup_opentera_demos.launch.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double space.
Also, add newline
@@ -0,0 +1,30 @@ | |||
version: "2.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get WARN: the attribute
version is obsolete, it will be ignored, please remove it to avoid potential confusion
Dockerfile.opentera_ros2 contains build docker build instructions. | ||
|
||
## Instructions | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add link to install NVidia Container Toolkit for the nvidia
container runtime.
<arg name="can_send_audio_stream" value="true"/> | ||
<arg name="can_receive_audio_stream" value="false"/> | ||
<arg name="can_send_video_stream" value="true"/> | ||
<arg name="can_receive_video_stream" value="false"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be set to "true"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib | ||
|
||
# Set the Video Acceleration API (VA-API) driver to NVIDIA | ||
export LIBVA_DRIVER_NAME=nvidia |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole VAAPI stuff was a good idea, but it does not seem to work properly. The default case seems to work, because it chooses VP9, for which we ignore hardware accelerated encoding due to a bug. Testing with VP8 is not working reliably, therefore hardware accelerated support should probably be disabled in docker.
adds container for ros2 humble branch of opentera-webrtc-ros.
instruction is provided in the readme file.