{"id":590,"date":"2015-11-30T10:17:26","date_gmt":"2015-11-30T10:17:26","guid":{"rendered":"http:\/\/jafma.net\/ana\/theweekendarchaeologist\/?p=590"},"modified":"2015-11-30T10:17:26","modified_gmt":"2015-11-30T10:17:26","slug":"turtlebot-2-movement-analysis","status":"publish","type":"post","link":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/?p=590","title":{"rendered":"Turtlebot 2 movement analysis"},"content":{"rendered":"<a class=\"synved-social-button synved-social-button-share synved-social-size-16 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"http:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fjafma.net%2Fana%2Ftheweekendarchaeologist%2Findex.php%3Frest_route%3D%252Fwp%252Fv2%252Fposts%252F590&#038;t=Turtlebot%202%20movement%20analysis&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fjafma.net%2Fana%2Ftheweekendarchaeologist%2Findex.php%3Frest_route%3D%252Fwp%252Fv2%252Fposts%252F590&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=Turtlebot%202%20movement%20analysis\" style=\"font-size: 0px; width:16px;height:16px;margin:0;margin-bottom:5px;margin-right:5px;\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"16\" height=\"16\" style=\"display: inline; width:16px;height:16px; margin: 0; padding: 0; border: none; box-shadow: none;\" src=\"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/32x32\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-16 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fjafma.net%2Fana%2Ftheweekendarchaeologist%2Findex.php%3Frest_route%3D%252Fwp%252Fv2%252Fposts%252F590&#038;text=Check%20this%20out%20%2F%20Mira%20esto\" style=\"font-size: 0px; width:16px;height:16px;margin:0;margin-bottom:5px;margin-right:5px;\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"16\" height=\"16\" style=\"display: inline; width:16px;height:16px; margin: 0; padding: 0; border: none; box-shadow: none;\" src=\"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/32x32\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-16 synved-social-resolution-single synved-social-provider-reddit nolightbox\" data-provider=\"reddit\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Reddit\" href=\"http:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fjafma.net%2Fana%2Ftheweekendarchaeologist%2Findex.php%3Frest_route%3D%252Fwp%252Fv2%252Fposts%252F590&#038;title=Turtlebot%202%20movement%20analysis\" style=\"font-size: 0px; width:16px;height:16px;margin:0;margin-bottom:5px;margin-right:5px;\"><img loading=\"lazy\" decoding=\"async\" alt=\"reddit\" title=\"Share on Reddit\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"16\" height=\"16\" style=\"display: inline; width:16px;height:16px; margin: 0; padding: 0; border: none; box-shadow: none;\" src=\"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/32x32\/reddit.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-16 synved-social-resolution-single synved-social-provider-pinterest nolightbox\" data-provider=\"pinterest\" target=\"_blank\" rel=\"nofollow\" title=\"Pin it with Pinterest\" href=\"http:\/\/pinterest.com\/pin\/create\/button\/?url=https%3A%2F%2Fjafma.net%2Fana%2Ftheweekendarchaeologist%2Findex.php%3Frest_route%3D%252Fwp%252Fv2%252Fposts%252F590&#038;media=&#038;description=Turtlebot%202%20movement%20analysis\" style=\"font-size: 0px; width:16px;height:16px;margin:0;margin-bottom:5px;margin-right:5px;\"><img loading=\"lazy\" decoding=\"async\" alt=\"pinterest\" title=\"Pin it with Pinterest\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"16\" height=\"16\" style=\"display: inline; width:16px;height:16px; margin: 0; padding: 0; border: none; box-shadow: none;\" src=\"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/32x32\/pinterest.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-16 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"http:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fjafma.net%2Fana%2Ftheweekendarchaeologist%2Findex.php%3Frest_route%3D%252Fwp%252Fv2%252Fposts%252F590&#038;title=Turtlebot%202%20movement%20analysis\" style=\"font-size: 0px; width:16px;height:16px;margin:0;margin-bottom:5px;margin-right:5px;\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"16\" height=\"16\" style=\"display: inline; width:16px;height:16px; margin: 0; padding: 0; border: none; box-shadow: none;\" src=\"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/32x32\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-16 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Turtlebot%202%20movement%20analysis&#038;body=Check%20this%20out%20%2F%20Mira%20esto:%20https%3A%2F%2Fjafma.net%2Fana%2Ftheweekendarchaeologist%2Findex.php%3Frest_route%3D%252Fwp%252Fv2%252Fposts%252F590\" style=\"font-size: 0px; width:16px;height:16px;margin:0;margin-bottom:5px;\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"16\" height=\"16\" style=\"display: inline; width:16px;height:16px; margin: 0; padding: 0; border: none; box-shadow: none;\" src=\"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/32x32\/mail.png\" \/><\/a><p style=\"text-align: justify;\"><a id=\"spanish\"><\/a><br \/>\n<a href=\"#english\">[In English]<\/a><\/p>\n<p style=\"text-align: justify;\">Ahora que ya tenemos el Turtlebot 2 andando, hemos querido caracterizar los motores cuando se mueven con la carga inicial del robot. Para ello, hemos seguido los siguientes pasos, que est\u00e1n documentados en el v\u00eddeo al final del post; en mi repositorio de GitHub est\u00e1 el c\u00f3digo <a href=\"https:\/\/github.com\/WeekendArchaeo\/ROS\/blob\/master\/kobuki_testing.cpp\" target=\"_blank\">C++<\/a>, <a href=\"https:\/\/github.com\/WeekendArchaeo\/Matlab\/blob\/master\/turtlebotencodersplots.m\" target=\"_blank\">Matlab<\/a> y <a href=\"https:\/\/github.com\/WeekendArchaeo\/R\/blob\/master\/turtlebotencodersplots.R\" target=\"_blank\">R<\/a>:<\/p>\n<ul>\n<li style=\"text-align: justify;\">Hemos creado un nodo ROS que mueve al robot con velocidad lineal x=0.1 m\/sec, y almacena en fichero las medidas de los encoders de ambos motores junto con dos marcas de tiempo: las asociadas a los mensajes ROS, y las grabadas por la base Kobuki.<\/li>\n<li style=\"text-align: justify;\">Despu\u00e9s, analizamos las medidas con Matlab.\n<ul>\n<li style=\"text-align: justify;\">Primero, hemos representado gr\u00e1ficamente las medidas de los ticks frente a los dos tipos de marcas de tiempos (tanto relativas como absolutas).<\/li>\n<li style=\"text-align: justify;\">En segundo lugar hemos representado la velocidad de cada rueda, entendiendo velocidad como la relaci\u00f3n entre ticks y variaci\u00f3n de tiempo. En el v\u00eddeo se observa que la velocidad aparece como rads\/sec; para hacer la transformaci\u00f3n nos hemos basado en <a href=\"http:\/\/kobuki.yujinrobot.com\/home-en\/about\/specifications\/\" target=\"_blank\">las especificaciones de la base Kobuki<\/a>. Si manualmente se hace el c\u00e1lculo V = r*\u03c9 se observa que todo es correcto.<\/li>\n<li style=\"text-align: justify;\">En tercer lugar, aprovechando la Control Toolbox de Matlab, hemos hecho una identificaci\u00f3n de los motores de las ruedas usando un m\u00e9todo de aproximaci\u00f3n mediante sistemas de primer orden con retraso. La K y la \u03c4 obtenidas se han tomado como base para hacer despu\u00e9s un reajuste manual, que se adapta bastante bien a los datos reales (sobre todo en el caso del motor derecho).<\/li>\n<\/ul>\n<\/li>\n<li style=\"text-align: justify;\">Finalmente, hemos hecho una representaci\u00f3n muy b\u00e1sica (a\u00fan sin usar ggplot2, estamos trabajando en ello \ud83d\ude09 ) en R.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\n<a id=\"english\"><\/a><br \/>\n<a href=\"#spanish\">[En espa\u00f1ol]<\/a><\/p>\n<p style=\"text-align: justify;\">Now that our Turtlebot moves, we have characterized its motors when they are moving bearing the initial load of the robot. We have followed these steps, which are documented in the video at the botton of this post; my GitHub repository stores the <a href=\"https:\/\/github.com\/WeekendArchaeo\/ROS\/blob\/master\/kobuki_testing.cpp\" target=\"_blank\">C++<\/a>, <a href=\"https:\/\/github.com\/WeekendArchaeo\/Matlab\/blob\/master\/turtlebotencodersplots.m\" target=\"_blank\">Matlab<\/a> and <a href=\"https:\/\/github.com\/WeekendArchaeo\/R\/blob\/master\/turtlebotencodersplots.R\" target=\"_blank\">R <\/a>code<a href=\"https:\/\/github.com\/WeekendArchaeo\/R\/blob\/master\/turtlebotencodersplots.R\" target=\"_blank\">:<\/a><\/p>\n<ul>\n<li style=\"text-align: justify;\">We have created a ROS node that makes the robot move with a linear x speed=0.1 m\/sec, and then writes to a file the measurements of both encoders along with two timestamps: those related to ROS messages, and those taken by the Kobuki base.<\/li>\n<li style=\"text-align: justify;\">Then, we have analysed the data using Matlab.\n<ul>\n<li style=\"text-align: justify;\">First, we have plotted the ticks values versus both timestamps (both relative and absolute).<\/li>\n<li style=\"text-align: justify;\">In the second place, we have plotted the speed of each wheel, where speed is the relationship between ticks and time difference. You can see in the video that speed is represented as rads\/sec; we transformed the values using the <a href=\"http:\/\/kobuki.yujinrobot.com\/home-en\/about\/specifications\/\" target=\"_blank\">Kobuki mobile base specifications<\/a>. If you do your maths by hand (V = r*\u03c9), you will see that calculations are correct.<\/li>\n<li style=\"text-align: justify;\">In the third place, using the Control Toolbox provided by Matlab, we did the identification of both motors with an approximation using a first order system with delay. The resulting K and \u03c4 are the basis for a manual recalculation, which fits quite well to the real data (especially, for the right motor).<\/li>\n<\/ul>\n<\/li>\n<li style=\"text-align: justify;\">Finally, we prepared a very basic R plotting (still without ggplot2, but we are working on it \ud83d\ude09 )<\/li>\n<\/ul>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/0IUIptUqJkg\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[In English] Ahora que ya tenemos el Turtlebot 2 andando, hemos querido caracterizar los motores cuando se mueven con la carga inicial del robot. Para ello, hemos seguido los siguientes pasos, que est\u00e1n documentados en el v\u00eddeo al final del post; en mi repositorio de GitHub est\u00e1 el c\u00f3digo C++, Matlab y R: Hemos creado &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/?p=590\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Turtlebot 2 movement analysis&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10],"tags":[47,21,25,44],"_links":{"self":[{"href":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/index.php?rest_route=\/wp\/v2\/posts\/590"}],"collection":[{"href":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=590"}],"version-history":[{"count":5,"href":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/index.php?rest_route=\/wp\/v2\/posts\/590\/revisions"}],"predecessor-version":[{"id":596,"href":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/index.php?rest_route=\/wp\/v2\/posts\/590\/revisions\/596"}],"wp:attachment":[{"href":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jafma.net\/ana\/theweekendarchaeologist\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}