{"id":360,"date":"2020-04-03T04:08:49","date_gmt":"2020-04-03T04:08:49","guid":{"rendered":"http:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/?page_id=360"},"modified":"2020-12-18T21:45:58","modified_gmt":"2020-12-18T21:45:58","slug":"exploration-subsystem","status":"publish","type":"page","link":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/exploration-subsystem\/","title":{"rendered":"Goal Generation Subsystem"},"content":{"rendered":"\n<p>Given a lane detected in the 2D image, we need to translate the lane&#8217;s position on to the cost map generated by the navigation stack so that the paths generated are within the lane. We take a two-stage approach to implement this:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Re-project lane line into 3D lane cloud<\/li><li>Add a &#8220;lane&#8221; observation source to move_base to register lane on costmap<\/li><\/ol>\n\n\n\n<p>For the re-projection, we first register the depth image onto the RGB image using either RTAB&#8217;s depth_registration nodelet (on the husky) or image_view&#8217;s depth registration utility (in simulation). We use the RGB camera&#8217;s intrinsics to reproject the line onto 3D.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image.png\" alt=\"\" class=\"wp-image-606\" width=\"452\" height=\"378\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-300x252.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-230x193.png 230w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-350x294.png 350w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\">Husky in the gazebo world<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-1.png\" alt=\"\" class=\"wp-image-607\" width=\"440\" height=\"285\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-1.png 481w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-1-300x195.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-1-230x149.png 230w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-1-350x227.png 350w\" sizes=\"auto, (max-width: 440px) 100vw, 440px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\">Reprojected lane<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-2.png\" alt=\"\" class=\"wp-image-609\" width=\"584\" height=\"293\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-2.png 502w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-2-300x151.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-2-230x115.png 230w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-2-350x176.png 350w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-2-480x241.png 480w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\">Handling turns<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"638\" height=\"308\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-3.png\" alt=\"\" class=\"wp-image-610\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-3.png 638w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-3-300x145.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-3-230x111.png 230w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-3-350x169.png 350w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-3-480x232.png 480w\" sizes=\"auto, (max-width: 638px) 100vw, 638px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\">Reprojected Turn<\/p>\n\n\n\n<p>Cost map Registration:<\/p>\n\n\n\n<p>We use move_base&#8217;s plugin utility to add a fake lane sensor plugin which marks and clears obstacles on the costmap. The observation source was the pointcloud of the lane we reprojected<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"299\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-5.png\" alt=\"\" class=\"wp-image-612\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-5.png 872w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-5-300x103.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-5-768x263.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-5-830x285.png 830w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-5-230x79.png 230w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-5-350x120.png 350w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/10\/image-5-480x165.png 480w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\">Lane registered on the costmap<\/p>\n\n\n\n<p>Goal Generation:<\/p>\n\n\n\n<p>From this constrained costmap, the initial idea was to generate a goal by searching in front of the robot inside the lane. However, computing the position and yaw from just a local grid costmap with obstacle has proven to be challenging due to the following reasons:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Finding the center of the lane seems to be quite a challenge as there isn&#8217;t a lane line clearly registered on the map at times resulting in broken side lane constraint.<\/li><li>Even if we find frontiers, choosing the best one seems to be difficult as defining the center of the lane from that local view is hard.<\/li><li>Generating yaw requires interpolating the tangent of the lane<\/li><\/ul>\n\n\n\n<p>In order to overcome these, we&#8217;re moving ahead with generating the goal using the 3D lane as the prior. The idea is to translate the lane segment&#8217;s midpoint by a distance lane_width\/2 in the direction normal to the lane and generate the yaw using the line&#8217;s direction. We hope this works around curves due to a piece-wise approximation of the curve as a line.<\/p>\n\n\n\n<p><strong>3D lane based goal generation<\/strong><\/p>\n\n\n\n<p>From our sampled lane line in 2D, we reproject the lane pixels to 3D using the depth map and the camera intrinsics. This forms the center lane line. Extending this along the perpendicular direction, gives us the other lane boundary. These were used in projecting down to costmap to constrain the planner.<br><br>We extract another line (called &#8220;ego-line&#8221;) interpolated at a distance of 0.6*lane width from the center lane. 0.6 instead of 0.5 as it resulted in better performance on real-world experiments due to lower loss of lane line in the FOV of the camera over the turns in the environment. A few variants for generating the goal pose were implemented using this ego-line:<br><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Mid point of the ego-line cloud and principal direction of the cloud.<\/li><li>Mid point of the ego-line cloud adjusted into the costmap by the amount of line extended outside the costmap and the principal direction of the cloud<\/li><li>A tunable distance from the start of the cloud and the principal direction of the cloud.<\/li><\/ol>\n\n\n\n<p>We ended up using variant 2 as it removed an extra parameter to tune and ensure the generated goals were valid for the planner. The goal generated from the cloud is in 3D. We force it to 2D by setting the pitch and roll to zero and clear the z coordinate also.<br><br>Some of our real-world goal poses and simulation poses are shown below:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"439\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/exploration_goal.png\" alt=\"\" class=\"wp-image-728\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/exploration_goal.png 482w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/exploration_goal-300x273.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/exploration_goal-230x209.png 230w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/exploration_goal-350x319.png 350w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/exploration_goal-480x437.png 480w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\" \/><figcaption>Exploration goal in simulation (Green arrow represents 2D pose)<\/figcaption><\/figure><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"889\" height=\"501\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/image.png\" alt=\"\" class=\"wp-image-729\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/image.png 889w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/image-300x169.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/image-768x433.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/image-830x468.png 830w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/image-230x130.png 230w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/image-350x197.png 350w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-content\/uploads\/sites\/48\/2020\/12\/image-480x271.png 480w\" sizes=\"auto, (max-width: 889px) 100vw, 889px\" \/><figcaption>One of the goals generated in the parking lot. Green arrow shows the generated target pose <\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Given a lane detected in the 2D image, we need to translate the lane&#8217;s position on to the cost map generated by [&hellip;]<\/p>\n","protected":false},"author":218,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-templates\/page_fullwidth.php","meta":{"footnotes":""},"class_list":["post-360","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-json\/wp\/v2\/pages\/360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-json\/wp\/v2\/users\/218"}],"replies":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-json\/wp\/v2\/comments?post=360"}],"version-history":[{"count":13,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-json\/wp\/v2\/pages\/360\/revisions"}],"predecessor-version":[{"id":730,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-json\/wp\/v2\/pages\/360\/revisions\/730"}],"wp:attachment":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teami\/wp-json\/wp\/v2\/media?parent=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}