<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ROS101 Tutorial &#8211; Robohub</title>
	<atom:link href="https://robohub.org/tag/ros101-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>https://robohub.org</link>
	<description>Connecting the robotics community to the world</description>
	<lastBuildDate>Sun, 04 Oct 2026 22:53:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>
	<item>
		<title>ROS101: Creating your own RQT Dashboard</title>
		<link>https://robohub.org/ros101-creating-your-own-rqt-dashboard/</link>
		
		<dc:creator><![CDATA[Clearpath Robotics]]></dc:creator>
		<pubDate>Wed, 18 Mar 2015 11:54:23 +0000</pubDate>
				<category><![CDATA[education]]></category>
		<category><![CDATA[ROS]]></category>
		<category><![CDATA[ROS101 Tutorial]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://robohub.org/ros101-creating-your-own-rqt-dashboard/</guid>

					<description><![CDATA[<p>By Martin Cote After working in the terminal, gazebo and RViz, it&#8217;s time for a change of pace. For this ROS101 tutorial we&#8217;ll be detailing the basics of creating your own rqt dashboard!&#160;A dashboard is a single rqt window with one or more plugins displayed in movable, re-sizable frames. Dashboards generally consist of a number [&#8230;]</p>
<p>The post <a rel="nofollow external noopener noreferrer" href="http://www.clearpathrobotics.com/blog/ros101-creating-rqt-dashboard/" data-wpel-link="external" target="_blank">ROS101: Creating your own RQT Dashboard</a> appeared first on <a rel="nofollow external noopener noreferrer" href="http://www.clearpathrobotics.com/" data-wpel-link="external" target="_blank">Clearpath Robotics Inc.</a>.</p>]]></description>
										<content:encoded><![CDATA[<a href="http://robohub.org/tag/ros101-tutorial/" data-wpel-link="internal"><img fetchpriority="high" decoding="async" class="size-full wp-image-26299" src="http://robohub.org/wp-content/uploads/2014/01/ROS101.jpg" alt="ROS101_Clearpath" width="520" height="260" srcset="https://robohub.org/wp-content/uploads/2014/01/ROS101.jpg 520w, https://robohub.org/wp-content/uploads/2014/01/ROS101-300x150.jpg 300w, https://robohub.org/wp-content/uploads/2014/01/ROS101-500x250.jpg 500w" sizes="(max-width: 520px) 100vw, 520px" /></a>
<p><em>By Martin Cote</em></p>
<p>After working in the terminal, gazebo and RViz, it’s time for a change of pace. For this <a href="http://robohub.org/tag/ros101-tutorial/" data-wpel-link="internal">ROS101 tutorial</a> we’ll be detailing the basics of creating your own rqt dashboard! A dashboard is a single rqt window with one or more plugins displayed in movable, re-sizable frames. Dashboards generally consist of a number of plugins that, in combination, provide a suite of UI capabilities for working with robots and robot data.<span id="more-47342"></span></p>
<p>Dashboards can be populated and configured interactively in an rqt session. A preferred configuration can be saved as a “Perspective,” which saves the plugins loaded, their layout, where they are supported, their settings, and last-saved initial parameters (such as what topic we were last plotting). In this tutorial we’ll be working with the Husky simulation in ROS Indigo. To install ROS Indigo, please see <a title="ROS Wiki" href="http://wiki.ros.org/indigo/Installation/Ubuntu" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer">these</a> instructions, and visit our <a title="Husky" href="http://wiki.ros.org/husky_gazebo/Tutorials/Simulating%20Husky" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer">Husky simulation page</a> to install the Husky simulation.</p>
<h2><strong>Getting Started</strong></h2>
<p>The first step is to install rqt! We’ll also be installing some common plugins to create our dashboard:</p>
<pre>sudo apt-get install ros-indigo-rqt ros-indigo-rqt-common-plugins ros-indigo-rqt-robot-plugins</pre>
<p>We can then launch RQT by simply using:</p>
<pre>rqt</pre>
<p>In the Plugins menu, select each plugin you want to load. You can change the layout by dragging and rescaling each plugin by its title bar or edges.</p>
<img decoding="async" src="http://robohub.org/wp-content/uploads/2015/03/1-Blank-1024x576.png" alt="1-Blank-1024x576" width="1024" height="576" class="alignnone size-full wp-image-47382" srcset="https://robohub.org/wp-content/uploads/2015/03/1-Blank-1024x576.png 1024w, https://robohub.org/wp-content/uploads/2015/03/1-Blank-1024x576-425x239.png 425w, https://robohub.org/wp-content/uploads/2015/03/1-Blank-1024x576-500x281.png 500w" sizes="(max-width: 1024px) 100vw, 1024px" />
<h2><strong>A practical example</strong></h2>
<p>We’ll now create a rqt dashboard with a few useful plugins and demonstrate a potential use case for this particular dashboard. For this tutorial we’ll be using our virtual Husky to simulate sensor data. Open Husky up in Gazebo using:</p>
<pre>roslaunch husky_gazebo husky_playpen.launch</pre>
<p>You can minimize Gazebo for now as we set up our rqt dashboard. Begin by opening the following plugin from the plugins drop down menu, and re size them as you like,</p>
<p><em>Rviz<br />
Plot x2<br />
Bag<br />
Robot Steering</em></p>
<img decoding="async" src="http://robohub.org/wp-content/uploads/2015/03/1-With-Plugins-1024x576.png" alt="1-With-Plugins-1024x576" width="1024" height="576" class="alignnone size-full wp-image-47383" srcset="https://robohub.org/wp-content/uploads/2015/03/1-With-Plugins-1024x576.png 1024w, https://robohub.org/wp-content/uploads/2015/03/1-With-Plugins-1024x576-425x239.png 425w, https://robohub.org/wp-content/uploads/2015/03/1-With-Plugins-1024x576-500x281.png 500w" sizes="(max-width: 1024px) 100vw, 1024px" />
<p>Each plugin has their own uses and settings, for more information about a particular plugin, visit the <a href="http://wiki.ros.org/rqt/Plugins" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer">rqt plugins</a> page of the ROS wiki</p>
<p>When you’re happy with a dashboard configuration, you can save the perspective by selecting Perspectives, Create Perspective, giving it a name, and asking it to clone the current perspective. These perspectives are saved locally and persist between sessions.</p>
<p>To export a perspective for closer management such as sharing or persisting to a repository, select Perspectives, Export and give it a name with the filename extension, .perspective</p>
<h2><strong>Loading a Perspective</strong></h2>
<p>A perspective can be loaded interactively in RQT by selecting Perspectives, import. However a more useful way is to launch them from the command-line, which allows us to wrap them in a script that can be rosrun or roslaunched:</p>
<pre>rqt --perspective-file "$(rospack find my_ros_rqt_package)/config/my_dashboard.perspective"</pre>
<p>Some plugins allow you to configure options that impact its installation and behavior. For example, the Python Console plugin allows you to choose which console implementation to use. You can access these options for any plugin by selecting the gear icon in its title bar. If no gear icon is present, the plugin has not been configured to provide an options menu.</p>
<p><span style="text-decoration: underline;">Rviz:</span> To load Husky into your Rviz plugin, select “open config” from the drop down menu, and navigate to /opt/ros/indigo/share/husky_viz/rviz/view_robot.rviz. You should now see a model of Husky loaded in Rviz! By default, this config file will include the simulated laser, and you can see the object in Husky’s path in the Gazebo environment.</p>
<p>&nbsp;</p>
<img decoding="async" src="http://robohub.org/wp-content/uploads/2015/03/3-load-config-rqt-1024x576.png" alt="3-load-config-rqt-1024x576" width="1024" height="576" class="alignnone size-full wp-image-47384" srcset="https://robohub.org/wp-content/uploads/2015/03/3-load-config-rqt-1024x576.png 1024w, https://robohub.org/wp-content/uploads/2015/03/3-load-config-rqt-1024x576-425x239.png 425w, https://robohub.org/wp-content/uploads/2015/03/3-load-config-rqt-1024x576-500x281.png 500w" sizes="(max-width: 1024px) 100vw, 1024px" />
<img decoding="async" src="http://robohub.org/wp-content/uploads/2015/03/3-with-plugins-Gazebo-1024x576.png" alt="3-with-plugins-Gazebo-1024x576" width="1024" height="576" class="alignnone size-large wp-image-47385" srcset="https://robohub.org/wp-content/uploads/2015/03/3-with-plugins-Gazebo-1024x576.png 1024w, https://robohub.org/wp-content/uploads/2015/03/3-with-plugins-Gazebo-1024x576-425x239.png 425w, https://robohub.org/wp-content/uploads/2015/03/3-with-plugins-Gazebo-1024x576-500x281.png 500w" sizes="(max-width: 1024px) 100vw, 1024px" />
<p><span style="text-decoration: underline;"><strong>Plot</strong>:</span> The Plot tool is very useful to plot a particular topic in real time, for this example we will be plotting the commanded odometery topic versus the simulated odometrey. In the input window on the top right of the plot plugin, add the follow topic in each plot.</p>
<p>/odometry/filtered/twist/twist/angular/z</p>
<p>and</p>
<p>/husky_velocity_controller/odom/twist/twist/angular/z</p>
<p><span style="text-decoration: underline;"><span class="wysiwyg-underline"><strong>Robot Steering</strong>:</span></span> The robot steering plugin provides us with a simple way to manually drive Husky, all that is required is to specify  the  topic which accepts the velocity commands to move your Robot, for virtual Husky, that topic is /cmd_vel.</p>
<p>It’s time to put it together! Try commanding Husky to turn in place using the robot steering plugin, and watch your Husky is RViz turn in place while it’s updating the laser scan! You should also see the commanded odometry in one of your plots, while the actual odometry lags slightly behind as it catches up to the desired value.</p>
<img decoding="async" src="http://robohub.org/wp-content/uploads/2015/03/4-graph-topics-1024x576.png" alt="4-graph-topics-1024x576" width="1024" height="576" class="alignnone size-full wp-image-47386" srcset="https://robohub.org/wp-content/uploads/2015/03/4-graph-topics-1024x576.png 1024w, https://robohub.org/wp-content/uploads/2015/03/4-graph-topics-1024x576-425x239.png 425w, https://robohub.org/wp-content/uploads/2015/03/4-graph-topics-1024x576-500x281.png 500w" sizes="(max-width: 1024px) 100vw, 1024px" />
<p><span style="text-decoration: underline;"><span class="wysiwyg-underline"><strong>Rqt bag</strong>:</span></span> Rosbag is an extremely useful tool  for logging, and our support team may often ask for a bag file to take a closer look at your system. It’s possible to record a bag through the terminal, but using rqt is much simpler and more intuitive. Let’s record  a bag file of Husky driving around by clicking the record button, and selecting the topics you want to record. Once you’re happy with the data recorded, stop the recording.</p>
<p>Playing a bag file back is just as simple. Let’s go ahead and close rqt and Gazebo so ROS is no longer running, then start ROS again with just roscore:</p>
<pre>roscore</pre>
<p>And open rqt back up and load the ROS bag plugin again:</p>
<pre>rqt</pre>
<p>This time we are going to open up the bag file we just recorded by clicking the 2nd button. You’ll now see all the topics that were recorded, and when messages were sent over that topic. You can take a closer look at a particular ticket by right clicking and selecting to view either the values or plot a particular topic.</p>
<p>&nbsp;</p>
<img decoding="async" src="http://robohub.org/wp-content/uploads/2015/03/5-Bag-reply-1024x576.png" alt="5-Bag-reply-1024x576" width="1024" height="576" class="alignnone size-full wp-image-47387" srcset="https://robohub.org/wp-content/uploads/2015/03/5-Bag-reply-1024x576.png 1024w, https://robohub.org/wp-content/uploads/2015/03/5-Bag-reply-1024x576-425x239.png 425w, https://robohub.org/wp-content/uploads/2015/03/5-Bag-reply-1024x576-500x281.png 500w" sizes="(max-width: 1024px) 100vw, 1024px" />
<p>For more information regarding rqt, please visit the<a href="http://wiki.ros.org/rqt" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer"> ROS Wiki </a>page, if you have any questions regarding this particular tutorial, please don’t hesitate to contact us!</p>
<p>Looking for other Clearpath tutorials? <a title="Do more with Udev" href="http://robohub.org/do-more-with-udev/" data-wpel-link="internal">Here’s one</a> you might like! See all the ROS101 tutorials <a href="http://robohub.org/tag/ros101-tutorial/" data-wpel-link="internal">here</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Do more with Udev</title>
		<link>https://robohub.org/do-more-with-udev/</link>
		
		<dc:creator><![CDATA[Clearpath Robotics]]></dc:creator>
		<pubDate>Thu, 22 Jan 2015 00:40:49 +0000</pubDate>
				<category><![CDATA[education]]></category>
		<category><![CDATA[ROS]]></category>
		<category><![CDATA[ROS101 Tutorial]]></category>
		<guid isPermaLink="false">http://robohub.org/do-more-with-udev/</guid>

					<description><![CDATA[<p>By Paul Bovbel Udev is a device manager for Linux that dynamically creates and removes nodes&#160;for hardware&#160;devices. In short, it helps your computer find your robot easily. By default, hardware devices attached to your Linux (Ubuntu) PC will belong to the root user. This means that any programs (e.g. ROS nodes) running as an unpriveleged [&#8230;]</p>
<p>The post <a rel="nofollow external noopener noreferrer" href="http://www.clearpathrobotics.com/blog/udev/" data-wpel-link="external" target="_blank">Do More with Udev</a> appeared first on <a rel="nofollow external noopener noreferrer" href="http://www.clearpathrobotics.com/" data-wpel-link="external" target="_blank">Clearpath Robotics Inc.</a>.</p>]]></description>
										<content:encoded><![CDATA[<img decoding="async" class="alignnone size-full wp-image-45301" src="http://robohub.org/wp-content/uploads/2015/01/udev_blog.jpg" alt="udev_blog" width="520" height="260" srcset="https://robohub.org/wp-content/uploads/2015/01/udev_blog.jpg 520w, https://robohub.org/wp-content/uploads/2015/01/udev_blog-425x212.jpg 425w, https://robohub.org/wp-content/uploads/2015/01/udev_blog-500x250.jpg 500w" sizes="(max-width: 520px) 100vw, 520px" />
<p><em>By Paul Bovbel</em></p>
<p>Udev is a device manager for Linux that dynamically creates and removes nodes for hardware devices. In short, it helps your computer find your robot easily. By default, hardware devices attached to your Linux (Ubuntu) PC will belong to the root user. This means that any programs (e.g. ROS nodes) running as an unpriveleged (i.e. not root) user will not be able to access them. On top of that, devices will receive names such as ttyACMx and ttyUSBx arbitrarily based on the order in which they were plugged in. Luckily, you can solve this, and more, with <strong>udev</strong> rules.<span id="more-44952"></span><span id="more-3808"></span></p>
<p>You probably already have at least one udev rule on your system that solves the naming problem for network devices, and you can take a peek at it in the <code><strong>/etc/udev/rules.d/</strong></code> folder – it&#8217;s probably named <code><strong>70-persistent-net.rules</strong></code>.</p>
<p>Some driver/software packages will already provide udev rules you can use. Check the <strong><code>/etc/udev/rules.d/</code></strong> folder to see if there’s anything installed already. If the package is lazy and gives you a udev rule to install yourself, you can do this using:</p>
<pre>sudo cp &lt;rule file&gt; /etc/udev/rules.d/</pre>
<h2><strong>Writing a new udev rule:</strong></h2>
<p>If you still need to write your own rule to setup naming and permissions for your device, read on. Rules can get extremely complex, but the one below should cover 99% of use cases for ROS applications. If you’re looking for 99.9%, I suggest you start <a title="Udev Rules" href="http://www.reactivated.net/writing_udev_rules.html" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer">here</a>. As an example, we will examine the udev rule provided by the <strong>urg_node</strong> driver in ROS:</p>
<pre>SUBSYSTEMS==”usb”, KERNEL==”ttyACM[0-9]*”, ACTION==”add”, ATTRS{idVendor}==”15d1″, ATTRS{idProduct}==”0000″, MODE=”666″, PROGRAM=”/opt/ros/hydro/lib/urg_node/getID /dev/%k q”, SYMLINK+=”sensors/hokuyo_%c”, GROUP=”dialout”</pre>
<p>A udev rule is made up of a bunch of comma separated tags, as above. The tags are divided into two parts: <strong>matching</strong> and <strong>configuration</strong>, however they can be written into the rule in any order (confusingly enough).</p>
<h2><strong>Matching:</strong></h2>
<p>The matching part lets the udev device manager match the rule to the device you want. The manager will try to match all new devices as they get plugged in, so it’s important that the rule be specific enough to capture only the device you’re looking for, otherwise you’ll end up with a <strong><code>/dev/hokuyo</code></strong> symlink to an IMU. There are many potential matching tags, and the best way to pick the useful ones is to get all the device attributes straight from udev.</p>
<p>Run the following command, inserting the <strong>&lt;devpath&gt;</strong> such as <strong><code>/dev/ttyACM0</code></strong>:</p>
<pre>udevadm info -a -p $(udevadm info -q path -n &lt;devpath&gt;)</pre>
<p>You will get a list of all <strong>device attributes</strong> visible to udev. looking at device ‘…/ttyACM0′:</p>
<pre>KERNEL=="ttyACM0"
SUBSYSTEM=="tty"
DRIVER==""
looking at parent device '...':
KERNELS=="3-3:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="cdc_acm"
ATTRS{bInterfaceClass}=="02"
ATTRS{bInterfaceNumber}=="00"
looking at parent device '...':
...
ATTRS{idVendor}=="0483"
ATTRS{idProduct}=="5740"
...</pre>
<p>Each of the device attributes is a potential tag. You can use any of the tags in the first section to filter, along with tags from a parent device. Use regex to make matching more flexible (e.g. [0-9] to match any number, * to match anything at all).</p>
<p>Example:</p>
<pre>SUBSYSTEM=="tty", KERNEL=="ttyACM[0-9]*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", ...</pre>
<p>Due to the way udev is designed, you can only pull in the tags from <strong>one parent device</strong>. So in the above example you can always use the KERNEL and the SUBSYSTEM tag in your udev rule, but you cannot use both DRIVERS and ATTRS{idVendor} to do matching. Usually this is not a problem, since idVendor and idProduct are always present, and identify the majority of device types uniquely.</p>
<p>You should also add the ACTION tag, which is usually “add”, sometimes “remove” if you want to do something when the device is unplugged.</p>
<pre>..., ACTION=="add", ...</pre>
<h2><strong>Configuration:</strong></h2>
<p>Now that you have a rule that matches the device you want, you can add several configuration tags:</p>
<table class="confluenceTable tablesorter" width="100%">
<tbody>
<tr>
<td class="confluenceTd" width="40%"><strong><span class="tablesorter-header-inner">Tag</span></strong></td>
<td class="confluenceTd" width="60%"><strong><span class="tablesorter-header-inner">Usage</span></strong></td>
</tr>
<tr>
<td class="confluenceTd" width="40%">
<pre>MODE="0666"</pre>
</td>
<td class="confluenceTd" width="60%">Set permissions to allow any user read/write access to the device.</td>
</tr>
<tr>
<td class="confluenceTd" width="40%">
<pre>SYMLINK+=”hokuyo”</pre>
</td>
<td class="confluenceTd" width="60%">Create a symlink in /dev/ for this device.</td>
</tr>
<tr>
<td class="confluenceTd" width="40%">
<pre>RUN+=”/bin/echo ‘hello world’”</pre>
</td>
<td class="confluenceTd" width="60%">Execute an arbitrary command. (<a class="external-link" style="color: #3b73af;" href="http://www.reactivated.net/writing_udev_rules.html#external-run" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">Advanced usage, more here</a>)</td>
</tr>
</tbody>
</table>
<p>It is good practice to make sure symlinks are unique for each device, so the above is actually poor practice! If you have multiple devices of the same type (e.g. 2 Hokuyos), or if you have multiple devices using a generic USB-to-Serial converter (e.g. FTDI), a basic idVendor and idProduct rule will not properly discriminate between these devices, since udev will map all matching devices to the same symlink. There are several approaches:</p>
<h2><strong>Directly through device attributes:</strong></h2>
<p>If your device has a unique identifier, such as a serial number, encoded in its attributes, you can painlessly create a unique symlink:</p>
<pre>…, SYMLINK+=”device_$attr{serial}”, …</pre>
<p>&nbsp;</p>
<p>This will usually not be the case. If a parent device has a serial number, you can use the following trick using environment variables. Create a udev rule for the parent device to store an environment variable:</p>
<pre>…, &lt;match parent device&gt;…, ENV{SERIAL_NUMBER}=”$attr{serial_number}”</pre>
<p>And a rule for the child device that uses the variable in the symlink:</p>
<pre>..., &lt;match child device&gt;..., SYMLINK+="device_$env{SERIAL_NUMBER}"</pre>
<h2><strong>External Program:</strong></h2>
<p>If the manufacturer does not expose a unique identifier through the device attributes, you can execute an external command using the PROGRAM tag:</p>
<pre>PROGRAM="/bin/device_namer %k", SYMLINK+="%c"</pre>
<p>Unlike the RUN tag which spins off, this command will be executed before the rule is fully processed, so it must return quickly. The <strong>urg_node</strong> driver above uses this tag to execute a ROS binary:</p>
<pre>PROGRAM="/opt/ros/hydro/lib/urg_node/getID /dev/%k q", SYMLINK+="sensors/hokuyo_%c"</pre>
<p>Substitution argument <strong>%k</strong> refers to the device path relative to <strong>/dev/</strong>, and <strong>%c</strong> refers to the output of the PROGRAM tag.</p>
<h2><strong>Running a new udev rule:</strong></h2>
<p>Once you have sudo cp’ed your rule into the <code>/etc/udev/rules.d/</code> folder, you can test it with your device. To get udev to recognize your rule, run the following command:</p>
<pre>sudo udevadm control --reload-rules &amp;&amp; sudo service udev restart &amp;&amp; sudo udevadm trigger</pre>
<p>You should be able to find a symlink in<strong> /dev/</strong> that links to the full device path (e.g. <strong>/dev/ttyACM0</strong>), and the permissions on the device path should be read/write for all users.</p>
<p>If your permissions aren’t being set, and you symlink is not being created in <strong>/dev/</strong> as expected, you can try simulating udev’s processing of the rule by running the following with the appropriate device path:</p>
<pre>udevadm test $(udevadm info -q path -n /dev/ttyACM0)</pre>
<h2><strong>Things to keep in mind</strong></h2>
<p>Check that your rule follows the naming convention – &lt;priority&gt;-&lt;device name&gt;.rules. Technically you can have multiple rules for the same device, and the number determines what order they’d get executed in. Since we’re writing addon rules, a priority of 99 is safest.</p>
<p>You can have multiple rules in a file separated by newlines. Make sure that each individual rule is on one line.</p>
<p>Check that all tags (matching and configuration) are comma separated.</p>
<p>Check that your rule file has a trailing newline.</p>
<p>Check that your rule is owned by the root user – ll /etc/udev/rules.d/ should say ‘root root’ for the rule file.</p>
<p><em>The post <a href="http://www.clearpathrobotics.com/blog/udev/" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">Do More with Udev</a> appeared first on <a href="http://www.clearpathrobotics.com/" rel="nofollow external noopener noreferrer" data-wpel-link="external" target="_blank">Clearpath Robotics Inc.</a>.</em></p>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ROS101: Creating a subscriber using GitHub</title>
		<link>https://robohub.org/ros101-creating-a-subscriber-using-git-hub/</link>
		
		<dc:creator><![CDATA[Clearpath Robotics]]></dc:creator>
		<pubDate>Fri, 12 Dec 2014 17:44:55 +0000</pubDate>
				<category><![CDATA[education]]></category>
		<category><![CDATA[ROS]]></category>
		<category><![CDATA[ROS101 Tutorial]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://robohub.org/ros101-creating-a-subscriber-using-git-hub/</guid>

					<description><![CDATA[<p>By Martin Cote We previously learned how to write&#160;a publisher node to move Husky randomly. BUT! What good is publishing all these messages if no one is there to read it? In this tutorial we&#8217;ll write a subscriber that reads Husky&#8217;s position from the odom topic, and graph its movements. Instead of just copy-pasting code [&#8230;]</p>
<p>The post <a rel="nofollow external noopener noreferrer" href="http://www.clearpathrobotics.com/blog/ros101-subscriber-using-github/" data-wpel-link="external" target="_blank">ROS101: Creating a Subscriber Using Git Hub</a> appeared first on <a rel="nofollow external noopener noreferrer" href="http://www.clearpathrobotics.com/" data-wpel-link="external" target="_blank">Clearpath Robotics Inc.</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><em><img decoding="async" class="aligncenter wp-image-26319 size-full" src="http://robohub.org/wp-content/uploads/2014/01/ROS101_logo.gif" alt="ROS101_logo" width="701" height="417" />By Martin Cote</em></p>
<p>We previously learned how to write a <a title="ROS 101 Publisher Node" href="http://robohub.org/ros-101-creating-a-publisher-node/" data-wpel-link="internal">publisher node to move Husky randomly</a>. BUT: what good is publishing all these messages if no one is there to read it? In this tutorial we’ll write a subscriber that reads Husky’s position from the odom topic, and graph its movements. Instead of just copy-pasting code into a text file, we’ll pull the required packages from <a title="GitHub" href="https://github.com/" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer">GitHub</a>, a very common practice among developers.<span id="more-43693"></span><span id="more-3714"></span></p>
<p>Before we begin, install Git to pull packages from GitHub, and pygame, to provide us with the tools to map out Husky’s movements:</p>
<pre>sudo apt-get install git
sudo apt-get install python-pygame</pre>
<h2><strong>Pulling from GitHub</strong></h2>
<p>GitHub is a popular tool among developers due to its use of version control – most ROS software has an associated GitHub repository. Users are able to “pull” files from the GitHub servers, make changes, then “push” these changes back to the server. In this tutorial we will be using GitHub to pull the ROS packages that we’ll be using. The first step is to make a new directory to pull the packages:</p>
<pre>mkdir ~/catkin_ws/src/ros101
cd ~/catkin_ws/src/ros101
git init</pre>
<p>Since we now know the URL that hosts the repositories, we’ll easily be able to pull the packages from GitHub. Access the repositories using the following command:</p>
<pre>git pull https://github.com/mcoteCPR/ROS101.git</pre>
<p>That’s it! You should see an src and launch folder, as well as a CMakelist.txt and package.xml in your ros101 folder. You now have the package “ros101″, which includes the nodes “random_driver.cpp” and “odom_graph.py”.</p>
<h2><strong>Writing the subscriber</strong></h2>
<p>We’ve already gone through the random_driver C++ code in the last tutorial, so this time we’ll go over the python code for odom_graph.py. This node uses the Pygame library to track Husky’s movement. Pygame is a set of modules intended to create video games in python; however, we’ll focus on the ROS portion of this code. More information on Pygame can be found on <a title="Pygame">their website</a>. The code for the odom_graph node can be found at:</p>
<pre>gedit -p ~/catkin_ws/src/ros101/src/odom_graph.py</pre>
<p>Let’s take a look at this code line by line:</p>
<pre>import rospy
from nav_msgs.msg import Odometry</pre>
<p>Much like the C++ publisher code, this includes the rospy library and imports the Odometry message type from nav_msgs.msg. To learn more about a specific message type, you can visit <a href="http://docs.ros.org/" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer"><span style="color: #551a8b;">http://docs.ros.org</span></a> to see it’s definition, for example, we are using <a href="http://docs.ros.org/api/nav_msgs/html/msg/Odometry.html" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer"><span style="color: #551a8b;">http://docs.ros.org/api/nav_msgs/html/msg/Odometry.html</span></a> . The next block of code imports the pygame libraries and sets up the initial conditions for our display.</p>
<pre>def odomCB(msg)</pre>
<p>This is the odometry call back function, which is called every time our subscriber receives a message. The content of this function simply draws a line on our display between the last coordinates read from the odometry position message. This function will continually be called in our main loop.</p>
<pre>def listener():</pre>
<p>The following line starts the ROS node, anonymous=True means multiples of the same node can run at the same time:</p>
<pre>rospy.init_node('odom_graph', anonymous=True)</pre>
<p>Subscriber sets up the node to read messages from the “odom” topic, which are of the type Odometry, and calls the odomCB functions when it receives a message:</p>
<pre>rospy.Subscriber("odom", Odometry, odomCB)</pre>
<p>The last line of this function keeps the node active until it’s shut down:</p>
<pre>rospy.spin()</pre>
<h2><strong>Putting it all together</strong></h2>
<p>Now it’s time to test it out! Go ahead and close the odom_graph.py file and build your workspace using the catkin_make function in your workspace directory.</p>
<pre>cd ~/catkin_ws
catkin_make</pre>
<p>The next step is to launch our Husky simulation to start up ROS and all the Husky related nodes</p>
<pre>roslaunch husky_gazebo husky_emepty_world.launch</pre>
<p>In this tutorial we have provided a launch file that will start the random_driver and odom_graph node. The launch file is located in ~/ros101/src/launch and is called odom_graph_test.launch. If you want to learn more about launch files, check out our launch file article on our <a href="https://support.clearpathrobotics.com/hc/en-us/categories/200165835-ROS" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer"><span style="color: #551a8b;">support knowledge base</span></a>. We will now source our workspace and launch both nodes with the launch file in a new terminal window.</p>
<pre>source ~/catkin_ws/devel/setup.bash
roslaunch ros101 odom_graph_test.launch</pre>
<img decoding="async" class="aligncenter wp-image-43752 size-full" src="http://robohub.org/wp-content/uploads/2014/12/ROS101-GitHub1-1024x767.png" alt="ROS101-GitHub1-1024x767" width="1024" height="767" srcset="https://robohub.org/wp-content/uploads/2014/12/ROS101-GitHub1-1024x767.png 1024w, https://robohub.org/wp-content/uploads/2014/12/ROS101-GitHub1-1024x767-425x318.png 425w, https://robohub.org/wp-content/uploads/2014/12/ROS101-GitHub1-1024x767-400x300.png 400w" sizes="(max-width: 1024px) 100vw, 1024px" />
<p>There you have it! Our subscriber is now listening to messages on the odom topic, and graphing out Husky’s path.</p>
<p>&nbsp;</p>
<p><em>See all the ROS101 tutorials <a href="http://robohub.org/tag/ros101-tutorial/" data-wpel-link="internal">here</a>. </em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ROS 101: Creating a publisher node</title>
		<link>https://robohub.org/ros-101-creating-a-publisher-node/</link>
		
		<dc:creator><![CDATA[Clearpath Robotics]]></dc:creator>
		<pubDate>Tue, 23 Sep 2014 17:02:08 +0000</pubDate>
				<category><![CDATA[education]]></category>
		<category><![CDATA[ROS]]></category>
		<category><![CDATA[ROS101 Tutorial]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://robohub.org/ros-101-creating-a-publisher-node/</guid>

					<description><![CDATA[By Martin Cote
In our previous post, we graduated from driving a Husky, to taking on a Grizzly! Now it&#8217;s time to get down and dirty with what ROS is really made of, nodes! We will first be creating a workspace to work from, then we will write ...]]></description>
										<content:encoded><![CDATA[<img decoding="async" class="size-full wp-image-26319" alt="ROS101_logo" src="http://robohub.org/wp-content/uploads/2014/01/ROS101_logo.gif" width="701" height="417" />
<p><em>By Martin Cote</em></p>
<p>In our <a title="ROS 101: DRIVE A GRIZZLY" href="http:///http://www.clearpathrobotics.com/blog/ros-101-drive-grizzly/" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer">previous post</a>, we graduated from driving a Husky to taking on a Grizzly! Now it’s time to get down and dirty with what ROS is really made of: nodes! We will first be creating a workspace to work from, then we will write a simple publisher that will make our virtual Husky drive around randomly. If this is your first time visiting a Clearpath Robotics ROS 101 blog, get started <a href="http://robohub.org/ros-101-intro-to-the-robot-operating-system/" data-wpel-link="internal">here</a>.<span id="more-38292"></span></p>
<h2>Creating a workspace and package</h2>
<p>Before we begin writing a node, we need to create a workspace and a package. Workspaces are simply directories to store all of your packages. First we will need to create a new directory.</p>
<pre><code class="sh">mkdir ~/ros101</code></pre>
<p>This created a directory in your home folder, which we will use as a workspace directory. We now need to create a subdirectory in your workspace directory to store all your source code for your packages.</p>
<pre><code class="sh">mkdir ~/ros101/src</code></pre>
<p>The last step to creating the workspace will be to initialize the workspace with catkin_init_workspace.</p>
<pre><code class="sh">cd ~/ros101/src
catkin_init_workspace</code></pre>
<p>Now that our workspace has been created, we will create a package in the src directory we just created. This can be done by navigating to the ~/ros101/src directory, which you should have already done in the last step, and using the catkin_create_pkg command  followed by what we want the package to be named, and then followed by what other packages our package will be dependent on; this command creates another directory for your new package, and two new configuration files inside that directory with some default settings.</p>
<pre><code class="sh">catkin_create_pkg random_husky_driver roscpp std_msgs</code></pre>
<p>You can see that this created CMakeLists.txt and package.xml inside the random_husky_driver directory; this is also where you will store all your source code for your packages. The roscpp and std_msgs  dependencies were added into the CMakeLIst.txt and package.xml.</p>
<h2>Writing the publisher</h2>
<p>As mentioned in our <a href="http://robohub.org/ros-101-drive-a-grizzly-2/" data-wpel-link="internal">previous post</a>, a publisher publishes messages to a particular topic. For this tutorial, we will be publishing random commands to the /husky/cmd_vel topic to make your Husky visualization drive itself. Start by creating a file in your ~/ros101/src/random_husky_driver directory called random_driver.cpp, and copy the following code.</p>
<pre><code class="sh">#include &lt;ros/ros.h&gt;
#include &lt;geometry_msgs/Twist.h&gt; 
#include &lt;stdlib.h&gt; 

int main(int argc, char **argv) {
     //Initializes ROS, and sets up a node
     ros::init(argc, argv, "random_husky_commands");
     ros::NodeHandle nh;

     //Ceates the publisher, and tells it to publish
     //to the husky/cmd_vel topic, with a queue size of 100
     ros::Publisher pub=nh.advertise&lt;geometry_msgs::Twist&gt;("husky/cmd_vel", 100);

     //Sets up the random number generator
     srand(time(0));

     //Sets the loop to publish at a rate of 10Hz
     ros::Rate rate(10);

       while(ros::ok()) {
            //Declares the message to be sent
            geometry_msgs::Twist msg;
           //Random x value between -2 and 2
           msg.linear.x=4*double(rand())/double(RAND_MAX)-2;
           //Random y value between -3 and 3
           msg.angular.z=6*double(rand())/double(RAND_MAX)-3;
           //Publish the message
           pub.publish(msg);

          //Delays untill it is time to send another message
          rate.sleep();
         }
}
</code></pre>
<p>Let’s break down this code line by line:</p>
<pre><code class="sh">#include &lt;ros/ros.h&gt;
#include &lt;geometry_msgs/Twist.h&gt; </code></pre>
<p>These lines includes the headers that we are going to need. The &lt;ros/ros.h&gt; header is required for ROS functionality and the &lt;geometry_msgs/Twist.h&gt; is added so that we can create a message of that type.</p>
<pre><code class="sh">ros::init(argc, argv, "random_husky_commands");
ros::NodeHandle nh;</code></pre>
<p>The first line, ros::init,  is used to initialize the ROS node, and name it “random_husky_commands”, while ros:NodeHandle starts the node.</p>
<pre><code class="sh">ros::Publisher pub=nh.advertise&lt;geometry_msgs::Twist&gt;("husky/cmd_vel", 100);</code></pre>
<p>Publishing a message is done using ros:Publisher pub=nh.advertise, followed by the message type that we are going to be sending, in this case it is a geometry_msga::Twist, and the topic that we are going to be sending it too, which for us is husky/cmd_vel.</p>
<p>The 100 is the message queue size; that is, if you are publishing message faster than what roscpp can send, 100 messages will be saved in the queue to be sent. The larger the queue, the more delay in robot movement in case of buffering.</p>
<p>Therefore in a real life example, you will want to have a smaller queue in the case of robot movement, where delay in movement commands are undesirable and even dangerous, but dropped messages are acceptable. In the case of sensors, it is recommended to use a larger queue, since delay is acceptable to ensure no data is lost.</p>
<pre><code class="sh">ros::Rate rate(10)
...
rate.sleep()</code></pre>
<p>ROS is able to control the loop frequency  using ros:Rate to dictate how rapidly the loop will run in Hz. rate.sleep will delay a variable amount of time such that your loop cycles at the desired frequency. This accounts for time consumed by other parts of the loop. All Clearpath robots require a minimum loop rate of 10Hz.</p>
<pre><code class="sh">while(ros::ok())</code></pre>
<p>The ros::ok function will return true unless it receives a command to shut down, either by using the rosnode kill command, or by the user pusing Ctrl-C in a terminal.</p>
<pre><code class="sh">geometry_msgs::Twist msg;</code></pre>
<p>This creates the message we are going to send, msg, of the type geometry_msgs:Twist<br />
msg.linear.x=4*double(rand())/double(RAND_MAX)-2;<br />
msg.angular.z=6*double(rand())/double(RAND_MAX)-3;</p>
<img decoding="async" class="size-full wp-image-38297 " alt="Screen-Shot-2014-09-19-at-10.16.36-AM-300x151" src="http://robohub.org/wp-content/uploads/2014/09/Screen-Shot-2014-09-19-at-10.16.36-AM-300x151.png" width="300" height="151" />
<p>These lines calculate the random linear x and angular z values that will be sent to Husky.</p>
<pre><code class="sh">pub.publish(msg)</code></pre>
<p>We are finally ready to publish the message! The pub.publish adds msg to the publisher queue to be sent.</p>
<h2>Compiling the random Husky driver</h2>
<p>Compilation in ROS in handled by the catkin build system. The first step would usually be to set up our package dependencies in the CMakeLists.txt and package.xml. However this has already been done for us when we created the package and specified our dependencies. The next step is then to declare our new node as a executable, this is done by adding the following two lines to the CMakeLists.txt files in ~/ros101/src/random_husky_driver</p>
<pre><code class="sh">add_executable(random_driver random_driver.cpp)
target_link_libraries(random_driver ${catkin_LIBRARIES})</code></pre>
<p>The first line creates the executable called random_driver, and directs ROS to its source files. The second lines specifies what libraries will be used. Now we need to build our workspace using the catkin_make command in the workspace directory</p>
<pre>cd ~/ros101
catkin_make</pre>
<p>Let’s bring up the husky visualization as we did in a previous blog post.</p>
<pre>roslaunch husky_gazebo husky_empty_world.launch</pre>
<p>The final step is to source your setup.bash file in the workspace you have created. This script allows ROS to find the packages that are contained in your workspace. <strong>Don&#8217;t forget this process will have to be done on every new terminal instance!</strong></p>
<pre>source ~/ros101/devel/setup.bash</pre>
<p>It’s now time to test it out! Make sure you have a instance of roscore running in a separate terminal, then start the node.</p>
<pre>rosrun random_husky_driver random_driver</pre>
<p>You should now see Husky drive around! In a new terminal window, we can make sure that our node is publishing to the /husky/cmd_vel topic by echoing all messages on this topic.</p>
<pre>rostopic echo /husky/cmd_vel

<img decoding="async" class="size-full wp-image-38298 " alt="Screen-Shot-2014-08-27-at-1.11.36-PM-300x300" src="http://robohub.org/wp-content/uploads/2014/09/Screen-Shot-2014-08-27-at-1.11.36-PM-300x300.png" width="300" height="300" srcset="https://robohub.org/wp-content/uploads/2014/09/Screen-Shot-2014-08-27-at-1.11.36-PM-300x300.png 300w, https://robohub.org/wp-content/uploads/2014/09/Screen-Shot-2014-08-27-at-1.11.36-PM-300x300-290x290.png 290w, https://robohub.org/wp-content/uploads/2014/09/Screen-Shot-2014-08-27-at-1.11.36-PM-300x300-100x100.png 100w, https://robohub.org/wp-content/uploads/2014/09/Screen-Shot-2014-08-27-at-1.11.36-PM-300x300-220x220.png 220w, https://robohub.org/wp-content/uploads/2014/09/Screen-Shot-2014-08-27-at-1.11.36-PM-300x300-32x32.png 32w, https://robohub.org/wp-content/uploads/2014/09/Screen-Shot-2014-08-27-at-1.11.36-PM-300x300-64x64.png 64w, https://robohub.org/wp-content/uploads/2014/09/Screen-Shot-2014-08-27-at-1.11.36-PM-300x300-96x96.png 96w, https://robohub.org/wp-content/uploads/2014/09/Screen-Shot-2014-08-27-at-1.11.36-PM-300x300-128x128.png 128w" sizes="(max-width: 300px) 100vw, 300px" /></pre>
<p>You should now see a stream of random linear x and angular z values.</p>
<p><em>See all the ROS101 tutorials <a href="http://robohub.org/tag/ros101-tutorial/" data-wpel-link="internal">here</a>. </em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ROS 101: Drive a Grizzly!</title>
		<link>https://robohub.org/ros-101-drive-a-grizzly-2/</link>
		
		<dc:creator><![CDATA[Clearpath Robotics]]></dc:creator>
		<pubDate>Thu, 03 Jul 2014 19:42:42 +0000</pubDate>
				<category><![CDATA[education]]></category>
		<category><![CDATA[Clearpath Robotics]]></category>
		<category><![CDATA[ROS]]></category>
		<category><![CDATA[ROS101 Tutorial]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://robohub.org/?p=34048</guid>

					<description><![CDATA[So you have had a taste of driving a virtual Husky in our previous tutorial, but now want to try something a little bigger? How about 2000 lbs bigger? Read on to learn how to drive a (virtual) Grizzly, Clearpath Robotic’s largest and meanest platform. If you are totally new to ROS, be sure to check [&#8230;]]]></description>
										<content:encoded><![CDATA[<img decoding="async" class="size-full wp-image-26319" alt="ROS101_logo" src="http://robohub.org/wp-content/uploads/2014/01/ROS101_logo.gif" width="701" height="417" />
<p>So you have had a taste of driving a virtual Husky in our <a title="ROS 101: Drive a Husky!" href="http://robohub.org/ros-101-drive-a-husky/" target="_blank" data-wpel-link="internal">previous tutorial</a>, but now want to try something a little bigger? How about 2000 lbs bigger?</p>
<p><span id="more-34048"></span>Read on to learn how to drive a (virtual) Grizzly, Clearpath Robotic’s largest and meanest platform. If you are totally new to ROS, be sure to check out our tutorial series starting <a title="ROS 101: Intro to the Robot Operating System" href="http://robohub.org/ros-101-intro-to-the-robot-operating-system/" target="_blank" data-wpel-link="internal">here</a> and the <a title="ROS Cheat Sheet" href="http://www.clearpathrobotics.com/ros-cheat-sheet" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">ROS Cheat Sheet</a>. Here is your next ROS 101 dose.</p>
<p>An updated version of the Learn_ROS disk is available here:</p>
<p><a title="Public Learn ROS Disk" href="https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS-disk1.vmdk.gz" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS-disk1.vmdk</a><br />
<a title="Public Learn ROS ovf" href="https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS.ovf" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS.ovf</a></p>
<p>Login (username): user<br />
Password: learn</p>
<h2><strong>Updating the Virtual Machine</strong></h2>
<p>Open a terminal window (Ctrl + Alt + T), and enter the following:</p>
<pre><code>sudo apt-get update
sudo apt-get install ros-hydro-grizzly-simulator 
</code><code>sudo apt-get install </code>ros-hydro-grizzly-desktop 
<code>sudo apt-get install </code>ros-hydro-grizzly-navigation</pre>
<h2><strong>Running a virtual Grizzly</strong></h2>
<p>Open a terminal window, and enter:</p>
<pre>roslaunch grizzly_gazebo grizzly_empty_world.launch</pre>
<p>Open another terminal window, and enter:</p>
<pre>roslaunch grizzly_viz view_robot.launch</pre>
<p>You should be given two windows, both showing a yellow, rugged robot (the Grizzly!). The left one shown is Gazebo. This is where we get a realistic simulation of our robot, including wheel slippage, skidding, and inertia. We can add objects to this simulation, or even entire maps of real places.</p>
<img decoding="async" class="size-full wp-image-34055" alt="Grizzly_gazebo-2" src="http://robohub.org/wp-content/uploads/2014/07/Grizzly_gazebo-2.png" width="1275" height="776" srcset="https://robohub.org/wp-content/uploads/2014/07/Grizzly_gazebo-2.png 1275w, https://robohub.org/wp-content/uploads/2014/07/Grizzly_gazebo-2-425x258.png 425w, https://robohub.org/wp-content/uploads/2014/07/Grizzly_gazebo-2-1024x623.png 1024w, https://robohub.org/wp-content/uploads/2014/07/Grizzly_gazebo-2-492x300.png 492w" sizes="(max-width: 1275px) 100vw, 1275px" />
<div class="minitext">Grizzly RUV in simulation</div>
<div style="clear: both;"></div>
<p>The right window is RViz. This tool allows us to see sensor data from a robot, and give it commands (in a future post). RViz is a more simplified simulation in the interest of speed.</p>
<img decoding="async" class="size-full wp-image-34056" alt="Grizzly_rviz" src="http://robohub.org/wp-content/uploads/2014/07/Grizzly_rviz.png" width="1300" height="689" srcset="https://robohub.org/wp-content/uploads/2014/07/Grizzly_rviz.png 1300w, https://robohub.org/wp-content/uploads/2014/07/Grizzly_rviz-425x225.png 425w, https://robohub.org/wp-content/uploads/2014/07/Grizzly_rviz-1024x542.png 1024w, https://robohub.org/wp-content/uploads/2014/07/Grizzly_rviz-500x265.png 500w" sizes="(max-width: 1300px) 100vw, 1300px" />
<div class="minitext">RViz – sensor data</div>
<div style="clear: both;"></div>
<p>We can now command the robot to go forwards. Open a terminal window, and enter:</p>
<pre><code>rostopic pub /cmd_vel geometry_msgs/Twist -r 100 '[0.5,0,0]' '[0,0,0]'</code></pre>
<p>In the above command, we publish to the cmd_vel topic, of topic type geometry_msgs/Twist, at a rate of 100Hz. The data we publish tells the simulated Grizzly to go forwards at 0.5m/s, without any rotation. You should see your Grizzly move forwards. In the gazebo window, you might also notice simulated wheel slip, and skidding. Enjoy and stay tuned for more soon!</p>
<p>&nbsp;</p>
<div class="divideronpost"></div>
<p><em>See all the ROS101 tutorials <a href="http://robohub.org/tag/ros101-tutorial/" data-wpel-link="internal">here</a>. If you liked this article, you may also be interested in:</em></p>
<ul>
<li><a href="http://robohub.org/up-and-flying-with-the-ar-drone-and-ros-getting-started/" data-wpel-link="internal">Up and flying with the AR.Drone and ROS: Getting started</a></li>
<li><a href="http://robohub.org/taking-your-first-steps-in-robotics-with-the-thymio-ii/" data-wpel-link="internal">Taking your first steps in robotics with the Thymio II</a></li>
<li><a title="Permalink to Discovering social robotics with the Aisoy1" href="http://robohub.org/discovering-social-robotics-with-the-aisoy1/" rel="bookmark" data-wpel-link="internal">Discovering social robotics with the Aisoy1</a></li>
<li><a title="Permalink to Parrot AR.Drone app harnesses crowd power to fast-track vision learning in robotic spacecraft" href="http://robohub.org/parrot-ar-drone-app-harnesses-crowd-power-to-fast-track-vision-learning-in-robotic-spacecraft/" rel="bookmark" data-wpel-link="internal">Parrot AR.Drone app harnesses crowd power to fast-track vision learning in robotic spacecraft</a></li>
</ul>
<p><em>See all <a href="http://robohub.org/" data-wpel-link="internal">the latest robotics news</a> on Robohub, or <a title="" href="http://eepurl.com/t-UEf" target="_blank" rel="external nofollow noopener noreferrer" data-wpel-link="external">sign up for our weekly newsletter</a>.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ROS 101: Drive a Husky!</title>
		<link>https://robohub.org/ros-101-drive-a-husky/</link>
		
		<dc:creator><![CDATA[Clearpath Robotics]]></dc:creator>
		<pubDate>Fri, 21 Mar 2014 15:08:00 +0000</pubDate>
				<category><![CDATA[education]]></category>
		<category><![CDATA[Clearpath Robotics]]></category>
		<category><![CDATA[Husky]]></category>
		<category><![CDATA[ROS]]></category>
		<category><![CDATA[ROS101 Tutorial]]></category>
		<category><![CDATA[Simulation]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://robohub.org/?p=29235</guid>

					<description><![CDATA[In the previous ROS 101 post, we showed how easy it is to get ROS going inside a virtual machine, publish topics and subscribe to them. If you haven’t had a chance to check the out all the previous ROS 101 tutorials, you may want to do so before we go on. In this post, we’re [&#8230;]]]></description>
										<content:encoded><![CDATA[<img decoding="async" src="http://robohub.org/wp-content/uploads/2014/01/ROS101.jpg" alt="ROS101_Clearpath" width="520" height="260" class="alignnone size-full wp-image-26299" srcset="https://robohub.org/wp-content/uploads/2014/01/ROS101.jpg 520w, https://robohub.org/wp-content/uploads/2014/01/ROS101-300x150.jpg 300w, https://robohub.org/wp-content/uploads/2014/01/ROS101-500x250.jpg 500w" sizes="(max-width: 520px) 100vw, 520px" />
<p>In<a href="http://robohub.org/ros-101-a-practical-example/" target="_blank" data-wpel-link="internal"> the previous ROS 101 post</a>, we showed how easy it is to get ROS going inside a virtual machine, publish topics and subscribe to them. If you haven’t had a chance to check the out all the previous <a href="http://robohub.org/tag/ros101-tutorial/" target="_blank" data-wpel-link="internal">ROS 101</a> tutorials, you may want to do so before we go on. In this post, we’re going to drive a Husky in a virtual environment, and examine how ROS passes topics around.<br />
<span id="more-29235"></span></p>
<p>An updated version of the Learn_ROS disk is available here:</p>
<p><a title="Public Learn ROS Disk" href="https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS-disk1.vmdk.gz" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS-disk1.vmdk</a><br />
<a title="Public Learn ROS ovf" href="https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS.ovf" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS.ovf</a></p>
<p>Login (username): user<br />
Password: learn</p>
<p>If you just downloaded the updated version above, please skip the next section. If you have already downloaded it, or are starting from a base install of ROS, please follow the next section.</p>
<h2><strong>Updating the Virtual Machine</strong></h2>
<p>Open a terminal window (Ctrl + Alt + T), and enter the following:</p>
<pre><code>sudo apt-get update
sudo apt-get install ros-hydro-husky-desktop</code></pre>
<h2><strong>Running a virtual Husky</strong></h2>
<p>Open a terminal window, and enter:</p>
<pre><code>roslaunch husky_gazebo husky_empty_world.launch</code></pre>
<p>Open another terminal window, and enter:</p>
<pre><code>roslaunch husky_viz view_robot.launch</code></pre>
<p>You should be given two windows, both showing a yellow, rugged robot (the Husky!)</p>
<a href="http://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_34_30.png" data-wpel-link="internal"><img decoding="async" class="wp-image-29240" alt="Screenshot-from-2014-03-14-07_34_30" src="http://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_34_30.png" width="1534" height="797" srcset="https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_34_30.png 1534w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_34_30-425x220.png 425w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_34_30-1024x532.png 1024w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_34_30-500x259.png 500w" sizes="(max-width: 1534px) 100vw, 1534px" /><br /></a>
<p>&nbsp;</p>
<p>The first window shown is Gazebo. This is where we get a realistic simulation of our robot, including wheel slippage, skidding, and inertia. We can add objects to this simulation, such as the cube above, or even entire maps of real places.</p>
<a href="http://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_35_36.png" data-wpel-link="internal"><img decoding="async" class="wp-image-29239" alt="Screenshot-from-2014-03-14-07_35_36" src="http://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_35_36.png" width="1537" height="905" srcset="https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_35_36.png 1537w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_35_36-425x250.png 425w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_35_36-1024x602.png 1024w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-07_35_36-500x294.png 500w" sizes="(max-width: 1537px) 100vw, 1537px" />
<p></a></p>
<p>The second window is RViz. This tool allows us to see sensor data from a robot, and give it commands (We&#8217;ll talk about how to do this in a future post). RViz is a more simplified simulation in the interest of speed.</p>
<p>We can now command the robot to go forwards. Open a terminal window, and enter:</p>
<pre><code>rostopic pub /husky/cmd_vel geometry_msgs/Twist -r 100 '[0.5,0,0]' '[0,0,0]'</code></pre>
<p>In the above command, we publish to the /husky/cmd_vel topic, of topic type geometry_msgs/Twist, at a rate of 100Hz. The data we publish tells the simulated Husky to go forwards at 0.5m/s, without any rotation. You should see your Husky move forwards. In the gazebo window, you might notice simulated wheel slip, and skidding.</p>
<h2><strong>Using rqt_graph</strong></h2>
<p>We can also see the structure of how topics are passed around the system. Leave the publishing window running, and open a terminal window. Type in:</p>
<pre><code>rosrun rqt_graph rqt_graph</code></pre>
<p>This command generates a representation of how the nodes and topics running on the current ROS Master are related. You should get something similar to the following:</p>
<a href="http://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-08_10_25.png" data-wpel-link="internal"><img decoding="async" class="wp-image-29238" alt="Screenshot-from-2014-03-14-08_10_25" src="http://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-08_10_25.png" width="1426" height="645" srcset="https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-08_10_25.png 1426w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-08_10_25-425x192.png 425w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-08_10_25-1024x463.png 1024w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-14-08_10_25-500x226.png 500w" sizes="(max-width: 1426px) 100vw, 1426px" />
<p></a></p>
<p>&nbsp;</p>
<p>The highlighted node and arrow show the topic that you are publishing to the simulated Husky. This Husky then goes on to update the gazebo virtual environment, which takes care of movement of the joints (wheels) and the physics of the robot. The rqt_graph command is very handy to use, when you are unsure who is publishing to what in ROS. Once you figure out what topic you are interested in, you can see the content of the topic using rostopic echo.</p>
<h2><strong>Using tf</strong></h2>
<p>In Ros, tf is a special topic that keeps track of coordinate frames, and how they relate to each other. So, our simulated Husky starts at (0,0,0) in the world coordinate frame. When the Husky moves, it’s own coordinate frame changes. Each wheel has a coordinate frame that tracks how it is rotating, and where it is. Generally, anything on the robot that is not fixed in space, will have a tf describing it. In the rqt_graph section, you can see that the /tf topic is published to and subscribed from by many different nodes.</p>
<p>One intuitive way to see how the tf topic is structured for a robot is to use the view_frames tool provided by ROS. Open a terminal window. Type in:</p>
<pre><code>rosrun tf2_tools view_frames.py
</code></pre>
<p>Wait for this to complete, and then type in:</p>
<pre><code>evince frames.pdf</code></pre>
<p>This will bring up the following image.</p>
<p><a href="http://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-18-12_20_59.png" data-wpel-link="internal"><img decoding="async" class="wp-image-29237" alt="Screenshot-from-2014-03-18-12_20_59" src="http://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-18-12_20_59.png" width="1664" height="571" srcset="https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-18-12_20_59.png 1664w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-18-12_20_59-425x145.png 425w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-18-12_20_59-1024x351.png 1024w, https://robohub.org/wp-content/uploads/2014/03/Screenshot-from-2014-03-18-12_20_59-500x171.png 500w" sizes="(max-width: 1664px) 100vw, 1664px" /></a>Here we can see that all four wheel are referenced to the base_link, which is referenced from the base_frootprint. (Toe bone connected to the foot bone, the foot bone….). We also see that the odom topic is driving the reference of the whole robot. This means that if you write to the odom topic (IE, when you publish to the /cmd_vel topic) then the whole robot will move.</p>
<div>
<div></div>
<p><em>See all the ROS101 tutorials <a href="http://robohub.org/tag/ros101-tutorial/" data-wpel-link="internal">here</a>. If you liked this article, you may also be interested in:</em></p>
<ul>
<li><a href="http://robohub.org/up-and-flying-with-the-ar-drone-and-ros-getting-started/" data-wpel-link="internal">Up and flying with the AR.Drone and ROS: Getting started</a></li>
<li><a href="http://robohub.org/taking-your-first-steps-in-robotics-with-the-thymio-ii/" data-wpel-link="internal">Taking your first steps in robotics with the Thymio II</a></li>
<li><a title="Permalink to Discovering social robotics with the Aisoy1" href="http://robohub.org/discovering-social-robotics-with-the-aisoy1/" rel="bookmark" data-wpel-link="internal">Discovering social robotics with the Aisoy1</a></li>
<li><a title="Permalink to Parrot AR.Drone app harnesses crowd power to fast-track vision learning in robotic spacecraft" href="http://robohub.org/parrot-ar-drone-app-harnesses-crowd-power-to-fast-track-vision-learning-in-robotic-spacecraft/" rel="bookmark" data-wpel-link="internal">Parrot AR.Drone app harnesses crowd power to fast-track vision learning in robotic spacecraft</a></li>
</ul>
<p><em>See all <a href="http://robohub.org/" data-wpel-link="internal">the latest robotics news</a> on Robohub, or <a title="" href="http://eepurl.com/t-UEf" target="_blank" rel="external nofollow noopener noreferrer" data-wpel-link="external">sign up for our weekly newsletter</a>.</em></p>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ROS 101: A practical example</title>
		<link>https://robohub.org/ros-101-a-practical-example/</link>
		
		<dc:creator><![CDATA[Clearpath Robotics]]></dc:creator>
		<pubDate>Wed, 05 Feb 2014 21:30:20 +0000</pubDate>
				<category><![CDATA[education]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[ROS]]></category>
		<category><![CDATA[ROS101 Tutorial]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://robohub.org/?p=26465</guid>

					<description><![CDATA[In the previous ROS 101 post, we provided a quick introduction to ROS to answer questions like What is ROS? and How do I get started? Now that you understand the basics, here’s how they can apply to a practical example. Follow along to see how we actually ‘do’ all of these things … First, you will need to run Ubuntu, [&#8230;]]]></description>
										<content:encoded><![CDATA[<img decoding="async" src="http://robohub.org/wp-content/uploads/2014/01/ROS101.jpg" alt="ROS101_Clearpath" width="520" height="260" class="alignnone size-full wp-image-26299" srcset="https://robohub.org/wp-content/uploads/2014/01/ROS101.jpg 520w, https://robohub.org/wp-content/uploads/2014/01/ROS101-300x150.jpg 300w, https://robohub.org/wp-content/uploads/2014/01/ROS101-500x250.jpg 500w" sizes="(max-width: 520px) 100vw, 520px" />
<p>In the previous <a title="ROS 101: How to Guide" href="http://robohub.org/ros-101-intro-to-the-robot-operating-system/" target="_blank" data-wpel-link="internal">ROS 101 post</a>, we provided a quick introduction to ROS to answer questions like <em>What is ROS? </em>and <em>How do I get started? </em>Now that you understand the basics, here’s how they can apply to a practical example. Follow along to see how we actually ‘do’ all of these things …<span id="more-26465"></span></p>
<p>First, you will need to run Ubuntu, and have ROS installed on it. For your convenience, you can download our easy-to-use image here:</p>
<p><a title="Public Learn ROS Disk" href="https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS-disk1.vmdk.gz" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS-disk1.vmdk</a><br />
<a title="Public Learn ROS ovf" href="https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS.ovf" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">https://s3.amazonaws.com/CPR_PUBLIC/LEARN_ROS/Learn_ROS.ovf</a></p>
<p>Login (username): user<br />
Password: learn</p>
<p>Get VMWare Player, and use the virtual disk above. If you don’t want to use the provided image, follow the tutorial here (after installing Ubuntu 12.04):</p>
<p><a title="Ubunto Installation" href="http://wiki.ros.org/hydro/Installation/Ubuntu" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">http://wiki.ros.org/hydro/Installation/Ubuntu</a></p>
<p>Throughout the rest of the tutorials, we will be referencing the <a title="ROS Cheat Sheet" href="http://www.clearpathrobotics.com/ros-cheat-sheet" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">ROS cheatsheet available here</a>.<em><br />
</em></p>
<p>Open a new Terminal Window (Ctrl + Alt + T).<br />
In the new terminal, type roscore (And press enter).<br />
This should produce something similar to the below.</p>
<img decoding="async" class="size-full wp-image-26466" alt="ROSpic1" src="http://robohub.org/wp-content/uploads/2014/02/ROSpic1.png" width="724" height="553" srcset="https://robohub.org/wp-content/uploads/2014/02/ROSpic1.png 724w, https://robohub.org/wp-content/uploads/2014/02/ROSpic1-300x229.png 300w, https://robohub.org/wp-content/uploads/2014/02/ROSpic1-392x300.png 392w" sizes="(max-width: 724px) 100vw, 724px" />
<div style="clear: both;"></div>
<div class="minitext">ROS Figure 1</div>
<p>What you have just done is started the ROS Master as we described above. We can now experiment with some ROS commands.<br />
Open a new Terminal, and type in rostopic. This will give you a list of all the options that the rostopic command can do. For now, we are interested in rostopic list<br />
Type in rostopic list. (And press enter). This should give you a window like the following:</p>
<img decoding="async" class="size-full wp-image-26467" alt="rospic2" src="http://robohub.org/wp-content/uploads/2014/02/rospic2.png" width="553" height="337" srcset="https://robohub.org/wp-content/uploads/2014/02/rospic2.png 553w, https://robohub.org/wp-content/uploads/2014/02/rospic2-300x182.png 300w, https://robohub.org/wp-content/uploads/2014/02/rospic2-492x300.png 492w" sizes="(max-width: 553px) 100vw, 553px" />
<div style="clear: both;"></div>
<div class="minitext">ROS Figure 2</div>
<p>The two entries listed above are ROS’s built in way of reporting and aggregating debug messages in the system. What we want to do is publish and subscribe to a message.<br />
You can open a new Terminal again, or open a new tab on the same terminal window (Ctrl + Shift + T).<br />
In the new Terminal, type in: rostopic pub /hello std_msgs/String “Hello Robot”</p>
<img decoding="async" class="size-full wp-image-26468" alt="ROSpic3" src="http://robohub.org/wp-content/uploads/2014/02/ROSpic3.png" width="642" height="369" srcset="https://robohub.org/wp-content/uploads/2014/02/ROSpic3.png 642w, https://robohub.org/wp-content/uploads/2014/02/ROSpic3-300x172.png 300w, https://robohub.org/wp-content/uploads/2014/02/ROSpic3-500x287.png 500w" sizes="(max-width: 642px) 100vw, 642px" />
<div style="clear: both;"></div>
<div class="minitext">ROS Figure 3</div>
<p>Let’s break down the parts of that command.<br />
rostopic pub – This commands ROS to publish a new topic.<br />
/hello – This is the name of the new topic. (Can be whatever you want)<br />
std_msgs/String – This is the topic type. We want to publish a string topic. In our overview examples above, it was an image data type.<br />
“Hello Robot” – This is the actual data contained by the topic. I.E. the message itself.<br />
Going back to the previous Terminal, we can execute rostopic list again.<br />
We now have a new topic listed! We can also echo the topic to see the message. rostopic echo /hello</p>
<img decoding="async" class="size-full wp-image-26469" alt="rospic4" src="http://robohub.org/wp-content/uploads/2014/02/rospic4.png" width="642" height="369" srcset="https://robohub.org/wp-content/uploads/2014/02/rospic4.png 642w, https://robohub.org/wp-content/uploads/2014/02/rospic4-300x172.png 300w, https://robohub.org/wp-content/uploads/2014/02/rospic4-500x287.png 500w" sizes="(max-width: 642px) 100vw, 642px" />
<div style="clear: both;"></div>
<div class="minitext">ROS Figure 4</div>
<p>We have now successfully published a topic with a message, and received that message.<br />
Type Ctrl + C to stop echoing the /hello topic.<br />
We can also look into the node that is publishing the message. Type in rosnode list. You will get a list similar to the one below. (The exact numbers beside the rostopic node may be different)</p>
<img decoding="async" class="size-full wp-image-26470" alt="rospic5" src="http://robohub.org/wp-content/uploads/2014/02/rospic5.png" width="642" height="477" srcset="https://robohub.org/wp-content/uploads/2014/02/rospic5.png 642w, https://robohub.org/wp-content/uploads/2014/02/rospic5-300x222.png 300w, https://robohub.org/wp-content/uploads/2014/02/rospic5-403x300.png 403w" sizes="(max-width: 642px) 100vw, 642px" />
<div style="clear: both;"></div>
<div class="minitext">ROS Figure 5</div>
<p>Because we asked rostopic to publish the /hello topic for us, ROS went ahead and created a node to do so. We can look into details of by typing rosnode info /rostopic_…..(whatever numbers)<br />
TIP: In ROS, and in Linux in general, whenever you start typing something, you can press the Tab key to auto-complete it. If there is more than one entry, double tap Tab to get the list. In the above example, all I typed was rosnode info /rost(TAB)</p>
<img decoding="async" class=" size-full wp-image-26471" alt="rospic6" src="http://robohub.org/wp-content/uploads/2014/02/orspic6.png" width="642" height="477" srcset="https://robohub.org/wp-content/uploads/2014/02/orspic6.png 642w, https://robohub.org/wp-content/uploads/2014/02/orspic6-300x222.png 300w, https://robohub.org/wp-content/uploads/2014/02/orspic6-403x300.png 403w" sizes="(max-width: 642px) 100vw, 642px" />
<div style="clear: both;"></div>
<div class="minitext">ROS Figure 6</div>
<p>We can get info on our topic the same way, by typing rostopic info /hello.</p>
<img decoding="async" class="size-full wp-image-26472" alt="rospic7" src="http://robohub.org/wp-content/uploads/2014/02/rospic7.png" width="642" height="477" srcset="https://robohub.org/wp-content/uploads/2014/02/rospic7.png 642w, https://robohub.org/wp-content/uploads/2014/02/rospic7-300x222.png 300w, https://robohub.org/wp-content/uploads/2014/02/rospic7-403x300.png 403w" sizes="(max-width: 642px) 100vw, 642px" />
<div style="clear: both;"></div>
<div class="minitext">ROS Figure 7</div>
<p>You will notice that the node listed under “Publishers:” is the same node we requested info about.</p>
<p>Up till now, we have covered the fundamentals of ROS, how to use rostopic, rosnode.</p>
<p>Next time, we will compile a short example program, and try it out.</p>
<p>&nbsp;</p>
<div class="divideronpost"></div>
<p><em>See all the ROS101 tutorials <a href="http://robohub.org/tag/ros101-tutorial/" data-wpel-link="internal">here</a>. If you liked this article, you may also be interested in:</em></p>
<ul>
<li><a href="http://robohub.org/up-and-flying-with-the-ar-drone-and-ros-getting-started/" data-wpel-link="internal">Up and flying with the AR.Drone and ROS: Getting started</a></li>
<li><a href="http://robohub.org/taking-your-first-steps-in-robotics-with-the-thymio-ii/" data-wpel-link="internal">Taking your first steps in robotics with the Thymio II</a></li>
<li><a title="Permalink to Discovering social robotics with the Aisoy1" href="http://robohub.org/discovering-social-robotics-with-the-aisoy1/" rel="bookmark" data-wpel-link="internal">Discovering social robotics with the Aisoy1</a></li>
<li><a title="Permalink to Parrot AR.Drone app harnesses crowd power to fast-track vision learning in robotic spacecraft" href="http://robohub.org/parrot-ar-drone-app-harnesses-crowd-power-to-fast-track-vision-learning-in-robotic-spacecraft/" rel="bookmark" data-wpel-link="internal">Parrot AR.Drone app harnesses crowd power to fast-track vision learning in robotic spacecraft</a></li>
</ul>
<p><em>See all <a href="http://robohub.org/" data-wpel-link="internal">the latest robotics news</a> on Robohub, or <a href="http://eepurl.com/t-UEf" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer">sign up for our weekly newsletter</a>.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ROS 101: Intro to the Robot Operating System</title>
		<link>https://robohub.org/ros-101-intro-to-the-robot-operating-system/</link>
		
		<dc:creator><![CDATA[Clearpath Robotics]]></dc:creator>
		<pubDate>Wed, 29 Jan 2014 16:15:22 +0000</pubDate>
				<category><![CDATA[education]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[ROS]]></category>
		<category><![CDATA[ROS101 Tutorial]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://robohub.org/?p=26290</guid>

					<description><![CDATA[Clearpath Robotics brings us a new tutorial series on ROS! Since we practically live in the Robot Operating System (ROS), we thought it was time to share some tips on how to get started with ROS. We’ll answer questions like where do I begin? How do I get started? What terminology should I brush up on? Keep [&#8230;]]]></description>
										<content:encoded><![CDATA[<img decoding="async" src="http://robohub.org/wp-content/uploads/2014/01/ROS101.jpg" alt="ROS101_Clearpath" width="520" height="260" class="alignnone size-full wp-image-26299" srcset="https://robohub.org/wp-content/uploads/2014/01/ROS101.jpg 520w, https://robohub.org/wp-content/uploads/2014/01/ROS101-300x150.jpg 300w, https://robohub.org/wp-content/uploads/2014/01/ROS101-500x250.jpg 500w" sizes="(max-width: 520px) 100vw, 520px" />
<p><em><a href="http://www.clearpathrobotics.com" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer">Clearpath Robotics</a> brings us a new tutorial series on ROS!</em></p>
<p>Since we practically live in the Robot Operating System (ROS), we thought it was time to share some tips on how to get started with ROS. We’ll answer questions like <em>where do I begin? How do I get started? What terminology should I brush up on?</em> Keep an eye out for this ongoing ROS 101 blog series that will provide you with a top to bottom view of ROS that will focus on introducing basic concepts simply, cleanly and at a reasonable pace. This guide is meant as a groundwork for new users, which can then be used to jump into in-depth data at <a title="ROS Wiki" href="http://wiki.ros.org/" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">wiki.ros.org</a>. If you are totally unfamiliar with ROS, Linux, or both, this is the place for you!<span id="more-26290"></span></p>
<h2><strong>The ROS Cheat Sheet</strong></h2>
<p>This ROS Cheat Sheet is filled with tips and tricks to help you get started and to continue using once you’re a true ROS user. This version is written for ROS Hydro Medusa. <a title="ROS Cheat Sheet-Hydrov1" href="http://www.clearpathrobotics.com/ros-cheat-sheet" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">Download the ROS Cheat Sheet here</a>.</p>
<h2><strong>What is ROS?</strong></h2>
<p><a title="ROS.org" href="http://www.ros.org/" target="_blank" data-wpel-link="external" rel="follow external noopener noreferrer">ROS (Robot Operating System)</a> is a BSD-licensed system for controlling robotic components from a PC. A ROS system is comprised of a number of independent nodes, each of which communicates with the other nodes using a publish/subscribe messaging model. For example, a particular sensor’s driver might be implemented as a node, which publishes sensor data in a stream of messages. These messages could be consumed by any number of other nodes, including filters, loggers, and also higher-level systems such as guidance, pathfinding, etc.</p>
<h2><strong>Why ROS?</strong></h2>
<p>Note that nodes in ROS do not have to be on the same system (multiple computers) or even of the same architecture! You could have a Arduino publishing messages, a laptop subscribing to them, and an Android phone driving motors. This makes ROS really flexible and adaptable to the needs of the user. ROS is also open source, maintained by many people.</p>
<h2><strong>General Concepts</strong></h2>
<p>Let’s look at the ROS system from a very high level view. No need to worry how any of the following works, we will cover that later.</p>
<p>ROS starts with the ROS Master. The Master allows all other ROS pieces of software (Nodes) to find and talk to each other. That way, we do not have to ever specifically state “Send this sensor data to that computer at 127.0.0.1. We can simply tell Node 1 to send messages to Node 2.</p>
<img decoding="async" class="size-full wp-image-26294" alt="ros101-1" src="http://robohub.org/wp-content/uploads/2014/01/ros101-1.png" width="853" height="534" srcset="https://robohub.org/wp-content/uploads/2014/01/ros101-1.png 853w, https://robohub.org/wp-content/uploads/2014/01/ros101-1-300x187.png 300w, https://robohub.org/wp-content/uploads/2014/01/ros101-1-479x300.png 479w" sizes="(max-width: 853px) 100vw, 853px" />
<div class="minitext">Figure 1</div>
<p>How do Nodes do this? By publishing and subscribing to Topics.</p>
<p>Let’s say we have a camera on our Robot. We want to be able to see the images from the camera, both on the Robot itself, and on another laptop.</p>
<p>In our example, we have a Camera Node that takes care of communication with the camera, a Image Processing Node on the robot that process image data, and a Image Display Node that displays images on a screen. To start with, all Nodes have registered with the Master. Think of the Master as a lookup table where all the nodes go to find where exactly to send messages.</p>
<img decoding="async" class="size-full wp-image-26295" alt="ros101-2" src="http://robohub.org/wp-content/uploads/2014/01/ros101-2.png" width="965" height="673" srcset="https://robohub.org/wp-content/uploads/2014/01/ros101-2.png 965w, https://robohub.org/wp-content/uploads/2014/01/ros101-2-300x209.png 300w, https://robohub.org/wp-content/uploads/2014/01/ros101-2-430x300.png 430w" sizes="(max-width: 965px) 100vw, 965px" />
<div class="minitext">Figure 2</div>
<p>In registering with the ROS Master, the Camera Node states that it will Publish a Topic called /image_data (for example). Both of the other Nodes register that they are Subscribed to the Topic /image_data.</p>
<p>Thus, once the Camera Node receives some data from the Camera, it sends the /image_data message directly to the other two nodes. (Through what is essentially TCP/IP)</p>
<img decoding="async" class="size-full wp-image-26296" alt="ros101-3" src="http://robohub.org/wp-content/uploads/2014/01/ros101-3.png" width="965" height="693" srcset="https://robohub.org/wp-content/uploads/2014/01/ros101-3.png 965w, https://robohub.org/wp-content/uploads/2014/01/ros101-3-300x215.png 300w, https://robohub.org/wp-content/uploads/2014/01/ros101-3-417x300.png 417w" sizes="(max-width: 965px) 100vw, 965px" />
<div class="minitext">Figure 3</div>
<p>Now you may be thinking, what if I want the Image Processing Node to request data from the Camera Node at a specific time? To do this, ROS implements Services.</p>
<p>A Node can register a specific service with the ROS Master, just as it registers its messages. In the below example, the Image Processing Node first requests /image_data, the Camera Node gathers data from the Camera, and then sends the reply.</p>
<img decoding="async" class="size-full wp-image-26297" alt="ros101-4" src="http://robohub.org/wp-content/uploads/2014/01/ros101-4.png" width="927" height="658" srcset="https://robohub.org/wp-content/uploads/2014/01/ros101-4.png 927w, https://robohub.org/wp-content/uploads/2014/01/ros101-4-300x212.png 300w, https://robohub.org/wp-content/uploads/2014/01/ros101-4-422x300.png 422w" sizes="(max-width: 927px) 100vw, 927px" />
<div class="minitext">Figure 4</div>
<p>We will have another tutorial &#8220;ROS 101 &#8211; Practical Example&#8221; next week.</p>
<p>&nbsp;</p>
<div class="divideronpost"></div>
<p><em>See all the ROS101 tutorials <a href="http://robohub.org/tag/ros101-tutorial/" data-wpel-link="internal">here</a>. If you liked this article, you may also be interested in:</em></p>
<ul>
<li><a href="http://robohub.org/up-and-flying-with-the-ar-drone-and-ros-getting-started/" data-wpel-link="internal">Up and flying with the AR.Drone and ROS: Getting started</a></li>
<li><a href="http://robohub.org/taking-your-first-steps-in-robotics-with-the-thymio-ii/" data-wpel-link="internal">Taking your first steps in robotics with the Thymio II</a></li>
<li><a title="Permalink to Discovering social robotics with the Aisoy1" href="http://robohub.org/discovering-social-robotics-with-the-aisoy1/" rel="bookmark" data-wpel-link="internal">Discovering social robotics with the Aisoy1</a></li>
<li><a title="Permalink to Parrot AR.Drone app harnesses crowd power to fast-track vision learning in robotic spacecraft" href="http://robohub.org/parrot-ar-drone-app-harnesses-crowd-power-to-fast-track-vision-learning-in-robotic-spacecraft/" rel="bookmark" data-wpel-link="internal">Parrot AR.Drone app harnesses crowd power to fast-track vision learning in robotic spacecraft</a></li>
</ul>
<p><em>See all <a href="http://robohub.org/" data-wpel-link="internal">the latest robotics news</a> on Robohub, or <a href="http://eepurl.com/t-UEf" data-wpel-link="external" target="_blank" rel="follow external noopener noreferrer">sign up for our weekly newsletter</a>.</em></p>
<p><em> </em></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: robohub.org @ 2026-10-24 21:39:25 by W3 Total Cache
-->