セル生産方式におけるロボットの活用には様々な問題があるが,その一つとして 3 体以上の物体の組み立てが挙げられる.一般に,複数物体を同時に組み立てる際は,対象の部品をそれぞれロボットアームまたは治具でそれぞれ独立に保持することで組み立てを遂行すると考えられる.ただし,この方法ではロボットアームや治具を部品数と同じ数だけ必要とし,部品数が多いほどコスト面や設置スペースの関係で無駄が多くなる.この課題に対して音𣷓らは組み立て対象物に働く接触力等の解析により,治具等で固定されていない対象物が組み立て作業中に運動しにくい状態となる条件を求めた.すなわち,環境中の非把持対象物のロバスト性を考慮して,組み立て作業条件を検討している.本研究ではこの方策に基づいて,複数物体の組み立て作業を単腕マニピュレータで実行することを目的とする.このとき,対象物のロバスト性を考慮することで,仮組状態の複数物体を同時に扱う手法を提案する.作業対象としてパイプジョイントの組み立てを挙げ,簡易な道具を用いることで単腕マニピュレータで複数物体を同時に把持できることを示す.さらに,作業成功率の向上のために RGB-D カメラを用いた物体の位置検出に基づくロボット制御及び動作計画を実装する.
This paper discusses assembly operations using a single manipulator and a parallel gripper to simultaneously
grasp multiple objects and hold the group of temporarily assembled objects. Multiple robots and jigs generally operate
assembly tasks by constraining the target objects mechanically or geometrically to prevent them from moving. It is
necessary to analyze the physical interaction between the objects for such constraints to achieve the tasks with a single
gripper. In this paper, we focus on assembling pipe joints as an example and discuss constraining the motion of the
objects. Our demonstration shows that a simple tool can facilitate holding multiple objects with a single gripper.
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matchingharmonylab
公開URL:https://arxiv.org/pdf/2404.19174
出典:Guilherme Potje, Felipe Cadar, Andre Araujo, Renato Martins, Erickson R. ascimento: XFeat: Accelerated Features for Lightweight Image Matching, Proceedings of the 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2023)
概要:リソース効率に優れた特徴点マッチングのための軽量なアーキテクチャ「XFeat(Accelerated Features)」を提案します。手法は、局所的な特徴点の検出、抽出、マッチングのための畳み込みニューラルネットワークの基本的な設計を再検討します。特に、リソースが限られたデバイス向けに迅速かつ堅牢なアルゴリズムが必要とされるため、解像度を可能な限り高く保ちながら、ネットワークのチャネル数を制限します。さらに、スパース下でのマッチングを選択できる設計となっており、ナビゲーションやARなどのアプリケーションに適しています。XFeatは、高速かつ同等以上の精度を実現し、一般的なラップトップのCPU上でリアルタイムで動作します。
40. 1 to 1 ブラウザ側 (1) JavaScript
socket.io 関連
<script src="http://localhost:9001/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost:9001/');
socket.on('connect', onChannelOpened)
.on('message', onMessage);
function onChannelOpened(evt) {
}
function onMessage(evt) {
Signaling
if (evt.type === 'offer') {
(1)
sendAnswer(evt); // receive offer, send answer
} else if (evt.type === 'answer') {
peerConn.setRemoteDescription(new RTCSessionDescription(evt)); // receive answer
} else if (evt.type === 'candidate') {
var candidate = new RTCIceCandidate({sdpMLineIndex:evt.sdpMLineIndex,
sdpMid:evt.sdpMid, candidate:evt.candidate});
peerConn.addIceCandidate(candidate); // set and send candidate
} else if (evt.type === 'bye') {
stop();
}
}
42
41. 1 to 1 ブラウザ側 (2) JavaScript
connection handling
// 通信開始
function connect() {
sendOffer();
}
// 通信終了
function hangUp() {
socket.json.send({type: "bye"});
stop();
}
function stop() {
peerConn.close();
peerConn = null;
}
43
42. 1 to 1 ブラウザ側 (3) JavaScript
SDP offer / answer
var peerConn = null; // RTCPeerConnection
function sendOffer() {
peerConn = prepareNewConnection();
peerConn.createOffer(function (sessionDescription) { // in case of success
peerConn.setLocalDescription(sessionDescription);
socket.json.send(sessionDescription);
}, function () { // in case of error
console.log("Create Offer failed");
}, mediaConstraints);
}
function sendAnswer(evt) {
peerConn = prepareNewConnection();
peerConn.setRemoteDescription(new RTCSessionDescription(evt));
peerConn.createAnswer(function (sessionDescription) { // in case of success
peerConn.setLocalDescription(sessionDescription);
socket.json.send(sessionDescription);
}, function () { // in case of error
console.log("Create Answer failed");
}, mediaConstraints);
}
44
43. 1 to 1 ブラウザ側 (4) JavaScript
RTCPeerConnection
function prepareNewConnection() {
var pc_config = {"iceServers":[]};
var peer = new webkitRTCPeerConnection(pc_config);
peer.onicecandidate = function (evt) {
if (evt.candidate) {
socket.json.send({type: "candidate", sdpMLineIndex: evt.candidate.sdpMLineIndex,
sdpMid: evt.candidate.sdpMid, candidate: evt.candidate.candidate});
} else { }
};
Signaling
(2)
peer.addStream(localStream);
peer.addEventListener("addstream", onRemoteStreamAdded, false);
peer.addEventListener("removestream", onRemoteStreamRemoved, false)
function onRemoteStreamAdded(event) {
remoteVideo.src = window.webkitURL.createObjectURL(event.stream); // set stream to video element
}
function onRemoteStreamRemoved(event) {
remoteVideo.src = ""; // clear stream of video element
}
return peer;
}
45
44. 1 to 1 ブラウザ側 (5) JavaScript
Video handling
var localVideo = document.getElementById('local-video');
var remoteVideo = document.getElementById('remote-video');
var localStream = null;
function startVideo() {
navigator.webkitGetUserMedia({video: true, audio: true}, successCallback, errorCallback);
function successCallback(stream) {
localStream = stream;
localVideo.src = window.webkitURL.createObjectURL(stream);
localVideo.play();
}
function errorCallback(error) {
console.error('An error occurred: [CODE ' + error.code + ']');
return;
}
}
function stopVideo() {
localVideo.src = "";
localStream.stop();
}
46
51. ICEのやり取り(理想ケース)
User A
createNewPeer
User B
send offer sdp
createNewPeer
setRemoteDescription(sdp)
send answer sdp
setRemoteDescription(sdp)
send ice
addIceCandidate(ice)
send ice
addIceCandidate(ice)
Iceを
交互に送信
send ice
send ice
addIceCandidate(ice)
addIceCandidate(ice)
end of candidate
end of candidate
P2P stream transfer
53
52. ICEのやり取り(想定していたケー
ス)
User A
User B
createNewPeer
send offer sdp
createNewPeer
setRemoteDescription(sdp)
send answer sdp
setRemoteDescription(sdp)
send ice
send ice
end of candidate
addIceCandidate(ice)
addIceCandidate(ice)
addIceCandidate(ice)
send ice
Iceを片方が
連続して送信
send ice
addIceCandidate(ice)
end of candidate
P2P stream transfer
54
53. ICEのやり取り(想定外のケース)
User A
createNewPeer
User B
send offer sdp
createNewPeer
setRemoteDescription(sdp)
send ice
addIceCandidate(ice)
send ice
end of candidate
addIceCandidate(ice)
send answer sdp
※エラーとして
弾いていたら
嵌った…
setRemoteDescription(sdp)
send ice
addIceCandidate(ice)
Answer SDP
を生成前に、
Ice を受け取る
ことも可能
約1ヶ月
send ice
addIceCandidate(ice)
end of candidate
P2P stream transfer
55
54. WebRTCで可能な(通信)形態
• 双方向通信
– 1 to 1 の音声通信
– 1 to 1 の映像通信
– 1 to 1 のスクリーンキャプチャ通信(と
音声通信)
– n to n の音声通信
– n to n の映像通信
– n to n のスクリーンキャプチャ
通信(と音声通信)
1会議室に複数人、
かつ複数会議室
56
55. では、見てみましょう
• WebRTC 4 people Video Chat (Chrome用)
– http://localhost/rtc/rtc4.html
57
57. 1対1の流れ
User A
createNewPeer
User B
send offer sdp (broadcast)
createNewPeer
setRemoteDescription(sdp)
send answer sdp (broadcast)
setRemoteDescription(sdp)
send ice
send ice
addIceCandidate(ice)
addIceCandidate(ice)
send ice
send ice
addIceCandidate(ice)
addIceCandidate(ice)
end of candidate
end of candidate
P2P stream transfer
59
58. n対nの流れ:SDP部分で衝突
User B
User A
createNewPeer
send offer sdp (broadcast)
send answer sdp
OK
setRemoteDescription(sdp)
User C
send offer sdp (broadcast)
createNewPeer
setRemoteDescription(sdp)
OK
createNewPeer
setRemoteDescription(sdp)
OK
send answer sdp
no peer!
→ createNewPeer
setRemoteDescription(sdp)
send offer sdp
※この流れを理解するのに、苦労
約2ヶ月
corrupt!
60
59. n対nの流れ:Broadcastを分離
User B
User A
send “call” (broadcast)
createNewPeer
send “call” (broadcast)
send “response”
send offer sdp
send answer sdp
setRemoteDescription(sdp)
OK
createNewPeer
setRemoteDescription(sdp)
OK
send “response”
createNewPeer
User C
setRemoteDescription(sdp)
send offer sdp
createNewPeer
send answer sdp
setRemoteDescription(sdp)
OK
setRemoteDescription(sdp)
OK
61
60. 4 people ブラウザ側 (1) JavaScript
function call() {
if (! isLocalStreamStarted()) return;
socket.json.send({type: "call"});
}
function onMessage(evt) {
var id = evt.from;
var target = evt.sendto;
var conn = getConnection(id);
if (evt.type === 'call') {
if (! isLocalStreamStarted()) return;
if (conn) return; // already connected
if (isConnectPossible()) {
socket.json.send({type: "response", sendto: id });
}
else { console.warn('max connections. so ignore call');
}
}
else if (evt.type === 'response') {
sendOffer(id);
return;
}
}
62
61. 4 people ブラウザ側 (3) JavaScript
function sendOffer(id) {
var conn = getConnection(id);
if (!conn) {
conn = prepareNewConnection(id);
}
conn.peerconnection.createOffer(function (sessionDescription) { // in case of success
conn.iceReady = true;
conn.peerconnection.setLocalDescription(sessionDescription);
sessionDescription.sendto = conn.id;
socket.json.send(sessionDescription);
}, function () { // in case of error
console.log("Create Offer failed");
}, mediaConstraints);
conn.iceReady = true;
}
63
62. 4 people ブラウザ側 (3) JavaScript
function sendAnswer(id, evt) {
var conn = getConnection(id);
if (! conn) {
conn = prepareNewConnection(id);
}
conn.peerconnection.setRemoteDescription(new RTCSessionDescription(evt));
conn.peerconnection.createAnswer(function (sessionDescription) {
// in case of success
conn.iceReady = true;
conn.peerconnection.setLocalDescription(sessionDescription);
sessionDescription.sendto = id;
socket.json.send(sessionDescription);
}, function () { // in case of error
console.log("Create Answer failed");
}, mediaConstraints);
conn.iceReady = true;
}
64
63. 4 people ブラウザ側 (4) JavaScript
function prepareNewConnection(id) {
var pc_config = {"iceServers":[]};
var peer = null;
peer = new webkitRTCPeerConnection(pc_config);
var conn = new Connection();
conn.id = id;
conn.peerconnection = peer;
peer.id = id;
addConnection(id, conn);
// send any ice candidates to the other peer
peer.onicecandidate = function (evt) {
if (evt.candidate) {
socket.json.send({type: "candidate", sendto: conn.id,
sdpMLineIndex: evt.candidate.sdpMLineIndex, sdpMid: evt.candidate.sdpMid,
candidate: evt.candidate.candidate});
} else {
conn.established = true; // end of candidates
}
};
…
65
64. 4 people ブラウザ側 (5) JavaScript
var MAX_CONNECTION_COUNT = 3;
var connections = {}; // Connection hash
function Connection() { // Connection Class
var self = this;
var id = ""; // socket.id of partner
var peerconnection = null; // RTCPeerConnection instance
var established = false; // is Already Established
var iceReady = false;
}
function getConnection(id) {
var con = null;
con = connections[id];
return con;
}
function addConnection(id, connection) {
connections[id] = connection;
}
getConnectionCount(), isConnectPossible(), deleteConnection(id), …, etc.
66
65. 4 peopleサーバー (node.js)
socket.on('message', function(message) {
// set message sender
message.from = socket.id;
// send to specific target
var target = message.sendto;
if (target) {
io.sockets.socket(target).emit('message', message);
return;
}
// broadcast in room
emitMessage('message', message);
});
67