-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.xml
More file actions
154 lines (116 loc) · 5.66 KB
/
index.xml
File metadata and controls
154 lines (116 loc) · 5.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Preetham Chalasani</title>
<link>http://preethamchalasani.com/</link>
<description>Recent content on Preetham Chalasani</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Sun, 05 Apr 2015 21:54:16 -0400</lastBuildDate>
<atom:link href="http://preethamchalasani.com/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>MatlabRosTutorial</title>
<link>http://preethamchalasani.com/posts/matlab-ros-setup-tutorial/</link>
<pubDate>Sun, 05 Apr 2015 21:54:16 -0400</pubDate>
<guid>http://preethamchalasani.com/posts/matlab-ros-setup-tutorial/</guid>
<description>
<p>This tutorial will briefly describe how to use the robotics systems toolbox provided in R2015a, to interface with ROS. [Subscriber uses callback function]</p>
<h3 id="setup:4648a9840b5c9d4c29a3abf329dfcd2c">Setup</h3>
<ol>
<li><p>I will be assuming that you have already innstalled <a href="http://wiki.ros.org/hydro/Installation/Ubuntu">ROS</a> and had setup appropriate environment variables.</p></li>
<li><p>Create a folder for the project</p>
<pre><code class="language-shell">mkdir -p dev/tutorial
cd dev/tutorial
touch MatlabRos.m
</code></pre></li>
<li><p>First get the URI for the master</p>
<pre><code>MasterHost = getenv('ROS_MASTER_URI');
</code></pre></li>
<li><p>Next check whether a rosocre is running at that URI, if not, initialize one</p>
<pre><code>Nodelist = [];
try
Nodelist = rosnode('list');
disp('Master already initialized')
catch
rosinit(MasterHost);
Nodelist = rosnode('list');
end
</code></pre></li>
<li><p>Create a ros node for testing</p>
<pre><code>Node = robotics.ros.Node('MatlabExperiment', MasterHost);
disp('Node ''/MatlabExperiment'' created')
</code></pre></li>
<li><p>Create a publisher</p>
<pre><code>PubMyName = robotics.ros.Publisher(Node, '/set_my_name' ,'std_msgs/String');
</code></pre></li>
<li><p>Create a subscriber and its corresponding callback function</p>
<pre><code>SubMyName = rossubscriber('/set_my_name', @cbMyName);
</code></pre>
<p>Put the following function in <code>cbMyName.m</code></p>
<pre><code>function cbMyName(~, message)
disp (['I recieved ', message.Data])
end
</code></pre></li>
<li><p>Now try to puplish something using <code>PubMyName</code></p>
<pre><code>msg = rosmessage(PubMyName);
msg.Data = 'Hello'
send(PubMyName, msg)
</code></pre>
<p>You should see the following output</p>
<pre><code>I recieved Hello
</code></pre></li>
</ol>
<!--
* Create a [timr](http://www.mathworks.com/help/matlab/matlab_prog/use-a-matlab-timer-object.html) object and specify the handle for a [Timer Callback Function](http://www.mathworks.com/help/matlab/matlab_prog/timer-callback-functions.html), say `cbFunction`.
```
% 250 hz
timr = timer('Period', 0.004, 'ExecutionMode','fixedRate'); % 250 hz
timr.TimerFcn = {@cbFunction, input1, input2};
```
Start the timer
```
start(timr)
```
This will search for the function `cbFunction` in the search path and will call the function with the specified input at a specified frequency. Read more on timer callback functions [here](http://www.mathworks.com/help/matlab/matlab_prog/timer-callback-functions.html).
-->
</description>
</item>
<item>
<title></title>
<link>http://preethamchalasani.com/homepage/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>http://preethamchalasani.com/homepage/</guid>
<description><!-- This file is the homepage of the website. -->
{{ partial "header.html" . }}
<body class="theme-base-08">
{{ partial "sidebar.html" . }}
<!-- See /layouts/indexes/category.html for explanation of this section -->
<div class="wrap">
<div class="masthead">
<div class="container">
<h3 class="masthead-title">
<a href="http://preethamchalasani.com/homepage" title="Home">Home</a>
</h3>
</div>
</div>
<!--
This section contains the content of our home page.
I have broken it into three main sections:
(1) about the blog
(2) about me
(3) Recent posts
The first two sections are pretty self explanatory.
In the recent posts section we ask Hugo to use the template found in
/layouts/posts/summary.html to show a summary of the 10 most recent
posts we have made.
-->
<div class="container content">
<p class="lead"> Welcome to my Site! </p>
</div>
</div>
<label for="sidebar-checkbox" class="sidebar-toggle"></label>
</body>
</html></description>
</item>
</channel>
</rss>