First cut at phone to robot RPC - #1
Conversation
| /home/citrus/wpilib/user/java/lib/libCTRE_PhoenixCCI.so=8f5e4ab9156fdf558f7805d280dab06a | ||
| C\:\\Users\\Michael\\wpilib\\user\\java\\lib\\libCTRE_PhoenixCCI.so=e02aeb19c8a0962f906f1bbbb0100fc6 | ||
| C\:\\Users\\TrcUser\\wpilib\\user\\java\\lib\\libCTRE_PhoenixCCI.so=e02aeb19c8a0962f906f1bbbb0100fc6 | ||
| C\:\\Users\\Abhay\\wpilib\\user\\java\\lib\\libCTRE_PhoenixCCI.so=8f5e4ab9156fdf558f7805d280dab06a |
There was a problem hiding this comment.
I'm curious what this file is for.
| * | ||
| * @author Artem Prigoda | ||
| */ | ||
| public class JsonRpcClient { |
There was a problem hiding this comment.
It would be nice to pull in library code from other teams as jar files instead of as raw source. That would help keep our source tree more minimal, make it easier to navigate, and also make it easier to upgrade library versions over time.
Usually we only import raw source for libraries if we need to alter the library ourselves for some reason and can't or don't want to maintain our own builds of it.
|
|
||
| public AdbBridge(Path location) | ||
| { | ||
| bin_location_ = location; |
There was a problem hiding this comment.
I see that there are two different ways to override the path to the binary - either via this second constructor, or the first constructor via the environment variable. Any idea which way people would prefer to change the path? I'm curious if we need both ways to do that.
|
|
||
| import com.github.arteam.simplejsonrpc.client.Transport; | ||
|
|
||
| public class AwooCommunicator implements Transport |
There was a problem hiding this comment.
We might be able to skip writing all of this code if we were to use jsonrpc4j instead - it looks like it offers a SocketServer that can work with InputStream and OutputStreams directly, which would pair up nicely with the Socket provided by ADB.
I've only looked very briefly, so probably needs some investigation - here's a link: https://github.com/briandilley/jsonrpc4j
| { | ||
| private int port; | ||
| private BufferedWriter bw; | ||
| private Socket kemono; |
There was a problem hiding this comment.
This is a bit unusual of a name for a socket.
| awooCommunicator = new AwooCommunicator(13970); | ||
| awooCommunicator.initCommunicator(); | ||
|
|
||
| rpcClient = new JsonRpcClient(awooCommunicator); |
There was a problem hiding this comment.
It would be nice to hide more of these setup details outside of Robot.java such that users of the class do not need to know all of these details to get it work.
| diagnostics = new OnBoardDiagnostics(this); | ||
|
|
||
|
|
||
| // ayyioasjfasfdjisagoibdsaofisajo;bas;ofjsaiojfasiojgisaofj |
There was a problem hiding this comment.
That's a rather creative comment.
No description provided.