diff --git a/README.md b/README.md index c85cf45dbc67f1dba8ab55b6c3f178c64be2d7fd..58f525bf245fa9e4d1c800995e4eb2b0f7dc8326 100644 --- a/README.md +++ b/README.md @@ -18,28 +18,29 @@ Use `connectomnibot` to create a TCP-connection. Whenever your script is done or ``` using Omnibot -host = ... -port = ... -bot = connectomnibot(host, port) +HOST = "xxx.xxx.xxx.xxx" +PORT = yyyy + +bot = connectomnibot(HOST, PORT) for i = 1:100 - setspeed(bot,[100,100,100]) - println("x: @(getx(bot))") - println("y: @(gety(bot))") - println("z: @(getz(bot))") - println("theta: @(gettheta(bot))") + setspeed(bot, [100, 100, 100]) + println("x: $(getx(bot))") + println("y: $(gety(bot))") + println("z: $(getz(bot))") + println("theta: $(gettheta(bot))") sleep(0.1) end close(bot) + ``` #### Example: Read the maximum set-point for servo speed ``` using Omnibot -host = ... -port = ... -bot = connectomnibot(host, port) +HOST = "xxx.xxx.xxx.xxx" +PORT = yyyy println(getmaxspeed(bot)) @@ -47,21 +48,21 @@ close(bot) ``` ### Example: `do x` syntax -The following example does practically the same as the first example. +The following example does practically the same as the first example, but is perhaps a bit safer as it automatically closes the bot-connection when exiting the `do x` block. ``` using Omnibot -host = ... -port = ... -connectomnibot(host, port) do bot +HOST = "xxx.xxx.xxx.xxx" +PORT = yyyy + +connectomnibot(HOST, PORT) do bot for i = 1:100 - setspeed(bot,[100,100,100]) - println("x: @(getx(bot))") - println("y: @(gety(bot))") - println("z: @(getz(bot))") - println("theta: @(gettheta(bot))") - sleep(0.1) + setspeed(bot, [100, 100, 100]) + println("x: $(getx(bot))") + println("y: $(gety(bot))") + println("z: $(getz(bot))") + println("theta: $(gettheta(bot))") sleep(0.1) end @@ -69,7 +70,7 @@ end ``` ### 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*. You can connect to this router via IP `130.235.83.171`. Use port `90XX` to rout to bot number `XX`, e.g. `9006` routs to bot number 6. +The omnibots automatically connect to the router named "robotlab". You can connect to the omnibots via this router, IP `130.235.83.171`. Use port `90XX` to rout to bot number `XX`, e.g. `9006` routs to bot number 6. ## Support