This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## @param Gist:tytle=gist|type=string|required=true | |
#set ($gist = $paramGist + ".js") | |
<script src="https://gist.github.com/$gist"> </script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$output = array( | |
"param1" => isset($_GET["param1"]) ? $_GET["param1"] : "data1", | |
"param2" => isset($_GET["param2"]) ? $_GET["param2"] : "data2", | |
); | |
$json = json_encode($output); | |
header( 'Content-Type: application/json; cahrset=utf8' ); | |
echo isset($_GET["callback"]) ? "{$_GET["callback"]}($json)" : $json; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header( 'Content-Type: application/json; cahrset=utf8' ); | |
if (isset($_GET['callback'])) { | |
# callbackが設定されているときはJSONPエンコーディングして応答 | |
$callback = $_GET['callback']; | |
unset($_GET['callback']); | |
echo "{$callback}(", json_encode($_GET), ")"; | |
} else { | |
# パラメータをJSONエンコーディングして応答 | |
echo json_encode($_GET); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.ros.address.*; | |
@Override | |
protected void init(NodeMainExecutor nodeMainExecutor) { | |
talker = new Talker(); | |
NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress().toString()); | |
// At this point, the user has already been prompted to either enter the URI | |
// of a master to use or to start a master locally. | |
nodeConfiguration.setMasterUri(getMasterUri()); | |
nodeMainExecutor.execute(talker, nodeConfiguration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.test; | |
import android.os.Bundle; | |
import android.app.Activity; | |
import android.view.Menu; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.util.Log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.rosbridge; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import android.os.Bundle; | |
import android.app.Activity; | |
import android.util.Log; | |
import android.view.Menu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var WebSocketClient = require('websocket').client; | |
var wsc = new WebSocketClient(); | |
var net = require('net'); | |
var socket = net.connect("8080"); | |
// ADBからの入力データを処理するハンドラを登録 | |
socket.on('data', function (c) { | |
var s = c.toString(); | |
console.log(s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
var socket = net.connect("8080"); | |
socket.on('connect', function () { | |
var msg = { op: 'subscribe', topic: 'chatter', type: 'std_msgs/String' }; | |
socket.write(JSON.stringify(msg)); | |
}); | |
socket.on('data', function (c) { | |
var s = c.toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- PIAXDTNSample.java (revision 39) | |
+++ PIAXDTNSample.java (working copy) | |
@@ -1,12 +1,22 @@ | |
package org.piax.sample; | |
+import java.io.IOException; | |
+import java.io.InputStream; | |
+import java.io.OutputStream; | |
+import java.net.ServerSocket; | |
+import java.net.Socket; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.piax.sample; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.net.Socket; | |
import android.util.Log; | |
import org.piax.dtpubsub.DTPubSub; |