Coder Social home page Coder Social logo

ros-webrtc's Introduction

ros-webrtc Build Status codecov

Exposes Google's implementation of WebRTC to ROS. It consists of 2 ROS nodes:

  • ros_webrtc_host
  • ros_webrtc_rosbridge

a Python library ros_webrtc to help you write your own Python based ROS WebRTC apps and 2 example ROS nodes:

  • ros_webrtc_example
  • ros_webrtc_signaling

which show how everything fits together.

dev

Get it:

~/code$ git clone [email protected]:MayfieldRoboticsPublic/ros-webrtc.git

generate a project if you want, e.g. for Eclipse CDT do:

~/code$ mkdir ros-webrtc-project
~/code$ cd ros-webrtc-project
~/code/ros-webrtc-project$ cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../ros-webrtc/

and setup a catkin workspace using ansible:

~$ cd ~/code/ros-webrtc/test/provision
~/code/ros-webrtc/test/provision$ ansible-galaxy install -r requirements.yml
~/code/ros-webrtc/test/provision$ ansible-playbook -i 'localhost,' -c local -K dev.yml

or use vagrant:

~$ cd ~/code/ros-webrtc
~/code/ros-webrtc$ vagrant up

test

~/code/ros-webrtc/test/provision$ cd ~/tmp/ros-webrtc-ws
~/tmp/ros-webrtc-ws$ source devel/setup.bash
~/tmp/ros-webrtc-ws$ catkin_make run_tests

and if you want compiled code coverage:

~/tmp/ros-webrtc-ws$ catkin_make -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON
~/tmp/ros-webrtc-ws$ catkin_make run_tests

then use e.g. lcov to view the results:

~/tmp/ros-webrtc-ws$ lcov --path . --directory . --capture --no-external --output-file coverage.info
~/tmp/ros-webrtc-ws$ lcov --remove coverage.info 'devel/*' 'test/*' --output-file coverage.info
~/tmp/ros-webrtc-ws$ lcov --list coverage.info

demo

Let's walkthrough an example. Start by launching the demo:

~$ cd ~/tmp/ros-webrtc-ws
~/tmp/ros-webrtc-ws$ source devel/setup.bash
~/tmp/ros-webrtc-ws$ roslaunch ros_webrtc ros_webrtc.launch
...

If your webcam is somewhere other than /dev/video0 (e.g. /dev/video2) set that when launching:

~/tmp/ros-webrtc-ws$ ROS_WEBRTC_WEBCAM=id:///dev/video2 roslaunch ros_webrtc ros_webrtc.launch

This all leaves you with a few ros_webrtc nodes:

~/tmp/ros-webrtc-ws$ rosnode list
/ros_webrtc/host
/ros_webrtc_example/example
/ros_webrtc_example/signaling
/rosout

/ros_webrtc/host

This ros_webrtc_host instance exposes a build of Google's implementation of WebRTC to ROS using an interface similar to the one exposed to browsers.

So to e.g. create an RTCPeerConnection you'd use this ros_webrtc_host ROS service:

~/tmp/ros-webrtc-ws$ rosservice info /ros_webrtc/create_peer_connection
Node: /ros_webrtc/host
URI: rosrpc://ai-gazelle:34929
Type: ros_webrtc/CreatePeerConnection
Args: session_id peer_id sdp_constraints video_sources audio_sources

which has type ros_webrtc/CreatePeerConnection:

~/tmp/ros-webrtc-ws$ rossrv info ros_webrtc/CreatePeerConnection
rossrv show ros_webrtc/CreatePeerConnection
string session_id
string peer_id
ros_webrtc/MediaConstraints sdp_constraints
  ros_webrtc/Constraint[] mandatory
    string key
    string value
  ros_webrtc/Constraint[] optional
    string key
    string value
string[] video_sources
string[] audio_sources
---

/ros_webrtc_example/signaling

Initiating a peer connection and negotiating how and what to send over it is referred to as signaling in WebRTC. You can do that anyway you like (e.g. an internet facing pub/sub service) as long that the peer's can send each other signaling messages.

The example ROS node ros_webrtc_signaling is a simple WebSocket sever that does that and is suitable for testing. The peers (e.g. a browser and a ros_webrtc_example ROS node) will both connect to ros_webrtc_signaling and exchange signaling messages.

Just as the browser RTCPeerConnection has no knowledge of signaling, neither does ros_webrtc_host.

/ros_webrtc_example/example

A ros_webrtc_example ROS node intended to show how ROS WebRTC app might be implemented using helpers from the ros_webrtc Python library.

It connects to signaling and can be called by another peer. In that case a signaling message will be received from the other peer via signaling.

Alternatively ros_webrtc_example can call another peer. In that case signaling message will be sent from the other peer via signaling.

/ros_webrtc/rosbridge_*

You shouldn't see instances of the ros_webrtc_rosbridge ROS node yet as they tunnel the ROS protocol over an RTCDataChannel using rosbridge.

test site

In another terminal serve the test site which we'll use later to setup a peer connection between the browser and ros_webrtc:

~$ cd ~/code/ros-webrtc/test/fixtures/site
~/code/ros-webrtc/test/fixtures/site$ grunt clean build connect watch
...

connect!

Finally, it's time to connect. Let start by initiating a peer connection to ros_webrtc_example from a compatible browser using the test site:

http://localhost:8080/#cd0bdd0b147c4ba4bea16ca3cb35c140/call/{host-name}

where:

  • cd0bdd0b147c4ba4bea16ca3cb35c140 is a random identifier for the browser
  • {host-name} is the host name of your local machine (e.g. whatever $ hostname prints).

Once the connection is established ros_webrtc_host will list it:

~/tmp/ros-webrtc-ws$ rosservice call /ros_webrtc/get_host
...
peer_connections:
  -
    session_id: 9eb17a42bbf947649f3b92f24fc7b88c
    peer_id: cd0bdd0b147c4ba4bea16ca3cb35c140
...

Notice that a peer connection is identified by 2 values:

  • a session_id and
  • a peer_id

We also have a new ros_webrtc_rosbridge node instance:

~/tmp/ros-webrtc-ws$ rosnode list /ros_webrtc
...
/ros_webrtc/rosbridge_9eb17a42bbf947649f3b92f24fc7b88c_rosbridge_cd0bdd0b147c4ba4bea16ca3cb35c140
...

which is tunneling the ROS protocol over this peer connection's rosbridge data channel . We also have a bunch of new peer connection specific service advertised by ros_webrtc_example:

~/tmp/ros-webrtc-ws$ rosservice list /ros_webrtc_example/example/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/
/ros_webrtc_example/example/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/on_add_stream
/ros_webrtc_example/example/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/on_close
/ros_webrtc_example/example/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/on_data_channel
/ros_webrtc_example/example/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/on_ice_candidate
/ros_webrtc_example/example/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/on_ice_connection_state_change
/ros_webrtc_example/example/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/on_negotiation_needed
/ros_webrtc_example/example/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/on_remove_stream
/ros_webrtc_example/example/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/on_set_session_description
/ros_webrtc_example/example/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/on_signaling_state_change

and invoked by ros_webrtc_host as calbacks which mirror RTCPeerConnection event handlers. Note also that these events are also published to topics which you can monitor:

~/tmp/ros-webrtc-ws$ rostopic list /ros_webrtc/
/ros_webrtc/add_stream
/ros_webrtc/chatter
/ros_webrtc/close
/ros_webrtc/data_channel
/ros_webrtc/ice_candidate
/ros_webrtc/ice_connection_state_change
/ros_webrtc/local/webcam
/ros_webrtc/negotiation_needed
/ros_webrtc/peer_connection_bond
/ros_webrtc/remove_stream
/ros_webrtc/session_aa2f63408bb444508d68bc8a60dae20c/peer_cd0bdd0b147c4ba4bea16ca3cb35c140/data_rosbridge
/ros_webrtc/set_session_description
/ros_webrtc/signaling_state_change

We can reverse the direction of the call and have ros_webrtc_example call the browser. Change the browser to:

http://localhost:8080/#cd0bdd0b147c4ba4bea16ca3cb35c140/wait

and call it from ros_webrtc_example:

~/tmp/ros-webrtc-ws$ rosservice call /ros_webrtc_example/example/call cd0bdd0b147c4ba4bea16ca3cb35c140 ''

where:

  • cd0bdd0b147c4ba4bea16ca3cb35c140 is the browser peer id to call and
  • '' is an empty string indicating ros_webrtc_example should generate a random session id for the peer connection

At this point read the commented ros_webrtc_example source to get an idea of how these connections were established and what a ROS WebRTC app looks like.

params

These are used to configure ros_webrtc_host, e.g.:

~/tmp/ros-webrtc-ws$ rosparam get /ros_webrtc
cameras:
  webcam:
    constraints:
      mandatory: {maxHeight: '480', maxWidth: '640', minHeight: '480', minWidth: '640'}
    label: webcam
    name: id:///dev/video0
    publish: true
example: {id: hostname}
ice_servers:
- {uri: 'stun:stun.services.mozilla.com:3478'}
- {uri: 'stun:stun.l.google.com:19302'}
queue_sizes: {audio: 1000, data: 1000, event: 1000, video: 1000}
session:
  constraints:
    optional: {DtlsSrtpKeyAgreement: 'true'}
trace: {file: /tmp/ros_webrtc.trace, filter: all}

cameras

This is a mapping describing the video sources of the host. Each has these fields:

  • label - string naming the video source.
  • constraints- optional - nested mapping of mandatory and optional string constraints.
  • name - string of the form {type}://{resource}.
  • publish - optional - boolean controlling whether images from this source should be published.

See Google's source for possible constraints. In the e.g. above we constrained the webcam source to have size 640x480.

The name determines where video source images come from and is one of these types:

  • name - name of the video source (e.g. name://BisonCam, NB Pro).
  • id - device file of the video source (e.g. id:///dev/video0).
  • ros - a ROS sensor_msgs/Image topic (e.g. ros:///my/image/topic).

If publish is true then ros_webrtc_host will publish source images to a sensor_msgs/Image topic (e.g. /ros_webrtc/local/webcam).

ice_servers

A list of STUN and TURN servers to use when generating ice candidates. Each is a mapping with fields:

  • uri - type and network location formatted as {sturn|turn}:{hostname}[:{port}].
  • username - optional - authentication.
  • password - optional - authentication.

trace

A mapping with these fields controlling WebRTC tracing:

  • file - path to file where traces should be written.
  • filter - optional - either a sequence of strings or a single string of trace levels used to build a filter. In the e.g. above all traces have been included.

queue_sizes

Mapping of queue sizes to use for ros_webrtc_example ROS publishers. Each field of the mapping if a type of publisher (audio, video, data and event) with an integer value for the queue size.

peer_connection/timeout

Number of seconds (as a double) to use for the peer connection bond heart-beat timeout, or 0 to disable peer connection bonding (useful when debugging).

A peer connection bond is typically formed between the local WebRTC application and ros_webrtc_host so that either side is notified if peer connection is closed out-of-band.

peer_connection/constraint

This is a nested mapping of mandatory and optional string constraints to apply to each peer connection. See Google's source for possible constraints. In the e.g. above we constrained peer connections to optionally enable DTLS-SRTP for key management.

open_media_sources

Boolean controlling whether local media sources (cameras, microphones, speakers, etc) are opened/captured on start. It is true by default.

If set to false then local media sources will only be opened when there are peer connections that need them. So e.g. they will be opened on first peer connection, closed when the last peer connection ends then re-opened when the next peer connection is created.

ros-webrtc's People

Contributors

aisch avatar bkearns avatar cinchcircuits avatar cjwilliams avatar haidai avatar hopewm avatar jonbinney avatar kaijenhsiao avatar peregrinebadger avatar po1 avatar roypollock avatar sosentos avatar spmaniato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ros-webrtc's Issues

travis integration

  • add .travis.yml to ~ setup workspace, catkin_make, catkin_make install

Ansible playbook missing stuff

Trying to run the ansible-playbook command in the README.md, it seems to be missing most of its roles:

kaijen@daisy:~/ros_webrtc_ws/src/ros-webrtc/test/provision$ ansible-playbook -i 'localhost,' -c local -K dev.yml
SUDO password: 
ERROR! the role 'chrome' was not found in /home/kaijen/research/ros_webrtc_ws/src/ros-webrtc/test/provision/roles:/home/kaijen/research/ros_webrtc_ws/src/ros-webrtc/test/provision:./roles

The error appears to have been in '/home/kaijen/ros_webrtc_ws/src/ros-webrtc/test/provision/dev.yml': line 16, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  roles:
  - {role: chrome, become: yes}
    ^ here

example signaling server leaves orphan pcs

if you kill a remote peer during pc setup its orphaned in the ros_webrtc_host. looks like we need to have the example signaling server report remote peer disconnects and the webrtc app teardown pc if that happens.

Webrtc crashes

If you leave it running for a long time on tigger (the odroid) it eventually crashes.

Ansible-galaxy requirements.yml error

There seems to be an error running requirements.yml as webrtc git could not be found. A username and password is prompted.

[WARNING]: - webrtc was NOT installed successfully: - command git clone https://github.com/mayfieldrobotics/ansible-webrtc.git
webrtc failed in directory /tmp/tmpbnIYbw (rc=128)

ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.

nforce/armhf libjingle seg-faults when streaming audio

Changing video state, recv=1 send=0
Channel enabled
Changing data state, recv=1 send=0
Session:220278191443244482 Old state:STATE_SENTINITIATE New state:STATE_RECEIVEDACCEPT Type:urn:xmpp:jingle:apps:rtp:1 Transport:http://www.google.com/transport/p2p
Setting remote voice description

-------------

* 19   Thread 0x4d1ff420 (LWP 4642) "webrtc_audio_mo" 0x00000000 in ?? ()

#0  0x00000000 in ?? ()
#1  0x006318b4 in webrtc::scoped_ptr<webrtc::Blocker, webrtc::DefaultDeleter<webrtc::Blocker> >::reset (this=0x0, p=0x0) at ../../../webrtc/system_wrappers/interface/scoped_ptr.h:382
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

session initiation w/ data channel is failing

Allowing SCTP data engine.
Local and Remote descriptions must be applied to get SSL Role of the session.
Error(webrtcsession.cc:1137): ConnectDataChannel called when data_channel_ is NULL.

support data channel protocol field

used to communicate media/mime type information. ours are:

  • application/vnd.mayfield.msg-v1+json
  • application/vnd.mayfield.msg-chunk-v1+json; chunksize={bytes}

ERROR! the role 'webrtc' was not found

Hello,
I wanted to try ros-webrtc but can't manage to go beyond the step:
~/code/ros-webrtc/test/provision$ ansible-playbook -i 'localhost,' -c local -K dev.yml

I get

ERROR! the role 'webrtc' was not found in /*/ros-webrtc/test/provision/roles:/*/ros-webrtc/test/provision:./roles

The error appears to have been in '/*/ros-webrtc/test/provision/dev.yml': line 19, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  - nodejs
  - {role: webrtc, become: yes}
    ^ here

Maybe I miss something obvious, this is the first time I am using ansible.

investigate video delay

for now we want to know where the delay is:

  • bus (usb)
  • ros (usb_cam, image transport, ?)
  • ros-webrtc (image transport, ?)
  • jingle

using HD Pro Webcam C920.

support video capture rotation

in libjingle there is VideoCaptureModule::SetCaptureRotation(VideoCaptureRotation) where VideoCaptureRotation is:

enum VideoCaptureRotation
{
    kCameraRotate0 = 0,
    kCameraRotate90 = 5,
    kCameraRotate180 = 10,
    kCameraRotate270 = 15
};

is should be set / camera like e.g.:

cameras:
  webcam:
    name: sys://BisonCam, NB Pro
    label: webcam
    rotation: 0|90|180|270

and since we need to fiddle w/ DeviceManager's VideoCaptureModule changes are ~:

publishing local media srcs should be session independent

currently if src.publish == true the local stream added to each session will pub media data (e.g. sensor_msgs/Image, etc.) to ros topics. this means:

  1. nothing published if no sessions
  2. duplicate publish if multiple sessions

maybe we can just setup a local, peer-less stream including all srcs w/ src.publish == true on host init and publish that instead.

ros integration tests

should test:

  • ros pub streaming a/v/d from peer
  • ros sub streaming a/v/d to peer
  • signaling service(s)
  • stat service(s)

ideally we could also test interop:

  • headless chrome
  • headless ffox

end session deadlock

Thread [7] 17342 [core: 2] (Suspended : Container)  
    __lll_lock_wait() at lowlevellock.S:135 0x7ffff4cfef2c  
    _L_lock_953() at 0x7ffff4cfa672 
    __GI___pthread_mutex_lock() at pthread_mutex_lock.c:114 0x7ffff4cfa4da  
    ros::SubscriptionQueue::clear() at 0x7ffff709f512   
    ros::Subscription::removeCallback() at 0x7ffff7091878   
    ros::TopicManager::unsubscribe() at 0x7ffff703b6f3  
    ros::Subscriber::Impl::unsubscribe() at 0x7ffff700b210  
    Session::_close_peer_connection() at session.cpp:192 0x542de8   
    Session::end() at session.cpp:59 0x542098   
    Host::end_session() at host.cpp:153 0x4fcea6    
    Host::SessionObserver::on_connection_change() at host.cpp:542 0x501364  
    Session::PeerConnectionObserver::OnIceConnectionChange() at session.cpp:477 0x54614d    
    webrtc::PeerConnection::OnIceConnectionChange() at peerconnection.cc:836 0x60b10c   
    non-virtual thunk to webrtc::PeerConnection::OnIceConnectionChange() at peerconnection.cc:837 0x60b142  
    webrtc::WebRtcSession::SetIceConnectionState() at webrtcsession.cc:1,282 0x7837d7   
    webrtc::WebRtcSession::OnTransportWritable() at webrtcsession.cc:1,313 0x787a4b 
    sigslot::_connection1<cricket::BaseSession, cricket::Transport*, sigslot::single_threaded>::emit() at sigslot.h:1,853 0x6c6325  
    sigslot::signal1<cricket::Transport*, sigslot::single_threaded>::operator() at sigslot.h:2,347 0x7efceb 
    cricket::Transport::OnChannelWritableState_s() at transport.cc:533 0x7ed9f5 
    cricket::Transport::OnMessage() at transport.cc:901 0x7ee981    
    rtc::MessageQueue::Dispatch() at messagequeue.cc:381 0x5acee2   
    rtc::Thread::ProcessMessages() at thread.cc:564 0x595620    
    rtc::Thread::Run() at thread.cc:404 0x59554a    
    rtc::Thread::PreRun() at thread.cc:396 0x5952ba 
    start_thread() at pthread_create.c:312 0x7ffff4cf8182   
    clone() at clone.S:111 0x7ffff4204efd   

Demo server is not working

I'm trying to view the demos here but get the error: WebSocket connection to ws://demo.robotwebtools.org:9090/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

need uncompressed pixel format for sizes > vga

webrtc/modules/video_capture/linux/video_capture_linux.cc does:

// Supported video formats in preferred order.
// If the requested resolution is larger than VGA, we prefer MJPEG. Go for
// I420 otherwise.
const int nFormats = 5;
unsigned int fmts[nFormats];
if (capability.width > 640 || capability.height > 480) {
    fmts[0] = V4L2_PIX_FMT_MJPEG;
    fmts[1] = V4L2_PIX_FMT_YUV420;
    fmts[2] = V4L2_PIX_FMT_YUYV;
    fmts[3] = V4L2_PIX_FMT_UYVY;
    fmts[4] = V4L2_PIX_FMT_JPEG;
} else {
    fmts[0] = V4L2_PIX_FMT_YUV420;
    fmts[1] = V4L2_PIX_FMT_YUYV;
    fmts[2] = V4L2_PIX_FMT_UYVY;
    fmts[3] = V4L2_PIX_FMT_MJPEG;
    fmts[4] = V4L2_PIX_FMT_JPEG;
}

so for anything sized > vga we'll prefer mjpeg. can we override this behavior?

Publishers should stay up even if no webrtc clients are connected

We ran into this issue with the action server for romoji (https://github.com/mayfieldrobotics/ixi_project_management/issues/1238) and traced it back to the fact that rospy was written with the assumption that nodes in its computation graph doesn't suddenly stop providing advertised topics.

Currently, ros_webrtc brings up ROS publishers when web clients connect:

$ rostopic info /romoji/goal
Type: gizmo_msgs/RomojiActionGoal

Publishers: 
 * /gizmo_webrtc/gizmo_webrtc_teleop (http://192.168.123.72:55782/)

Subscribers: 
 * /gizmo (http://192.168.123.72:40472/)
 * /gizmo_webrtc/gizmo_webrtc_teleop (http://192.168.123.72:55782/)

But it also tears them down when clients disconnect:

$ rostopic info /romoji/goal
Type: gizmo_msgs/RomojiActionGoal

Publishers: None

Subscribers: 
 * /gizmo (http://192.168.123.72:40472/)

The problem is that once rospy makes a connection, it starts a persistent thread that watches the associated socket for data. The same thread also reconnects with exponential back-off if something happens to that socket. That something in this case tends to be the web client going away, causing ros_webrtc to stop publishing, which results in this frequently seen (and so far ignored) error:

[WARN] [WallTime: 1460601009.598211] Could not process inbound connection: [/gizmo_webrtc/gizmo_webrtc_teleop] is not a publisher of [/romoji/goal]. Topics are [['/rosout', 'rosgraph_msgs/Log']]{'message_definition': "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======\n\nHeader header\nactionlib_msgs/GoalID goal_id\nRomojiGoal goal\n\n================================================================================\nMSG: std_msgs/Header\n# Standard metadata for higher-level stamped data types.\n# This is generally used to communicate timestamped data \n# in a particular coordinate frame.\n# \n# sequence ID: consecutively increasing ID \nuint32 seq\n#Two-integer timestamp that is expressed as:\n# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n# time-handling sugar is provided by the client library\ntime stamp\n#Frame this data is associated with\n# 0: no frame\n# 1: global frame\nstring frame_id\n\n================================================================================\nMSG: actionlib_msgs/GoalID\n# The stamp should store the time at which this goal was requested.\n# It is used by an action server when it tries to preempt all\n# goals that were requested before a certain time\ntime stamp\n\n# The id provides a way to associate feedback and\n# result message with specific goal requests. The id\n# specified must be unique.\nstring id\n\n\n================================================================================\nMSG: gizmo_msgs/RomojiGoal\n# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======\n# Name of romoji to play\nstring name\n# Whether to play sound or not (if the animation has sounds)\nbool sound\n# Parameters to the animation (if it has them)\ngizmo_msgs/KeyValue[] params\n\n================================================================================\nMSG: gizmo_msgs/KeyValue\nstring k\nstring v\n\n", 'callerid': '/gizmo', 'tcp_nodelay': '0', 'md5sum': '32f165664bf0eedc9cdabf43f0d3e5b7', 'topic': '/romoji/goal', 'type': 'gizmo_msgs/RomojiActionGoal'}

Because of the back off, the longer the iOS app stays disconnected the longer it takes for rospy to give up (or something else comes along and kills that thread somehow?). Usually it hangs when waiting on ros_webrtc to send a header. So when the iOS app does reconnect, ros_webrtc comes back up, but gizmo, since it's stuck waiting, will sit there until some other event closes its socket and then wait for the requisite timeout.

Rather than changing how rospy and action servers work, can we have ros_webrtc not tear down publications?

need to chunk data channel messages

service /webrtc/send_data buffer overruns

@hai noticed these:

[ERROR] [1463176815.409781812]: Exception thrown while processing service call: Buffer Overrun
[ERROR] [1463176815.410338312]: Exception thrown while processing service call: Buffer Overrun
[ERROR] [1463176815.410700937]: Exception thrown while processing service call: Buffer Overrun
[ERROR] [1463176815.411068937]: Exception thrown while processing service call: Buffer Overrun
[ERROR] [1463176815.411375687]: Exception thrown while processing service call: Buffer Overrun
[ERROR] [1463176815.423410604]: Exception thrown while processing service call: Buffer Overrun
[ERROR] [WallTime: 1463176815.565320] Exception calling subscribe callback: service [] responded with an error: Buffer Overrun

when testing #53.

Does not like video devices remounted via Docker's -v option

In the past I was able to launch Docker containers with -v /dev/video0:/dev/upward_looking_camera and have cameras work via:
roslaunch gizmo_bringup elp_camera.launch

But ros-webrtc doesn't seem to like this trick:

[ INFO] [1444179812.452007865]: initializing ros
[ INFO] [1444179812.478271796]: loading config
[ INFO] [1444179812.521458031]: initializing ssl
[ INFO] [1444179812.529474830]: creating host
[ INFO] [1444179812.529914203]: opening host ...
[ERROR] [1444179813.704420921]: cannot get video capture device for file '/dev/upward_looking_camera'
[ INFO] [1444179813.707686866]: host open failed
[webrtc/ros_webrtc_host-13] process has died [pid 860, exit code 2, cmd /root/gizmo/devel/lib/ros_webrtc/host __name:=ros_webrtc_host __log:=/root/.ros/log/1cdc8e40-6c8f-11e5-a214-7cdd908a9fcd/webrtc-ros_webrtc_host-13.log].
log file: /root/.ros/log/1cdc8e40-6c8f-11e5-a214-7cdd908a9fcd/webrtc-ros_webrtc_host-13*.log

If I change https://github.com/mayfieldrobotics/gizmo_app/blob/develop/app_bringup/src/app_bringup/ixi_app.py#L128 to use /dev/video0 instead of /dev/upward_looking_camera, it seems to work inside the Docker. Any idea what's going on? Does webrtc just really really want a real device instead of one that's been remounted?

ros image video capturer

rather than futzing w/ libjingle /dev/video* mapping/resolving it looks like we can write a:

cricket::VideoCapturer impl (see src/webrtc/src/talk/media/base/videocapturer.h)

to serve images from a sub'd ros-topic w/ camera frames. this will make dealing with ros'd envs much simpler.

  • ros image topic impl for webrtc::videocapturemodule::DeviceInfoImpl
  • ros image topic impl for webrtc::videocapturemodule::VideoCaptureImpl
  • update Device to use v4l2 devices or ros image topics
  • verify works w/ sim
  • verify works w/ odroid
  • verify works w/ release bits
  • optimize encoding image pipeline (e.g. camera images are ideally yuv420 @ desired wxh so we just copy to jingle rather than pixel-convert + scale)

Webrtc connection persists even after client dies

After connecting with the iOS app or just trying to connect, a peer_id shows up in /gizmo_webrtc/gizmo_webrtc_teleop/list but it'll stay there even if the client crashes or gets forcibly killed.

If you need an iOS dev to test with, there's one on top of curiouskitten (the deep learning machine).

coverage reports

currently generating coverage data for cpp and py. can those be merged and submitted to coveralls.io?

Can I give the image data from host

Hi, I'm try to using the webrtc into the ros system.
Is possible to give the image data from the ros_webrtc_host? (which topic?)
thanks :)

Setup instructions not working on Ubuntu 14.04 / develop branch

After a clone on the develop branch I'm hitting the below when running the first instruction. Am I doing something wrong? Any advice would be appreciated

ros-webrtc/test/provision$ ansible-galaxy install -r requirements.yml
 downloading role '---', owned by 
Sorry, --- was not found on galaxy.ansible.com.
 downloading role 'nodejs', owned by -%20src%3A%20laggyluke
Sorry, - src: laggyluke.nodejs was not found on galaxy.ansible.com.
 downloading role '0', owned by version%3A%20v0.4
Sorry, version: v0.4.0 was not found on galaxy.ansible.com.
 downloading role 'name%3A%20nodejs', owned by 
Sorry, name: nodejs was not found on galaxy.ansible.com.
 downloading role 'ROS', owned by -%20src%3A%20jalessio
Sorry, - src: jalessio.ROS was not found on galaxy.ansible.com.
 downloading role 'name%3A%20ros', owned by 
Sorry, name: ros was not found on galaxy.ansible.com.
 downloading role 'com/cmprescott/ansible-role-chrome', owned by -%20src%3A%20https%3A//github
Sorry, - src: https://github.com/cmprescott/ansible-role-chrome was not found on galaxy.ansible.com.
 downloading role 'version%3A%200ddd8ad7c6f27c729537de0ab388194a4be22c3b', owned by 
Sorry, version: 0ddd8ad7c6f27c729537de0ab388194a4be22c3b was not found on galaxy.ansible.com.
 downloading role 'name%3A%20chrome', owned by 
Sorry, name: chrome was not found on galaxy.ansible.com.
 downloading role 'git', owned by -%20src%3A%20https%3A//github.com/DrTom/ansible-role-chromedriver
Sorry, - src: https://github.com/DrTom/ansible-role-chromedriver.git was not found on galaxy.ansible.com.
 downloading role 'name%3A%20chrome-driver', owned by 
Sorry, name: chrome-driver was not found on galaxy.ansible.com.
 downloading role 'git', owned by -%20src%3A%20https%3A//github.com/mayfieldrobotics/ansible-webrtc
Sorry, - src: https://github.com/mayfieldrobotics/ansible-webrtc.git was not found on galaxy.ansible.com.
 downloading role 'name%3A%20webrtc', owned by 
Sorry, name: webrtc was not found on galaxy.ansible.com.

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.