Skip to content
Snippets Groups Projects
Commit a8454b01 authored by Felix Agner's avatar Felix Agner
Browse files

changed to not always have the same port

parent d5f97740
Branches
No related tags found
No related merge requests found
......@@ -18,8 +18,9 @@ Use `connectomnibot` to create a TCP-connection. Whenever your script is done or
```
using Omnibot
ip = ...
bot = connectomnibot(ip)
host = ...
port = ...
bot = connectomnibot(host, port)
for i = 1:100
setspeeds(bot,[100,100,100])
......@@ -36,8 +37,9 @@ close(bot)
```
using Omnibot
ip = ...
bot = connectomnibot(ip)
host = ...
port = ...
bot = connectomnibot(host, port)
println(getmaxspeed(bot))
......@@ -45,7 +47,7 @@ close(bot)
```
### Network
At the department of automatic control, you should be connected to the omnibots via the same router. Currently this has been done with the router with name *robotlab*, where the IP naming conventions for the robots are `192.168.0.10X` for robot with name `omniX`, i.e. omnibot `omni6` has IP `192.168.0.106`.
At the department of automatic control, you should be connected to the omnibots via the same router. Currently this has been done with the router with name *robotlab*. IP and port conventions: Robot with name *omniX* has IP `192.168.0.10X` and port `900X` e.g.. omnibot `omni10` has IP `192.168.0.110`and port `9006`.
## Support
......
"""
connectomnibot(ip::String;port::Int=9998)
connectomnibot(ip::String, port::Int)
Connect to the omnibot with `ip` and `port`. Return a `TCPSocket` with open connection.
"""
function connectomnibot(ip::String;port::Int=9998)
function connectomnibot(ip::String, port::Int)
return connect(ip,port)
end
"""
connectomnibot(ip::IPv4;port::Int=9998)
connectomnibot(ip::IPv4;port::Int)
Also callable with an IPv4 type argument
"""
function connectomnibot(ip::IPv4;port::Int=9998)
function connectomnibot(ip::IPv4, port::Int)
return connect(ip,port)
end
......@@ -2,7 +2,8 @@ using Omnibot
using Sockets
ip = getipaddr()
bot = connectomnibot(ip,port=9998)
port = 9998
bot = connectomnibot(ip,port)
for i = 1:100
println(setspeed(bot,[100,100,100]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment