{"id":503,"date":"2020-03-30T19:56:40","date_gmt":"2020-03-30T19:56:40","guid":{"rendered":"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/?page_id=503"},"modified":"2020-12-18T04:08:09","modified_gmt":"2020-12-18T04:08:09","slug":"perception","status":"publish","type":"page","link":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/perception\/","title":{"rendered":"Sensing"},"content":{"rendered":"<h2>Visual Servo<\/h2>\n<p>Our sensing subsystem is mainly used for visual servoing, with the package and balcony platform as targets.<\/p>\n<p><span style=\"font-weight: 400\">The camera-input takes in the stream of RGB images captured by the camera. It detects the existence of any AprilTags in the image, identifies if it belongs to a package or platform, and calculates and sends the pose transformation information to the planning subsystem. The camera input will also be used to perform simple wall and obstacle detection, which we might utilize the point cloud sensor data type.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-606 aligncenter\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/perception-graph-300x134.png\" alt=\"\" width=\"830\" height=\"371\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/perception-graph-300x134.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/perception-graph-768x343.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/perception-graph-1024x458.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/perception-graph.png 1107w\" sizes=\"auto, (max-width: 830px) 100vw, 830px\" \/><\/p>\n<p>As of May of 2020, most of the progress of the visual servo has been in Gazebo simulation, due to the COVID-19 outbreak.<\/p>\n<p>We utilize the realsense_gazebo_plugin package to implement two simulated RealSense D435i cameras, both attached to our simulated drone, one\u00a0p<span style=\"font-weight: 400\">ointing straight down to detect packages, the other pointing 25 degrees forward from the z-axis.\u00a0<\/span><span style=\"font-weight: 400\">When the package is gripped and being transported, the <\/span>bottom camera will be blocked<span style=\"font-weight: 400\">, thus we need an additional camera for the visual servoing of the platform. The front tilt also helps with the platform servo, since it allows the drone to not be right on top of the AprilTag and risk hitting the eaves.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-817 aligncenter\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/05\/Screenshot-from-2020-04-15-03-32-01-296x300.png\" alt=\"\" width=\"296\" height=\"300\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/05\/Screenshot-from-2020-04-15-03-32-01-296x300.png 296w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/05\/Screenshot-from-2020-04-15-03-32-01.png 682w\" sizes=\"auto, (max-width: 296px) 100vw, 296px\" \/><\/p>\n<p>With the transformation from the drone to the AprilTag, we are able to use the global coordinates of the drone to obtain the global coordinate of the package location in every frame where the AprilTag is detected. we publish these coordinates to the navigation subsystem to generate waypoints for the drone to fly directly on top of the package in range to activate the gripper and pick up the package.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/media.giphy.com\/media\/YP790gKMkqXI3sYANY\/giphy.gif\" \/><\/p>\n<p>Here are the performance statistics of our visual servo function, for both the package servo and platform servo:<\/p>\n<table>\n<tbody>\n<tr>\n<td style=\"text-align: center\">\u00a0<\/td>\n<td style=\"text-align: center\"><b># of tests<\/b><\/td>\n<td style=\"text-align: center\"><b># of success<\/b><\/td>\n<td style=\"text-align: center\"><b>Success Rate<\/b><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center\"><b>Package<\/b><\/td>\n<td>\n<p style=\"text-align: center\"><span style=\"font-weight: 400\">20<\/span><\/p>\n<\/td>\n<td>\n<p style=\"text-align: center\"><span style=\"font-weight: 400\">20<\/span><\/p>\n<\/td>\n<td>\n<p style=\"text-align: center\"><span style=\"font-weight: 400\">100%<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p style=\"text-align: center\"><b>Platform<\/b><\/p>\n<\/td>\n<td>\n<p style=\"text-align: center\"><span style=\"font-weight: 400\">20<\/span><\/p>\n<\/td>\n<td>\n<p style=\"text-align: center\"><span style=\"font-weight: 400\">19<\/span><\/p>\n<\/td>\n<td>\n<p style=\"text-align: center\"><span style=\"font-weight: 400\">95%<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Camera<\/h2>\n<p>To meet the needs mentioned in the previous section, we decided to use the Intel RealSense Depth Camera D435i, and we are currently only using the RGB sensor functions of this camera. There is also a laser depth sensor and an\u00a0 IMU implemented in the RealSense D435i which we might utilize in the future.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-588 aligncenter\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/41LaVXUyPcL._AC_SX679_-300x123.jpg\" alt=\"\" width=\"488\" height=\"200\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/41LaVXUyPcL._AC_SX679_-300x123.jpg 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/41LaVXUyPcL._AC_SX679_.jpg 675w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><\/p>\n<p>Camera Update<\/p>\n<p>\u00a0<\/p>\n<p>Although the RealSense is a powerful piece of hardware, it has some compatibility issues with our system. The D435i pulls too much current from the system, causing the GPS to shut off. We even switched off all the functions that are not in uses on the ReaslSense (IMU, depth) and it is still drawing too much. Thus, we decided to switch to Microsoft LifeCam, which is a USB webcam with RGB only. After the switch, everything worked fine.<\/p>\n<p><strong><img decoding=\"async\" src=\"https:\/\/compass-ssl.microsoft.com\/assets\/93\/2e\/932e9274-2758-43fc-80b9-0c7ba78bedfe.jpg?n=ic_lcc_2_otherviews02.jpg\" alt=\"Microsoft Webcam: LifeCam Cinema | Microsoft Accessories\" \/><\/strong><\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<h2>Software Packages<\/h2>\n<p>We use the realsense-ros package for the ROS wrapper, which is the driver to receive RealSense sensor data for ROS. The ROS wrapper requires the official RealSense Camera Software Development Kit &#8211; librealsense. For the AprilTag tracking, the apriltags_ros package provides the pose transformations of the AprilTag. Below is an image of using all three of these packages to detect an AprilTag using the RealSense Camera, visualized in Rviz.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-631 aligncenter\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/Capture-300x215.png\" alt=\"\" width=\"539\" height=\"386\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/Capture-300x215.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/Capture-768x550.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/04\/Capture.png 777w\" sizes=\"auto, (max-width: 539px) 100vw, 539px\" \/><\/p>\n\n\n<h2 class=\"wp-block-heading\">Mounting Design and Installation<\/h2>\n\n\n\n<p>We designed it in Solidworks, and made the front camera angle-adjustable. The connecting peice is 3D printed with PLA, and subsequently installed onto the drone. Below is the original camera mount design for the RealSense D435i.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/10\/unnamed-1-1-1024x768.png\" alt=\"\" class=\"wp-image-888\" width=\"512\" height=\"384\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/10\/unnamed-1-1-1024x768.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/10\/unnamed-1-1-300x225.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/10\/unnamed-1-1-768x576.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/10\/unnamed-1-1-1536x1152.png 1536w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/10\/unnamed-1-1.png 1600w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><figcaption><br><\/figcaption><\/figure><\/div>\n\n\n\n<p>Below is the CAD drawing screenshot of the new design for Microsoft LifeCam.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/Screenshot-from-2020-12-12-11-37-01-300x260.png\" alt=\"\" width=\"414\" height=\"359\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Visual Servoing without GPS<\/h3>\n\n\n\n<p>In a field test, we found out that the GPS error from the drone is too high for precise pickup, mostly the Z direction\u2019s error. The error was about 0.5 meters, which would have a significant chance of crashing into the ground. As a result, we needed to change our previous visual servoing with the position-based controller to the velocity-based controller as the DJI&#8217;s velocity controller is much more accurate.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"502\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/image-1024x502.png\" alt=\"\" class=\"wp-image-1005\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/image-1024x502.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/image-300x147.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/image-768x376.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/image.png 1165w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"398\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/image-1-1024x398.png\" alt=\"\" class=\"wp-image-1007\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/image-1-1024x398.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/image-1-300x117.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/image-1-768x298.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/image-1.png 1205w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The new visual servoing will only consider the tag\u2019s pose to compute the corresponding velocity and send directly to the drone interface, bypassing the pose controller as in the previous version. With the updated visual servoing, the drone can make a smoother descend as it does not depend on the odometry to navigate.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Visual Servoing Defensive Behavior<\/h3>\n\n\n\n<p>With the previously implemented visual servoing without GPS, our drone works well in simulation. However, because we found out that the hertz rate of the camera in the drone is neither stable nor decently fast when unit testing them and that wind could make the April tag out-of-view, I implemented more safety-guard steps within visual servoing to ensure that the drone see the April tag stably before executing the grasping. The updated visual servoing behavior will have several parameters for tuning to adapt to the environment that we will test on.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"635\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/Screen-Shot-2020-12-15-at-9.29.57-PM-1024x635.png\" alt=\"\" class=\"wp-image-1016\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/Screen-Shot-2020-12-15-at-9.29.57-PM-1024x635.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/Screen-Shot-2020-12-15-at-9.29.57-PM-300x186.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/Screen-Shot-2020-12-15-at-9.29.57-PM-768x477.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-content\/uploads\/sites\/45\/2020\/12\/Screen-Shot-2020-12-15-at-9.29.57-PM.png 1465w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The diagram above illustrates the drone&#8217;s states during the visual servoing process and some of the parameters that would help the robot to grasp the box in harsh environments defensively, specifically: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>maximum_tag_time<\/strong>: The maximum seconds from now that the detection must be within to be considered.<\/li><li><strong>fly_up_time<\/strong>: The maximum seconds from now that the detection must be within to be considered.<\/li><li><strong>hover_distance<\/strong>: The z distance above the April tag that the drone needs to fly to.<\/li><li><strong>minimum_detection_times<\/strong>: The minimum times that the April Tag needs to be seen after the drone reached the point above the April tag.<\/li><li><strong>dropdown_velocity_z:<\/strong> The dropdown velocity in direction z for the drone to grasp the box<\/li><li><strong>acceptance_time<\/strong>: The drone must stop dropping down after these seconds.<\/li><li><strong>acceptance_distance_x<\/strong>: The threshold for the drone to be considered having reached the hovering distance in x direction.<\/li><li><strong>acceptance_distance_y<\/strong>: The threshold for the drone to be considered having reached the hovering distance in y direction.<\/li><li><strong>acceptance_distance_z:<\/strong> The threshold for the drone to be considered having reached the hovering distance in z direction.<\/li><\/ul>\n\n\n\n<p>We defined these parameters to give the flexibility for the team to test the behavior defensively in the real world to avoid any potential crash.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual Servo Our sensing subsystem is mainly used for visual servoing, with the package and balcony platform as targets. The camera-input takes in the stream of RGB images captured by the camera. It detects the existence of any AprilTags in the image, identifies if it belongs to a package or platform, and calculates and sends<br \/><a class=\"moretag\" href=\"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/perception\/\">+ Read More<\/a><\/p>\n","protected":false},"author":208,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-503","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-json\/wp\/v2\/pages\/503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-json\/wp\/v2\/users\/208"}],"replies":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-json\/wp\/v2\/comments?post=503"}],"version-history":[{"count":23,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-json\/wp\/v2\/pages\/503\/revisions"}],"predecessor-version":[{"id":1090,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-json\/wp\/v2\/pages\/503\/revisions\/1090"}],"wp:attachment":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2020teamf\/wp-json\/wp\/v2\/media?parent=503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}