{"id":415,"date":"2018-02-25T15:38:54","date_gmt":"2018-02-25T20:38:54","guid":{"rendered":"https:\/\/sites.bu.edu\/uav\/?page_id=415"},"modified":"2018-03-19T00:17:08","modified_gmt":"2018-03-19T04:17:08","slug":"installing-ros-kinetic-and-connection-to-parrot-drone","status":"publish","type":"page","link":"https:\/\/sites.bu.edu\/uav\/extra\/installing-ros-kinetic-and-connection-to-parrot-drone\/","title":{"rendered":"Installing ROS Kinetic and Connection to Parrot Drone"},"content":{"rendered":"<p class=\"line874\"><strong>Step 1:<\/strong><\/p>\n<p>Setup your computer to accept software from ROS site. For this open the terminal in your computer and type:<\/p>\n<pre><small><span style=\"color: #993366;\">sudo sh -c 'echo \"deb http:\/\/packages.ros.org\/ros\/ubuntu $(lsb_release -sc) main\" &gt; \/etc\/apt\/sources.list.d\/ros-latest.list'<\/span> <\/small><\/pre>\n<p>Enter password and follow to the next step.<\/p>\n<p><strong>Step 2:<\/strong><\/p>\n<p>Also in the terminal type:<\/p>\n<pre><span style=\"color: #993366;\"><small>sudo apt-key adv --keyserver hkp:\/\/ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116<\/small><\/span><\/pre>\n<p>This will set up the keys for the download.<\/p>\n<p><strong>Step 3:<\/strong><\/p>\n<p><span>First, make sure your Debian package index is up-to-date:<\/span><\/p>\n<pre><span style=\"color: #993366;\"><small>sudo apt-get update<\/small><\/span><\/pre>\n<p>After this you can install ROS Kinetic by typing:<\/p>\n<pre><small><span style=\"color: #993366;\">sudo apt-get install ros-kinetic-desktop\r\n<\/span><\/small><\/pre>\n<p><strong>Step 4:<\/strong><\/p>\n<p>Initialize rosdep, update it and setup the environment (each line is a different input for the terminal):<\/p>\n<pre><span style=\"color: #993366;\"><small>sudo rosdep init<\/small>\r\n<span class=\"anchor\" id=\"line-2-2\"><\/span><small>rosdep update<\/small><small>echo \"source \/opt\/ros\/kinetic\/setup.bash\" &gt;&gt; ~\/.bashrc\r\n<span class=\"anchor\" id=\"kinetic.2BAC8-Installation.2BAC8-DebEnvironment.line-2-1\"><\/span>source ~\/.bashrc\r\n<\/small><\/span><\/pre>\n<p><strong> Step 5:<\/strong><\/p>\n<p>Open the terminal and open .bashrc using the command:<\/p>\n<pre><span style=\"color: #993366;\"><small>gedit ~\/.bashrc<\/small><\/span><\/pre>\n<p>Go to the end of the document and add the line:<\/p>\n<pre><small><span style=\"color: #993366;\">source\/opt\/ros\/kinetic\/setup.bash\r\n<\/span><\/small><\/pre>\n<p>Save it and exit gedit, close terminal and open a new one. Install catkin and build the workspace by following the following lines:<\/p>\n<pre><small><span style=\"color: #993366;\">sudo apt-get install ros-kinetic-catkin\r\ncd\r\nmkir -p ~catkin_ws\/src\r\ncd ~\/catkin_ws\r\ncatkin_make\r\ngedit \/.bashrc\r\n<\/span><\/small><\/pre>\n<p>Add the line at the end of the document, each to be saved in different lines:<\/p>\n<pre><small><span style=\"color: #993366;\">source ~\/catkin_ws\/devel\/setup.bash\r\nexport ROS_PACKAGE_PATH = ~\/catkin_ws:$ROS_PACKAGE_PATH\r\n<\/span><\/small><\/pre>\n<p>Save and exit the terminal and open a new one, type:<\/p>\n<pre><small><span style=\"color: #993366;\">sudo apt install git\r\ncd ~\/catkin_ws\/src\r\ngit clone https:\/\/github.com\/AutonomyLab\/ardrone_autonomy\r\ncd ..\r\nrosdep install --from-paths src --ignore-src\r\ncatkin_make\r\ncatking_ws\/src\r\ncatkin_create_pkg insert_name_here std_msgs rospy roscpp cv_bridge\r\n<\/span><\/small><\/pre>\n<p>Copy and paste the following code into a code editor and save it as &#8220;dronelaunch.launch&#8221; to your package (it should be a folder in your computer):<\/p>\n<pre><small><span style=\"color: #993366;\">&lt;launch&gt;\r\n&lt;arg name=\"droneip\" default=\"192.168.1.1\"&gt;&lt;\/arg&gt;\r\n&lt;node name=\"ardrone_driver\" pkg=\"ardrone_autonomy\" type=\"ardrone_driver\" output=\"screen\" args=\"-ip $(arg droneip)\"&gt;\r\n&lt;param name=\"navdata_demo\" value=\"False\" \/&gt;&lt;param name=\"realtime_navdata\" value=\"True\" \/&gt;&lt;param name=\"realtime_video\" value=\"True\" \/&gt;&lt;param name=\"looprate\" value=\"30\" \/&gt;&lt;\/node&gt;\r\n&lt;\/launch&gt;\r\n<\/span><\/small><\/pre>\n<p>Before testing your code on your drone you must:<\/p>\n<ol>\n<li>Connect your computer to ardrone wifi<\/li>\n<li>Run roscore on one terminal (just type that on the terminal) this initializes ros framework<\/li>\n<li>On another terminal write:\n<pre><small><span style=\"color: #993366;\"> roslaunch your_folder_name <\/span><\/small><\/pre>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step 1: Setup your computer to accept software from ROS site. For this open the terminal in your computer and type: sudo sh -c &#8216;echo &#8220;deb http:\/\/packages.ros.org\/ros\/ubuntu $(lsb_release -sc) main&#8221; &gt; \/etc\/apt\/sources.list.d\/ros-latest.list&#8217; Enter password and follow to the next step. Step 2: Also in the terminal type: sudo apt-key adv &#8211;keyserver hkp:\/\/ha.pool.sks-keyservers.net:80 &#8211;recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 This [&hellip;]<\/p>\n","protected":false},"author":14144,"featured_media":0,"parent":404,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"page-templates\/no-sidebars.php","meta":[],"_links":{"self":[{"href":"https:\/\/sites.bu.edu\/uav\/wp-json\/wp\/v2\/pages\/415"}],"collection":[{"href":"https:\/\/sites.bu.edu\/uav\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.bu.edu\/uav\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.bu.edu\/uav\/wp-json\/wp\/v2\/users\/14144"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.bu.edu\/uav\/wp-json\/wp\/v2\/comments?post=415"}],"version-history":[{"count":6,"href":"https:\/\/sites.bu.edu\/uav\/wp-json\/wp\/v2\/pages\/415\/revisions"}],"predecessor-version":[{"id":418,"href":"https:\/\/sites.bu.edu\/uav\/wp-json\/wp\/v2\/pages\/415\/revisions\/418"}],"up":[{"embeddable":true,"href":"https:\/\/sites.bu.edu\/uav\/wp-json\/wp\/v2\/pages\/404"}],"wp:attachment":[{"href":"https:\/\/sites.bu.edu\/uav\/wp-json\/wp\/v2\/media?parent=415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}