{"id":463,"date":"2022-12-09T06:54:15","date_gmt":"2022-12-09T06:54:15","guid":{"rendered":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/?p=463"},"modified":"2022-12-09T06:54:15","modified_gmt":"2022-12-09T06:54:15","slug":"spring-subsystems","status":"publish","type":"post","link":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/2022\/12\/09\/spring-subsystems\/","title":{"rendered":"Spring Subsystems"},"content":{"rendered":"\r\n<h2 class=\"wp-block-heading\">Localization<\/h2>\r\n \r\n\r\nThe localization subsystem determines pose of an agent given a map of the environment.\r\n\r\n \r\n<figure class=\"wp-block-table aligncenter is-style-regular\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>Inputs<\/td>\r\n<td>Output<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Initial estimated pose\r\nOccupancy grid map of environment\r\nWheel encoder ticks\r\nPlanar LIDAR range and bearing measurements<\/td>\r\n<td>Robot pose<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n \r\n\r\nThe system must be able to determine the pose of every agent in the map. Knowing the agents\u2019 poses is crucial for determining victim pose, task allocation, swarm control, and navigation. To accomplish this, the sensors on the agents are used. The user must also provide a map of the environment, as well as the initial positions of the agents in the map.\r\n\r\n \r\n\r\nFirstly, the wheel encoders are used to compute odometry. This first estimate is then used for laser scan matching, which refines the odometry calculation by lining up laser scans from two different time frames, resulting in a refined estimate for change in pose. This improved estimate is used to put the laser scan in the map frame, which is then compared to the provided map, and loop closure is performed by updating the agent pose. This process is done separately and independently for each agent, all of which are using the same map provided by the user.\r\n\r\n \r\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/6d3unhx5G9q8cG8Iqk9TNpIAf4F8wj-FlSMU1T2KCZvsV3exOBoSPqRQnMUhwxPWVrX_5gM5SmJsgW1hpTI3zjwkjowp6W1aZPMagtbxfSUoK_ad2IBF-OP3NUi2NN_xIjiad6nXPm_nLdyUlA\" width=\"309\" height=\"188\" \/><\/p>\r\n \r\n\r\nAccuracy testing was done in the VICON area in Professor Sycara\u2019s lab, using the VICON motion capture system as ground truth. An artificial environment was set up and mapped, then provided to the localization system. Testing revealed that the localization system was able to maintain agent position below 6 cm RMS, which was sufficient for our application.\r\n\r\n \r\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/A6aNrZF8mQqLtJ3ybQSlBedmuWGCQiAhHXvCG5SARLOID1GZLmx_GJtpTHP0Q88Omn79epUG5uX_3v8gv4r1-ZJYogb30ed8pZAidhb9hP6jRapbkp_4BGgTw-ZBNai-da9R5IKqNH9qZqWlqQ\" width=\"624\" height=\"185\" \/><\/p>\r\n \r\n\r\nOnce localization was proven to work in an artificial and controlled environment, we moved to testing in the real world. Testing near TechSpark in Scott Hall revealed the need for tuning of the localization parameters. We found multi-robot localization to be robust even in the presence of dynamic obstacles or obstacles that were not included in the map. We also found that we could make the agents move very quickly and aggressively without delocalization occurring, proving that localization is both accurate and robust enough for our application.\r\n\r\n \r\n<h2 class=\"wp-block-heading\">Task Generation<\/h2>\r\n \r\n\r\nThe task generation subsystem generates interest points or tasks for the robot to explore given an input map.\r\n\r\n \r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>Input<\/td>\r\n<td>Output<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Occupancy Grid Map<\/td>\r\n<td>Set of (x,y) nodes to be visited<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n \r\n\r\nThe subsystem is modeled as a maximization problem which aims to maximize the visibility of the room with the least amount of points possible. Its input is an occupancy grid map with free space represented as 1 and obstacles represented as 0, and outputs a set of (x,y) nodes to visit.\r\n\r\n \r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"154\" class=\"wp-image-351\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-content\/uploads\/sites\/59\/2022\/05\/Screen-Shot-2022-05-02-at-4.22.37-PM-1024x154.png\" alt=\"\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-content\/uploads\/sites\/59\/2022\/05\/Screen-Shot-2022-05-02-at-4.22.37-PM-1024x154.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-content\/uploads\/sites\/59\/2022\/05\/Screen-Shot-2022-05-02-at-4.22.37-PM-300x45.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-content\/uploads\/sites\/59\/2022\/05\/Screen-Shot-2022-05-02-at-4.22.37-PM-768x116.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-content\/uploads\/sites\/59\/2022\/05\/Screen-Shot-2022-05-02-at-4.22.37-PM-1536x231.png 1536w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-content\/uploads\/sites\/59\/2022\/05\/Screen-Shot-2022-05-02-at-4.22.37-PM-2048x309.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\r\n<\/div>\r\n \r\n\r\nOn this subsystem, various methods were analyzed to compute the required points for search. After trying out different types of algorithms, we narrowed down a frontier based search algorithm namely, Voronoi Search. The base algorithm was provided to our team by Authors of the paper Algorithm provided by authors of \u201c<a href=\"https:\/\/www.researchgate.net\/publication\/339408528_Improving_Autonomous_Exploration_Using_Reduced_Approximated_Generalized_Voronoi_Graphs\">Improving Autonomous Exploration Using Reduced Approximated Generalized Voronoi Graphs<\/a>\u201d.\r\n\r\n \r\n\r\nThis subsystem acts as a service and is invoked when called by the Task Allocator. As mentioned earlier, it takes in OGM as input and outputs x,y nodes to visit. The stack has been modified to control the number of points to explore: as few or as many as need be.\r\n\r\n \r\n<h2 class=\"wp-block-heading\">Task Allocation<\/h2>\r\n \r\n\r\nThe task allocation subsystem efficiently assigns each robot tasks such that all tasks are completed in minimal time.\r\n\r\n \r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>Inputs<\/td>\r\n<td>Outputs<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Occupancy grid map\r\n<em>n<\/em> Robots\r\n<em>m<\/em> Tasks\r\nRobot initial positions<\/td>\r\n<td>Next assigned task to robot <em>i<\/em><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n \r\n\r\nWe have implemented two different task allocation algorithms: greedy assignment, and Multiple Traveling Salesman (mTSP) assignment.\r\n\r\n \r\n\r\nWhile the greedy task allocator simply assigns the robot the nearest unvisited task, the mTSP task allocator formulates the task allocation problem as an optimization problem. It uses Constraint Programming (CP) to find a solution that satisfies all constraints of the problem (every task is visited only once, subtour elimination), and minimizes the maximum path cost. The path costs are calculated at the A* path length between each task.\r\n\r\n \r\n<p class=\"has-text-align-center\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/aGpMQay19-tTMV5FjSr5enV-42v-2UOyi9QuUyGEbxzfGbavJ02F2r5adkJ1L0h6VzT-ALXMkCP2ssrnDHPKWSZ6rY313DjDgvGf5Uos2vUN3w-Hdqw6rOqEszRYa5vlWkA7lEeuJQhZ\" width=\"409px;\" height=\"193px;\" \/><\/p>\r\n \r\n\r\nBy testing the task allocation algorithms in simulation, we found that the mTSP algorithm was on average 29% more optimal than the greedy algorithm. This exceeds our mandatory performance requirement, which was at 20%.\r\n\r\n \r\n<p class=\"has-text-align-center\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/UesoONOenIzQ-dNp-zcHwoBLadQEemoUBJdZJ_4n3DxkgHakPy62hVlNn4-c2GscgzCN0BQmtYG_bLRIixLCyBxVF6t1w_uV2YlQky1yYEH6T78zUmxpVg-6K1ZQ74Gfa18ZPv-1iuWuybMATQ\" width=\"470\" height=\"211.396\" \/><\/p>\r\n \r\n\r\nAdditionally, the task allocation subsystem is also able to dynamically reallocate tasks. For example, if an agent runs out of battery or crashes during search, the system is able to take the unfinished tasks and reallocate them to the remaining agents such that all tasks are still completed.\r\n\r\n \r\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/-66IhZS3YxQm4EyKqtk7SnH8iwxnIn15E8_bw6lfB_y50SSvTqC_vOD6s4b9lKdtfUlh9V31IC6rYITxfIv2oY-3a6Z4SsveaIQ89V3XaF5G00QDLpGP_pKcjZIjRE9WuXekPaaVUzJk-sVp1g\" width=\"624\" height=\"127\" \/><\/p>\r\n \r\n<h2 class=\"wp-block-heading\">Navigation<\/h2>\r\n \r\n\r\nThe navigation subsystem generates path and velocity commands for all robots to complete their aThe navigation subsystem is responsible for generating paths as well as velocity commands for all the agents such that the agents are able to navigate to their assigned tasks while avoiding collisions with each other and traverse the environment in the shortest time possible.\r\n\r\n \r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>Inputs<\/td>\r\n<td>Outputs<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Occupancy grid map of the environment\r\nInitial location of the agents\r\nGoal location of the agents<\/td>\r\n<td>Velocity commands<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n \r\n\r\nAs shown in the figure below, the navigation stack takes input from the FMS regarding the current agents in the fleet, takes the initial and goal positions of the agents from the task allocator and the map of the environment to first compute the path that the agents need to follow. Once the path for all the agents is computed, the mission executive sends these paths as goals to the controllers for each of the agents.\r\n\r\n \r\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Jw5-aIs7DLaKz4drGXDyBh1gjJYvtreYN7-secII-sqvMqmVnevgsc5wj5_QoZ820akzh8uaplZ12cY5y3kyW91ElL1kF7BDrLUrWZ69oYxfCqrHRTd50p5_Zz0pFNP55-xhB3vpeXxMsB6xBg\" width=\"528\" height=\"313\" \/><\/p>\r\n \r\n\r\nThe design of the navigation stack is outlined in fig 11. The prioritised multi A* planner, plans the trajectories for each of the agents on top of the 3d graph. These paths are sent to the pure pursuit controller, which computes the linear and angular velocities based on the error between the current position of the agent and the desired position. These linear and angular velocities are sent to the low level controller of the Khepera which converts these to wheel speeds.\r\n\r\n \r\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/-u6591ZTNJfBMUOpcbqsJ8vhfH-X0tmZceOeohcHBH1Je6SvL_ctQrcLG_GqmvkoXvdbe35nuUTdAbpUEYuyLhdJs2v5c0PQUvraNCQNnuecxHPXgoVeHBNlj4UdI6NrIKqzMc3BqrjAeC3cXQ\" width=\"624\" height=\"227\" \/><\/p>\r\n \r\n<h2 class=\"wp-block-heading\">Fleet Management<\/h2>\r\n \r\n\r\nThe fleet management system (FMS) is the bridge between the server and all the agents in the field. As depicted in the diagram the green functions are the ones which are already implemented currently in the spring. The red ones are on the schedule for the fall semester.\r\n\r\n \r\n<p class=\"has-text-align-center\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/RBXIYemnCDcL1SHtkky-Js-Fpv6Kx657wrsJs8xs9jg_q1Kim-NTx282lKlldaaWf_-cRCsRtTRTHDQAxFDcn9EO4NIGJMFoc32RNcABVRifz8PILRHBw9u0TTX7LWNbFMgGdAONou271sUNGQ\" width=\"512.4345999999999\" height=\"280\" \/><\/p>\r\n \r\n\r\nAt a high level, the FMS accepts a config file from the operators which contains information on all the robots in the fleet, then uses that to set up communication channels for transmission and receiving with all the robots in the fleet. It also monitors these connections during operation, decodes sensor data for the ROS network, logs this data in rotating log files and also informs all the other subsystems on any changes in the fleet.\r\n\r\n \r\n<h2 class=\"wp-block-heading\">Simulation<\/h2>\r\n \r\n\r\nThe RoboSAR system also includes a multi robot simulator which is based on the ROS stage simulator that we can use for testing and debugging our algorithms before transferring them to real hardware. This saved us a lot of time in the spring semester and will continue to prove instrumental in our plans for the fall semester!\r\n\r\n \r\n<p class=\"has-text-align-center\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/zVThIWr755tare0ODQux2Sq_OX0WGL4eXx2nQTtuwGe2vaWrD-A2k7Vniwa5Cj5Y9d88xEcgUolieotIJeNk46BgaNAkHtDJZTMR5Q91Wfgl_w1tkoAVGE8hBaqsOHfL-yfliBA8mbUBzI-qmL5RCA\" width=\"324px;\" height=\"276px;\" \/><\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Localization The localization subsystem determines pose of an agent given a map of the environment. Inputs Output Initial estimated pose Occupancy grid map of environment Wheel encoder ticks Planar LIDAR range and bearing measurements Robot pose The system must be able to determine the pose of every agent in the map. Knowing the agents\u2019 poses<br \/><a class=\"moretag\" href=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/2022\/12\/09\/spring-subsystems\/\">+ Read More<\/a><\/p>\n","protected":false},"author":276,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-463","post","type-post","status-publish","format-standard","hentry","category-subsystems"],"_links":{"self":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-json\/wp\/v2\/posts\/463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-json\/wp\/v2\/users\/276"}],"replies":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-json\/wp\/v2\/comments?post=463"}],"version-history":[{"count":1,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-json\/wp\/v2\/posts\/463\/revisions"}],"predecessor-version":[{"id":464,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-json\/wp\/v2\/posts\/463\/revisions\/464"}],"wp:attachment":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-json\/wp\/v2\/media?parent=463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-json\/wp\/v2\/categories?post=463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamf\/wp-json\/wp\/v2\/tags?post=463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}