From 7fdb47ed4d22dc99dcfd2ce1c8ae1aedc6197d59 Mon Sep 17 00:00:00 2001 From: Felix Agner <felix.agner@control.lth.se> Date: Tue, 17 Oct 2023 08:46:35 +0200 Subject: [PATCH] Updated the readme --- README.md | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index c85cf45..58f525b 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 -- GitLab