<?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[xiaoqiang tutorial (10) use kinect for autonomous mobile and obstacle avoidance]]></title><description><![CDATA[<p dir="auto"><a href="http://www.bwbot.org/en/products/xiaoqiang-4-pro" target="_blank" rel="noopener noreferrer">Xiaoqiang Homepage</a></p>
<p dir="auto">Click to watch the demo video</p>
<p dir="auto"><video src="https://www.bwbot.org/static/video/obj3.mp4" controls style="max-width:100%"></video></p>
<h2>principle:</h2>
<p dir="auto">The <code>freenct_stack</code> package provides a kinect driver, and its published point cloud is transformed into an obstacle grid distribution image by <code>image_pipeline</code>. After the <code>nav_test</code> software package starts the navigation program, it analyzes the obstacle distribution map automatically, and then moves autonomously according to the target navigation point published by the rviz.</p>
<h2>Steps：</h2>
<h3>1. Configure the hosts file of the host and the local virtual machine so that the two computer can access the corresponding ros data.</h3>
<h4>1.a Configure the local virtual machine</h4>
<pre><code class="language-bash">sudo gedit /etc/hosts
</code></pre>
<p dir="auto">Replace the ip address in the figure below with the actual value of the platform</p>
<p dir="auto"><img src="/assets/uploads/files/1536821745183-ff847a2d-1bf4-45c4-b672-46338d05808c-image-resized.png" alt="0_1536821744437_ff847a2d-1bf4-45c4-b672-46338d05808c-image.png" class=" img-responsive img-markdown" /></p>
<h4>1.b Configuration Xiaoqiang Host</h4>
<p dir="auto">LAN ssh login Xiaoqiang host</p>
<pre><code class="language-bash">ssh xiaoqiang@192.168.0.101 -X
sudo gedit /etc/hosts
</code></pre>
<p dir="auto">Replace the ip address in the following figure with the actual value of the virtual machine and change the host name to the virtual machine name</p>
<p dir="auto"><img src="/assets/uploads/files/1536821793321-bfc4e11d-f049-4c14-8f5d-17ef104e6980-image-resized.png" alt="0_1536821792571_bfc4e11d-f049-4c14-8f5d-17ef104e6980-image.png" class=" img-responsive img-markdown" /></p>
<h3>2. Open three windows in the local virtual machine, respectively ssh login Xiaoqiang host, start the relevant software package mentioned in the principle section</h3>
<h4>2.a Ssh login</h4>
<p dir="auto"><img src="/assets/uploads/files/1536821821038-a1efd39d-0a74-4287-8f26-d320aa50a76e-image-resized.png" alt="0_1536821820312_a1efd39d-0a74-4287-8f26-d320aa50a76e-image.png" class=" img-responsive img-markdown" /></p>
<h4>2.b Start the kinect driver in the first window</h4>
<p dir="auto">For kinect v1</p>
<pre><code class="language-bash">roslaunch freenect_launch kinect-xyz.launch
</code></pre>
<p dir="auto">For Kinect v2</p>
<pre><code class="language-bash">roslaunch kinect2_bridge kinect2-xyz.launch
</code></pre>
<p dir="auto">For astrapro</p>
<pre><code class="language-bash">roslaunch astra_launch astrapro.launch
</code></pre>
<h4>2.c Set kinect angle in the second window, this angle is not arbitrary</h4>
<p dir="auto">For kinect v1</p>
<pre><code class="language-bash">rostopic pub /set_tilt_degree std_msgs/Int16 '{data: -19}' -1
</code></pre>
<p dir="auto">For Kinect v2</p>
<p dir="auto">Since the kinect v2 does not have a pitch angle motor, manually adjust the kinect v2 to the maximum depression angle</p>
<p dir="auto">For astrapro</p>
<p dir="auto">Since the astrapro does not have a pitch angle motor, manually adjust the astrapro to the maximum depression angle.</p>
<h4>2.d Edit the platform navigator configuration file /home/xiaoqiang/Documents/ros/src/nav_test/config/fake/base_local_planner_params2.yaml to enable kinect</h4>
<p dir="auto"><img src="/assets/uploads/files/1536822065157-e1075027-0199-4e0c-8447-5feb0471cf47-image-resized.png" alt="0_1536822064424_e1075027-0199-4e0c-8447-5feb0471cf47-image.png" class=" img-responsive img-markdown" /></p>
<h4>2.e Launch the platform navigation program in the third window</h4>
<pre><code class="language-bash">roslaunch nav_test fake_move_base_blank_map.launch
</code></pre>
<h4>2.f If all normal, there will be an interface similar to the following figure. All configurations on xiaoqiang have completed.</h4>
<p dir="auto"><img src="/assets/uploads/files/1536822111024-8b4b566a-9ca8-4ed1-a027-1507e5f5e149-image-resized.png" alt="0_1536822110307_8b4b566a-9ca8-4ed1-a027-1507e5f5e149-image.png" class=" img-responsive img-markdown" /></p>
<h3>3.Open a new window in the local virtual machine and start rviz</h3>
<h4>3.a After joining ros LAN, open rviz</h4>
<pre><code class="language-bash">export ROS_MASTER_URI=http://xiaoqiang-desktop:11311
rviz
</code></pre>
<p dir="auto">Note: If Xiaoqiang’s model cannot be displayed, Xiaoqiang model package should be installed locally.</p>
<p dir="auto"><img src="/assets/uploads/files/1536822190616-2cd6c0d0-24a7-49de-83c3-c4f55b55e4f8-image.png" alt="0_1536822189815_2cd6c0d0-24a7-49de-83c3-c4f55b55e4f8-image.png" class=" img-responsive img-markdown" width="724" height="175" /></p>
<h4>3.b Click open config in the upper left corner of the rviz interface and select the /home/xiaoqiang/Documents/ros/src/nav_test/config/nav_addwa_kinect.rviz configuration file on Xiaoqiang’s host.</h4>
<p dir="auto"><img src="/assets/uploads/files/1536822214450-b07422df-9744-4e34-8871-24d464c10231-image-resized.png" alt="0_1536822213670_b07422df-9744-4e34-8871-24d464c10231-image.png" class=" img-responsive img-markdown" /></p>
<h4>3.c Normally, a picture similar to the one below will appear in rviz. Now that all configurations have been completed, the next step is to publish navigation targets.</h4>
<p dir="auto"><img src="/assets/uploads/files/1536822244948-3e83b532-25d4-4207-b2a8-f09a1b57b5b3-image-resized.png" alt="0_1536822244220_3e83b532-25d4-4207-b2a8-f09a1b57b5b3-image.png" class=" img-responsive img-markdown" /></p>
<h4>3.d Randomly publish a target point, Xiaoqiang will start autonomous movement</h4>
<p dir="auto"><img src="/assets/uploads/files/1536824006841-a3fdb7cb-f1ae-47b1-9901-1f2d467ff280-image-resized.png" alt="0_1536824006028_a3fdb7cb-f1ae-47b1-9901-1f2d467ff280-image.png" class=" img-responsive img-markdown" /></p>
<h4>3.e Xiaoqiang reaches the target point, please continue to try other positions. This tutorial ended.</h4>
<p dir="auto"><img src="/assets/uploads/files/1536824035903-69fc0931-fae1-41a2-ac37-fd8eaebbc020-image-resized.png" alt="0_1536824035150_69fc0931-fae1-41a2-ac37-fd8eaebbc020-image.png" class=" img-responsive img-markdown" /></p>
<p dir="auto">Please insert the kinect data cable into the blue host USB3.0 port of xiaoqiang to ensure the normal operation of the driver. Model 1473 kinect users please refer to the preparation method in tutorial (9).</p>
<p dir="auto">If xiaoqiang has been moving backwards, it can be seen in rviz that there is a black area in front of xiaoqiang, and the black area has been following Xiaoqiang’s movement. This situation indicates that the kinect installation or kienct angle is not in right. Please check the kinect mounting bracket, remove the kienct film and re-execute the instructions in the tutorial.</p>
<h3>FAQ</h3>
<p dir="auto">Q: Map shows normally and the car can also be remote controlled, although published the target point vai rviz to the car , the car does not move to the target point.<br />A: In general, this problem is a network setup problem. This tutorial requires the hosts record to be set up between the xiaoqiang and the local machine, and to be able to access each other directly. After setting up the IP record, you can ping each other on the xiaoqiang and local computer to check the network connection. For example type following cmd on local machine</p>
<pre><code class="language-bash">ping xiaoqiang-desktop
</code></pre>
<p dir="auto">Enter the following cmd on xiaoqiang</p>
<pre><code class="language-bash">ping ubuntu # Suppose your computer name is ubuntu
</code></pre>
<p dir="auto">If we cannot ping between the two successfully, then you need check your network settings.</p>
<p dir="auto"><a href="http://www.bwbot.org/en/products/xiaoqiang-4-pro" target="_blank" rel="noopener noreferrer">Xiaoqiang Homepage</a><br />
<a href="https://community.bwbot.org/topic/617" target="_blank" rel="noopener noreferrer">Back To Index</a></p>
]]></description><link>http://community.bwbot.org/topic/591/xiaoqiang-tutorial-10-use-kinect-for-autonomous-mobile-and-obstacle-avoidance</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 04:37:53 GMT</lastBuildDate><atom:link href="http://community.bwbot.org/topic/591.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Sep 2018 07:34:14 GMT</pubDate><ttl>60</ttl></channel></rss>