<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with robotupstart]]></title><description><![CDATA[A list of topics that have been tagged with robotupstart]]></description><link>http://community.bwbot.org/tags/robotupstart</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Mar 2026 05:24:15 GMT</lastBuildDate><atom:link href="http://community.bwbot.org/tags/robotupstart.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 30 Oct 2018 12:01:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[如何不设置HOST通过ROS远程连接]]></title><description><![CDATA[<p dir="auto">在有些情况下我们想要连接远程的master节点是没办法设置hosts文件的。比如在Android上运行rosjava时。这样就导致我们能够发布消息到远程节点，但是却无法订阅远程消息。问题在于默认的<code>ROS_MASTER_URI</code>是<code>http://computer-name:11311</code>。而我们连接的时候是通过IP连接的，这样导致本地节点订阅的是<code>http://xxx.xxx.xxx.xxx:11311</code>，其中<code>xxx.xxx.xxx.xxx</code>是远程机器的IP。这两个不一致，导致无法订阅消息。</p>
<p dir="auto">解决方法是把远程的<code>ROS_MASTER_URI</code>也设置成IP的形式。这个可以通过设置<code>ROS_IP</code>变量实现。比如在launch文件内添加</p>
<pre><code class="language-xml">&lt;env name="ROS_IP" value="xxx.xxx.xxx.xxx" /&gt;
</code></pre>
<p dir="auto">但是实际使用的时候远程节点IP可能并不是固定的。这样设置之后一旦IP发生变化，程序就没办法继续运行了。下面介绍一个更好的方法。使用<code>robot_upstart</code>软件包</p>
<p dir="auto">安装<code>robot_upstart</code>软件包</p>
<pre><code class="language-bash">sudo apt-get install ros-kinetic-robot-upstart
</code></pre>
<p dir="auto">安装自启动服务</p>
<pre><code class="language-bash">rosrun robot_upstart install --interface enp2s0 startup/launch/startup.launch
</code></pre>
<p dir="auto">需要注意的是这里的 <code>--interface</code>参数。这个参数指定网络设备，在程序启动的时候会自动获取这个网络设备的IP然后设置到<code>ROS_IP</code>环境变量。这样<code>ROS_MASTER_URI</code>就会和当前的IP一致。</p>
]]></description><link>http://community.bwbot.org/topic/634/如何不设置host通过ros远程连接</link><guid isPermaLink="true">http://community.bwbot.org/topic/634/如何不设置host通过ros远程连接</guid><dc:creator><![CDATA[weijiz]]></dc:creator><pubDate>Tue, 30 Oct 2018 12:01:00 GMT</pubDate></item></channel></rss>