Answer
stringlengths
44
28.2k
Id
stringlengths
1
6
CreationDate
stringlengths
23
23
Tags
stringlengths
4
94
Body
stringlengths
54
35.7k
Title
stringlengths
13
150
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Gmapping node subscribes to the odometry data of your robot (topic name) and also the laser scan. The only package I know about that uses only laser scan data to build map is hector mapping ...for that to work you have to get a transform from map to base_link to laser_frame of your robot .</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/103873/davies-ogunsina/" rel="nofollow noreferrer">Davies Ogunsina</a> with karma: 96 on 2022-11-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/117137/wugeshenhuaking/" rel="nofollow noreferrer">wugeshenhuaking</a> on 2022-11-21</strong>:<br /> I have used Hector to get the map I want. I want to ask again what method can I use to build a map with the topic of odom?</p>
102729
2022-11-18T09:18:40.000
|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I learned from reading the relevant links of gmapping that gmapping uses odom and laser scan to build maps. Is there any way to let gmapping only accept laserscan data to build maps</p> <hr /> <p><a href="https://answers.ros.org/question/409569/how-to-make-the-gmapping-algorithm-use-only-laser-scan-topics-to-build-maps%EF%BC%9F/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/117137/wugeshenhuaking/" rel="nofollow noreferrer">wugeshenhuaking</a> on ROS Answers with karma: 35 on 2022-11-18</p> <p>Post score: 0</p>
How to make the gmapping algorithm use only laser scan topics to build maps?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Found answer to both questions:</p> <ol start="2"> <li>Questions and Issues about the Create3: <a href="https://github.com/iRobotEducation/create3_docs/discussions" rel="nofollow noreferrer">https://github.com/iRobotEducation/create3_docs/discussions</a></li> </ol> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16689505631988233.png" alt="image description" /></p> <ol> <li>It is by design:</li> </ol> <p><a href="https://github.com/iRobotEducation/create3_docs/discussions/243#discussioncomment-4187712" rel="nofollow noreferrer">https://github.com/iRobotEducation/create3_docs/discussions/243#discussioncomment-4187712</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/40559/robotdreams/" rel="nofollow noreferrer">RobotDreams</a> with karma: 327 on 2022-11-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102731
2022-11-19T14:44:03.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The Create3 publishes a /battery_state topic roughly every 10 seconds, but the header time stamp and data changes every 169 seconds.</p> <p><strong>Is this a defect, and if so where do I file the issue?</strong></p> <pre><code>--- header: stamp: sec: 1668885286 nanosec: 307109232 frame_id: '' voltage: 14.880000114440918 temperature: 42.45000076293945 current: 0.42100000381469727 charge: 0.9739999771118164 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.47999998927116394 --- header: stamp: sec: 1668885463 &lt;&lt;--- TimeStamp and Data Changed nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885463 nanosec: 885139612 frame_id: '' voltage: 14.902000427246094 temperature: 42.54999923706055 current: 0.4269999861717224 charge: 0.9950000047683716 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.49000000953674316 --- header: stamp: sec: 1668885632 &lt;&lt;-- TimeStamp and Data Changed nanosec: 998287917 frame_id: '' voltage: 14.92300033569336 temperature: 42.54999923706055 current: 0.4230000078678131 charge: 1.0149999856948853 capacity: 2.049999952316284 design_capacity: 2.049999952316284 percentage: 0.5 </code></pre> <hr /> <p><a href="https://answers.ros.org/question/409609/%5Bcreate3%5D-/battery_state-topic-time-stamp-and-data-repeated-17-times?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/40559/robotdreams/" rel="nofollow noreferrer">RobotDreams</a> on ROS Answers with karma: 327 on 2022-11-19</p> <p>Post score: 0</p>
[Create3] /battery_state topic time stamp and data repeated 17 times?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The error you're getting is due to conflicting files installed from different packages. It looks like you have very old versions of some of those packages.</p> <p>There's a few things I'll flag. First is that you appear to be mixing python2 and python3 which is unexpected for melodic. By default everything should be using python2 in melodic.</p> <p>Second, I see python3-catkin-pkg-modules is quite old. The instruction that you link to have an <code>apt-get upgrade</code> that I think you may have not executed, or your system is old enough you need to use an <code>apt-get dist-upgrade</code> to get coverage.</p> <p>I tried it out on in a clean buster container and wasn't able to reproduce the problem. You may need to understand more about where your image is coming from or what the legacy of that system is. But the primary recommendation is to make sure that your tools are up to date before you try to install the new ones.</p> <p>And secondly I would strongly recommend that you double check where the different python version is coming from and that that is something that you want to debug and deal with. It will make your experience more complicated.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2022-11-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/124526/tunamayo/" rel="nofollow noreferrer">tunamayo</a> on 2022-11-25</strong>:<br /> I tried an <code>apt-get</code> and an <code>apt-get dist-upgrade</code> , but nothing updated.</p> <p>So I reinstalled the OS and it works fine.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> on 2022-11-29</strong>:<br /> Yeah, it sounds like you had some conflicting packages preinstalled on your system.</p>
102733
2022-11-21T02:06:09.000
|ros-melodic|rosdep|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to install ROS Melodic on Raspberrypi4 model B.</p> <p>My environment:RaspberryPi4 model B 2GB RAM</p> <pre><code><span class="math-container">$ uname -a Linux raspberrypi 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux $</span> cat /etc/debian_version 10.13 </code></pre> <p>I followed the steps in this page:<a href="http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Melodic%20on%20the%20Raspberry%20Pi" rel="nofollow noreferrer">Installing ROS Melodic on the Raspberry Pi</a></p> <p>An error occurred when executing the following command</p> <pre><code>rosdep install -y --from-paths src --ignore-src --rosdistro melodic -r --os=debian:buster </code></pre> <p>Sorry,Error contains Japanese characters.</p> <p>Error:</p> <blockquote> <p>executing command [sudo -H apt-get install -y python-catkin-pkg-modules]<br /> パッケージリストを読み込んでいます... 完了<br /> 依存関係ツリーを作成しています<br /> 状態情報を読み取っています... 完了<br /> 以下のパッケージが自動でインストールされましたが、もう必要とされていません:<br /> python3-rospkg-modules<br /> これを削除するには 'sudo apt autoremove' を利用してください。<br /> 以下のパッケージが新たにインストールされます:<br /> python-catkin-pkg-modules<br /> アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。<br /> 41.0 kB 中 0 B のアーカイブを取得する必要があります。<br /> この操作後に追加で 249 kB のディスク容量が消費されます。<br /> (データベースを読み込んでいます ... 現在 150007 個のファイルとディレクトリがインストールされています。)<br /> .../python-catkin-pkg-modules_0.4.8-1_all.deb を展開する準備をしています ...<br /> python-catkin-pkg-modules (0.4.8-1) を展開しています...<br /> dpkg: アーカイブ /var/cache/apt/archives/python-catkin-pkg-modules_0.4.8-1_all.deb の処理中にエラーが発生しました (--unpack):<br /> '/usr/lib/python2.7/dist-packages/catkin_pkg/topological_order.py' を上書きしようとしています。これはパッケージ python-catkin-pkg 0.4.10-1 にも存在します<br /> 処理中にエラーが発生しました:<br /> /var/cache/apt/archives/python-catkin-pkg-modules_0.4.8-1_all.deb<br /> E: Sub-process /usr/bin/dpkg returned an error code (1)<br /> executing command [sudo -H apt-get install -y python-rosdep-modules]<br /> パッケージリストを読み込んでいます... 完了<br /> 依存関係ツリーを作成しています<br /> 状態情報を読み取っています... 完了<br /> E: パッケージ python-rosdep-modules が見つかりません<br /> executing command [sudo -H apt-get install -y python3-rosdep-modules]<br /> パッケージリストを読み込んでいます... 完了<br /> 依存関係ツリーを作成しています<br /> 状態情報を読み取っています... 完了<br /> E: パッケージ python3-rosdep-modules が見つかりません<br /> executing command [sudo -H apt-get install -y python3-rospkg]<br /> パッケージリストを読み込んでいます... 完了<br /> 依存関係ツリーを作成しています<br /> 状態情報を読み取っています... 完了<br /> 以下のパッケージが自動でインストールされましたが、もう必要とされていません:<br /> python-catkin-pkg python-rospkg-modules<br /> これを削除するには 'sudo apt autoremove' を利用してください。<br /> 以下のパッケージは「削除」されます:<br /> python-rosdep python-rosdistro python-rosinstall python-rosinstall-generator python-rospkg<br /> 以下のパッケージが新たにインストールされます:<br /> python3-rospkg<br /> アップグレード: 0 個、新規インストール: 1 個、削除: 5 個、保留: 0 個。<br /> 2,142 B 中 0 B のアーカイブを取得する必要があります。<br /> この操作後に 776 kB のディスク容量が解放されます。<br /> (データベースを読み込んでいます ... 現在 150006 個のファイルとディレクトリがインストールされています。)<br /> python-rosdep (0.14.0-1) を削除しています ...<br /> python-rosinstall-generator (0.1.14-1) を削除しています ...<br /> python-rosinstall (0.7.8-2) を削除しています ...<br /> python-rosdistro (0.7.2-1) を削除しています ...<br /> python-rospkg (1.1.7-100) を削除しています ...<br /> 以前に未選択のパッケージ python3-rospkg を選択しています。<br /> (データベースを読み込んでいます ... 現在 149858 個のファイルとディレクトリがインストールされています。)<br /> .../python3-rospkg_1.1.7-100_all.deb を展開する準備をしています ...<br /> python3-rospkg (1.1.7-100) を展開しています...<br /> python3-rospkg (1.1.7-100) を設定しています ...<br /> executing command [sudo -H apt-get install -y python3-catkin-pkg-modules]<br /> パッケージリストを読み込んでいます... 完了<br /> 依存関係ツリーを作成しています<br /> 状態情報を読み取っています... 完了<br /> 以下のパッケージが自動でインストールされましたが、もう必要とされていません:<br /> python-catkin-pkg python-rospkg-modules<br /> これを削除するには 'sudo apt autoremove' を利用してください。<br /> 以下のパッケージが新たにインストールされます:<br /> python3-catkin-pkg-modules<br /> アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。<br /> 41.0 kB 中 0 B のアーカイブを取得する必要があります。<br /> この操作後に追加で 248 kB のディスク容量が消費されます。<br /> (データベースを読み込んでいます ... 現在 149867 個のファイルとディレクトリがインストールされています。)<br /> .../python3-catkin-pkg-modules_0.4.8-1_all.deb を展開する準備をしています ...<br /> python3-catkin-pkg-modules (0.4.8-1) を展開しています...<br /> dpkg: アーカイブ /var/cache/apt/archives/python3-catkin-pkg-modules_0.4.8-1_all.deb の処理中にエラーが発生しました (--unpack):<br /> '/usr/lib/python3/dist-packages/catkin_pkg/topological_order.py' を上書きしようとしています。これはパッケージ python3-catkin-pkg 0.4.10-1 にも存在します<br /> 処理中にエラーが発生しました:<br /> /var/cache/apt/archives/python3-catkin-pkg-modules_0.4.8-1_all.deb<br /> E: Sub-process /usr/bin/dpkg returned an error code (1)<br /> ERROR: the following rosdeps failed to install<br /> apt: command [sudo -H apt-get install -y python-catkin-pkg-modules] failed<br /> apt: command [sudo -H apt-get install -y python-rosdep-modules] failed<br /> apt: command [sudo -H apt-get install -y python3-rosdep-modules] failed<br /> apt: command [sudo -H apt-get install -y python3-catkin-pkg-modules] failed<br /> apt: Failed to detect successful installation of [python-catkin-pkg-modules]<br /> apt: Failed to detect successful installation of [python-rosdep-modules]<br /> apt: Failed to detect successful installation of [python3-rosdep-modules]<br /> apt: Failed to detect successful installation of [python3-catkin-pkg-modules]</p> </blockquote> <p>How can I resolve these errors?</p> <hr /> <p><a href="https://answers.ros.org/question/409637/rosdep-failed-to-install-python-catkin-pkg-modules-on-debian-buster/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/124526/tunamayo/" rel="nofollow noreferrer">tunamayo</a> on ROS Answers with karma: 1 on 2022-11-21</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> on 2022-11-21</strong>:<br /> Please edit your question to include more of the error content above. This is mostly the summary and not the full error.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/124526/tunamayo/" rel="nofollow noreferrer">tunamayo</a> on 2022-11-22</strong>:<br /> I have added the full error.</p>
Rosdep failed to install python-catkin-pkg-modules on Debian buster
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Problem solved with sudo apt install ros-foxy-gazebo-ros2-control</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> with karma: 95 on 2022-11-21</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102735
2022-11-21T08:45:13.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi. Sorry for all mistakes, English is not my native language. I'm trying to spawn my robot in gazebo. The world is loaded successfully but model of robot itself is not and I have following error in terminal.</p> <pre><code>[gazebo-1] [Err] [Plugin.hh:212] Failed to load plugin libgazebo_ros2_control.so: libgazebo_ros2_control.so: cannot open shared object file: No such file or directory [spawn_entity.py-4] [INFO] [1669073669.505081456] [urdf_spawner]: Spawn status: SpawnEntity: Successfully spawned entity [minicar] [INFO] [spawn_entity.py-4]: process has finished cleanly [pid 10576] </code></pre> <p>I've installed my gazebo with ros2 foxy using desktop installation, after receiving this error first time I checked if this file can be found in /opt/ros/foxy/lib folder and there are no such file. I reinstall gazebo with following command</p> <pre><code>sudo apt install ros-foxy-gazebo-pkg </code></pre> <p>Didn't work ether. If first and last time than I launched it environment has been sourced with:</p> <pre><code>source /opt/ros/foxy/setup.bash </code></pre> <p>so I, honestly speaking, have no idea where the problem can be. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/409654/failed-to-load-plugin-libgazebo_ros2_control.so:-libgazebo_ros2_control.so:-cannot-open-shared-object-file:-no-such-file-or-directory/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on ROS Answers with karma: 95 on 2022-11-21</p> <p>Post score: 0</p>
Failed to load plugin libgazebo_ros2_control.so: libgazebo_ros2_control.so: cannot open shared object file: No such file or directory
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have found <a href="https://www.youtube.com/playlist?list=PLunhqkrRNRhYAffV8JDiFOatQXuU-NnxT" rel="nofollow noreferrer">this course</a> on YouTube by Articulated Robotics to be extremely helpful in getting things running on a physical robot, not only nav2 but also slam_toolbox and more. Huge props to the creator.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/117662/coatwolf/" rel="nofollow noreferrer">coatwolf</a> with karma: 13 on 2023-04-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102737
2022-11-21T11:32:20.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi community,</p> <p>I'm working on building my own SLAM robot as an educational project, and I've been following along the excellent <a href="https://navigation.ros.org/setup_guides/index.html" rel="nofollow noreferrer">guide</a> on setting up Nav2. I'm a bit stuck, and here's why:</p> <p>My robot is running a Raspberry Pi 4 (Ubuntu 22.04) <em>headlessly</em>, but the Nav2 setup guide assumes (or maybe requires? I'm not sure) the use of Gazebo. I made it from the beginning all the way through the URDF set up section, but starting from the <a href="https://navigation.ros.org/setup_guides/odom/setup_odom.html" rel="nofollow noreferrer">Setting Up Odometry</a> it gets a bit Gazebo-heavy.</p> <p>I'd appreciate some help with regards to either:</p> <ul> <li>Knowing which parts of the tutorial(s) to ignore (since I'm not using sim) without skipping critical steps in getting my real robot moving</li> <li>Using a different guide (if there exists one) that is less sim-oriented and more geared toward setting up a physical robot with Nav2</li> </ul> <p>Thanks in advance and huge kudos to everyone making Nav2 happen!!</p> <hr /> <p><a href="https://answers.ros.org/question/409664/setting-up-nav2-on-real-robot/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/117662/coatwolf/" rel="nofollow noreferrer">coatwolf</a> on ROS Answers with karma: 13 on 2022-11-21</p> <p>Post score: 0</p>
Setting up Nav2 on real robot
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I was able to build it with the following changes.</p> <hr /> <p>In test-external-lib/external-lib/CMakeLists.txt create shared library instead of static</p> <pre><code>add_library(${PROJECT_NAME} SHARED src/my-lib.cc) </code></pre> <hr /> <p>And in test-external-lib/executor/CMakeLists.txt, use</p> <pre><code>#ament_target_dependencies(<span class="math-container">${PROJECT_NAME} external-lib) target_link_libraries($</span>{PROJECT_NAME} PUBLIC external-lib::external-lib) </code></pre> <hr /> <p>Finally, in test-external-lib/executor/src/exec.cc</p> <pre><code>auto tmp = new Consol(); tmp-&gt;Run(argc, argv); </code></pre> <hr /> <p>Edit after comment :</p> <p>You can use STATIC library too.</p> <p>In <strong>test-external-lib/external-lib/CMakeLists.txt</strong>, do the following 2 changes</p> <ol> <li><p>ament couldnt find cli, so link it with <strong>target_link_libraries</strong></p> <p>#target_link_libraries(<span class="math-container">${PROJECT_NAME} PRIVATE cli::cli rclcpp::rclcpp) target_link_libraries($</span>{PROJECT_NAME} PRIVATE cli::cli) ament_target_dependencies(${PROJECT_NAME} PUBLIC rclcpp)</p> </li> <li><p>export cli too</p> <p>#ament_export_dependencies(rclcpp) ament_export_dependencies(rclcpp cli)</p> </li> </ol> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/9486/bvbdort/" rel="nofollow noreferrer">bvbdort</a> with karma: 3034 on 2022-11-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/120210/mr_leonard/" rel="nofollow noreferrer">Mr_Leonard</a> on 2022-11-23</strong>:<br /> Thanks for your reply! Yes, with your changes the example worked. But it's strange. Why should we use a dynamic library? And it seems that dependency export stopped working. I move <em>#include rclcpp.hpp</em> from source file to header file in &quot;external-lib&quot; package, and the 'executor' package can not find the rclcpp lib in &quot;external-lib&quot; `s file. This only works if you directly include rclcpp in the cmake file of the executor package. Any ideas what I'm doing wrong? <a href="https://github.com/MrLeonardPak/ros-test/tree/foxy/test-external-lib" rel="nofollow noreferrer">Link </a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/120210/mr_leonard/" rel="nofollow noreferrer">Mr_Leonard</a> on 2022-11-24</strong>:<br /> I updated the repo with your changes and it works, but only with a SHARED property. If I set STATIC property I get this error <em>&quot;The following imported targets are referenced, but are missing: cli::cli&quot;</em></p>
102740
2022-11-21T18:42:01.000
|ros2|c++|cmake|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to create a package that combines the rclcpp libraries and an external library installed with CMake FetchContent. How do I properly create a cmake file? I have already tried different ways, but I keep getting different errors. <a href="https://github.com/MrLeonardPak/ros-test/tree/foxy/test-external-lib" rel="nofollow noreferrer">Here</a> two package for example. An external-lib package contains an external library, and an executor package includes a external-lib package. If I use the command <strong>ament_target_dependencies()</strong> then I catch the error: <strong>ament_target_dependencies() the passed package name 'cli' was not found</strong>. If I use the command <strong>target_link_libraries()</strong> then I catch the error: <strong>The following imported targets are referenced, but are missing: cli::cli</strong>.</p> <p>I appreciate your help, thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/409683/how-to-create-ros2-library-with-dependence-installed-with-cmake-fetchcontent?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/120210/mr_leonard/" rel="nofollow noreferrer">Mr_Leonard</a> on ROS Answers with karma: 5 on 2022-11-21</p> <p>Post score: 0</p>
How to create ROS2 library with dependence installed with CMake FetchContent?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I suggest you to describe your problem you are trying to solve by running the node in root mode. Using <code>sudo</code> can reset a path to shared libraries + there are other possible reasons for ROS2 to not work (e.g. DDS configurations).</p> <p>Please also check this question and its comments:</p> <ul> <li><a href="https://answers.ros.org/question/375968/ros2-foxy-not-seeing-topics-published-in-sudo-shell/" rel="nofollow noreferrer">https://answers.ros.org/question/375968/ros2-foxy-not-seeing-topics-published-in-sudo-shell/</a></li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> with karma: 3064 on 2022-11-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/71483/dei/" rel="nofollow noreferrer">dei</a> on 2022-11-27</strong>:<br /> Thank you for your answer, At the moment I found a temporany solution:</p> <p>From root terminal: ros2 daemon stop ros2 daemon start Launch your sudo node here</p> <p>After that I can see <code>ros2 topic list</code> output from every terminal</p> <p>Sure, I know that is not the best practice but I need to launch that node with sudo priviliges because it must use <code>eno</code> interface</p>
102742
2022-11-22T06:04:01.000
|ros|ros2|topic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all,</p> <p>I'm using Ubuntu 22.04.1 LTS with Linux 5.10.0-18-rt-amd64, with ros2 humble debian release. I try to launch ros2_control from sudo terminal, but I can't see the ros2 topics outside ( from other terminals )</p> <p>I tried also to launch &quot;ros2 topic list&quot; from sudo mode but it doesn't work. Currently I'm only able to view the ros2 topics list only using the user mode terminals.</p> <p>If I use a terminal in root mode and an other one in user mode the issue persists.</p> <p>Have you got any suggestions about it?</p> <hr /> <p><a href="https://answers.ros.org/question/409701/ros2-topic-list-doesn%27t-work-in-sudo-mode/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/71483/dei/" rel="nofollow noreferrer">dei</a> on ROS Answers with karma: 3 on 2022-11-22</p> <p>Post score: 0</p>
ros2 topic list doesn't work in sudo mode
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Once the communication system is shutting down, it's too late to publish a message reliably via the communication system. You will want to design your system to communicate prior to shutting down the node.</p> <p>A simple analogy to this is that you want to say goodbye after someone has hung up the phone. It's not going to work well. You want to have an expected exchange prior to hanging up the phone.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2022-11-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/60874/anonymous60874/" rel="nofollow noreferrer">anonymous60874</a> on 2022-11-22</strong>:<br /> So, i can't publish message during the roscore closing right? Isn't there any way to publish message without design my system and if i have to design my system, how can i do that?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> on 2022-11-22</strong>:<br /> Just to be clear, roscore and rospy are different things. roscore is remote, rospy is local. When <code>rospy.on_shutdown</code> is called that's to tell you that the connections are being shutdown and you cannot expect to communicate any more. You're asking to do something that the callback is explicitly informing you that you can't do anymore. I suspect that on_shutdown is not the right thing to use for your use case. This is more likey an X-Y problem, but without knowing your use case I can't help much more.</p>
102744
2022-11-22T07:57:08.000
|rospy|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to publish message while roscore is closing. I tried to use rospy.on_shutdown but it didn't work. In wiki it says &quot;Messages are not guaranteed to be published.&quot; for on_shutdown. I am coding with python. How can i do that?</p> <hr /> <p><a href="https://answers.ros.org/question/409709/is-it-possible-to-publish-msg-in-rospy.on_shutdown/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/60874/anonymous60874/" rel="nofollow noreferrer">anonymous60874</a> on ROS Answers with karma: 1 on 2022-11-22</p> <p>Post score: 0</p>
Is it possible to publish msg in rospy.on_shutdown
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>There is no need to rush to rviz to set the pose. You can do this whenever you want.</p> <p>It seems like gazebo is not starting properly. Start it alone with <code>gazebo --verbose</code> and make sure it starts properly. Also with the gazebo path defined. It will download a lot of stuff in the beginning. If this is all good, try the launch file again.</p> <p>But with the headless:=false it should also show gazebo with the turtlebot and environment. Only then you must set the initial pose.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/12141/ct2034/" rel="nofollow noreferrer">ct2034</a> with karma: 862 on 2022-11-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/124711/is_that_so/" rel="nofollow noreferrer">Is_that_so</a> on 2022-11-24</strong>:<br /> I started gazebo using <code>gazebo --verbose</code> then I closed it. I then sourced my enviroment and ran <code>ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False</code> and it finally worked.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/12141/ct2034/" rel="nofollow noreferrer">ct2034</a> on 2022-11-24</strong>:<br /> Glad to hear that. Could you please click the tick next to my answer, then.</p>
102746
2022-11-22T12:10:06.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><a href="https://navigation.ros.org/getting_started/index.html" rel="nofollow noreferrer">https://navigation.ros.org/getting_started/index.html</a></p> <p>I'm following the NAV2 tutorial and this is what happens:</p> <p>I have everything installed:</p> <pre><code>sudo apt install ros-humble-navigation2 sudo apt install ros-humble-nav2-bringup sudo apt install ros-humble-turtlebot3* sudo apt-get install ros-humble-turtlebot3-gazebo </code></pre> <p>Then I set the key environment variables:</p> <pre><code>source /opt/ros/humble/setup.bash export TURTLEBOT3_MODEL=waffle export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models </code></pre> <p>Then after running:</p> <pre><code>ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False </code></pre> <p>I rush to rviz, set the 2D pose estimation as quick as I can and end up with this in the terminal:</p> <pre><code>[component_container_isolated-6] [INFO] [1669122316.072762902] [amcl]: Creating bond (amcl) to lifecycle manager. [rviz2-5] [INFO] [1669122320.120000768] [rviz2]: Setting estimate pose: Frame:map, Position(-2.97266, -0.58257, 0), Orientation(0, 0, 0.0273898, 0.999625) = Angle: 0.0547864 [spawn_entity.py-3] [ERROR] [1669122345.950231796] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory? [spawn_entity.py-3] [ERROR] [1669122345.950698437] [spawn_entity]: Spawn service failed. Exiting. [ERROR] [spawn_entity.py-3]: process has died [pid 20529, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -entity turtlebot3_waffle -file /opt/ros/humble/share/nav2_bringup/worlds/waffle.model -robot_namespace -x -2.00 -y -0.50 -z 0.01 -R 0.00 -P 0.00 -Y 0.00 --ros-args']. </code></pre> <p>Some system info ROS_VERSION=2 ROS_PYTHON_VERSION=3 ROS_LOCALHOST_ONLY=0 ROS_DISTRO=humble Ubuntu 22 duel booted</p> <hr /> <p><a href="https://answers.ros.org/question/409723/nav2-getting-started-example-error/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/124711/is_that_so/" rel="nofollow noreferrer">Is_that_so</a> on ROS Answers with karma: 13 on 2022-11-22</p> <p>Post score: 1</p>
NAV2 Getting Started Example error
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Before I asked for help, many probable solutions were found on the internet, but none worked. While doing a completely different internet query, I stumbled on the answer. Just do the following when all else fails: sudo apt -o Dpkg::Options::=&quot;--force-overwrite&quot; --fix-broken install</p> <p>All will then work!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/702/turtlebot_fan/" rel="nofollow noreferrer">TurtleBot_Fan</a> with karma: 287 on 2022-11-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102748
2022-11-22T14:24:57.000
|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>System: I'm running Ubuntu 18.04.6 64 bit with kernel 5.4.0-131-generic on Intel Core i5 CPU</p> <p>Please help me successfully install ROS Melodic When following the installation guide for ROS Melodic the following encountered an error: (I have scoured the internet to find a solution, but nothing has worked!)</p> <pre><code>(base) sam@nexus:~$ sudo apt install ros-melodic-desktop-full Reading package lists... Done Building dependency tree Reading state information... Done ros-melodic-desktop-full is already the newest version (1.4.1-0bionic.20221025.215612). You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: python-rosdep-modules : Depends: python-rospkg-modules (&gt;= 1.4.0) but it is not going to be installed python-rosdistro-modules : Depends: python-rospkg- modules but it is not going to be installed ros-melodic-rqt-gui : Depends: python-rospkg-modules but it is not going to be installed ros-melodic-rqt-robot-monitor : Depends: python-rospkg-modules but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). </code></pre> <p>============================ Then I tried:</p> <pre><code>(base) sam@nexus:~$ sudo apt --fix-broken install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required: efibootmgr libfwup1 libllvm9 linux-hwe-5.4-headers-5.4.0-124 linux-hwe-5.4-headers-5.4.0-125 linux-hwe-5.4-headers-5.4.0-126 linux-hwe-5.4-headers-5.4.0-128 Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: python-rospkg-modules The following NEW packages will be installed: python-rospkg-modules 0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded. 948 not fully installed or removed. Need to get 0 B/24.0 kB of archives. After this operation, 135 kB of additional disk space will be used. Do you want to continue? [Y/n] Y (Reading database ... 341929 files and directories currently installed.) Preparing to unpack .../python-rospkg-modules_1.4.0-1_all.deb ... Unpacking python-rospkg-modules (1.4.0-1) ... dpkg: error processing archive /var/cache/apt/archives/python-rospkg-modules_1.4.0-1_all.deb (--unpack): trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/__init__.py', which is also in package python-rospkg 1.1.4-1 Errors were encountered while processing: /var/cache/apt/archives/python-rospkg-modules_1.4.0-1_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) </code></pre> <p>============================ Then I tried:</p> <pre><code>(base) sam@nexus:~$ sudo apt --fix-broken install python-rospkg-modules Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: efibootmgr libfwup1 libllvm9 linux-hwe-5.4-headers-5.4.0-124 linux-hwe-5.4-headers-5.4.0-125 linux-hwe-5.4-headers-5.4.0-126 linux-hwe-5.4-headers-5.4.0-128 Use 'sudo apt autoremove' to remove them. The following NEW packages will be installed: python-rospkg-modules 0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded. 948 not fully installed or removed. Need to get 0 B/24.0 kB of archives. After this operation, 135 kB of additional disk space will be used. (Reading database ... 341929 files and directories currently installed.) Preparing to unpack .../python-rospkg-modules_1.4.0-1_all.deb ... Unpacking python-rospkg-modules (1.4.0-1) ... dpkg: error processing archive /var/cache/apt/archives/python-rospkg-modules_1.4.0-1_all.deb (--unpack): trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/__init__.py', which is also in package python-rospkg 1.1.4-1 Errors were encountered while processing: /var/cache/apt/archives/python-rospkg-modules_1.4.0-1_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) </code></pre> <p>============================ FYI:</p> <pre><code>(base) sam@nexus:~$ apt-cache show python-rospkg-modules Package: python-rospkg-modules Priority: optional Section: python Installed-Size: 132 Maintainer: Ken Conley &lt;kwc@willowgarage.com&gt; Architecture: all Version: 1.4.0-1 Replaces: python-rospkg (&lt;&lt; 1.1.0) Depends: python (&lt;&lt; 2.8), python (&gt;= 2.7), python-yaml, python:any (&gt;= 2.6.6-7~), python-catkin-pkg-modules, lsb-release Conflicts: python-rospkg (&lt;&lt; 1.1.0) Filename: pool/main/p/python-rospkg-modules/python-rospkg-modules_1.4.0-1_all.deb SHA512: 98cfab3b71859449fcc3123bf433113bcdede6c230685435f616bf620b00f34bc7634bd5971dd260402dbacf3a46f89042cdf8a91b077cf454b0106a51ddcc60 Size: 24020 SHA256: 17d89de452b1be9dc22a67875782497aa6f00b37a80905e2cac821f916e059fe SHA1: f37cd81928257147c44d799421086e160fad2663 MD5sum: 2fbacb0e4fe9e296e2bedca4baf42872 Description: ROS package library Library for retrieving information about ROS packages and stacks. Description-md5: 1f0f66a0136715f5b0d845083b68d081 Homepage: http://wiki.ros.org/rospkg </code></pre> <p>============================ Finally, I tried:</p> <pre><code>(base) sam@nexus:~$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/python-rospkg-modules_1.4.0-1_all.deb [sudo] password for sam: (Reading database ... 341929 files and directories currently installed.) Preparing to unpack .../python-rospkg-modules_1.4.0-1_all.deb ... Unpacking python-rospkg-modules (1.4.0-1) ... dpkg: warning: overriding problem because --force enabled: dpkg: warning: trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/__init__.py', which is also in package python-rospkg 1.1.4-1 dpkg: warning: overriding problem because --force enabled: dpkg: warning: trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/common.py', which is also in package python-rospkg 1.1.4-1 dpkg: warning: overriding problem because --force enabled: dpkg: warning: trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/distro.py', which is also in package python-rospkg 1.1.4-1 dpkg: warning: overriding problem because --force enabled: dpkg: warning: trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/environment.py', which is also in package python-rospkg 1.1.4-1 dpkg: warning: overriding problem because --force enabled: dpkg: warning: trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/manifest.py', which is also in package python-rospkg 1.1.4-1 dpkg: warning: overriding problem because --force enabled: dpkg: warning: trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/os_detect.py', which is also in package python-rospkg 1.1.4-1 dpkg: warning: overriding problem because --force enabled: dpkg: warning: trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/rospack.py', which is also in package python-rospkg 1.1.4-1 dpkg: warning: overriding problem because --force enabled: dpkg: warning: trying to overwrite '/usr/lib/python2.7/dist-packages/rospkg/stack.py', which is also in package python-rospkg 1.1.4-1 dpkg: dependency problems prevent configuration of python-rospkg-modules: python-rospkg-modules depends on python-catkin-pkg-modules; however: Package python-catkin-pkg-modules is not configured yet. dpkg: error processing package python-rospkg-modules (--install): dependency problems - leaving unconfigured Errors were encountered while processing: python-rospkg-modules </code></pre> <p>============================ How do I fix this for a successful install?</p> <hr /> <p><a href="https://answers.ros.org/question/409728/need-help-on-%27unmet-dependencies%27-error-when-installing-ros-melodic/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/702/turtlebot_fan/" rel="nofollow noreferrer">TurtleBot_Fan</a> on ROS Answers with karma: 287 on 2022-11-22</p> <p>Post score: 0</p>
Need help on 'Unmet dependencies' error when installing ROS Melodic
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>Is there a way to stop roslaunch from printing out this summary or otherwise suppress the output while leaving node output intact?</p> </blockquote> <p>No.</p> <p><code>--no-summary</code> will suppress everything from the summary.</p> <hr /> <p>Edit:</p> <blockquote> <p>when I said node output I meant the printouts from the nodes themselves (with output=screen), not the list of nodes launched in the summary.</p> </blockquote> <p>Ah.</p> <p>In that case: <code>--no-summary</code> should do what you want.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2022-11-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/28049/raika/" rel="nofollow noreferrer">Raika</a> on 2022-11-23</strong>:<br /> This was exactly what I was looking for, thanks a lot!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-11-23</strong>:<br /> I'm confused. <code>--no-summary</code> suppresses the summary completely, including the Nodes section.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/28049/raika/" rel="nofollow noreferrer">Raika</a> on 2022-11-23</strong>:<br /> Sorry, when I said node output I meant the printouts from the nodes themselves (with output=screen), not the list of nodes launched in the summary.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-11-23</strong>:<br /> Then technically, your question is a duplicate of #q349820.</p> <p>But seeing as the title is different, I've not closed it as such.</p>
102750
2022-11-22T17:07:59.000
|roslaunch|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm doing a project where I'm using roslaunch to run our software stack through several regression tests and each time I call roslaunch it prints out a summary with all the parameters loaded (there are dozens). This summary is getting in the way of parsing useful printouts from our nodes. Is there a way to stop roslaunch from printing out this summary or otherwise suppress the output while leaving node output intact?</p> <pre><code>started roslaunch server &lt;&gt; SUMMARY ======== PARAMETERS * /rosdistro: noetic * /rosversion: 1.15.14 </code></pre> <hr /> <p><a href="https://answers.ros.org/question/409735/roslaunch:-suppress-summary/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/28049/raika/" rel="nofollow noreferrer">Raika</a> on ROS Answers with karma: 18 on 2022-11-22</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-11-23</strong>:<br /> I've updated the title of your question, as the original title made it seem it was a duplicate of the many other Q&amp;As which ask for &quot;suppressing summary output&quot; (such as #q349820).</p>
roslaunch: suppress summary
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>An ActionServer/ActionClient communicate with each other using 5 ros topics with specific names: cancel, feedback, goal, result, status.</p> <p>That box is removing clutter from the diagram by not explicitly listing these 5 well-known topic names.</p> <p>See <a href="http://wiki.ros.org/actionlib" rel="nofollow noreferrer">http://wiki.ros.org/actionlib</a> for a poorly-written description of actionlib.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-11-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/106378/renox/" rel="nofollow noreferrer">Renox</a> on 2022-11-23</strong>:<br /> Thank you for your reply. I understood.</p>
102752
2022-11-23T01:34:31.000
|ros|rqt-graph|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I use robot arm(Ufactory Lite6), and I got rqt_graph.</p> <p>In the graph, nodes are showed by ellipses and topics are showed by rectangle. However, there are cuboid among them.</p> <p>what is this cuboid? Please tell me.</p> <p>At nodes only mode, we can watch &quot;/ufactory/lite6_traj_controller/follow_joint_trajectory/status&amp;goal (rectangle)&quot;. At nodes and topics(All) mode, we can watch &quot;/ufactory/lite6_traj_controller/follow_joint_trajectory/action_topics (cuboid)&quot;, not &quot;status&amp;goal&quot;.</p> <p>What is the relationship between &quot;status&amp;goal&quot;and &quot;action_topics&quot;? Please tell me.</p> <p>Nodes only mode. <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16692039097165156.png" alt="image description" /></p> <p>Node and topics(All) mode. <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16691845491807265.png" alt="image description" /></p> <hr /> <p><a href="https://answers.ros.org/question/409743/what%27s-this-cuboid-at-rqt_graph?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/106378/renox/" rel="nofollow noreferrer">Renox</a> on ROS Answers with karma: 27 on 2022-11-23</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-11-23</strong>:<br /> Pedantic perhaps, but a <em>cuboid</em> is 3D. <code>rqt_graph</code> is pretty fancy, but it's not a 3D program (yet).</p>
What's this cuboid at rqt_graph?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I am not sure it matters a lot. Actually when using tf inside a node you can also not use pointers at all. You just have to initialize the constructors of buffer and listener in the member initializer list.</p> <pre><code>class MyNode : public rclcpp::Node { public: MyNode(rclcpp::NodeOptions options) : Node(&quot;the_name&quot;, options), tf_buffer(get_clock()), tf_listener(tf_buffer) { // constructor } private: // TF 2 stuff tf2_ros::Buffer tf_buffer; // order matters, buffer has to be built before listener tf2_ros::TransformListener tf_listener; } </code></pre> <p>You can even do it in the member variable declaration:</p> <pre><code>class MyNode : public rclcpp::Node { public: MyNode(rclcpp::NodeOptions options) : Node(&quot;the_name&quot;, options) { // constructor } private: // TF 2 stuff tf2_ros::Buffer tf_buffer{get_clock()}; tf2_ros::TransformListener tf_listener{tf_buffer}; } </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/11856/olivier-kermorgant/" rel="nofollow noreferrer">Olivier Kermorgant</a> with karma: 280 on 2023-06-02</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102754
2022-11-23T04:59:29.000
|ros|ros2|shared-ptr|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>In the TF2 listener tutorial (c++), the buffer is defined as a <code>std::unique_ptr</code> whereas the listener is a <code>std::shared_ptr</code>.</p> <pre><code>tf_buffer_ = std::make_unique&lt;tf2_ros::Buffer&gt;(this-&gt;get_clock()); tf_listener_ = std::make_shared&lt;tf2_ros::TransformListener&gt;(*tf_buffer_); </code></pre> <p>Is this intentional? I.e. is there a specific reason for the listener to be a <code>std::shared_ptr</code>, or could it just as well also have been a <code>std::unique_ptr</code>?</p> <hr /> <p><a href="https://answers.ros.org/question/409751/make_unique-vs-make_shared/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/124778/jrtg/" rel="nofollow noreferrer">jrtg</a> on ROS Answers with karma: 145 on 2022-11-23</p> <p>Post score: 1</p>
make_unique vs make_shared
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Bloom likely expects/assumes/requires a non-empty release repository.</p> <p>&quot;Non-empty&quot; meaning: a repository with at least one branch in it.</p> <p><a href="https://github.com/ros2-gbp/wall_follower_ros2-release" rel="nofollow noreferrer">ros2-gbp/wall_follower_ros2-release</a> does not contain any branch, hence the error message.</p> <p>I'd suggest doing something like:</p> <pre><code>git clone https://github.com/ros2-gbp/wall_follower_ros2-release.git /tmp/ros2-gbp/wall_follower_ros2-release cd /tmp/ros2-gbp/wall_follower_ros2-release # if needed: # git config --local user.name ... &amp;&amp; git config --local user.email ... git commit --allow-empty -m &quot;Initial commit&quot; git push origin master # or whatever you have as default branch </code></pre> <p>It should start working after this.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2022-11-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/39640/roberto-z./" rel="nofollow noreferrer">Roberto Z.</a> on 2022-12-08</strong>:<br /> Hello @gvdhoorn, thank you for your answer. I did as described in your answer but I didn't work. Any thoughts? This is what I did:</p> <pre><code>user:~/ros2_ws/src/wall_follower_ros2<span class="math-container">$ cd .. user:~/ros2_ws/src$</span> git clone https://github.com/ros2-gbp/wall_follower_ros2-release.git Cloning into 'wall_follower_ros2-release'... warning: You appear to have cloned an empty repository. user:~/ros2_ws/src<span class="math-container">$ cd wall_follower_ros2-release/ user:~/ros2_ws/src/wall_follower_ros2-release$</span> git commit --allow-empty -m &quot;Initial commit&quot; [main (root-commit) 8b1bd57] Initial commit user:~/ros2_ws/src/wall_follower_ros2-release<span class="math-container">$ git push origin master error: src refspec master does not match any error: failed to push some refs to 'https://github.com/ros2-gbp/wall_follower_ros2-release.git' user:~/ros2_ws/src/wall_follower_ros2-release$</span> git branch * main </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/39640/roberto-z./" rel="nofollow noreferrer">Roberto Z.</a> on 2022-12-08</strong>:<br /> It managed to get past the point where <strong>bloom-release</strong> was failing before. I followed @gvdhoorn advice with one small change:<br /> Once, inside the cloned <code>wall_follower_ros2-release</code> repository I had to create and switch to the <code>master</code> branch before creating the empty commit. Like so:</p> <pre><code>cd wall_follower_ros2-release/ git branch master git switch master Switched to branch 'master' git commit --allow-empty -m &quot;Initial commit&quot; </code></pre> <p>Now <strong>bloom-release</strong> is failing with the message:</p> <pre><code>Bloom requires a version 4 or greater rosdistro index to support package format 3. &lt;== Error running command '['/usr/bin/git-bloom-generate', '-y', 'rosdebian', '--prefix', 'release/humble', 'humble', '-i', '1', '--os-name', 'ubuntu']' Release failed, exiting. </code></pre> <p>Regardless I will mark this answer as correct since it pointed to the solution, and the error now is a different one. I will post a new question regarding the new error message. Thanks you @gvdhoorn !</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-12-08</strong>:<br /> From the <code>git</code> output:</p> <pre><code>[main (root-commit) 8b1bd57] Initial commit </code></pre> <p>you can see that <code>main</code> is actually the branch that was created/is the default.</p> <p>That's why I added the comment:</p> <pre><code># or whatever you have as default branch </code></pre> <p>I would expect a <code>git push origin main</code> to have worked. Bloom would most likely have complained there was no <code>master</code> branch, but would then have created it.</p> <p>Explicitly creating a <code>master</code> branch and then pushing it obviously also works.</p>
102757
2022-11-23T07:58:02.000
|ros|ros2|git|bloom-release|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello community,</p> <p>I want to release a repository using bloom (first time) and I am following ROS2's official documentation: <a href="https://docs.ros.org/en/humble/How-To-Guides/Releasing/Releasing-a-Package.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/How-To-Guides/Releasing/Releasing-a-Package.html</a></p> <p>What I have done so far:</p> <ul> <li>Installed the tools required (python3-bloom python3-catkin-pkg)</li> <li>Created a release team</li> <li>Created a release repository</li> <li>Create a GIT access token to authenticate</li> <li>Created a 'bloom' file to use the GIT access token</li> <li>Create a ros/rosdistro source entry</li> <li>Generated a Changelog</li> <li>Bumped the package version using catkin_prepare_release</li> </ul> <p>Then I executed:</p> <pre><code>bloom-release --new-track --rosdistro humble --track humble wall_follower_ros2 </code></pre> <p>Which asked me to enter a release repository URL, which I did entering: <code>https://github.com/ros2-gbp/wall_follower_ros2-release.git</code></p> <p>And then I get prompt to enter the repository name, the repo URL, VSC type, among others (you can see values entered below).</p> <p>My problem is that I get this error:</p> <pre><code>==&gt; git push --dry-run fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master Cannot push to remote release repository. Hint: If you just typed in your username/password and you have two-factor authentication,see: http://wiki.ros.org/bloom/Tutorials/GithubManualAuthorization </code></pre> <p><strong>My guess is that this is related to the fact that locally I am on branch <code>main</code> and I don't have a <code>master</code> branch.</strong></p> <p>Output of <code>git branch</code> is:</p> <pre><code>*main </code></pre> <p>Output of <code>git remote -v</code> is:</p> <pre><code>origin https://github.com/rfzeg/wall_follower_ros2.git (fetch) origin https://github.com/rfzeg/wall_follower_ros2.git (push) </code></pre> <p>I Googled it and I found this <a href="https://answers.ros.org/question/368985/ignore-pkgs-during-initial-bloom-release-master-vs-main-branch/" rel="nofollow noreferrer">question</a> that says regarding having having <strong>main</strong> as branch :</p> <blockquote> <p>works OK for regular releases (as master will just be another branch to git and Github, and Bloom is able to find everything it needs just fine)</p> </blockquote> <p>But I doesn't seem to work for me. What is it that I am doing wrong?</p> <p>I really appreciate any help you can provide.</p> <p>Roberto</p> <hr /> <p>Here are the lines of output of 'bloom-release` :</p> <pre><code>Release repository url [press enter to abort]: https://github.com/ros2-gbp/wall_follower_ros2-release.git ==&gt; Fetching 'wall_follower_ros2' repository from 'https://github.com/ros2-gbp/wall_follower_ros2-release.git' Cloning into '/tmp/tmp72wn05ft'... warning: You appear to have cloned an empty repository. WARNING [vcstools] Command failed: 'git checkout master' run at: '/tmp/tmp72wn05ft' errcode: 1: error: pathspec 'master' did not match any file(s) known to git [/vcstools] Creating 'master' branch. Creating track 'humble'... Repository Name: &lt;name&gt; Name of the repository (used in the archive name) upstream Default value, leave this as upstream if you are unsure ['upstream']: wall_follower_ros2 Upstream Repository URI: &lt;uri&gt; Any valid URI. This variable can be templated, for example an svn url can be templated as such: &quot;https://svn.foo.com/foo/tags/foo-:{version}&quot; where the :{version} token will be replaced with the version for this release. [None]: https://github.com/rfzeg/wall_follower_ros2 Upstream VCS Type: git Upstream URI is a git repository hg Upstream URI is a hg repository svn Upstream URI is a svn repository tar Upstream URI is a tarball ['git']: Version: :{auto} This means the version will be guessed from the devel branch. This means that the devel branch must be set, the devel branch must exist, and there must be a valid package.xml in the upstream devel branch. :{ask} This means that the user will be prompted for the version each release. This also means that the upstream devel will be ignored. &lt;version&gt; This will be the version used. It must be updated for each new upstream version. [':{auto}']: Release Tag: :{version} This means that the release tag will match the :{version} tag. This can be further templated, for example: &quot;foo-:{version}&quot; or &quot;v:{version}&quot; This can describe any vcs reference. For git that means {tag, branch, hash}, for hg that means {tag, branch, hash}, for svn that means a revision number. For tar this value doubles as the sub directory (if the repository is in foo/ of the tar ball, putting foo here will cause the contents of foo/ to be imported to upstream instead of foo itself). :{ask} This means the user will be prompted for the release tag on each release. :{none} For svn and tar only you can set the release tag to :{none}, so that it is ignored. For svn this means no revision number is used. [':{version}']: Upstream Devel Branch: &lt;vcs reference&gt; Branch in upstream repository on which to search for the version. This is used only when version is set to ':{auto}'. [None]: main ROS Distro: &lt;ROS distro&gt; This can be any valid ROS distro, e.g. foxy, galactic, humble, melodic, noetic, rolling ['humble']: Patches Directory: &lt;path in bloom branch&gt; This can be any valid relative path in the bloom branch. The contents of this folder will be overlaid onto the upstream branch after each import-upstream. Additionally, any package.xml files found in the overlay will have the :{version} string replaced with the current version being released. :{none} Use this if you want to disable overlaying of files. [None]: Release Repository Push URL: &lt;url&gt; (optional) Used when pushing to remote release repositories. This is only needed when the release uri which is in the rosdistro file is not writable. This is useful, for example, when a releaser would like to use a ssh url to push rather than a https:// url. :{none} This indicates that the default release url should be used. [None]: Created 'humble' track. ==&gt; Testing for push permission on release repository ==&gt; git remote -v origin https://github.com/ros2-gbp/wall_follower_ros2-release.git (fetch) origin https://github.com/ros2-gbp/wall_follower_ros2-release.git (push) ==&gt; git push --dry-run fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master Cannot push to remote release repository. Hint: If you just typed in your username/password and you have two-factor authentication,see: http://wiki.ros.org/bloom/Tutorials/GithubManualAuthorization </code></pre> <hr /> <p><a href="https://answers.ros.org/question/409759/bloom-release:-cannot-push-to-remote-release-repository.-fatal:-the-current-branch-master-has-no-upstream-branch./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/39640/roberto-z./" rel="nofollow noreferrer">Roberto Z.</a> on ROS Answers with karma: 500 on 2022-11-23</p> <p>Post score: 0</p>
Bloom-release: Cannot push to remote release repository. fatal: The current branch master has no upstream branch
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It is certainly fine to use <code>std::shared_ptr&lt;&gt;</code> for new code.</p> <p>The SharedPtr alias is a legacy from the ros1 days. <code>std::shared_ptr&lt;&gt;</code> is a relatively recent addition to the c++ standard, and before that the SharedPtr defined by ros was a type alias to a boost library shared pointer class. It saved a lot more typing back then <em>and</em> made it clearer what the code was doing.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-11-24</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
102759
2022-11-23T08:05:14.000
|ros|ros2|shared-ptr|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>Please bear with me, I haven´t been programming since 2006, and it turns out that learning both c++11/c++17 and ROS2 has a bit of a steep learning curve. ;-)</p> <p>After reading the relevant chapters at learncpp.com, I think I have an adequate understanding of std::shared_ptr, weak_ptr and unique_ptr.</p> <p>However, going back to the ROS2 tutorials, I see that often an alias is defined:</p> <pre><code>using something::SharedPtr = std::shared_ptr&lt;something&gt; </code></pre> <p>For instance, in the publisher tutorial, the publisher is declared as follows:</p> <pre><code>rclcpp::Publisher&lt;std_msgs::msg::String&gt;::SharedPtr publisher_; </code></pre> <p>which (I think) is fully equivalent to:</p> <pre><code>std::shared_ptr&lt;clcpp::Publisher&lt;std_msgs::msg::String&gt;&gt; publisher_; </code></pre> <p>I find this rather confusing, even more so since it is not general. For instance, in the TF2 TransformBroadcaster tutorial, the broadcaster must be declared as follows:</p> <pre><code>std::shared_ptr&lt;tf2_ros::StaticTransformBroadcaster&gt; tf_static_broadcaster_; </code></pre> <p>since the ::SharedPtr alias is not defined:</p> <pre><code>tf2_ros::StaticTransformBroadcaster::SharedPtr tf_static_broadcaster_; // Not ok: &quot;class tf2_ros::StaticTransformBroadcaster has no member SharedPtr&quot; </code></pre> <p>So: is there any specific reason (other than it being 6 characters less) to give preference to the <code>::SharedPtr</code> way of declaring, or is it ok to stick to using <code>std::shared_ptr&lt;...&gt;</code>?</p> <hr /> <p><a href="https://answers.ros.org/question/409760/::sharedptr-vs-std::shared_ptr%3C%3E/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/124778/jrtg/" rel="nofollow noreferrer">jrtg</a> on ROS Answers with karma: 145 on 2022-11-23</p> <p>Post score: 0</p>
::SharedPtr vs std::shared_ptr<>
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I gazebo with ros, you have to read all message logs into the terminal you will get the error messages.</p> <p>In your case,</p> <pre><code>[gzserver-3] [ERROR] [1669321310.420717058] [gazebo_ros2_control]: Error parsing URDF in gazebo_ros2_control plugin, plugin not active : no attribute name in ros2_control tag [spawner.py-2] [INFO] [1669321311.033782844] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-2] [INFO] [1669321313.050987270] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-2] [INFO] [1669321315.067009109] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-2] [ERROR] [1669321317.086227286] [spawner_joint_state_broadcaster]: Controller manager not available [ERROR] [spawner.py-2]: process has died [pid 30428, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_state_broadcaster -c /controller_manager --ros-args']. [INFO] [spawner.py-6]: process started with pid [30593] [spawner.py-6] [INFO] [1669321317.558955885] [spawner_minicar_controller]: Waiting for /controller_manager services [spawner.py-6] [INFO] [1669321319.576272847] [spawner_minicar_controller]: Waiting for /controller_manager services [spawner.py-6] [INFO] [1669321321.593130100] [spawner_minicar_controller]: Waiting for /controller_manager services [spawner.py-6] [INFO] [1669321323.608227359] [spawner_minicar_controller]: Waiting for /controller_manager services [spawner.py-6] [INFO] [1669321325.625707465] [spawner_minicar_controller]: Waiting for /controller_manager services [spawner.py-6] [ERROR] [1669321327.644283473] [spawner_minicar_controller]: Controller manager not available [ERROR] [spawner.py-6]: process has died [pid 30593, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py minicar_controller -c /controller_manager --ros-args']. ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) [robot_state_publisher-1] [INFO] [1669321412.145160525] [rclcpp]: signal_handler(signal_value=2) [INFO] [robot_state_publisher-1]: process has finished cleanly [pid 30426] ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) again, ignoring... [INFO] [gzclient-4]: process has finished cleanly [pid 30432] ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) again, ignoring... [ERROR] [gzserver-3]: process has died [pid 30430, exit code -11, cmd 'gzserver -s libgazebo_ros_factory.so /home/mikita/ros2_ws/install/minicar_simulator/share/minicar_simulator/worlds/test_walls.world']. </code></pre> <p>This are your error messages.</p> <p>I think you need to have a look into your URDF file and in your plugin code you are missing the argument name <code>ros2_control</code>.</p> <pre><code>&lt;plugin filename=&quot;file_name.so&quot; name=&quot;gazebo_ros2_control&quot;&gt; # You need to add tag over here. &lt;/plugin&gt; </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2022-11-24</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-11-24</strong>:<br /> Sorry, I didn't notice that. Thank you very much for your help. Everything is loading now.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2022-11-24</strong>:<br /> That's great.</p>
102761
2022-11-24T04:36:11.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi. Sorry for all mistakes, English is not my native language. I managed to load world in gazebo and as far as I can tell from messages in terminal robot description is also loaded without any issue and robot name with all joints, plugin and links is listed in world tab, but no model to be seen in gazebo window.</p> <pre><code>[INFO] [launch]: All log files can be found below /home/mikita/.ros/log/2022-11-24-12-21-46-325682-ubuntu-30424 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [30426] [INFO] [spawner.py-2]: process started with pid [30428] [INFO] [gzserver-3]: process started with pid [30430] [INFO] [gzclient-4]: process started with pid [30432] [INFO] [spawn_entity.py-5]: process started with pid [30434] [robot_state_publisher-1] Parsing robot urdf xml string. [robot_state_publisher-1] Link base_link had 7 children [robot_state_publisher-1] Link board had 2 children [robot_state_publisher-1] Link depth_camera had 1 children [robot_state_publisher-1] Link depth_camera_link_optical had 0 children [robot_state_publisher-1] Link rplidar_a2_frame had 0 children [robot_state_publisher-1] Link front_left_steering had 1 children [robot_state_publisher-1] Link front_left_wheel had 0 children [robot_state_publisher-1] Link front_right_steering had 1 children [robot_state_publisher-1] Link front_right_wheel had 0 children [robot_state_publisher-1] Link rear_left_steering had 1 children [robot_state_publisher-1] Link rear_left_wheel had 0 children [robot_state_publisher-1] Link rear_right_steering had 1 children [robot_state_publisher-1] Link rear_right_wheel had 0 children [robot_state_publisher-1] Link stm_back had 3 children [robot_state_publisher-1] Link ir_sensor_ground_back_0 had 0 children [robot_state_publisher-1] Link ir_sensor_ground_back_1 had 0 children [robot_state_publisher-1] Link ir_sensor_pack_back had 5 children [robot_state_publisher-1] Link ir_sensor_back_0 had 0 children [robot_state_publisher-1] Link ir_sensor_back_1 had 0 children [robot_state_publisher-1] Link ir_sensor_back_2 had 0 children [robot_state_publisher-1] Link ir_sensor_back_3 had 0 children [robot_state_publisher-1] Link ir_sensor_back_4 had 0 children [robot_state_publisher-1] Link stm_front had 3 children [robot_state_publisher-1] Link ir_sensor_ground_front_0 had 0 children [robot_state_publisher-1] Link ir_sensor_ground_front_1 had 0 children [robot_state_publisher-1] Link ir_sensor_pack_front had 5 children [robot_state_publisher-1] Link ir_sensor_front_0 had 0 children [robot_state_publisher-1] Link ir_sensor_front_1 had 0 children [robot_state_publisher-1] Link ir_sensor_front_2 had 0 children [robot_state_publisher-1] Link ir_sensor_front_3 had 0 children [robot_state_publisher-1] Link ir_sensor_front_4 had 0 children [robot_state_publisher-1] [INFO] [1669321306.678753978] [robot_state_publisher]: got segment base_link [robot_state_publisher-1] [INFO] [1669321306.678913614] [robot_state_publisher]: got segment board [robot_state_publisher-1] [INFO] [1669321306.678929934] [robot_state_publisher]: got segment depth_camera [robot_state_publisher-1] [INFO] [1669321306.678938199] [robot_state_publisher]: got segment depth_camera_link_optical [robot_state_publisher-1] [INFO] [1669321306.678945528] [robot_state_publisher]: got segment front_left_steering [robot_state_publisher-1] [INFO] [1669321306.678952716] [robot_state_publisher]: got segment front_left_wheel [robot_state_publisher-1] [INFO] [1669321306.678959930] [robot_state_publisher]: got segment front_right_steering [robot_state_publisher-1] [INFO] [1669321306.678967088] [robot_state_publisher]: got segment front_right_wheel [robot_state_publisher-1] [INFO] [1669321306.678974402] [robot_state_publisher]: got segment ir_sensor_back_0 [robot_state_publisher-1] [INFO] [1669321306.678981308] [robot_state_publisher]: got segment ir_sensor_back_1 [robot_state_publisher-1] [INFO] [1669321306.678988170] [robot_state_publisher]: got segment ir_sensor_back_2 [robot_state_publisher-1] [INFO] [1669321306.678995042] [robot_state_publisher]: got segment ir_sensor_back_3 [robot_state_publisher-1] [INFO] [1669321306.679001910] [robot_state_publisher]: got segment ir_sensor_back_4 [robot_state_publisher-1] [INFO] [1669321306.679008919] [robot_state_publisher]: got segment ir_sensor_front_0 [robot_state_publisher-1] [INFO] [1669321306.679015705] [robot_state_publisher]: got segment ir_sensor_front_1 [robot_state_publisher-1] [INFO] [1669321306.679022495] [robot_state_publisher]: got segment ir_sensor_front_2 [robot_state_publisher-1] [INFO] [1669321306.679029833] [robot_state_publisher]: got segment ir_sensor_front_3 [robot_state_publisher-1] [INFO] [1669321306.679036640] [robot_state_publisher]: got segment ir_sensor_front_4 [robot_state_publisher-1] [INFO] [1669321306.679043418] [robot_state_publisher]: got segment ir_sensor_ground_back_0 [robot_state_publisher-1] [INFO] [1669321306.679050338] [robot_state_publisher]: got segment ir_sensor_ground_back_1 [robot_state_publisher-1] [INFO] [1669321306.679057817] [robot_state_publisher]: got segment ir_sensor_ground_front_0 [robot_state_publisher-1] [INFO] [1669321306.679064665] [robot_state_publisher]: got segment ir_sensor_ground_front_1 [robot_state_publisher-1] [INFO] [1669321306.679071480] [robot_state_publisher]: got segment ir_sensor_pack_back [robot_state_publisher-1] [INFO] [1669321306.679078453] [robot_state_publisher]: got segment ir_sensor_pack_front [robot_state_publisher-1] [INFO] [1669321306.679085471] [robot_state_publisher]: got segment rear_left_steering [robot_state_publisher-1] [INFO] [1669321306.679092411] [robot_state_publisher]: got segment rear_left_wheel [robot_state_publisher-1] [INFO] [1669321306.679099810] [robot_state_publisher]: got segment rear_right_steering [robot_state_publisher-1] [INFO] [1669321306.679106837] [robot_state_publisher]: got segment rear_right_wheel [robot_state_publisher-1] [INFO] [1669321306.679113695] [robot_state_publisher]: got segment rplidar_a2_frame [robot_state_publisher-1] [INFO] [1669321306.679120998] [robot_state_publisher]: got segment rs_t265_pose_frame [robot_state_publisher-1] [INFO] [1669321306.679127840] [robot_state_publisher]: got segment stm_back [robot_state_publisher-1] [INFO] [1669321306.679134940] [robot_state_publisher]: got segment stm_front [spawner.py-2] [INFO] [1669321307.001865035] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawn_entity.py-5] [INFO] [1669321307.239212058] [spawn_husky]: Spawn Entity started [spawn_entity.py-5] [INFO] [1669321307.239865322] [spawn_husky]: Loading entity published on topic robot_description [spawn_entity.py-5] [INFO] [1669321307.242287340] [spawn_husky]: Waiting for entity xml on robot_description [spawn_entity.py-5] [INFO] [1669321307.259608563] [spawn_husky]: Waiting for service /spawn_entity, timeout = 30 [spawn_entity.py-5] [INFO] [1669321307.260107698] [spawn_husky]: Waiting for service /spawn_entity [gzserver-3] [INFO] [1669321308.517755527] [gazebo_ros_node]: ROS was initialized without arguments. [spawn_entity.py-5] [INFO] [1669321308.769025346] [spawn_husky]: Calling service /spawn_entity [spawner.py-2] [INFO] [1669321309.016166908] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [gzserver-3] [INFO] [1669321309.538614741] [camera_controller]: Publishing camera info to [/minicar/camera/camera_info] [gzserver-3] [INFO] [1669321309.564746072] [depth_camera_controller]: Publishing camera info to [/minicar/camera/depth/camera_info] [gzserver-3] [INFO] [1669321309.566462159] [depth_camera_controller]: Publishing depth camera info to [/minicar/camera/depth/depth/camera_info] [gzserver-3] [INFO] [1669321309.567765923] [depth_camera_controller]: Publishing pointcloud to [/minicar/camera/depth/points] [gzserver-3] [WARN] [1669321309.866834068] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321309.878659208] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321309.897202736] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321309.911094225] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321309.937911380] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321309.958253337] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321309.990086422] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321310.022248107] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321310.047210297] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321310.078033574] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321310.102946786] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321310.127462784] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [gzserver-3] [WARN] [1669321310.175710796] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [spawn_entity.py-5] [INFO] [1669321310.231455510] [spawn_husky]: Spawn status: SpawnEntity: Successfully spawned entity [minicar] [INFO] [spawn_entity.py-5]: process has finished cleanly [pid 30434] [gzserver-3] [INFO] [1669321310.375428377] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin [gzserver-3] [INFO] [1669321310.392089643] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: / [gzserver-3] [INFO] [1669321310.392223097] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control [gzserver-3] [INFO] [1669321310.392309359] [gazebo_ros2_control]: Loading parameter file /home/mikita/ros2_ws/install/minicar_control/share/minicar_control/config/control.yaml [gzserver-3] [gzserver-3] [INFO] [1669321310.406510343] [gazebo_ros2_control]: connected to service!! robot_state_publisher [gzserver-3] [INFO] [1669321310.415515714] [gazebo_ros2_control]: Recieved urdf from param server, parsing... [gzserver-3] [ERROR] [1669321310.420717058] [gazebo_ros2_control]: Error parsing URDF in gazebo_ros2_control plugin, plugin not active : no attribute name in ros2_control tag [spawner.py-2] [INFO] [1669321311.033782844] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-2] [INFO] [1669321313.050987270] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-2] [INFO] [1669321315.067009109] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services [spawner.py-2] [ERROR] [1669321317.086227286] [spawner_joint_state_broadcaster]: Controller manager not available [ERROR] [spawner.py-2]: process has died [pid 30428, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_state_broadcaster -c /controller_manager --ros-args']. [INFO] [spawner.py-6]: process started with pid [30593] [spawner.py-6] [INFO] [1669321317.558955885] [spawner_minicar_controller]: Waiting for /controller_manager services [spawner.py-6] [INFO] [1669321319.576272847] [spawner_minicar_controller]: Waiting for /controller_manager services [spawner.py-6] [INFO] [1669321321.593130100] [spawner_minicar_controller]: Waiting for /controller_manager services [spawner.py-6] [INFO] [1669321323.608227359] [spawner_minicar_controller]: Waiting for /controller_manager services [spawner.py-6] [INFO] [1669321325.625707465] [spawner_minicar_controller]: Waiting for /controller_manager services [spawner.py-6] [ERROR] [1669321327.644283473] [spawner_minicar_controller]: Controller manager not available [ERROR] [spawner.py-6]: process has died [pid 30593, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py minicar_controller -c /controller_manager --ros-args']. ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) [robot_state_publisher-1] [INFO] [1669321412.145160525] [rclcpp]: signal_handler(signal_value=2) [INFO] [robot_state_publisher-1]: process has finished cleanly [pid 30426] ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) again, ignoring... [INFO] [gzclient-4]: process has finished cleanly [pid 30432] ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) again, ignoring... [ERROR] [gzserver-3]: process has died [pid 30430, exit code -11, cmd 'gzserver -s libgazebo_ros_factory.so /home/mikita/ros2_ws/install/minicar_simulator/share/minicar_simulator/worlds/test_walls.world']. </code></pre> <p>This is my launch file for launching gazebo:</p> <pre><code>import os import xacro from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, ExecuteProcess, RegisterEventHandler from launch.event_handlers import OnProcessExit from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node from ament_index_python.packages import get_package_share_directory arg = [ DeclareLaunchArgument('world_path', default_value='', description='The world path, by default is empty.world'), ] def generate_launch_description(): # Launch args world_path = LaunchConfiguration('world_path') package_dir = os.path.join(get_package_share_directory('minicar_simulator')) doc = os.path.join(package_dir, 'urdf', 'minicar.gazebo.xacro') xacro_file = xacro.parse(open(doc)) xacro.process_doc(xacro_file) robot_description = {&quot;robot_description&quot;: xacro_file.toxml()} spawn_minicar_velocity_controller = Node( package='controller_manager', executable='spawner.py', arguments=['minicar_controller', '-c', '/controller_manager'], output='screen', ) node_robot_state_publisher = Node( package=&quot;robot_state_publisher&quot;, executable=&quot;robot_state_publisher&quot;, output=&quot;screen&quot;, parameters=[{'use_sim_time': True}, robot_description], ) spawn_joint_state_broadcaster = Node( package='controller_manager', executable='spawner.py', arguments=['joint_state_broadcaster', '-c', '/controller_manager'], output='screen', ) diffdrive_controller_spawn_callback = RegisterEventHandler( event_handler=OnProcessExit( target_action=spawn_joint_state_broadcaster, on_exit=[spawn_minicar_velocity_controller], ) ) gzserver = ExecuteProcess( cmd=['gzserver', '-s', 'libgazebo_ros_factory.so', world_path], output='screen', ) gzclient = ExecuteProcess( cmd=['gzclient'], output='screen', ) spawn_robot = Node( package='gazebo_ros', executable='spawn_entity.py', arguments=['-entity', 'minicar', '-topic', 'robot_description'], output='screen', ) ld = LaunchDescription(arg) ld.add_action(node_robot_state_publisher) ld.add_action(spawn_joint_state_broadcaster) ld.add_action(diffdrive_controller_spawn_callback) ld.add_action(gzserver) ld.add_action(gzclient) ld.add_action(spawn_robot) return ld </code></pre> <p>and aagazebo_world.launch.py file:</p> <pre><code>from launch import LaunchDescription from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource from launch.substitutions import PathJoinSubstitution from launch_ros.substitutions import FindPackageShare def generate_launch_description(): world_file = PathJoinSubstitution( [FindPackageShare(&quot;minicar_simulator&quot;), &quot;worlds&quot;, &quot;test_walls.world&quot;], ) gazebo_launch = PathJoinSubstitution( [FindPackageShare(&quot;minicar_simulator&quot;), &quot;launch&quot;, &quot;aagazebo.launch.py&quot;], ) gazebo_sim = IncludeLaunchDescription( PythonLaunchDescriptionSource([gazebo_launch]), launch_arguments={'world_path': world_file}.items(), ) ld = LaunchDescription() ld.add_action(gazebo_sim) return ld </code></pre> <p>Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/409800/can%27t-spawn-robot-model-in-gazebo-with-no-error-messages-in-terminal/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on ROS Answers with karma: 95 on 2022-11-24</p> <p>Post score: 0</p>
Can't spawn robot model in gazebo with no error messages in terminal
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The solution is:</p> <ol> <li><p>Simpler ROS Message representation:</p> <pre><code> geometry_msgs/Point pick geometry_msgs/Point place int16 speed bool arm --- bool success </code></pre> </li> <li><p>Function Name different from <code>callService</code> to remove ambiguity, for example: <code>callService_</code>:</p> <pre><code> import { Ros, Param, Message, Topic, Service, ServiceRequest } from &quot;roslib&quot;; export default class ROSInterface { constructor() { this.ros = new Ros({ url: &quot;ws://localhost:9090&quot;, }); } createService=(service_name, service_type) =&gt;{ let service = new Service({ ros: this.ros, name: service_name, serviceType: service_type, }); return service; } requestService=(params) =&gt;{ let request = new ServiceRequest(params); return request; } callService_ = (service_name, service_type, params) =&gt; { const srv = this.createService(service_name, service_type); const req = this.requestService(params); srv.callService( req, (result) =&gt; { console.log(result); }, (error) =&gt; { console.log(error); } ); } } </code></pre> </li> <li><p>Finally the parameters can be passed as object with children objects:</p> <pre><code> const params_ = { pick: {x: 1, y: 2, z: 3}, place: {x: -1, y: -2, z: -3}, speed: 10, arm: false, }; ROSInterface.callService_(service_name, service_type, params_); </code></pre> </li> </ol> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/71460/bhomaidan/" rel="nofollow noreferrer">bhomaidan</a> with karma: 114 on 2022-11-30</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102763
2022-11-24T06:55:35.000
|ros|roslibjs|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>According to the <code>ROSLib.js</code> <a href="http://wiki.ros.org/roslibjs/Tutorials/BasicRosFunctionality#CA-3bc839e9e2d3c2cac3f7fabffacfbda3d5c050ae_69" rel="nofollow noreferrer">documentation</a> I did this class</p> <pre><code>import { Ros, Param, Message, Topic, Service, ServiceRequest } from &quot;roslib&quot;; export default class ROSInterface { constructor() { this.ros = new Ros({ url: &quot;ws://localhost:9090&quot;, }); } createService(service_name, service_type) { const service = new Service({ ros: this.ros, name: service_name, serviceType: service_type, }); return service; } callService(service_name, service_type, params) { const service = this.createService(service_name, service_type); const request = new ServiceRequest(params); service.callService(request, function (result) { return result; }); } } </code></pre> <p>But I'm confused how can I pass a complex parameters to my service!</p> <h3>My Service looks like this:</h3> <pre><code>geometry_msgs/Point pick geometry_msgs/Point place std_msgs/UInt16 speed std_msgs/Bool arm </code></pre> <p>I have tried <code>let params = {pick:{x:0.1,y:0.2,z:0.3}, place:{x:-0.1,y:-0.2,z:-0.3},speed: 200, arm: 1}</code> and it didn't work! can you please tell me how can I form my params variabile properly to make my service works well? thanks in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/409807/how-to-pass-service-parameters-in-roslib.js/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/71460/bhomaidan/" rel="nofollow noreferrer">bhomaidan</a> on ROS Answers with karma: 114 on 2022-11-24</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2022-11-24</strong>:<br /> Can you add service_name and service_type to this? What are you passing</p> <p><strong>Comment by <a href="https://answers.ros.org/users/71460/bhomaidan/" rel="nofollow noreferrer">bhomaidan</a> on 2022-11-24</strong>:<br /> @RanjitKathiriya that is straight forward <code>const service_name = &quot;/pick_place&quot;; const service_type = &quot;my_interface/PickPlace&quot;;</code></p>
How to pass service parameters in ROSLib.js
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It depends on the action server you call. When you launch nav2 both action servers are offered as <code>/navigate_to_pose</code> and <code>/navigate_through_poses</code>. Names show which BT is used by each.</p> <p>You can use the <a href="https://navigation.ros.org/commander_api/index.html" rel="nofollow noreferrer">simple commander API</a> to easily interface your application with nav2. This API already wraps all the ROS2 code needed to use action servers in simple function calls. You can also write your own commander interface directly calling the action servers I mentioned above.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/66603/pepis/" rel="nofollow noreferrer">Pepis</a> with karma: 130 on 2022-11-25</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on 2022-11-25</strong>:<br /> Please correct me if I understood wrong.</p> <p>So basically, in the launch file, we load two BT trees (for both /navigate_to_pose and /navigate_through_poses). And then I will create a node that triggers either one of them.</p> <p>Thus, does this mean that If I want to have my own BT tree, all I need to do is to reconfigure it in the launch file?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/66603/pepis/" rel="nofollow noreferrer">Pepis</a> on 2022-11-25</strong>:<br /> Yes, the easiest thing IMO would be to take one of the BTs and modify it to your needs, then pass its path in the parameters or the launch file</p>
102765
2022-11-24T12:18:29.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>According to <a href="https://navigation.ros.org/configuration/packages/configuring-bt-navigator.html" rel="nofollow noreferrer">https://navigation.ros.org/configuration/packages/configuring-bt-navigator.html</a>, The document show that I need to configure two BT for both NavigateToPose and NavigateThroughPose.</p> <p>My question is, how will the Nav2 package decide which BT tree to use during navigation? Or will it just choose the best BT at that moment?</p> <p>Also, I am wondering how will I be able to send my goal to Nav2 package?</p> <p>Thank you very much in advance!</p> <hr /> <p><a href="https://answers.ros.org/question/409833/navigatetopose-vs-navigatethroughpose/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on ROS Answers with karma: 45 on 2022-11-24</p> <p>Post score: 0</p>
NavigateToPose vs NavigateThroughPose
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>More or less by chance I found the 'Curated List of common ROS2 packages' (<a href="https://www.ros.org/reps/rep-2005.html" rel="nofollow noreferrer">REP 2005</a>), which contains links per package to the <a href="https://index.ros.org/" rel="nofollow noreferrer">ROS Index</a>, and there I found the link to the api documentation.</p> <p>Turns out that the humble API docs are at <a href="http://docs.ros.org/en/humble/p/" rel="nofollow noreferrer">http://docs.ros.org/en/humble/p/ </a> as opposed to the previous ROS2 distributions at <a href="https://docs.ros2.org" rel="nofollow noreferrer">https://docs.ros2.org</a>.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/124778/jrtg/" rel="nofollow noreferrer">jrtg</a> with karma: 145 on 2022-11-28</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/37963/danzimmerman/" rel="nofollow noreferrer">danzimmerman</a> on 2023-06-02</strong>:<br /> Yes, I had trouble with this in the past. Now, at least, there's a link to the autogenerated API docs on the Humble, Rolling and Iron API Documentation pages (<a href="https://docs.ros.org/en/humble/API-Docs.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/API-Docs.html</a>, for example):</p> <blockquote> <p>A raw list of Humble package documentation <a href="https://docs.ros.org/en/humble/p/" rel="nofollow noreferrer">may be found here</a> .</p> </blockquote> <p>It's unfortunate that these still don't really seem to show up in search engine queries for the package and API features in question.</p> <p>There's some discussion here:</p> <p><a href="https://github.com/ros2/ros2/issues/1354" rel="nofollow noreferrer">https://github.com/ros2/ros2/issues/1354</a></p> <p>and here:</p> <p><a href="https://discourse.ros.org/t/plans-for-ros-2-documentation-particularly-api-docs/28638/2" rel="nofollow noreferrer">https://discourse.ros.org/t/plans-for-ros-2-documentation-particularly-api-docs/28638/2</a></p>
102767
2022-11-24T17:27:26.000
|ros|ros2|documentation|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>Can anyone point me to the ROS2 Humble API documentation?</p> <p>I found ROS2 API documentation for past distributions at <a href="https://docs.ros2.org" rel="nofollow noreferrer">https://docs.ros2.org</a>, e.g.:</p> <p><a href="https://docs.ros2.org/foxy/api/" rel="nofollow noreferrer">https://docs.ros2.org/foxy/api/</a><br/> <a href="https://docs.ros2.org/galactid/api/" rel="nofollow noreferrer">https://docs.ros2.org/galactic/api/</a></p> <p>But there's no such link for Humble.</p> <p>I found that there's also a &quot;latest&quot;, but even that one is outdated wrt the doxygen info in the installed .hpp files (installed from Ubuntu packages):</p> <p><a href="https://docs.ros2.org/latest/api/" rel="nofollow noreferrer">https://docs.ros2.org/latest/api/</a></p> <p>Thanks, <br/> Johan</p> <hr /> <p><a href="https://answers.ros.org/question/409840/ros2-humble-api-documentation/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/124778/jrtg/" rel="nofollow noreferrer">jrtg</a> on ROS Answers with karma: 145 on 2022-11-24</p> <p>Post score: 0</p>
ROS2 Humble API documentation
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>A process can be a node, if launched as independent systems, or as a collection of nodes if using manual or dynamic node composition. Its not each sub/pub. The context contains the DDS participant which is a global for the process so any nodes in a given process share it (by default, I believe you may override if you choose).</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2022-11-25</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/121834/bchurch8/" rel="nofollow noreferrer">bchurch8</a> on 2022-11-25</strong>:<br /> Thanks for the answer!</p> <p>Just to clarify my understanding, if I have an application that calls rclcpp::init() once on startup, and creates several nodes as the app runs, this counts as one DDS participant since they all belong to the global context?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2022-11-28</strong>:<br /> That is Correct!</p>
102769
2022-11-24T18:37:14.000
|ros|ros2|dds|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>On &quot;<a href="https://docs.ros.org/en/foxy/Concepts/About-Domain-ID.html" rel="nofollow noreferrer">The ROS_DOMAIN_ID</a>&quot; page of the ROS2 Foxy docs, it says the following:</p> <p>&quot;For each ROS 2 process running on a computer, one DDS “participant” is created. Since each DDS participant takes up two ports on the computer, running more than 120 ROS 2 processes on one computer may spill over into other domain IDs or the ephemeral ports.&quot;</p> <p>What exactly is considered a ROS 2 process? Is it every node? Every sub/pub? Or each time you call rclcpp::init()?</p> <p>I have an application that uses ROS for some features and looking into using different domain IDs in each instance of the app to ensure that the two instances do not interfere. However, I would like to know if there is any possibility of the two instances' ports overlapping.</p> <hr /> <p><a href="https://answers.ros.org/question/409841/what-is-a-%22ros2-process%22-with-regards-to-dds-participants?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121834/bchurch8/" rel="nofollow noreferrer">bchurch8</a> on ROS Answers with karma: 16 on 2022-11-24</p> <p>Post score: 0</p>
What is a "ROS2 Process" with regards to DDS Participants?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Thank you for your answers.</p> <p>It seems, that Gazebo has an issue with the <a href="https://github.com/ros-simulation/gazebo_ros_pkgs/issues/243" rel="nofollow noreferrer">plugin</a>. For as long the problem remains relevant the solution is to use the optical link as frame reference (<code>&lt;frame_name&gt;${sensor_reference}_virtual_frame_link&lt;/frame_name&gt;</code>) but <em><strong>not</strong></em> as Gazebo plugin reference ( <code>&lt;gazebo reference=&quot;${sensor_reference}_link&quot;&gt;</code>). With that you are able to rotate the optical link as you see fit, without impacting the Octomap. This solution was found <a href="https://paste.ubuntu.com/p/bFJPHVDNVQ/" rel="nofollow noreferrer">here</a>.</p> <p>Also as a note of importance (because it didn't occur to me right away): Do not publish a static transform for the camera link, if you implement the camera via URDF. Since your <code>robot_state_publisher</code> does already publish the transform for you, there will be issues if a static transform is tried, resulting in a inconsistent tf2 tree.</p> <p>The whole camera macro with solution:</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;robot xmlns:xacro=&quot;http://wiki.ros.org/xacro&quot;&gt; &lt;xacro:macro name=&quot;generate_camera&quot; params=&quot;prefix attachment_link package_name:=modproft_camera_description camera_type:=canon_powershot_g7_mk3 debug:=false&quot;&gt; &lt;xacro:include filename=&quot;<span class="math-container">$(find $</span>{package_name})/urdf/inc/camera_common.xacro&quot;/&gt; &lt;xacro:include filename=&quot;<span class="math-container">$(find $</span>{package_name})/urdf/inc/materials.xacro&quot;/&gt; &lt;xacro:read_camera_data model_parameter_file=&quot;<span class="math-container">$(find $</span>{package_name})/config/${camera_type}.yaml&quot;/&gt; &lt;!-- Todo: Fix Prefix <span class="math-container">${prefix} != &amp;quot; &amp;quot;--&gt; &lt;xacro:if value="$</span>{prefix != &amp;quot; &amp;quot;}&quot;&gt; &lt;xacro:property name=&quot;sensor_reference&quot; value=&quot;<span class="math-container">${prefix}$</span>{sensor_name}&quot;/&gt; &lt;/xacro:if&gt; &lt;xacro:if value=&quot;<span class="math-container">${prefix == &amp;quot; &amp;quot;}"&gt; &lt;xacro:property name="sensor_reference" value="$</span>{sensor_name}&quot;/&gt; &lt;/xacro:if&gt; &lt;!-- Define gazebo sensor --&gt; &lt;gazebo reference=&quot;<span class="math-container">${sensor_reference}_link"&gt; &lt;sensor name="$</span>{sensor_reference}&quot; type=&quot;<span class="math-container">${sensor_type}" &gt; &lt;always_on&gt;$</span>{sensor_always_on}&lt;/always_on&gt; &lt;update_rate&gt;<span class="math-container">${sensor_update_rate}&lt;/update_rate&gt; &lt;camera name="$</span>{sensor_reference}&quot;&gt; &lt;horizontal_fov&gt;<span class="math-container">${sensor_horizontal_fov}&lt;/horizontal_fov&gt; &lt;image&gt; &lt;width&gt;$</span>{sensor_image_width}&lt;/width&gt; &lt;height&gt;<span class="math-container">${sensor_image_height}&lt;/height&gt; &lt;format&gt;$</span>{sensor_image_format}&lt;/format&gt; &lt;/image&gt; &lt;clip&gt; &lt;near&gt;<span class="math-container">${sensor_image_clip_near}&lt;/near&gt; &lt;far&gt;$</span>{sensor_image_clip_far}&lt;/far&gt; &lt;/clip&gt; &lt;distortion&gt; &lt;k1&gt;<span class="math-container">${sensor_image_distortion_k1}&lt;/k1&gt; &lt;k2&gt;$</span>{sensor_image_distortion_k2}&lt;/k2&gt; &lt;k3&gt;<span class="math-container">${sensor_image_distortion_k3}&lt;/k3&gt; &lt;p1&gt;$</span>{sensor_image_distortion_p1}&lt;/p1&gt; &lt;p2&gt;<span class="math-container">${sensor_image_distortion_p2}&lt;/p2&gt; &lt;center&gt;$</span>{sensor_image_distortion_center}&lt;/center&gt; &lt;/distortion&gt; &lt;/camera&gt; &lt;plugin filename=&quot;libgazebo_ros_camera.so&quot; name=&quot;<span class="math-container">${sensor_reference}_controller"&gt; &lt;ros&gt; &lt;imageTopicName&gt;/$</span>{sensor_reference}/color/image_raw&lt;/imageTopicName&gt; &lt;cameraInfoTopicName&gt;/<span class="math-container">${sensor_reference}/color/camera_info&lt;/cameraInfoTopicName&gt; &lt;depthImageTopicName&gt;/$</span>{sensor_reference}/depth/image_raw&lt;/depthImageTopicName&gt; &lt;depthImageCameraInfoTopicName&gt;/<span class="math-container">${sensor_reference}/depth/camera_info&lt;/depthImageCameraInfoTopicName&gt; &lt;pointCloudTopicName&gt;/$</span>{sensor_reference}/points&lt;/pointCloudTopicName&gt; &lt;/ros&gt; &lt;camera_name&gt;<span class="math-container">${sensor_reference}&lt;/camera_name&gt; &lt;frame_name&gt;$</span>{sensor_reference}_virtual_frame_link&lt;/frame_name&gt; &lt;hack_baseline&gt;<span class="math-container">${sensor_hack_baseline}&lt;/hack_baseline&gt; &lt;min_depth&gt;$</span>{sensor_min_depth}&lt;/min_depth&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; &lt;!-- Links --&gt; &lt;link name=&quot;<span class="math-container">${sensor_reference}_link"&gt; &lt;visual&gt; &lt;origin rpy="$</span>{camera_visual_origin_rpy}&quot; xyz=&quot;<span class="math-container">${camera_visual_origin_xyz}"/&gt; &lt;geometry&gt; &lt;mesh filename="package://$</span>{package_name}/meshes/<span class="math-container">${camera_visual_geometry_mesh}" scale="$</span>{camera_visual_geometry_scale}&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin rpy=&quot;<span class="math-container">${camera_collision_origin_rpy}" xyz="$</span>{camera_collision_origin_xyz}&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://<span class="math-container">${package_name}/meshes/$</span>{camera_visual_geometry_mesh}&quot; scale=&quot;<span class="math-container">${camera_visual_geometry_scale}"/&gt; &lt;/geometry&gt; &lt;material name="$</span>{camera_visual_material}&quot;/&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;<span class="math-container">${camera_inertial_mass}"/&gt; &lt;origin rpy="$</span>{camera_inertial_origin_rpy}&quot; xyz=&quot;<span class="math-container">${camera_inertial_origin_xyz}"/&gt; &lt;inertia ixx="$</span>{camera_inertial_inertia_ixx}&quot; ixy=&quot;<span class="math-container">${camera_inertial_inertia_ixy}" ixz="$</span>{camera_inertial_inertia_ixz}&quot; iyy=&quot;<span class="math-container">${camera_inertial_inertia_iyy}" iyz="$</span>{camera_inertial_inertia_iyz}&quot; izz=&quot;${camera_inertial_inertia_izz}&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;link name=&quot;<span class="math-container">${sensor_reference}_virtual_frame_link"&gt; &lt;!-- Todo Fix debug condition block--&gt; &lt;xacro:if value="$</span>{debug != 'False'}&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://<span class="math-container">${package_name}/meshes/$</span>{virtual_visual_geometry_mesh}&quot; scale=&quot;${virtual_visual_geometry_scale}&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;/xacro:if&gt; &lt;/link&gt; &lt;!-- Joints --&gt; &lt;joint type=&quot;fixed&quot; name=&quot;<span class="math-container">${prefix}$</span>{attachment_link}_<span class="math-container">${sensor_name}_joint"&gt; &lt;origin rpy="$</span>{cameraattachment_joint_origin_rpy}&quot; xyz=&quot;<span class="math-container">${cameraattachment_joint_origin_xyz}"/&gt; &lt;child link="$</span>{sensor_reference}_link&quot;/&gt; &lt;parent link=&quot;<span class="math-container">${prefix}$</span>{attachment_link}&quot;/&gt; &lt;/joint&gt; &lt;joint type=&quot;fixed&quot; name=&quot;<span class="math-container">${prefix}$</span>{attachment_link}_<span class="math-container">${sensor_name}_virtual_frame_joint"&gt; &lt;origin rpy="$</span>{cameravirtual_joint_origin_rpy}&quot; xyz=&quot;<span class="math-container">${cameravirtual_joint_origin_xyz}"/&gt; &lt;child link="$</span>{sensor_reference}_virtual_frame_link&quot;/&gt; &lt;parent link=&quot;${sensor_reference}_link&quot;/&gt; &lt;/joint&gt; &lt;/xacro:macro&gt; &lt;/robot&gt; </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/69326/notarobot/" rel="nofollow noreferrer">NotARobot</a> with karma: 109 on 2022-11-28</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102771
2022-11-25T09:20:02.000
|gazebo|ros2|camera|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Greetings. I have inserted a camera within my gazebo simulation via the gazebo plugin. The camera works as intended, however the point cloud generated does not match the camera picture. Since Octomaps are build on the point cloud the collision map is also misaligned. I've aligned the gazebo camera plugin via optical link to the camera link (mesh and collision).</p> <p>How do I get the proper orientation of the point cloud? - Since the picture in RViz matches the viewed object I would assume the point cloud would behave the same.</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16693857276838972.png" alt="Gazebo Scene" /> <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1669385744973487.png" alt="RViz Camera Image" /> <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16693857731893983.png" alt="RViz Octomap" /></p> <p>Camera macro:</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;robot xmlns:xacro=&quot;http://wiki.ros.org/xacro&quot;&gt; &lt;xacro:macro name=&quot;generate_camera&quot; params=&quot;prefix attachment_link package_name:=modproft_camera_description camera_type:=canon_powershot_g7_mk3 debug:=false&quot;&gt; &lt;xacro:include filename=&quot;<span class="math-container">$(find $</span>{package_name})/urdf/inc/camera_common.xacro&quot;/&gt; &lt;xacro:include filename=&quot;<span class="math-container">$(find $</span>{package_name})/urdf/inc/materials.xacro&quot;/&gt; &lt;xacro:read_camera_data model_parameter_file=&quot;<span class="math-container">$(find $</span>{package_name})/config/${camera_type}.yaml&quot;/&gt; &lt;!-- Todo: Fix Prefix <span class="math-container">${prefix} != &amp;quot; &amp;quot;--&gt; &lt;xacro:if value="$</span>{prefix != &amp;quot; &amp;quot;}&quot;&gt; &lt;xacro:property name=&quot;sensor_reference&quot; value=&quot;<span class="math-container">${prefix}$</span>{sensor_name}&quot;/&gt; &lt;/xacro:if&gt; &lt;xacro:if value=&quot;<span class="math-container">${prefix == &amp;quot; &amp;quot;}"&gt; &lt;xacro:property name="sensor_reference" value="$</span>{sensor_name}&quot;/&gt; &lt;/xacro:if&gt; &lt;!-- Define gazebo sensor --&gt; &lt;gazebo reference=&quot;<span class="math-container">${sensor_reference}_virtual_frame_link"&gt; &lt;sensor name="$</span>{sensor_reference}&quot; type=&quot;<span class="math-container">${sensor_type}" &gt; &lt;always_on&gt;$</span>{sensor_always_on}&lt;/always_on&gt; &lt;update_rate&gt;<span class="math-container">${sensor_update_rate}&lt;/update_rate&gt; &lt;camera name="$</span>{sensor_reference}&quot;&gt; &lt;horizontal_fov&gt;<span class="math-container">${sensor_horizontal_fov}&lt;/horizontal_fov&gt; &lt;image&gt; &lt;width&gt;$</span>{sensor_image_width}&lt;/width&gt; &lt;height&gt;<span class="math-container">${sensor_image_height}&lt;/height&gt; &lt;format&gt;$</span>{sensor_image_format}&lt;/format&gt; &lt;/image&gt; &lt;clip&gt; &lt;near&gt;<span class="math-container">${sensor_image_clip_near}&lt;/near&gt; &lt;far&gt;$</span>{sensor_image_clip_far}&lt;/far&gt; &lt;/clip&gt; &lt;distortion&gt; &lt;k1&gt;<span class="math-container">${sensor_image_distortion_k1}&lt;/k1&gt; &lt;k2&gt;$</span>{sensor_image_distortion_k2}&lt;/k2&gt; &lt;k3&gt;<span class="math-container">${sensor_image_distortion_k3}&lt;/k3&gt; &lt;p1&gt;$</span>{sensor_image_distortion_p1}&lt;/p1&gt; &lt;p2&gt;<span class="math-container">${sensor_image_distortion_p2}&lt;/p2&gt; &lt;center&gt;$</span>{sensor_image_distortion_center}&lt;/center&gt; &lt;/distortion&gt; &lt;/camera&gt; &lt;plugin filename=&quot;libgazebo_ros_camera.so&quot; name=&quot;<span class="math-container">${sensor_reference}_controller"&gt; &lt;ros&gt; &lt;imageTopicName&gt;/$</span>{sensor_reference}/color/image_raw&lt;/imageTopicName&gt; &lt;cameraInfoTopicName&gt;/<span class="math-container">${sensor_reference}/color/camera_info&lt;/cameraInfoTopicName&gt; &lt;depthImageTopicName&gt;/$</span>{sensor_reference}/depth/image_raw&lt;/depthImageTopicName&gt; &lt;depthImageCameraInfoTopicName&gt;/<span class="math-container">${sensor_reference}/depth/camera_info&lt;/depthImageCameraInfoTopicName&gt; &lt;pointCloudTopicName&gt;/$</span>{sensor_reference}/points&lt;/pointCloudTopicName&gt; &lt;/ros&gt; &lt;camera_name&gt;<span class="math-container">${sensor_reference}&lt;/camera_name&gt; &lt;frame_name&gt;$</span>{sensor_reference}_virtual_frame_link&lt;/frame_name&gt; &lt;hack_baseline&gt;<span class="math-container">${sensor_hack_baseline}&lt;/hack_baseline&gt; &lt;min_depth&gt;$</span>{sensor_min_depth}&lt;/min_depth&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; &lt;!-- Links --&gt; &lt;link name=&quot;<span class="math-container">${sensor_reference}_link"&gt; &lt;visual&gt; &lt;origin rpy="$</span>{camera_visual_origin_rpy}&quot; xyz=&quot;<span class="math-container">${camera_visual_origin_xyz}"/&gt; &lt;geometry&gt; &lt;mesh filename="package://$</span>{package_name}/meshes/<span class="math-container">${camera_visual_geometry_mesh}" scale="$</span>{camera_visual_geometry_scale}&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin rpy=&quot;<span class="math-container">${camera_collision_origin_rpy}" xyz="$</span>{camera_collision_origin_xyz}&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://<span class="math-container">${package_name}/meshes/$</span>{camera_visual_geometry_mesh}&quot; scale=&quot;<span class="math-container">${camera_visual_geometry_scale}"/&gt; &lt;/geometry&gt; &lt;material name="$</span>{camera_visual_material}&quot;/&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;<span class="math-container">${camera_inertial_mass}"/&gt; &lt;origin rpy="$</span>{camera_inertial_origin_rpy}&quot; xyz=&quot;<span class="math-container">${camera_inertial_origin_xyz}"/&gt; &lt;inertia ixx="$</span>{camera_inertial_inertia_ixx}&quot; ixy=&quot;<span class="math-container">${camera_inertial_inertia_ixy}" ixz="$</span>{camera_inertial_inertia_ixz}&quot; iyy=&quot;<span class="math-container">${camera_inertial_inertia_iyy}" iyz="$</span>{camera_inertial_inertia_iyz}&quot; izz=&quot;${camera_inertial_inertia_izz}&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;link name=&quot;<span class="math-container">${sensor_reference}_virtual_frame_link"&gt; &lt;!-- Todo: Fix debug condition block--&gt; &lt;xacro:if value="$</span>{debug != 'False'}&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://<span class="math-container">${package_name}/meshes/$</span>{virtual_visual_geometry_mesh}&quot; scale=&quot;${virtual_visual_geometry_scale}&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;/xacro:if&gt; &lt;/link&gt; &lt;!-- Joints --&gt; &lt;joint type=&quot;fixed&quot; name=&quot;<span class="math-container">${prefix}$</span>{attachment_link}_<span class="math-container">${sensor_name}_joint"&gt; &lt;origin rpy="$</span>{cameraattachment_joint_origin_rpy}&quot; xyz=&quot;<span class="math-container">${cameraattachment_joint_origin_xyz}"/&gt; &lt;child link="$</span>{sensor_reference}_link&quot;/&gt; &lt;parent link=&quot;<span class="math-container">${prefix}$</span>{attachment_link}&quot;/&gt; &lt;/joint&gt; &lt;joint type=&quot;fixed&quot; name=&quot;<span class="math-container">${prefix}$</span>{attachment_link}_<span class="math-container">${sensor_name}_virtual_frame_joint"&gt; &lt;origin rpy="$</span>{cameravirtual_joint_origin_rpy}&quot; xyz=&quot;<span class="math-container">${cameravirtual_joint_origin_xyz}"/&gt; &lt;child link="$</span>{sensor_reference}_virtual_frame_link&quot;/&gt; &lt;parent link=&quot;${sensor_reference}_link&quot;/&gt; &lt;/joint&gt; &lt;/xacro:macro&gt; &lt;/robot&gt; </code></pre> <hr /> <p><a href="https://answers.ros.org/question/409868/point-cloud-misaligned-with-gazebo-sensor-plugin/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/69326/notarobot/" rel="nofollow noreferrer">NotARobot</a> on ROS Answers with karma: 109 on 2022-11-25</p> <p>Post score: 0</p>
Point cloud misaligned with gazebo sensor plugin
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Ok, found the answer by myself.</p> <p>In the CMakeList.txt file, changed the following line:</p> <pre><code>ament_target_dependencies(mono rclcpp sensor_msgs visualization_msgs cv_bridge ORB_SLAM2 Boost) </code></pre> <p>into:</p> <pre><code>ament_target_dependencies(mono rclcpp sensor_msgs visualization_msgs message_filters cv_bridge ORB_SLAM2 Boost) </code></pre> <p>Now it compiles correctly.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/120573/damiano/" rel="nofollow noreferrer">damiano</a> with karma: 18 on 2022-11-28</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102774
2022-11-28T00:02:44.000
|ros|ros2|callback|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I am trying to build a node that subscribes to two topics using message_filters::Synchronizer with approximate policy. Here is the relevant part of my code:</p> <pre><code>MonocularSlamNode::MonocularSlamNode(ORB_SLAM2::System* pSLAM, const string &amp;strVocFile, const string &amp;strSettingsFile, const string &amp;strSensor) : Node(&quot;orbslam&quot;), m_SLAM(pSLAM) { message_filters::Subscriber&lt;ImageMsg&gt; image_sub_; message_filters::Subscriber&lt;ImageMsg&gt; depth_sub_; image_sub_.subscribe(this, &quot;camera&quot;); depth_sub_.subscribe(this, &quot;depth_map&quot;); typedef message_filters::sync_policies::ApproximateTime&lt;ImageMsg, ImageMsg&gt; approximate_policy; message_filters::Synchronizer&lt;approximate_policy&gt;syncApproximate(approximate_policy(10), image_sub_, depth_sub_); syncApproximate.registerCallback(&amp;MonocularSlamNode::GrabRGBD,this); } </code></pre> <p>And then the callback function, just for reference:</p> <pre><code> void MonocularSlamNode::GrabRGBD(const ImageMsg::SharedPtr msgIm, const ImageMsg::SharedPtr msgD) { // Copy the ros image message to cv::Mat. try { m_cvImPtr = cv_bridge::toCvCopy(msgIm); } catch (cv_bridge::Exception&amp; e) { RCLCPP_ERROR(this-&gt;get_logger(), &quot;cv_bridge exception: %s&quot;, e.what()); return; } // Copy the ros image message to cv::Mat. try { m_cvDPtr = cv_bridge::toCvCopy(msgD); } catch (cv_bridge::Exception&amp; e) { RCLCPP_ERROR(this-&gt;get_logger(), &quot;cv_bridge exception: %s&quot;, e.what()); return; } //rclcpp::Time now = this-&gt;get_clock()-&gt;now(); cout &lt;&lt; m_cvImPtr-&gt;header.stamp.sec &lt;&lt; &quot; &quot; &lt;&lt; m_cvDPtr-&gt;header.stamp.sec &lt;&lt; endl; Tcw = m_SLAM-&gt;TrackRGBD(m_cvImPtr-&gt;image, m_cvDPtr-&gt;image, m_cvImPtr-&gt;header.stamp.sec); } </code></pre> <p>The problem is, when I try to compile with colcon build, I get the following errors:</p> <pre><code> /usr/bin/ld: CMakeFiles/mono.dir/src/monocular/monocular-slam-node.cpp.o: in function `message_filters::Synchronizer&lt;message_filters::sync_policies::ApproximateTime&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;, sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType&gt; &gt;::disconnectAll()': monocular-slam-node.cpp:(.text._ZN15message_filters12SynchronizerINS_13sync_policies15ApproximateTimeIN11sensor_msgs3msg6Image_ISaIvEEES7_NS_8NullTypeES8_S8_S8_S8_S8_S8_EEE13disconnectAllEv[_ZN15message_filters12SynchronizerINS_13sync_policies15ApproximateTimeIN11sensor_msgs3msg6Image_ISaIvEEES7_NS_8NullTypeES8_S8_S8_S8_S8_S8_EEE13disconnectAllEv]+0x38): undefined reference to `message_filters::Connection::disconnect()' /usr/bin/ld: CMakeFiles/mono.dir/src/monocular/monocular-slam-node.cpp.o: in function `message_filters::Connection message_filters::Signal9&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;, sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType&gt;::addCallback&lt;std::shared_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;, std::shared_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;&gt;(std::function&lt;void (std::shared_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;, std::shared_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;, std::shared_ptr&lt;message_filters::NullType const&gt; const&amp;)&gt; const&amp;)': monocular-slam-node.cpp:(.text._ZN15message_filters7Signal9IN11sensor_msgs3msg6Image_ISaIvEEES5_NS_8NullTypeES6_S6_S6_S6_S6_S6_E11addCallbackISt10shared_ptrIS5_ESA_RKS9_IKS6_ESE_SE_SE_SE_SE_SE_EENS_10ConnectionERKSt8functionIFvT_T0_T1_T2_T3_T4_T5_T6_T7_EE[_ZN15message_filters7Signal9IN11sensor_msgs3msg6Image_ISaIvEEES5_NS_8NullTypeES6_S6_S6_S6_S6_S6_E11addCallbackISt10shared_ptrIS5_ESA_RKS9_IKS6_ESE_SE_SE_SE_SE_SE_EENS_10ConnectionERKSt8functionIFvT_T0_T1_T2_T3_T4_T5_T6_T7_EE]+0x17a): undefined reference to `message_filters::Connection::Connection(std::function&lt;void ()&gt; const&amp;)' /usr/bin/ld: CMakeFiles/mono.dir/src/monocular/monocular-slam-node.cpp.o: in function `message_filters::Connection message_filters::SimpleFilter&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;::registerCallback&lt;message_filters::MessageEvent&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; const&gt; const&amp;&gt;(std::function&lt;void (message_filters::MessageEvent&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; const&gt; const&amp;)&gt; const&amp;)': monocular-slam-node.cpp:(.text._ZN15message_filters12SimpleFilterIN11sensor_msgs3msg6Image_ISaIvEEEE16registerCallbackIRKNS_12MessageEventIKS5_EEEENS_10ConnectionERKSt8functionIFvT_EE[_ZN15message_filters12SimpleFilterIN11sensor_msgs3msg6Image_ISaIvEEEE16registerCallbackIRKNS_12MessageEventIKS5_EEEENS_10ConnectionERKSt8functionIFvT_EE]+0xb8): undefined reference to `message_filters::Connection::Connection(std::function&lt;void ()&gt; const&amp;)' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/mono.dir/build.make:192: mono] Error 1 make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/mono.dir/all] Error 2 </code></pre> <p>Which I don't really understand at all, as it does not refer to specific lines of code.</p> <p>I think the critical part are the lines related to the Synchronizer, as they are the lines I added by myself - however I'm not sure if I did things right.</p> <p>Can someone helps me to shed some lights on the issue?</p> <p>For reference, I am using ros2 (foxy distro) on ubuntu 20.04. Thanks!</p> <p>EDIT: adding the CMakeList file as this is a linking error.</p> <pre><code> cmake_minimum_required(VERSION 3.5) project(orbslam2) # Cmake modules folder set(CMAKE_MODULE_PATH <span class="math-container">${CMAKE_MODULE_PATH} "$</span>{CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/&quot;) # Default to C++14 if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 14) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES &quot;Clang&quot;) add_compile_options(-Wall -Wextra -Wpedantic) endif() find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(sensor_msgs REQUIRED) find_package(visualization_msgs REQUIRED) find_package(cv_bridge REQUIRED) find_package(message_filters REQUIRED) find_package(Boost COMPONENTS system) find_package(OpenCV 3 REQUIRED) find_package(Eigen REQUIRED) find_package(ORB_SLAM2 REQUIRED) include_directories( <span class="math-container">${ORB_SLAM2_INCLUDE_DIRS} $</span>{message_filters_INCLUDE_DIRS} <span class="math-container">${Boost_INCLUDE_DIRS} $</span>{EIGEN_INCLUDE_DIR} ) # Monocular add_executable( mono src/monocular/mono.cpp src/monocular/monocular-slam-node.cpp ) target_link_libraries(mono g2o DBoW2 <span class="math-container">${ORB_SLAM2_LIBRARIES} $</span>{Boost_LIBRARIES} ) ament_target_dependencies(mono rclcpp sensor_msgs visualization_msgs cv_bridge ORB_SLAM2 Boost) install(TARGETS mono DESTINATION lib/${PROJECT_NAME}) ament_package() </code></pre> <p>Also, the message_filters package is correctly present in package.xml.</p> <hr /> <p><a href="https://answers.ros.org/question/409925/ros2,-undefined-reference-to-%60message_filters::connection::disconnect()/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/120573/damiano/" rel="nofollow noreferrer">damiano</a> on ROS Answers with karma: 18 on 2022-11-28</p> <p>Post score: 0</p>
Ros2, undefined reference to `message_filters::Connection::disconnect()
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I don't think that standard <code>moveit</code> supports this. The <code>moveit</code> system makes the simplifying assumption that a kinematic chain has only a single &quot;pathway&quot; of links from root to &quot;object&quot;. I don't know how much custom code it would take for you to support a closed-loop chain configuration.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-11-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/125248/don/" rel="nofollow noreferrer">don</a> on 2023-01-16</strong>:<br /> Thank you for your comment!!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/125248/don/" rel="nofollow noreferrer">don</a> on 2023-01-16</strong>:<br /> I was waiting for another comment, but seeing that it hasn't been commented yet, there must be no solution yet!</p>
102776
2022-11-28T01:24:25.000
|moveit|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>i'm trying to grasp one object with two arms(A arm and B arm) by this process.</p> <ol> <li>Attach object with A arm (l_tool_frame).</li> <li>Attach object with B arm (r_tool_frame).</li> </ol> <p>but it didn't work. when i attach the object to B arm, It is automatically detached from A arm.</p> <p>I want to attach the object with two arms. Is there any way to do this?</p> <hr /> <p>This code is the first way i tried it.</p> <pre><code>moveit_msgs::AttachedCollisionObject l_pad_attach; pad_attach.link_name = (&quot;l_tool_frame&quot;); pad_attach.object = add_object[0]; current_scene.applyAttachedCollisionObject( pad_attach ); moveit_msgs::AttachedCollisionObject r_pad_attach; pad_attach.link_name = (&quot;r_tool_frame&quot;); pad_attach.object = add_object[0]; current_scene.applyAttachedCollisionObject( pad_attach ); </code></pre> <hr /> <p>This code is the second way i tried it.</p> <pre><code>moveit_msgs::AttachedCollisionObject pad_attach; pad_attach.link_name = (&quot;l_tool_frame&quot;,&quot;r_tool_frame&quot;); pad_attach.object = add_object[0]; current_scene.applyAttachedCollisionObject( pad_attach ); </code></pre> <p>There is no error, but it is attached only to &quot;r_tool_frame&quot;</p> <p>Thank you</p> <hr /> <p><a href="https://answers.ros.org/question/409927/moveit-noetic,-how-to-attach-one-object-with-two-end-effectors?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/125248/don/" rel="nofollow noreferrer">don</a> on ROS Answers with karma: 23 on 2022-11-28</p> <p>Post score: 0</p>
moveit-noetic, How to attach one object with two end-effectors?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Your understanding seems correct.</p> <p><a href="http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/LaserScan.html" rel="nofollow noreferrer">http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/LaserScan.html</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/1108/martin-peris/" rel="nofollow noreferrer">Martin Peris</a> with karma: 5625 on 2022-11-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2022-12-01</strong>:<br /> @Martin Peris The values in the <code>ranges</code> array are the distances with reference to the sensor frame?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/1108/martin-peris/" rel="nofollow noreferrer">Martin Peris</a> on 2022-12-18</strong>:<br /> Sorry, I missed your comment. Yes, the values in ranges array are the distances with reference to the sensor frame (specified in the header of the message)</p>
102778
2022-11-28T23:39:58.000
|ros-melodic|ros-kinetic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Just to make sure I understand laser scan data. <code>ranges</code> is an array of scan distances. so:</p> <p><code>ranges[0]</code> shows scan distance at <code>angle_min</code>.</p> <p><code>ranges[1]</code> shows scan distance at <code>angle_min+angle_increment</code>.</p> <p><code>ranges[2]</code> shows scan distance at <code>angle_min+(2*angle_increment)</code> and so on? Is this correct</p> <hr /> <p><a href="https://answers.ros.org/question/409972/question-about-scan.ranges-information/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on ROS Answers with karma: 167 on 2022-11-28</p> <p>Post score: 0</p>
Question about scan.ranges information
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Kindly upload screenshot to elaborate well..want to help you out l.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/103873/davies-ogunsina/" rel="nofollow noreferrer">Davies Ogunsina</a> with karma: 96 on 2022-11-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2022-11-29</strong>:<br /> Hello,</p> <p>This is not the answer; please use add a comment button to request a screenshot or any other chat.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on 2022-12-08</strong>:<br /> Thank you for your reply. I wanted to upload the screenshot but I needed more points to upload some image files.. By the way, I solved the problem. The issue was related to the initial pose of the robot, which was different to the position values in the launch file.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/103873/davies-ogunsina/" rel="nofollow noreferrer">Davies Ogunsina</a> on 2022-12-08</strong>:<br /> Okay ,great</p>
102780
2022-11-29T03:29:04.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I followed the ros navigation tutorial from omniverse isaac sim, and discovered that the odom, local costmap and robot base link are not in the same plane. (I wanted to upload the screenshot of the rviz result and tf tree, but I lack of points..)</p> <p>Sorry if this is the basic question and thanks for your advices in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/409980/odom-frame,-robot-base-link-frame-and-local-cost-map-are-not-in-the-same-plane./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on ROS Answers with karma: 21 on 2022-11-29</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2022-11-29</strong>:<br /> Now you will be able to upload screenshot,</p>
odom frame, robot base link frame and local cost map are not in the same plane
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Looks like there is an issue with using</p> <pre><code>#pragma pack(1) </code></pre> <p>for one of the include files I was using for several structures in it. Once they were removed the sigsev is removed. However this needs further investigation on why is this happening</p> <p>Regards Shouvik</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/109848/shouvik1984/" rel="nofollow noreferrer">shouvik1984</a> with karma: 28 on 2022-12-02</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-12-03</strong>:<br /> A likely explanation would be you're changing the in-memory layout of <code>struct</code>s. Since you are using a binary distribution of <code>roscpp</code>, which wasn't compiled with that particular setting for padding/packing, you've introduced an ABI incompatibility. <code>SEGFAULT</code>s are one of the many things which can then happen.</p> <p>If you need to override padding/packing settings for specific <code>struct</code>s, limit the setting to just those data types. Do not set it globally, especially not before you <code>#include</code> other headers.</p>
102782
2022-11-30T06:30:14.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello there,</p> <p>I am facing a weird issue of getting a segmentation fault right in the second line of main function. Immediately after</p> <pre><code>ros::init(argc,argv,&quot;node_name&quot;); ros::NodeHandle nh(&quot;node_name&quot;); </code></pre> <p>Getting segmentation at NodeHandle function. The following is the back trace of the callstack where exception has occured.</p> <pre><code>Thread 1 &quot;removed&quot; received signal SIGSEGV, Segmentation fault. 0x00007ffff750ec15 in ros::names::validate(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;) () from /opt/ros/noetic/lib/libroscpp.so (gdb) bt #0 0x00007ffff750ec15 in ros::names::validate(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;) () at /opt/ros/noetic/lib/libroscpp.so #1 0x00007ffff753d8a2 in ros::NodeHandle::resolveName(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, bool) const () at /opt/ros/noetic/lib/libroscpp.so #2 0x00007ffff753f5d5 in ros::NodeHandle::initRemappings(std::map&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::pair&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt; const&amp;) () at /opt/ros/noetic/lib/libroscpp.so #3 0x00007ffff7540a1e in ros::NodeHandle::NodeHandle(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::map&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::pair&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt; const&amp;) () at /opt/ros/noetic/lib/libroscpp.so #4 0x00005555555e216d in main(int, char**) (argc=1, argv=0x7fffffffe1e8) at /removed/src/main.cpp:6 </code></pre> <p>Please help in troubleshooting this issue.</p> <p>Ros Version: ROS1 Noetic</p> <hr /> <p><a href="https://answers.ros.org/question/410039/segmentation-fault-at-ros::nodehandle-nh(%22node_name%22)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/109848/shouvik1984/" rel="nofollow noreferrer">shouvik1984</a> on ROS Answers with karma: 28 on 2022-11-30</p> <p>Post score: 0</p>
Segmentation Fault at ros::NodeHandle nh("node_name")
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Found out after a day of checking around! I'm a beginner and the tutorial doesn't mention it, but ros1_bridge works as a <code>workspace folder</code> so you'd have to source that workspace.</p> <p>In <code>.bashrc</code>, I alias 3 things:</p> <p><code>alias noetic='source /opt/ros/noetic/setup.bash'</code></p> <p><code>alias foxy='source /opt/ros/foxy/setup.bash'</code></p> <p><code>alias bridge='source ~/ros1_bridge/install/setup.bash'</code></p> <p>That way, when you want to run <code>ros1_bridge</code>, which is a ros2 workspace, you can use 1 terminal for this. Your terminal command lines should be something like:</p> <p>$ noetic</p> <p>$ foxy</p> <p>$ bridge</p> <p>$ ros2 run ros1_bridge dynamic_bridge</p> <p>in this order!</p> <p>I hope this helps new beginners trying to get into ROS2 and ROS1!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/125644/jacobsayono/" rel="nofollow noreferrer">jacobsayono</a> with karma: 16 on 2022-11-30</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/143866/nartmangnourt/" rel="nofollow noreferrer">Nartmangnourt</a> on 2023-06-23</strong>:<br /> Hey jacob,</p> <p>i still get this output in the terminal: No executable found</p>
102784
2022-11-30T21:10:55.000
|ros|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>This is the guide that I followed: <a href="https://github.com/ros2/ros1_bridge/tree/foxy" rel="nofollow noreferrer">https://github.com/ros2/ros1_bridge/tree/foxy</a> (I am stuck on attempting example 1).</p> <p>I was successful in building ros1_bridge with colcon (took about 20 mins). I am trying to do the first example. Note that I am bridging neotic (ros1) to foxy (ros2) so I have cloned the ros1_bridge repository from the foxy tree.</p> <p>In shell A, I sourced ros1 then ran roscore. In shell B, I sourced ros1 then sourced ros2. Then when I try to run:</p> <p><code>ros2 run ros1_bridge dynamic_bridge</code></p> <p>I get the error</p> <p><code>Package 'ros1_bridge' not found.</code></p> <p>Am I missing anything here?</p> <p>Thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/410063/package-%27ros1_bridge%60-not-found/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/125644/jacobsayono/" rel="nofollow noreferrer">jacobsayono</a> on ROS Answers with karma: 16 on 2022-11-30</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/125644/jacobsayono/" rel="nofollow noreferrer">jacobsayono</a> on 2022-11-30</strong>:<br /> ros1 and ros2 works perfectly btw!</p>
Package 'ros1_bridge` not found
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I am using <a href="https://app.diagrams.net/" rel="nofollow noreferrer">draw.io,</a> it is free. It provides all the basic structure you required for creating graphs, class, and functions.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2022-12-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102786
2022-12-01T02:45:57.000
|ros|ros2|package|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, I need to develop some ROS2 packages for my robot. Before writing each package, I want to draw a diagram for the package relations (e.g. the message, the class calling between them), like a class diagram?</p> <p>Is there a name for this diagram and is there any tool for this?</p> <p>The final diagram may look like rqt_graph. But it is designed before every package is prepared.</p> <p>There seems to be a &quot;package diagram&quot; in starUML. But I'm not sure whether this &quot;package diagram&quot; satisfies .</p> <p>Thanks for any help!</p> <hr /> <p><a href="https://answers.ros.org/question/410068/diagram-tool-for-the-design-of-ros2-packages/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/54937/xibeisiber/" rel="nofollow noreferrer">xibeisiber</a> on ROS Answers with karma: 137 on 2022-12-01</p> <p>Post score: 0</p>
diagram tool for the design of ros2 packages
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>A particular rosbag message can have two timestamps: one is the time-of-arrival at the node which is recording the rosbag, and the other is the <code>header.stamp</code> inside the message. It is not unexpected for the first to have duplicate arrival times -- it simply means that some networking delay caused two messages to be delivered to the rosbag process in the same memory buffer.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/125921/heisenasd/" rel="nofollow noreferrer">Heisenasd</a> on 2022-12-07</strong>:<br /> Thanks a lot for your answer! Do you think I can work out a solution to this problem? Also, I'm afraid there can be something wrong with the installation procedure I followed. Can it be the case in your opinion?. I'm saying this, because I installed ROS on three different machines in three different months (I've experienced some hardware problems, which were non-ROS related) and the only one where I didn't experience this issue was the first one, which was the least powerful one! Therefore. I suspect I may have forgotten something during, but my lack of experience with both Ubuntu and ROS doesn't really help me. At the end, this isn't such an insurmountable problem, but still it is, and I'd like to solve it. Thank you in advance for your considerations.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-12-07</strong>:<br /> You appear to be using the wrong timestamp. If your processing cares about exact timing of a msg, you should be using the <code>header.stamp</code> that was inserted by the node that published the message. This one is not affected by network latency.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/125921/heisenasd/" rel="nofollow noreferrer">Heisenasd</a> on 2022-12-08</strong>:<br /> I've managed to solve my problem! Thank you a lot!</p>
102788
2022-12-03T08:12:22.000
|ros|gazebo|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm using ROS Noetic on Ubuntu 20.04 (kernel version 5.15.0-53-generic) on a MSI GF66 and I have encountered a strange problem when analyzing a recorded rosbag.</p> <p>I have to publish at 10 Hz by means of a Simulink model some messages to the <code>/cmd_vel</code> topic of a Turtlebot that moves in Gazebo and records the <code>/odom</code> and <code>/cmd_vel</code> topics. When analyzing the recorded bag, I notice something strange: every once in a while, two consecutive timestamps are exactly equal, even though the value of the two corresponding messages of the topic are not equal (it holds both for <code>/odom</code> and <code>/cmd_vel</code>).</p> <p>I use the following script in Matlab to extract the information from the bag:</p> <pre><code>bagSelect = rosbag('BagPubSimulink.bag'); odomBag = select(bagSelect, 'Time', [bagSelect.StartTime bagSelect.EndTime], 'Topic', '/odom'); odomStructs = readMessages(odomBag, 'DataFormat','struct'); odomTime = odomBag.MessageList.Time; </code></pre> <p>Then, I cycle on <code>odomStructs</code> to extract the messages I need, let's say <code>odomX</code>.</p> <p>Taking two instants <code>k</code> and <code>k + 1</code> when the problem occurs:</p> <pre><code>odomTime(k : k + 1) = {149.674000000000; 149.674000000000} odomX(k : k + 1) = {-0.790906331505904; -0.787962666465643}` </code></pre> <p>I've noticed that this problem happens more frequently in the recorded bag when the considered topic has a high publishing frequency, e.g. if I record the <code>/clock</code> topic, this problem of consecutive timestamps being equal is magnified and can last for more than two consecutive timestamps.</p> <p>Can you please help me with this problem?</p> <p>In order to install ROS, I've followed the instructions at <a href="https://emanual.robotis.com/docs/en/platform/turtlebot3/quick-start/" rel="nofollow noreferrer">https://emanual.robotis.com/docs/en/platform/turtlebot3/quick-start/</a> up to paragraph 1.1.5.</p> <p>I've actually had to add some lines of code from the video linked in the same page, because they are not written there.</p> <p>I'm sorry if something is not clear and whether I've not used the correct wording, but I'm new to both Ubuntu and ROS and I have a lot to learn.</p> <p>Please, tell me if I have to provide some more details to work out a solution.</p> <p><em><strong>Edit</strong></em></p> <p>The problem is not due to the fact that the duplicated timestamps belong to two messages of the two topics I've recorded. In fact, this is <code>MessageList</code> of the variable <code>bagSelect</code>:</p> <pre><code>Time Topic MessageType FileOffset 99.3160000000000 '/cmd_vel' 'geometry_msgs/Twist' 402403 99.3170000000000 '/odom' 'nav_msgs/Odometry' 402497 99.3270000000000 '/odom' 'nav_msgs/Odometry' 403261 99.3690000000000 '/odom' 'nav_msgs/Odometry' 404025 99.4150000000000 '/cmd_vel' 'geometry_msgs/Twist' 404789 99.4170000000000 '/odom' 'nav_msgs/Odometry' 404883 99.4610000000000 '/odom' 'nav_msgs/Odometry' 405647 99.4610000000000 '/odom' 'nav_msgs/Odometry' 406411 99.5050000000000 '/odom' 'nav_msgs/Odometry' 407175 99.5160000000000 '/cmd_vel' 'geometry_msgs/Twist' 407939 99.5270000000000 '/odom' 'nav_msgs/Odometry' 408033 99.5730000000000 '/odom' 'nav_msgs/Odometry' 408797 99.6160000000000 '/cmd_vel' 'geometry_msgs/Twist' 409561 99.6170000000000 '/odom' 'nav_msgs/Odometry' 409655 99.6650000000000 '/odom' 'nav_msgs/Odometry' 410419 99.6650000000000 '/odom' 'nav_msgs/Odometry' 411183 99.7120000000000 '/odom' 'nav_msgs/Odometry' 411947 99.7150000000000 '/cmd_vel' 'geometry_msgs/Twist' 412711 </code></pre> <p>Interestingly, <code>/odom</code> is the only topic of this bag that suffers from this timestamps duplication problem. Thus, it seems that the problem doesn't affect topics that are published by myself.</p> <p>As a matter of fact, I've tried recording the <code>/clock</code> topic only with the Turtlebot staying still in the Gazebo world, and inside the <code>MessageList</code> I get bunch of equal timestamps, referring to different time instants, meaning that the messages of <code>/clock</code> topic are correctly different the one from the other.</p> <hr /> <p><a href="https://answers.ros.org/question/410131/%5Bclosed%5D-every-once-in-a-while-consecutive-timestamps-are-equal-in-rosbag./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/125921/heisenasd/" rel="nofollow noreferrer">Heisenasd</a> on ROS Answers with karma: 13 on 2022-12-03</p> <p>Post score: 1</p>
[CLOSED] Every once in a while consecutive timestamps are equal in rosbag
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I asked the same question in the Official RTAB-Map Forum and the great matlabbe answered it.</p> <p><a href="http://official-rtab-map-forum.206.s1.nabble.com/Error-The-goal-sent-to-the-navfn-planner-is-off-the-global-costmap-td9216.html#a9226" rel="nofollow noreferrer">http://official-rtab-map-forum.206.s1.nabble.com/Error-The-goal-sent-to-the-navfn-planner-is-off-the-global-costmap-td9216.html#a9226</a></p> <p>Thank you very much, Mathieu!!!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/113638/donguri/" rel="nofollow noreferrer">donguri</a> with karma: 13 on 2022-12-05</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102790
2022-12-04T01:33:33.000
|ros|navigation|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I use RTABMAP and Navigation stack.</p> <p>When I specify more than 4m ahead in &quot;2D Nav Gaol&quot; in move_base, I get the following error message.</p> <pre><code>The goal sent to the navfn planner is off the global costmap. Planning will always fail to this goal. </code></pre> <p>I want to set a goal point at least 10m away, but the robot does not work. The robot will go 3m away without error.</p> <p>I have heard that I can fix it with the RTABMAP settings, but no matter what I look up I can't figure out how to set it up.</p> <p>Below is the launch file for RTABMAP.</p> <pre><code> &lt;launch&gt; &lt;!-- Choose visualization --&gt; &lt;arg name=&quot;rtabmapviz&quot; default=&quot;false&quot; /&gt; &lt;arg name=&quot;rviz&quot; default=&quot;true&quot; /&gt; &lt;!-- Localization-only mode --&gt; &lt;arg name=&quot;localization&quot; default=&quot;false&quot;/&gt; &lt;!-- Corresponding config files --&gt; &lt;arg name=&quot;rtabmapviz_cfg&quot; default=&quot;<span class="math-container">$(find rtabmap_ros)/launch/config/rgbd_gui.ini" /&gt; &lt;arg name="rviz_cfg" default="$</span>(find rtabmap_ros)/launch/config/rgbd.rviz&quot; /&gt; &lt;arg name=&quot;frame_id&quot; default=&quot;robot_center&quot;/&gt; &lt;arg name=&quot;odom_topic&quot; default=&quot;/t265/odom/sample&quot;/&gt; &lt;arg name=&quot;rgbd_sync&quot; default=&quot;true&quot;/&gt; &lt;arg name=&quot;approx_rgbd_sync&quot; default=&quot;false&quot;/&gt; &lt;arg name=&quot;visual_odometry&quot; default=&quot;false&quot;/&gt; &lt;!--&lt;arg name=&quot;approx_sync&quot; default=&quot;true&quot;/&gt;--&gt; &lt;arg name=&quot;rgb_topic&quot; default=&quot;/d400/color/image_raw&quot; /&gt; &lt;arg name=&quot;depth_topic&quot; default=&quot;/d400/aligned_depth_to_color/image_raw&quot; /&gt; &lt;arg name=&quot;camera_info_topic&quot; default=&quot;/d400/color/camera_info&quot; /&gt; &lt;param name=&quot;Mem/UseOdomGravity&quot; type=&quot;string&quot; value=&quot;true&quot;/&gt; &lt;param name=&quot;Optimizer/GravitySigma&quot; type=&quot;string&quot; value=&quot;0.3&quot;/&gt; &lt;param name=&quot;Vis/MaxDepth&quot; type=&quot;string&quot; value=&quot;3.5&quot;/&gt; &lt;param name=&quot;cloud_noise_filtering_radius&quot; value=&quot;0.1&quot;/&gt; &lt;param name=&quot;cloud_noise_filtering_min_neighbors&quot; value=&quot;2&quot;/&gt; &lt;!-- param name = &quot;proj_max_ground_height&quot; value = &quot;0.2&quot; / --&gt; &lt;include file=&quot;<span class="math-container">$(find rtabmap_ros)/launch/rtabmap.launch"&gt; &lt;arg name="rtabmapviz" value="$</span>(arg rtabmapviz)&quot; /&gt; &lt;arg name=&quot;rviz&quot; value=&quot;<span class="math-container">$(arg rviz)" /&gt; &lt;arg name="localization" value="$</span>(arg localization)&quot;/&gt; &lt;arg name=&quot;gui_cfg&quot; value=&quot;<span class="math-container">$(arg rtabmapviz_cfg)" /&gt; &lt;arg name="rviz_cfg" value="$</span>(arg rviz_cfg)&quot; /&gt; &lt;arg name=&quot;odom_topic&quot; value=&quot;<span class="math-container">$(arg odom_topic)"/&gt; &lt;arg name="frame_id" value="$</span>(arg frame_id)&quot;/&gt; &lt;arg name=&quot;rgbd_sync&quot; value=&quot;<span class="math-container">$(arg rgbd_sync)"/&gt; &lt;arg name="depth_topic" value="$</span>(arg depth_topic)&quot;/&gt; &lt;arg name=&quot;rgb_topic&quot; value=&quot;<span class="math-container">$(arg rgb_topic)"/&gt; &lt;arg name="camera_info_topic" value="$</span>(arg camera_info_topic)&quot;/&gt; &lt;arg name=&quot;approx_rgbd_sync&quot; value=&quot;<span class="math-container">$(arg approx_rgbd_sync)"/&gt; &lt;arg name="visual_odometry" value="$</span>(arg visual_odometry)&quot;/&gt; &lt;/include&gt; &lt;/launch&gt; </code></pre> <p>What should I add to which part to solve this problem?</p> <p>Is it possible that it is not the RTABMAP setting in the first place, but the Navigation stack setting?</p> <p>Thank you.</p> <hr /> <p><a href="https://answers.ros.org/question/410137/%5Brtabmap,-navigation,-noetic%5Derror:the-goal-sent-to-the-navfn-planner-is-off-the-global-costmap./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/113638/donguri/" rel="nofollow noreferrer">donguri</a> on ROS Answers with karma: 13 on 2022-12-04</p> <p>Post score: 0</p>
[RTABMAP, Navigation, Noetic]Error:The goal sent to the navfn planner is off the global costmap
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>To summarize the cause of the two issues, in case others come across this question in the future:</p> <ol> <li><code>ros2_control</code>/<code>gazebo</code> trying to load a controller multiple times</li> </ol> <p>This shouldn't happen, and in this case was caused by multiple launch files loading the controllers.</p> <ol start="2"> <li>&quot;Command interface with 'front_left_steering_joint/velocity' does not exist&quot;;</li> </ol> <p>Your controller is looking for a <code>velocity</code> <strong>control</strong> interface for joint <code>front_left_steering_joint</code>, but your <code>&lt;ros2_control&gt;</code> tag in your URDF is telling the <code>controller_manager</code> that your &quot;hardware&quot; only supports <code>position</code> control for this joint. The <code>diff_driver_controller</code> currently only supports <code>velocity</code> <em>commands</em> to the wheels, and accepts <code>position</code> or <code>velocity</code> state interfaces (you can take a look at the source <a href="https://github.com/ros-controls/ros2_controllers/blob/foxy/diff_drive_controller/src/diff_drive_controller.cpp#L115-L127" rel="nofollow noreferrer">here for reference</a>).</p> <pre><code>&lt;ros2_control name=&quot;GazeboSystem&quot; type=&quot;system&quot;&gt; &lt;hardware&gt; &lt;plugin&gt;gazebo_ros2_control/GazeboSystem&lt;/plugin&gt; &lt;/hardware&gt; &lt;joint name=&quot;front_left_steering_joint&quot;&gt; &lt;command_interface name=&quot;position&quot;/&gt; &lt;------------------- here &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;effort&quot;/&gt; &lt;/joint&gt; </code></pre> <p>Since this is a gazebo question, you can resolve this by simply changing <code>front_left</code>, <code>front_right</code>, <code>rear_left</code> and <code>rear_right</code> joints to be <code>velocity</code> controlled in the <code>&lt;ros2_control&gt;</code> block of your URDF.</p> <p>All that said, based on the naming convention you used, it sounds like you want those to be steerable joints. Perhaps you want to consider implementing an <code>Ackermann</code> controller or similar. The <code>ros2_controllers</code> repo has a <a href="https://github.com/ros-controls/ros2_controllers/tree/master/tricycle_controller" rel="nofollow noreferrer">tricycle_controller</a> which you may find to be a good starting point. Alternately, you could take a crack at porting either the ros1 <a href="https://github.com/ros-controls/ros_controllers/tree/noetic-devel/ackermann_steering_controller" rel="nofollow noreferrer">ackermann_controller</a> or this <a href="https://discourse.ros.org/t/independent-swerve-steering-controller-for-ros-control/21534/23" rel="nofollow noreferrer">swerve_steering_controller</a> to ros2.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/69938/shonigmann/" rel="nofollow noreferrer">shonigmann</a> with karma: 1567 on 2022-12-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-12-07</strong>:<br /> Thank you for your help, time and detailed explanation. I'll try to look tricycle_controller and ackermann_controller</p>
102792
2022-12-05T05:15:03.000
|ros|ros2|diff-drive-controller|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi. Sorry for all mistakes, English is not my native language. So I'm launching my gazebo simulation with JointStateBroadcaster and DiffDrive controllers. Gazebo loads without notable errors but then controllers start to load I receive following logs in terminal:</p> <pre><code>[gzserver-6] [INFO] [1670244707.718918444] [gazebo_ros2_control]: Loading controller_manager [gzserver-6] [WARN] [1670244707.830804032] [gazebo_ros2_control]: Desired controller update period (0.02 s) is slower than the gazebo simulation period (0.001 s). [gzserver-6] [INFO] [1670244707.831187703] [gazebo_ros2_control]: Loaded gazebo_ros2_control. [gzserver-6] [INFO] [1670244707.880241583] [controller_manager]: Loading controller 'minicar_cll' [gzserver-6] [INFO] [1670244707.969517659] [controller_manager]: Setting use_sim_time=True for minicar_cll to match controller manager (see ros2_control#325 for details) [spawner.py-3] [INFO] [1670244707.973501681] [spawner_minicar_cll]: Loaded minicar_cll [gzserver-6] [INFO] [1670244707.977437769] [controller_manager]: Configuring controller 'minicar_cll' [gzserver-6] [INFO] [1670244708.048451910] [controller_manager]: Loading controller 'joint_s_b' [gzserver-6] [INFO] [1670244708.178457173] [controller_manager]: Setting use_sim_time=True for joint_s_b to match controller manager (see ros2_control#325 for details) [spawner.py-5] [INFO] [1670244708.200924658] [spawner_joint_s_b]: Loaded joint_s_b [gzserver-6] [INFO] [1670244708.204831040] [controller_manager]: Loading controller 'joint_s_b' [gzserver-6] [ERROR] [1670244708.205196239] [controller_manager]: A controller named 'joint_s_b' was already loaded inside the controller manager [gzserver-6] [ERROR] [1670244708.226174298] [controller_manager]: Can't activate controller 'minicar_cll': Command interface with 'front_left_steering_joint/velocity' does not exist [spawner.py-3] [INFO] [1670244708.255965445] [spawner_minicar_cll]: Configured and started minicar_cll [gzserver-6] [INFO] [1670244708.262011951] [controller_manager]: Configuring controller 'joint_s_b' [ERROR] [spawner.py-2]: process has died [pid 5069, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_s_b --ros-args']. [INFO] [spawner.py-3]: process has finished cleanly [pid 5071] [spawner.py-5] [INFO] [1670244708.351449614] [spawner_joint_s_b]: Configured and started joint_s_b [INFO] [spawner.py-5]: process has finished cleanly [pid 5075] [INFO] [spawner.py-9]: process started with pid [5305] [gzclient-7] context mismatch in svga_surface_destroy [gzclient-7] context mismatch in svga_surface_destroy [spawner.py-9] [INFO] [1670244708.899426522] [spawner_minicar_cll]: Controller already loaded, skipping load_controller [gzserver-6] [INFO] [1670244708.902372504] [controller_manager]: Configuring controller 'minicar_cll' [gzserver-6] [ERROR] [1670244708.998457025] [controller_manager]: Can't activate controller 'minicar_cll': Command interface with 'front_left_steering_joint/velocity' does not exist [spawner.py-9] [INFO] [1670244709.020476614] [spawner_minicar_cll]: Configured and started minicar_cll </code></pre> <p>minicar_cll here is diff_drive controller.</p> <p>Here is yaml file with controllers settings:</p> <pre><code>controller_manager: ros__parameters: update_rate: 50 # Hz use_sim_time: True joint_s_b: type: joint_state_broadcaster/JointStateBroadcaster minicar_cll: type: diff_drive_controller/DiffDriveController minicar_cll: ros__parameters: left_wheel_names: ['front_left_wheel_joint', 'rear_left_wheel_joint', 'front_left_steering_joint', 'rear_left_steering_joint'] right_wheel_names: ['front_right_wheel_joint', 'rear_right_wheel_joint', 'front_right_steering_joint', 'rear_right_steering_joint'] publish_rate: 50.0 pose_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03] twist_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03] cmd_vel_timeout: 0.5 wheels_per_side: 1 preserve_turning_radius: true base_frame_id: rs_t265_pose_frame enable_odom_tf: false angular: steer: front_max_angle: 1.047 rear_max_angle: 0.0 </code></pre> <p>And that is transmission description:</p> <pre><code> &lt;transmission name=&quot;<span class="math-container">${wheel_prefix}_steering_trans" type="SimpleTransmission"&gt; &lt;type&gt;transmission_interface/SimpleTransmission&lt;/type&gt; &lt;actuator name="$</span>{wheel_prefix}_steering_motor&quot;&gt; &lt;hardwareInterface&gt;PositionJointInterface&lt;/hardwareInterface&gt; &lt;mechanicalReduction&gt;1&lt;/mechanicalReduction&gt; &lt;/actuator&gt; &lt;joint name=&quot;${wheel_prefix}_steering_joint&quot;&gt; &lt;hardwareInterface&gt;PositionJointInterface&lt;/hardwareInterface&gt; &lt;/joint&gt; &lt;/transmission&gt; &lt;transmission name=&quot;<span class="math-container">${wheel_prefix}_wheel_trans" type="SimpleTransmission"&gt; &lt;type&gt;transmission_interface/SimpleTransmission&lt;/type&gt; &lt;actuator name="$</span>{wheel_prefix}_wheel_motor&quot;&gt; &lt;mechanicalReduction&gt;1&lt;/mechanicalReduction&gt; &lt;/actuator&gt; &lt;joint name=&quot;${wheel_prefix}_wheel_joint&quot;&gt; &lt;hardwareInterface&gt;VelocityJointInterface&lt;/hardwareInterface&gt; &lt;/joint&gt; &lt;/transmission&gt; &lt;/xacro:macro&gt; </code></pre> <p>and ros2_control tag in robot description with gazebo plugin</p> <pre><code>&lt;ros2_control name=&quot;GazeboSystem&quot; type=&quot;system&quot;&gt; &lt;hardware&gt; &lt;plugin&gt;gazebo_ros2_control/GazeboSystem&lt;/plugin&gt; &lt;/hardware&gt; &lt;joint name=&quot;front_left_steering_joint&quot;&gt; &lt;command_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;effort&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;front_right_steering_joint&quot;&gt; &lt;command_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;effort&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;rear_left_steering_joint&quot;&gt; &lt;command_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;effort&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;rear_right_steering_joint&quot;&gt; &lt;command_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;effort&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;rear_right_wheel_joint&quot;&gt; &lt;command_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;effort&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;rear_left_wheel_joint&quot;&gt; &lt;command_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;effort&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;front_left_wheel_joint&quot;&gt; &lt;command_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;effort&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;front_right_wheel_joint&quot;&gt; &lt;command_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;effort&quot;/&gt; &lt;/joint&gt; &lt;/ros2_control&gt; &lt;gazebo&gt; &lt;plugin name=&quot;gazebo_ros2_control&quot; filename=&quot;libgazebo_ros2_control.so&quot;&gt; &lt;parameters&gt;$(find minicar_control)/config/control.yaml&lt;/parameters&gt; &lt;/plugin&gt; &lt;/gazebo&gt; </code></pre> <p>And my question is why is it trying to load JointStateBroadcaster several times and why is he complaining about &quot;Command interface with 'front_left_steering_joint/velocity' does not exist&quot;? Appreciate any help.</p> <p>UPD. Add full terminal output and launch files used to start gazebo simulation.</p> <p>Terminal:</p> <blockquote> <p>This code block was moved to the following github gist: <a href="https://gist.github.com/answers-se-migration-openrobotics/cccb826d947e62e554eb61c37050efc3" rel="nofollow noreferrer">https://gist.github.com/answers-se-migration-openrobotics/cccb826d947e62e554eb61c37050efc3</a></p> </blockquote> <p>launch file gazebo_world.launch.py:</p> <pre><code>import os import xacro from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource from launch.substitutions import PathJoinSubstitution from launch_ros.substitutions import FindPackageShare from launch_ros.actions import Node def generate_launch_description(): package_dir = os.path.join(get_package_share_directory('minicar_simulator')) controller_file = os.path.join(get_package_share_directory('minicar_control'), &quot;config&quot;, &quot;control.yaml&quot;) doc = os.path.join(package_dir, 'urdf', 'minicar.gazebo.xacro') xacro_file = xacro.parse(open(doc)) xacro.process_doc(xacro_file) robot_description = {&quot;robot_description&quot;: xacro_file.toxml()} world_file = PathJoinSubstitution( [FindPackageShare(&quot;minicar_simulator&quot;), &quot;worlds&quot;, &quot;test_walls.world&quot;], ) gazebo_launch = PathJoinSubstitution( [FindPackageShare(&quot;minicar_simulator&quot;), &quot;launch&quot;, &quot;gazebo.launch.py&quot;], ) node_controller_manager = Node( package=&quot;controller_manager&quot;, executable=&quot;ros2_control_node&quot;, parameters=[robot_description, controller_file], output={ &quot;stdout&quot;: &quot;screen&quot;, &quot;stderr&quot;: &quot;screen&quot;, }, ) spawn_controller = Node( package=&quot;controller_manager&quot;, executable=&quot;spawner.py&quot;, arguments=[&quot;joint_s_b&quot;], output=&quot;screen&quot;, ) spawn_diff_velocity_controller = Node( package=&quot;controller_manager&quot;, executable=&quot;spawner.py&quot;, arguments=[&quot;minicar_cll&quot;], output=&quot;screen&quot;, ) gazebo_sim = IncludeLaunchDescription( PythonLaunchDescriptionSource([gazebo_launch]), launch_arguments={'world_path': world_file}.items(), ) ld = LaunchDescription() ld.add_action(node_controller_manager) ld.add_action(spawn_controller) ld.add_action(spawn_diff_velocity_controller) ld.add_action(gazebo_sim) return ld </code></pre> <p>launch file gazebo.launch.py:</p> <pre><code>import os import xacro from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, ExecuteProcess, RegisterEventHandler from launch.event_handlers import OnProcessExit from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node from ament_index_python.packages import get_package_share_directory ARGUMENTS = [ DeclareLaunchArgument('world_path', default_value='', description='The world path, by default is empty.world'), DeclareLaunchArgument('verbose', default_value='true', description='Set &quot;true&quot; to increase messages written to terminal.'), ] def generate_launch_description(): # Launch args world_path = LaunchConfiguration('world_path') verbose = 'true' package_dir = os.path.join(get_package_share_directory('minicar_simulator')) doc = os.path.join(package_dir, 'urdf', 'minicar.gazebo.xacro') xacro_file = xacro.parse(open(doc)) xacro.process_doc(xacro_file) robot_description = {&quot;robot_description&quot;: xacro_file.toxml()} spawn_diff_velocity_controller = Node( package='controller_manager', executable='spawner.py', arguments=['minicar_cll', '-c', '/controller_manager'], output='screen', ) node_robot_state_publisher = Node( package=&quot;robot_state_publisher&quot;, executable=&quot;robot_state_publisher&quot;, output=&quot;screen&quot;, parameters=[{'use_sim_time': True}, robot_description], ) spawn_joint_state_broadcaster = Node( package='controller_manager', executable='spawner.py', arguments=['joint_s_b', '-c', '/controller_manager'], output='screen', ) diffdrive_controller_spawn_callback = RegisterEventHandler( event_handler=OnProcessExit( target_action=spawn_joint_state_broadcaster, on_exit=[spawn_diff_velocity_controller], ) ) gzserver = ExecuteProcess( cmd=['gzserver', '-s', 'libgazebo_ros_init.so', '-s', 'libgazebo_ros_factory.so', world_path, verbose], output='screen', ) # Gazebo client gzclient = ExecuteProcess( cmd=['gzclient'], output='screen', ) # Spawn robot spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py', arguments=['-topic', 'robot_description', '-x', '-3.0', '-y', '-1.5', '-z', '2.719', '-entity', 'minicar'], output='screen') ld = LaunchDescription(ARGUMENTS) ld.add_action(node_robot_state_publisher) ld.add_action(spawn_joint_state_broadcaster) ld.add_action(diffdrive_controller_spawn_callback) ld.add_action(gzserver) ld.add_action(gzclient) ld.add_action(spawn_entity) return ld </code></pre> <p>I was told not to add full URDF description, so sorry for inconvenience, but I already double check my robot description and I didn't find any problem with it.</p> <hr /> <p><a href="https://answers.ros.org/question/410159/problems-with-loading-and-configurating-diffdrive-and-jointstatebroadcaster-controllers./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on ROS Answers with karma: 95 on 2022-12-05</p> <p>Post score: 0</p>
Problems with loading and configurating DiffDrive and JointStateBroadcaster controllers
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I had a very similar issue with the point cloud from the ZED2i on a Jetson AGX, and I resolved it by switching to Cyclone DDS. It's important to note that the configuration of Cyclone DDS needs to be implemented identically on both machines. I hope this information is helpful to you.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/103088/angcorcue2/" rel="nofollow noreferrer">angcorcue2</a> with karma: 61 on 2023-05-16</p> <p>This answer was <strong>NOT ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
102794
2022-12-05T17:15:25.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, I have a problem regarding the depth computed using the Zed2i stereo camera on a jetson Nano on Ubuntu 20.04 with ROS noetic. I am using <a href="https://github.com/stereolabs/zed-ros-wrapper" rel="nofollow noreferrer">zed_ros_wrapper</a> to connect the zed to ROS noetic.</p> <p>By launching the file zed2i.launch to use the camera I get about 2fps for the depth images using quality=performance (the lowest setting) when looking at the images in another computer.</p> <p>Some details:</p> <ul> <li>the problem starts in the exact moment I subscribe to the depth topic using Rviz or rostopic, I guess this is when the Zed starts computing the depth.</li> <li>By using zed depth viewer, so without using ROS, I get about 30fps with depth quality set to ultra.</li> <li>When visualizing using rostopic hz the rate of the depth on the Jetson Nano I get about 13 fps</li> <li>When visualizing using rostopic hz the rate of the same depth topic on another computer I get 2 fps</li> <li>When visualizing multiple normal image topics on another computer the visualization is smooth: about 15-20 fps</li> </ul> <p>I already tried subscribing to the compressed topics but nothing changed.</p> <p>The strange thing is that it does not seem to be a computational issue because the Nano achieve 15 fps on its terminal, and it should not be a communication issue since with normal images I get an high rate on the receiving PC.</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16702781679949722.png" alt="image description" /></p> <p>Environment:</p> <ul> <li>Jetson Nano</li> <li>Ubuntu 20.04</li> <li>ROS noetic</li> <li>CUDA 10.2</li> <li>Jetpack 4.6-b197</li> </ul> <hr /> <p><a href="https://answers.ros.org/question/410186/zed2i-depth-framerate-really-slow-when-subscribing-from-other-machine/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/94489/alessioparmeggiani/" rel="nofollow noreferrer">AlessioParmeggiani</a> on ROS Answers with karma: 165 on 2022-12-05</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/79869/per-edwardsson/" rel="nofollow noreferrer">Per Edwardsson</a> on 2022-12-09</strong>:<br /> The data is sent completely uncompressed over the network, unless you have very wide bandwidth in your LAN there will always be throttling that looks like that. Use <code>rostopic bw</code> to figure out if the network is being throttled. Personally, I have tons of problems of this type with any non-trivial data, so if you figure something good out I'm very interested. In particular, what image topics are you <code>hz</code>ing? I also use Zed cameras.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/94489/alessioparmeggiani/" rel="nofollow noreferrer">AlessioParmeggiani</a> on 2022-12-13</strong>:<br /> Hi @Per Edwardsson, thanks for the answer. Since I can't use the jetson and the zed at the moment, I can't test the command you suggested, when I test it I'll let you know the results.</p> <p>Your intuition about the network problem could be right, but I also tested the compressed depth that wa sent by the zed and the issue persisted. So maybe the /zed2i/depth_registered/compressedDepth topic was not being compressed in the correct way. Whenever I can use the zed again I'll test this with <code>rostopic bw</code>. Maybe I could also verify if by compressing in a custom way the depth I can reduce the problem.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/79869/per-edwardsson/" rel="nofollow noreferrer">Per Edwardsson</a> on 2022-12-13</strong>:<br /> Sounds good. The compressed topics haven't worked for me for a good while (I'm on ROS2), so I have yet to view images coming through the ROS network. If you manage to send data through custom compression, feel free to comment to me as I'm curious about that. Thanks.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/94489/alessioparmeggiani/" rel="nofollow noreferrer">AlessioParmeggiani</a> on 2022-12-13</strong>:<br /> Yes, I'll let you know if I discover something interesting. I am using ROS 1 (noetic) by the way so something could not apply in your case</p> <p><strong>Comment by <a href="https://answers.ros.org/users/94489/alessioparmeggiani/" rel="nofollow noreferrer">AlessioParmeggiani</a> on 2022-12-15</strong>:<br /> @Per Edwardsson I found something interesting by using rostopic bw.</p> <pre><code>rostopic bw /zed2i/zed_node/depth/depth_registered=1.8MB/s rostopic hz /zed2i/zed_node/depth/depth_registered=0.4-0.8Hz rostopic bw .../depth/depth_registered/compressedDepth=200KB/s rostopic hz .../depth/depth_registered/compressedDepth=1.2Hz rostopic bw .../left/image_rect_color=2.3MB/s rostopic hz .../left/image_rect_color=2.2Hz rostopic bw .../left/image_rect_color/compressed=500-600KB/s rostopic hz .../left/image_rect_color/compressed=12Hz </code></pre> <p>It seems that the problem is not the bandwidth, in fact the rgb image use a higher bandwidth than the depth but is received at a higher rate. Moreover on the depth the compressed version weighs around 9 times less (1.8Mb against 200KB) but the rate it's only 1.5-3 times bigger.</p> <p>All the commands have been executed on a different machine than the jetson nano, on the nano I get 15 hz for eveery topic.</p>
Zed2i depth framerate really slow when subscribing from other machine
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Got it working. Probably, some conflict between different installations of pyqt5. I just typed</p> <blockquote> <p>pip uninstall pyqt5</p> </blockquote> <p>on command line.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/111100/vocdex/" rel="nofollow noreferrer">vocdex</a> with karma: 21 on 2022-12-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102797
2022-12-07T02:45:27.000
|ros|rqt|rqt-bag|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>When I run any rqt related command( rqt_bag, rqt_image_view), I get the following error:</p> <blockquote> </blockquote> <p>PluginManager._discover() force discovery of plugins RospkgPluginProvider._find_plugins() crawling for plugins of type 'qt_gui' Segmentation fault (core dumped)</p> <p>I re-installed ros-noetic and the issue didn't go away. Default python version is 3.8.10. I guess I manually removed previous python 2.7 due to some CUDA issue. Would appreciate any suggestions and help. Thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/410244/rqt-plugins-not-working-after-possible-change-in-python-version/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/111100/vocdex/" rel="nofollow noreferrer">vocdex</a> on ROS Answers with karma: 21 on 2022-12-07</p> <p>Post score: 0</p>
rqt plugins not working after possible change in python version
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This is a python2 vs. python3 mismatch. My guess that you are invoking the python2 interpreter, which is not supported by noetic.</p> <p>One small step to avoiding these kind of issues to make sure that /usr/bin/python is a symlink to python3, not python2.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/115712/chased11/" rel="nofollow noreferrer">chased11</a> on 2022-12-12</strong>:<br /> Yep that was the problem/ Fix was starting the scripts with #! /usr/bin/python3. The package I installed was using python 2.</p>
102799
2022-12-07T15:22:26.000
|ros|gps|catkin|python3|tcpros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am converting the <a href="https://github.com/MrCerealKiller/ros-trimble-bd960" rel="nofollow noreferrer">ros-trimble-bd960</a> package to read from a socket rather than serial port. I thought this was pretty straight forward as they read the same type of data but I just needed to change a few things in the code. I can upload what i have to a github repo if needed. I have tested the socket stream away from ROS and had no problems. I know this error is apparently something wrong with my python setup but would like some direction. Running both launch files gives the same error:</p> <pre><code>Traceback (most recent call last): File &quot;/home/user/catkin_ws/src/ros-trimble-bd960/scripts/gps.py&quot;, line 3, in &lt;module&gt; import rospy File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/__init__.py&quot;, line 49, in &lt;module&gt; from .client import spin, myargv, init_node, \ File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/client.py&quot;, line 60, in &lt;module&gt; import rospy.impl.init File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/init.py&quot;, line 54, in &lt;module&gt; from .tcpros import init_tcpros File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros.py&quot;, line 45, in &lt;module&gt; import rospy.impl.tcpros_service File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py&quot;, line 54, in &lt;module&gt; from rospy.impl.tcpros_base import TCPROSTransport, TCPROSTransportProtocol, \ File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py&quot;, line 167 (e_errno, msg, *_) = e.args ^ SyntaxError: invalid syntax [gps-2] process has died [pid 13458, exit code 1, cmd /home/chase/catkin_ws/src/ros-trimble-bd960/scripts/gps.py __name:=gps __log:=/home/user/.ros/log/4dde074c-766b-11ed-978b-f7fbe9041b00/gps-2.log]. log file: /home/chase/.ros/log/4dde074c-766b-11ed-978b-f7fbe9041b00/gps-2*.log </code></pre> <hr /> <p><a href="https://answers.ros.org/question/410277/any-ideas-what-could-be-causing-this-error-from-a-launch-file?---tcpros/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/115712/chased11/" rel="nofollow noreferrer">chased11</a> on ROS Answers with karma: 137 on 2022-12-07</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2022-12-11</strong>:<br /> Which Ubuntu do you have? If 20.04, you can install <code>python-is-python3</code> package to use Python 3.x as default one</p>
Any Ideas what could be causing this error from a launch file? - TCPROS
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>As far as I know, <code>catkin_make</code> does not support <strong>nested</strong> ros packages. But you can put multiple ros-packages in a single directory (i.e. side-by-side, like your ros_actions/.) That top-level directory does not need a CMakeLists.txt file, as catkin_make should discover the ros-packages on its own.</p> <p>If you change your catkin_ws/src/ directory structure, make sure you do a clean build by deleting catkin_ws/build/ and catkin_ws/devel/ directories.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-12</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102801
2022-12-07T18:19:02.000
|ros|add-dependencies|packages|dependencies|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am new to ROS so apologies if it is obvious. I have multiple ROS packages and currently I use them by linking them to my catkin workspace using symbolic links. What I want to do now is use one CMakeList to call and build the required ROS packages. I have different ROS actions stored as packages in a folder and I link the main folder to the workspace and I can build it. I can even link each ROS action directory separately and build it. But when I use add_subdirectory in the main cmake file I want to call, it gives me an error that catkin should be listed as a buildtool dependency in package.xml, which it is.</p> <p>My current folder structure looks like this</p> <pre><code>catkin_ws --build --devel --logs --src --ros_actions --action1 --include --src --CMakeLists.txt --package.xml --action2 --include --src --CMakeLists.txt --package.xml --main_file --config --launch --include --src --CMakeLists.txt --package.xml </code></pre> <p>and I want to have something like</p> <pre><code>catkin_ws --build --devel --logs --src --main_file --actions --action1 --include --src --CMakeLists.txt --package.xml --action2 --include --src --CMakeLists.txt --package.xml --config --launch --include --src --CMakeLists.txt --package.xml </code></pre> <p>I did try adding &quot;ros_actions&quot; in the CMakelist <code>include_directories</code> and <code>find_package</code> functions but failed. Is there a way to add a custom ROS package as a dependency to another?</p> <p>Thank you in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/410286/adding-a-custom-ros-package-as-dependency-to-another-ros-package/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/126388/a_j/" rel="nofollow noreferrer">A_J</a> on ROS Answers with karma: 13 on 2022-12-07</p> <p>Post score: 0</p>
Adding a custom ROS package as dependency to another ROS package
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Based on what you have said, I would not use <code>move_base</code> for this task. The robot movement will be ugly, and it will be constantly starting and stopping as the goal changes its position.</p> <p>If it were me, I'd create a custom ros node &quot;motion controller&quot;. It's job is to receive a goal distance and angle, then publish Twist messages to the /cmd_vel topic to move the robot closer to the (always changing) goal. The Twist velocity value should change smoothly (both up and down), and should be a function of the distance to the goal (or obstacle.)</p> <p>A basic controller like this one will have no ability to navigate <em>around</em> an obstacle (that's a MUCH harder problem), but the robot can smoothly stop and wait for an obstacle to move out of the way. Detecting whether there is sufficient free space for the robot to move forward safely (collision detect) is also required for a controller like this one.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-14</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on 2022-12-28</strong>:<br /> Thank you so much for your advice! As I need the robot that has ability to navigate around an obstacle, I think I have no choice but to use the move_base package for this task.. Thank you so much!</p>
102803
2022-12-08T04:12:11.000
|ros|navigation|move-base|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I'm newbie to this field and I'd like to use the move_base package for the navigation of robot to track people.</p> <p>However, as the move_base package is using action, not a topic, (I think) it is unable to get constantly changing navigation goals.</p> <p>In this case, how can I utilize this package?</p> <p>Thanks in advance ! :)</p> <hr /> <p><a href="https://answers.ros.org/question/410298/navigation-move_base-action-package-with-constantly-changing-goal./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on ROS Answers with karma: 21 on 2022-12-08</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-12-10</strong>:<br /> I do not understand what question you are asking. <code>move_base</code> is designed to move the robot to a destination goal on a map. It's not going to work well for the task of &quot;continuous&quot; tracking/following of an object.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on 2022-12-12</strong>:<br /> Thank you for the reply :) Since I need to use the navigation package in ros for tracking the continuously moving object, would you please recommend me if there is a better way for this task??</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-12-13</strong>:<br /> With move_base, if you have a new goal, you can send it before the robot reaches the current goal. However, the robot will pause while it calculates a path to the new goal, so the robot is probably not going to move smoothly.</p> <p>What sensor(s) are you using to find the target? Do you have distance and angle to the target from the robot's current pose? Do you need collision avoidance?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on 2022-12-13</strong>:<br /> Thank you for the explanation! I use a tracking vision AI to find the target given input video from camera. After the target is detected, it can measure the distance and angle to the target from the robot's current pose by LiDAR sensor. And yes, it need collision avoidance.</p>
navigation move_base action package with constantly changing goal
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Thanks for your kind attention. Here I actually have defined the <code>laser_sensor</code> as the desired LiDAR in <code>~/.bashrc</code>, so it should be okay. Finally I found that the reason for this problem is that another guy who previously borrowed my robot created a new workspace, which contains a package with the same name as mine, even the launch file inside. And when I input <code>roslaunch [package_name] [launch_file_name]</code>, somehow it is his launch file that is executed by default. I think maybe <code>roslaunch [launch_file_path]</code> is more reliable. What a coincidence! Thank you again for your reply!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/101146/rockandros/" rel="nofollow noreferrer">RockAndROS</a> with karma: 16 on 2022-12-12</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102805
2022-12-09T12:10:59.000
|navigation|ros-kinetic|amcl|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi guys. I'm trying to use a rplidar to run amcl navigation with my pre-built map on Turtlebot2, ROS Kinetic. Below is my amcl launch file:</p> <pre><code>&lt;launch&gt; &lt;!-- Define laser type--&gt; &lt;arg name=&quot;laser_sensor&quot; default=&quot;$(env TURTLEBOT_LASER_SENSOR)&quot; /&gt; &lt;!-- &lt;arg name=&quot;laser_sensor&quot; default=&quot;rplidar&quot; /&gt; --&gt; &lt;!-- laser driver --&gt; &lt;include file=&quot;<span class="math-container">$(find turtlebot_navigation)/laser/driver/$</span>(arg laser_sensor)_laser.launch&quot; /&gt; &lt;!-- Map server --&gt; &lt;arg name=&quot;map_file&quot; default=&quot;<span class="math-container">$(env TURTLEBOT_MAP_FILE)"/&gt; &lt;node name="map_server" pkg="map_server" type="map_server" args="$</span>(arg map_file)&quot; /&gt; &lt;!-- AMCL --&gt; &lt;arg name=&quot;custom_amcl_launch_file&quot; default=&quot;<span class="math-container">$(find turtlebot_navigation)/launch/includes/amcl/$</span>(arg laser_sensor)_amcl.launch.xml&quot;/&gt; &lt;arg name=&quot;initial_pose_x&quot; default=&quot;0.0&quot;/&gt; &lt;!-- Use 17.0 for willow's map in simulation --&gt; &lt;arg name=&quot;initial_pose_y&quot; default=&quot;0.0&quot;/&gt; &lt;!-- Use 17.0 for willow's map in simulation --&gt; &lt;arg name=&quot;initial_pose_a&quot; default=&quot;0.0&quot;/&gt; &lt;include file=&quot;<span class="math-container">$(arg custom_amcl_launch_file)"&gt; &lt;arg name="initial_pose_x" value="$</span>(arg initial_pose_x)&quot;/&gt; &lt;arg name=&quot;initial_pose_y&quot; value=&quot;<span class="math-container">$(arg initial_pose_y)"/&gt; &lt;arg name="initial_pose_a" value="$</span>(arg initial_pose_a)&quot;/&gt; &lt;/include&gt; &lt;!-- Move base --&gt; &lt;arg name=&quot;custom_param_file&quot; default=&quot;<span class="math-container">$(find turtlebot_navigation)/param/$</span>(arg laser_sensor)_costmap_params.yaml&quot;/&gt; &lt;include file=&quot;<span class="math-container">$(find turtlebot_navigation)/launch/includes/rplidar_move_base.launch.xml"&gt; &lt;arg name="custom_param_file" value="$</span>(arg custom_param_file)&quot;/&gt; &lt;/include&gt; &lt;/launch&gt; </code></pre> <p>where the &quot;laser_sensor&quot; is rplidar. But the weird thing is that when I ran this launch file, the <code>/scan</code> topic came from a camera node rather than the pre-defined rplidar node. <a href="https://imgur.com/a/Zn28F85" rel="nofollow noreferrer">Here</a> is the rqt_graph. I have no idea why this happened. I don't even equip the turtlebot2 with a camera. Could someone explain how to fix it? I really appreciate your help!</p> <hr /> <p><a href="https://answers.ros.org/question/410342//scan-topic-comes-from-a-camera-node-rather-than-the-desired-lidar-node/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/101146/rockandros/" rel="nofollow noreferrer">RockAndROS</a> on ROS Answers with karma: 16 on 2022-12-09</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-12-10</strong>:<br /> Why is line 4 commented out? This will make all the <code>$(arg laser_sensor)</code> vars expand to an empty string.</p>
/scan topic comes from a camera node rather than the desired LiDAR node
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You can find the logs in the terminal, in which you launched the controller manager.</p> <p>So in case of the ign_ros2_control repository (<a href="https://github.com/ros-controls/gz_ros2_control" rel="nofollow noreferrer">https://github.com/ros-controls/gz_ros2_control</a>), if you launch the demo &quot;cart_example_position.launch.py&quot; for example, the controller manager logs will be in the terminal, where you launched this demo.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/133879/jariba/" rel="nofollow noreferrer">Jariba</a> with karma: 26 on 2023-01-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/136181/jonst/" rel="nofollow noreferrer">jonst</a> on 2023-02-01</strong>:<br /> Same problem here - looked in recommended location but did not find a log, is there a filename pattern or extension I can search for (e.g. .log)?</p> <p>Also is there some way to get the verbose output to the terminal instead of just to log?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/14356/luczia/" rel="nofollow noreferrer">Luczia</a> on 2023-05-31</strong>:<br /> Yeah, it is pretty subtle as the logs are sometimes just one line, but the terminal with which I launched the controller_manager has a a &quot;log&quot; info, usually starting with :</p> <p>[ERROR] [1685575141.283231272] [controller_manager]:</p>
102807
2022-12-12T04:53:55.000
|ros|ros2|controller-manager|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I'am trying to use ros2 controllers on gazebo, yet without sucess.</p> <p>When launching the joint_trajectory_controller :</p> <pre><code>ros2 control load_controller --set-state active joint_trajectory_controller </code></pre> <p>I have an error :</p> <pre><code>[ros2-2] Error loading controller, check controller_manager logs [ERROR] [ros2-2]: process has died [pid 30159, exit code 1, cmd 'ros2 control load_controller --set-state active joint_trajectory_controller']. </code></pre> <p>Do you know where I can find the &quot;controller_manager&quot; logs on ros2 humble?</p> <p>Error loading controller, check controller_manager logs</p> <hr /> <p><a href="https://answers.ros.org/question/410400/where-are-the-controller_manager-logs/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/14356/luczia/" rel="nofollow noreferrer">Luczia</a> on ROS Answers with karma: 3 on 2022-12-12</p> <p>Post score: 0</p>
Where are the controller_manager logs
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Searching for <code>lifecycle</code> on <code>docs.ros.org</code> leads to <a href="https://docs.ros.org/en/humble/Tutorials/Demos/Managed-Nodes.html" rel="nofollow noreferrer">Managing nodes with managed lifecycles</a>, which points to <a href="https://github.com/ros2/demos/tree/humble/lifecycle" rel="nofollow noreferrer">ros2/demos/humble/lifecycle</a>.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2022-12-12</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/79869/per-edwardsson/" rel="nofollow noreferrer">Per Edwardsson</a> on 2022-12-12</strong>:<br /> That's a good place to end, thanks for providing the link. For the record, when I searched for <code>lifecycle</code> on <code>docs.ros.org</code> I mainly got links to change logs and release posts. It's there, but I hope you agree that this is not particularly ergonomic. A link from the GitHub readme would not be too much, I think.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-12-12</strong>:<br /> Sure.</p> <p>I would suggest you post this as an issue on the <code>rclcpp</code> repository's tracker.</p> <p>It's not going to have good visibility as a comment / question on ROS Answers.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-12-13</strong>:<br /> Looks like you did that: <a href="https://github.com/ros2/rclcpp/issues/2064" rel="nofollow noreferrer">ros2/rclcpp#2064</a>.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/79869/per-edwardsson/" rel="nofollow noreferrer">Per Edwardsson</a> on 2022-12-13</strong>:<br /> Yep! Thanks for guidance. </p>
102809
2022-12-12T06:36:59.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The implementation of my next node fits well with the LifecycleNode pattern, so I thought I would implement one using it. I go to the rclcpp GitHub page and ask myself, what do I need to inherit from the LifecycleNode and perform all transitions properly? The GitHub page refers me to the API page (<a href="https://docs.ros2.org/latest/api/rclcpp_lifecycle/" rel="nofollow noreferrer">https://docs.ros2.org/latest/api/rclcpp_lifecycle/</a>). It looks a lot like an API page, not a tutorial page. Maybe I am not good enough at reading API's, but I sure could not figure out how to make a LifecycleNode based on looking around the API.</p> <p>I am also referred to the design documents, which do give an idea of what the rclcpp implementation needs, but not necessarily what I as a user need.</p> <p>I am also referred to the quality declaration, where rclcpp_lifecycle intends to be a Quality Level 1 category, which includes all <em>kinds</em> of documentation.</p> <p>Is there a decent guide or example available that I just missed?</p> <hr /> <p><a href="https://answers.ros.org/question/410405/how-am-i-supposed-to-make-a-lifecyclenode-in-rclcpp?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/79869/per-edwardsson/" rel="nofollow noreferrer">Per Edwardsson</a> on ROS Answers with karma: 501 on 2022-12-12</p> <p>Post score: 0</p>
How am I supposed to make a LifecycleNode in rclcpp?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>These parameters are used for the occupancy grid.</p> <pre><code>rtabmap --params | grep Cluster Param: Grid/ClusterRadius = &quot;0.1&quot; [[Grid/NormalsSegmentation=true] Cluster maximum radius.] Param: Grid/MinClusterSize = &quot;10&quot; [[Grid/NormalsSegmentation=true] Minimum cluster size to project the points.] </code></pre> <p>They are used when <code>Grid/NormalsSegmentation=true</code>:</p> <pre><code>rtabmap --params | grep Grid/NormalsSegmentation Param: Grid/NormalsSegmentation = &quot;true&quot; [Segment ground from obstacles using point normals, otherwise a fast passthrough is used.] </code></pre> <p>Then to know more about this approach, look at the code here: <a href="https://github.com/introlab/rtabmap/blob/a4761ad397ce195c254f65be10f7e8e2810facd0/corelib/include/rtabmap/core/impl/util3d_mapping.hpp#L54" rel="nofollow noreferrer">https://github.com/introlab/rtabmap/blob/a4761ad397ce195c254f65be10f7e8e2810facd0/corelib/include/rtabmap/core/impl/util3d_mapping.hpp#L54</a></p> <p>So specifically for your question, the cluster parameters are used to cluster the point clouds into multiple surfaces. This can also filter some noise.</p> <p>Some examples of results:</p> <ul> <li><p><a href="http://wiki.ros.org/rtabmap_ros#rtabmap_ros.2Fobstacles_detection" rel="nofollow noreferrer">http://wiki.ros.org/rtabmap_ros#rtabmap_ros.2Fobstacles_detection</a></p> </li> <li><p><a href="http://wiki.ros.org/rtabmap_ros/Tutorials/StereoOutdoorNavigation#Global_costmap" rel="nofollow noreferrer">http://wiki.ros.org/rtabmap_ros/Tutorials/StereoOutdoorNavigation#Global_costmap</a></p> </li> <li><p><a href="http://official-rtab-map-forum.206.s1.nabble.com/Proj-map-min-obstacles-height-tp2866p2918.html" rel="nofollow noreferrer">http://official-rtab-map-forum.206.s1.nabble.com/Proj-map-min-obstacles-height-tp2866p2918.html</a></p> </li> <li><p><a href="https://github.com/introlab/rtabmap_ros/issues/304#issuecomment-484716536" rel="nofollow noreferrer">https://github.com/introlab/rtabmap_ros/issues/304#issuecomment-484716536</a></p> </li> <li><p>&quot;RTAB-Map as an open-source lidar and visual simultaneous localization and mapping library for large-scale and long-term online operation&quot; <a href="https://introlab.3it.usherbrooke.ca/mediawiki-introlab/images/7/7a/Labbe18JFR_preprint.pdf" rel="nofollow noreferrer">https://introlab.3it.usherbrooke.ca/mediawiki-introlab/images/7/7a/Labbe18JFR_preprint.pdf</a> (fig. 14 d, i)</p> </li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> with karma: 6409 on 2022-12-13</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 3</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/126980/sopesa/" rel="nofollow noreferrer">sopesa</a> on 2022-12-13</strong>:<br /> Ah okay, I think I get it now. Thank you!</p>
102811
2022-12-12T14:11:14.000
|slam|navigation|3d-slam|rtabmap|rtab|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I saw parameters related to cluster inside RTAB-Maps configuration ClusterRadius and MinClusterSize but their is absolutely no documentation that describes what these values are and how they should be configured. Their definitions are vague and useless as well. I kind of found out they are related to the grid cell size but not sure what this relation is.</p> <p>So my question is what do these parameters do exactly and how they should be configured?</p> <hr /> <p><a href="https://answers.ros.org/question/410427/what-is-a-cluster-in-rtab-map?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/126980/sopesa/" rel="nofollow noreferrer">sopesa</a> on ROS Answers with karma: 13 on 2022-12-12</p> <p>Post score: 1</p>
What is a cluster in RTAB-Map?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The documentation for the transform, and pose conventions I was looking for can be found here: <a href="http://wiki.ros.org/tf/Overview/Transformations" rel="nofollow noreferrer">http://wiki.ros.org/tf/Overview/Transformations</a><br /> tl;dr:</p> <blockquote> <p>To represent the pose of an object in the map, I'm not sure what convention is used. i.e.. if the data should be in the frame of object (camera, robot,etc..) or in the frame of the map.</p> </blockquote> <p>For the frame_id of an object <code>map</code>, the data should be in the coordinates of the <code>map</code>, opposite to CV/SLAM convention where a <code>pose</code> of a camera is the coordinates of a <code>map</code> in the frame of the camera.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/33199/pointsnadpixels/" rel="nofollow noreferrer">pointsnadpixels</a> with karma: 23 on 2022-12-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102813
2022-12-13T06:48:02.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, I keep getting confused with this every once in a while, and I can't find a definite resource for the convention. The frame id is supposed to be: <code>#Frame this data is associated with</code></p> <p>To represent the pose of an object in the map, I'm not sure what convention is used. i.e.. if the data should be in the frame of object (camera, robot,etc..) or in the frame of the map. In CV, SLAM literature, the 'pose' represented by a Rotation (R), and translation (t) is usually in the frame of the camera,<br /> i.e. <code>R</code> contains the coordinates of the bases of the <code>map</code> frame in the <code>Camera</code> frame, and <code>t</code> is the translation in the Camera frame, or <code>X_camera = R*X_map + t</code> where <code>X_map</code> is a point in the <code>map</code> frame, and <code>X_camera</code> the same point in the camera frame.</p> <p>From what I understand, it seems like the the <code>frame_id</code> should be <code>Camera</code> for orientation <code>R</code> (in quaternion) and position (<code>t</code>), and <code>map</code> for orientation <code>inv(R)</code> (in quat) and position <code>-inv(R)*t</code>, but I've lost count of the number of times I've gotten confused with this. Would appreciate it if you could point me to some documentation on this convention.</p> <hr /> <p><a href="https://answers.ros.org/question/410471/question-on-ros-frame-convention/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/33199/pointsnadpixels/" rel="nofollow noreferrer">pointsnadpixels</a> on ROS Answers with karma: 23 on 2022-12-13</p> <p>Post score: 1</p>
Question on ROS frame convention
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>So I figured out it was my dumb mistake<br /> I was following <a href="https://docs.docker.com/engine/install/linux-postinstall/" rel="nofollow noreferrer">these</a> instructions, but, apparently, I somehow skipped step (3) and didn't activate group changes. Now when I did, everything seems to work</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/55027/akim/" rel="nofollow noreferrer">akim</a> with karma: 11 on 2022-12-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102816
2022-12-13T10:30:03.000
|ros|communication|docker|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi!<br /> I would like to know how to set up connection between ROS in Docker with ROS on host PC correctly.<br /> Following some answers like these <a href="https://answers.ros.org/question/318939/communication-between-docker-and-host/" rel="nofollow noreferrer">[1]</a><a href="https://stackoverflow.com/questions/70466371/running-ros-in-docker-container-and-echo-pub-from-another-docker-container-withi">[2]</a> I can understand that connecting container to host network and exporting proper environmental variables should be enough.<br /> However, when I try pub/echo between container and host PC, I get no response</p> <p>Here is how I start everything:<br /> On host PC I have the following in my .bashrc:</p> <blockquote> <p>ROS_HOSTNAME=192.168.1.1<br /> ROS_MASTER_URI=http://192.168.1.1:11311/<br /> ROS_IP=192.168.1.1</p> </blockquote> <p>Then I start <code>roscore</code> in the first terminal. In the second terminal I run:<br /> <code>docker run --net=host --name ros-test -it --rm osrf/ros:noetic-desktop</code></p> <p>And in the resulting second terminal I export the same environmental variables as shown above. Then I inspect available topics with <code>rostopic list</code> and can see default topics when roscore in running:</p> <blockquote> <p>/rosout<br /> /rosout_agg</p> </blockquote> <p>Then in the third terminal from host PC I try simple publish command:<br /> <code>rostopic pub -r 1 /test std_msgs/String &quot;halo&quot;</code></p> <p>Then try to receive messages in the container which is the second terminal: <code>rostopic echo /test</code> I expect to receive messages, but there is nothing coming. When I do <code>rostopic hz /test</code>, it says &quot;no new messages&quot;<br /> When I check <code>rostopic info /test</code> from fourth terminal I get the folllowing:</p> <blockquote> <p>Type: std_msgs/String<br /> Publishers:</p> </blockquote> <ul> <li>/rostopic_178825_1670943581897 (http://risc-SYS-5049A-TR:33815/)<br /> Subscribers:</li> <li>/rostopic_111_1670945011845 (http://docker-desktop:57739/)</li> </ul> <p>With publisher being my third terminal and subscriber being my second terminal which is container</p> <p>Is there something wrong with how I am doing things? Please advise or help</p> <hr /> <p><a href="https://answers.ros.org/question/410484/ros-in-docker:-messaging-with-host-pc/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/55027/akim/" rel="nofollow noreferrer">akim</a> on ROS Answers with karma: 11 on 2022-12-13</p> <p>Post score: 1</p>
ROS in Docker: messaging with host PC
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>If you set <code>Vis/CorType=0</code>, feature matching will be done. In the paper, we compared <code>Odom/Strategy=0</code> (F2M)+<code>Vis/CorType=0</code> (Feature matching) with <code>Odom/Strategy=1</code> (F2F)+<code>Vis/CorType=1</code> (Optical Flow). When we set <code>Vis/FeatureType</code> to 6, it is GFTT keypoint + BRIEF descriptor. For <code>Vis/CorType=1</code>, the descriptors are just not extracted on GFTT features, optical flow is done instead. All approaches in <code>Vis/FeatureType</code> have a detector+descriptor, the later is not used in case of optical flow.</p> <p>Look at the F2M or F2F sections in the <a href="http://docs.ros.org/en/noetic/api/rtabmap_ros/html/msg/OdomInfo.html" rel="nofollow noreferrer">OdomInfo</a> message, you will see the features are published.</p> <p>If you use rtabmapviz with <code>subscribe_odom_info</code>, you will see the features over the images in Odometry view.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> with karma: 6409 on 2022-12-14</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/94489/alessioparmeggiani/" rel="nofollow noreferrer">AlessioParmeggiani</a> on 2022-12-15</strong>:<br /> Thank you for the explanation! :)</p> <p>I tried to use rtabmapviz but I didn't find some explanation about what the yellow and green dots represent on the image, moreover if I use it the odometry gets lost, maybe it's because by using it the computer slows down, the stereo_odometry node can't compute the odometry fast enough and so it loses some frames.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> on 2022-12-15</strong>:<br /> &quot;gets lost&quot; -&gt; mostly depend of your kind of camera. If you have narrow FOV with motion blur (rolling shutter), it will easily get lost. See also Lost Odometry section here <a href="https://github.com/introlab/rtabmap/wiki/Kinect-mapping#lostodometry" rel="nofollow noreferrer">https://github.com/introlab/rtabmap/wiki/Kinect-mapping#lostodometry</a></p>
102818
2022-12-14T05:19:17.000
|ros|slam|navigation|rtabmap-odometry|rtabmap|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, I am trying to tune the many parameters of RtabMap, in particular the ones of the stereo_odometry node.</p> <p>I have some doubts: <a href="https://introlab.3it.usherbrooke.ca/mediawiki-introlab/images/7/7a/Labbe18JFR_preprint.pdf" rel="nofollow noreferrer">in this paper</a> it's written that &quot;for F2F (Odom/Strategy=1), optical flow is done directly on GFTT features without having to extract descriptors&quot;.</p> <p>My question is: if I change the parameter Vis/CorType to 0, so the correspondences computation approach is Features Matching, which approach is used? features matching or optical flow?</p> <p>Similarly If I change the parameter Vis/FeatureType to use different features than GFTT, is this parameter valid, or with F2F approach the only parameter used is the one described in the paper?</p> <p>Also another question: there is a way to view at the detected features? My idea is to plot the corners (for F2F) and wordsValues (for F2M) points in the <a href="http://docs.ros.org/en/noetic/api/rtabmap_ros/html/msg/OdomInfo.html" rel="nofollow noreferrer">OdomInfo message</a> but I don't know if there is a better way.</p> <p>I am using Ubuntu 20.04 with ROS noetic and rtabmap built from source</p> <hr /> <p><a href="https://answers.ros.org/question/410498/doubts-on-rtabmap-stereo_odometry-parameters-and-feature-visualization/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/94489/alessioparmeggiani/" rel="nofollow noreferrer">AlessioParmeggiani</a> on ROS Answers with karma: 165 on 2022-12-14</p> <p>Post score: 0</p>
Doubts on rtabmap stereo_odometry parameters and feature visualization
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The <code>.tolist()</code> call is not doing what you think it is. If you want to flatten a 2d <code>np.ndarray</code> to a 1d list, use the <code>ravel()</code> method of ndarray.</p> <pre><code>M.data = Tab.astype(float).ravel() </code></pre> <p>For a good discussion, see:</p> <p><a href="https://stackoverflow.com/questions/22021939/numpy-reshaping-an-array-to-1-d">https://stackoverflow.com/questions/22021939/numpy-reshaping-an-array-to-1-d</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2022-12-18</strong>:<br /> @Mike Scheutzow This flattens all elements to a list like <code>[x y z d]</code>. I want to publish this <code>[ [x y],[z d] ]</code>. Maybe it's not possible?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2022-12-18</strong>:<br /> You can easily adapt it in a few lines though, why is it a problem? Flatten it to 1D list, then create a 2D list with <code>np.reshape</code></p> <p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2022-12-18</strong>:<br /> @ljaniec &quot;facepalm&quot; thanks! I'll try that</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-12-19</strong>:<br /> <em>I want to publish this [ [x y],[z d] ]</em></p> <p>No, that is not possible with this message. From the message definition: data must be a 1d array of float64.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2022-12-19</strong>:<br /> Good note, the ROS message definition matters here. This transformation should be in the subscriber callback if wanted.</p>
102820
2022-12-15T06:30:58.000
|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I get <code>rospy.exceptions.ROSSerializationException: field data[] must be float type</code> in terminal When I rostopic echo a topic recieving <code>Float64MultiArray</code> message. This is a snippet of my python code:</p> <pre><code>M = Float64MultiArray() Tab=np.zeros((11521,10)) Values in Tab are manipulated,some are int, some are float. M.data=(Tab.astype(float)).tolist() pub.publish(M) </code></pre> <p>I don't get it, M.data is of type <code>float</code>. is Tab too big?</p> <hr /> <p><a href="https://answers.ros.org/question/410541/very-confusing-float64multiarray-error/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on ROS Answers with karma: 167 on 2022-12-15</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/94489/alessioparmeggiani/" rel="nofollow noreferrer">AlessioParmeggiani</a> on 2022-12-15</strong>:<br /> Did you try creating the array by setting explicitly the type: <code>Tab=np.zeros((11521,10),dtype=np.float64)</code>?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2022-12-15</strong>:<br /> @AlessioParmeggiani This still gives the same error</p>
Very Confusing Float64MultiArray Error
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Amazon Workspaces supports Amazon Linux, Ubuntu and Windows 10 as operating systems. From your question I understand that you are running Amazon Linux. ROS Noetic officially supports installation on Ubuntu and Debian, and experimental installations on Windows and Arch Linux (<a href="http://wiki.ros.org/noetic/Installation" rel="nofollow noreferrer">source</a>). Amazon Linux is not supported by ROS, but it is possible to build it from source following the instructions <a href="http://wiki.ros.org/noetic/Installation/Source" rel="nofollow noreferrer">here</a>.</p> <p>Another way to go about it is to use Docker. You can install Docker on AWS Linux, and then use the <a href="https://hub.docker.com/_/ros/" rel="nofollow noreferrer">ROS Docker image</a>.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/26723/janindu/" rel="nofollow noreferrer">janindu</a> with karma: 849 on 2022-12-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/115758/raider83/" rel="nofollow noreferrer">raider83</a> on 2022-12-19</strong>:<br /> Thank you for the info janindu!</p> <p>We are currently working on moving our AWS from the Amazon image to Ubuntu so that we can more closely reflect our target environment.</p>
102822
2022-12-15T11:30:02.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have recently started working in AWS Workspaces on Windows 11, decision came from above my pay grade. Previous development has been done on Ubuntu.</p> <p>So I try to install ros using &quot;sudo apt install&quot; from a terminal window and I get the error that apt command not found. So I try the AWS software installer, yum as I understand. I search in yum for ros but I am unable to find it.</p> <p>I am <strong>not</strong> using the robot or anything like that, we're using ros for another application that we had already developed on Ubuntu.</p> <p>Has anyone been able to install ros in AWS Workspaces?</p> <p>Thanks, Doug</p> <hr /> <p><a href="https://answers.ros.org/question/410548/how-do-i-install-ros-noetic-on-aws-workspaces/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/115758/raider83/" rel="nofollow noreferrer">raider83</a> on ROS Answers with karma: 3 on 2022-12-15</p> <p>Post score: 0</p>
How do I install ROS Noetic on AWS Workspaces
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The Blue line plotting <code>/odometry/global</code> (output from our global EKF node) shows the behavior when <a href="https://github.com/ros-planning/navigation2/pull/2814/files/534f01a851b7a6fcde61d6b3d7ffb53141cf2102#r836826779" rel="nofollow noreferrer">this erroneous</a> point rotation was used in the original version of <a href="https://github.com/ros-planning/navigation2/pull/2814" rel="nofollow noreferrer">this PR</a>.</p> <p>The Orange line is plotted between two waypoints correctly by Robot Localization (through the /fromLL service). The erroneous point rotation mentioned caused the planned waypoint path (Blue Line) to be rotated again by the <code>utm_meridian_convergence</code> value calculated and used by the Navsat Transform Node (RL does this internally but <a href="https://sciencing.com/how-to-calculate-utm-convergence-12745902.html" rel="nofollow noreferrer">here</a> is an example of how it's calculated). The <code>/fromLL</code> service already deals with this when transforming Lat/Long-&gt;Map (x,y), so the rotation was basically being &quot;doubled&quot; (<a href="https://github.com/cra-ros-pkg/robot_localization/issues/727" rel="nofollow noreferrer">this</a> discussion sheds light). RL also accounts for things like a user set <code>yaw_offset</code>, <code>magnetic_declination</code>, etc., that would have also made this rotation much more noticeable if used, but we account for declination elsewhere and IMU data is already in the ENU frame so no yaw_offset was used.</p> <p>I live and test close to the <a href="https://gisgeography.com/central-meridian/#:%7E:text=UTM%20systems%20use%20a%20central%20meridian&amp;text=This%20central%20meridian%20is%20an,to%206%C2%B0E%20longitude." rel="nofollow noreferrer">meridian of my UTM zone</a>, so this angle was always very small (+-0.07 degrees), so ran &quot;unnoticed&quot; (I attributed the slight variation to differences in state estimation or other system portions). When testing much further away from the meridian, the erroneous rotation was very obvious as seen in the plotting above.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/92446/hapy-capy/" rel="nofollow noreferrer">hapy-capy</a> with karma: 33 on 2022-12-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102824
2022-12-15T12:46:11.000
|ros|navigation|gps|navsat-transform-node|robot-localization|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am running the navsat_transform node using a set datum point to get (x,y) coordinates in the map frame.</p> <p>I am inputting the same GPS lat/long values, just changing the declination. Using 0.0 for the declination value, the points output are represented by the Orange line in the photo. Using 0.1209513 for declination, the points output are represented by the Pinkline.</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16711263056983083.png" alt="image description" /></p> <p>The top portion of the Blue line is the robot travelling the path using the points output using 0.0 for declination.</p> <p>The desired real-world line should be the Orange line. We are using RTK GPS to gather points and in the navigation of the robot. Our IMU data is corrected for declination already.</p> <p>I have looked through robot_localization source and understand the point is being rotated about the datum.</p> <p>How is the declination parameter to be used? It seems adding the correct declination in the navsat_transform_node paramater places the map points in the incorrect place. We were considering removing the declination correction from our IMU driver and using the navsat_transform param.</p> <p>The params used (this node is running by itself, off bot just to test differences in using the declination parameter; similar on real bot):</p> <pre><code> navsat_transform: frequency: 5 delay: 3.0 magnetic_declination_radians: 0.0 #0.1209513 yaw_offset: 0.0 zero_altitude: true broadcast_utm_transform: true publish_filtered_gps: true use_odometry_yaw: false wait_for_datum: true datum: [38.038643, -103.694626, 0.0] </code></pre> <hr /> <p><a href="https://answers.ros.org/question/410550/declination-usage-in-navsat_transform/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/92446/hapy-capy/" rel="nofollow noreferrer">hapy-capy</a> on ROS Answers with karma: 33 on 2022-12-15</p> <p>Post score: 1</p>
Declination usage in navsat_transform
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The error output you posted says <code>The 'temperature' field must be a sub message of type 'Temperature'</code>. You've got a line in your code that says <code>msg.temperature = 15.0</code>. <code>float</code> is not a <code>sensor_msgs/Temperature</code> type, hence the error.</p> <p>I believe you meant to do something like <code>msg.temperature.temperature = 15.0</code> instead.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/30013/chuiv/" rel="nofollow noreferrer">ChuiV</a> with karma: 1046 on 2022-12-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/127516/arad2456/" rel="nofollow noreferrer">arad2456</a> on 2022-12-19</strong>:<br /> Thank you, it works now. I edited my post. Before I posted here I tried it, but wrote msg.Temperature.temperature instead, and when it didn't work I was confused</p>
102826
2022-12-15T16:00:32.000
|ros|ros2|publish|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hey everyone, I am trying to publish a weather message that is composed out of several fields (temperature, pressure, wind velocity, water velocity and a general weather code), but it doesn't work. In the creation process, I first try to send a message that contains only with the temperature field, but I get a weird output:</p> <pre><code>Traceback (most recent call last): File &quot;/home/user/ros2_ws/install/proj_pubsub/lib/proj_pubsub/talker&quot;, line 11, in &lt;module&gt; load_entry_point('proj-pubsub==0.0.0', 'console_scripts', 'talker')() File &quot;/home/aradhilel/ros2_ws/install/proj_pubsub/lib/python3.8/site-packages/proj_pubsub/publisher.py&quot;, line 30, in main rclpy.spin(minimal_publisher) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/rclpy/__init__.py&quot;, line 191, in spin executor.spin_once() File &quot;/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py&quot;, line 718, in spin_once raise handler.exception() File &quot;/opt/ros/foxy/lib/python3.8/site-packages/rclpy/task.py&quot;, line 239, in __call__ self._handler.send(None) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py&quot;, line 429, in handler await call_coroutine(entity, arg) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py&quot;, line 343, in _execute_timer await await_or_execute(tmr.callback) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py&quot;, line 118, in await_or_execute return callback(*args) File &quot;/home/user/ros2_ws/install/proj_pubsub/lib/python3.8/site-packages/proj_pubsub/publisher.py&quot;, line 20, in timer_callback msg.temperature = 15.0 File &quot;/home/user/ros2_ws/install/proj_msgs/lib/python3.8/site-packages/proj_msgs/msg/_weather_composite.py&quot;, line 169, in temperature assert \ AssertionError: The 'temperature' field must be a sub message of type 'Temperature' </code></pre> <p>This is my publisher file:</p> <pre><code>import rclpy from rclpy.node import Node from proj_msgs.msg import WeatherComposite from sensor_msgs.msg import Temperature class MinimalPublisher(Node): def __init__(self): super().__init__('minimal_publisher') self.publisher_ = self.create_publisher(WeatherComposite, 'weather', 10) timer_period = 0.5 # seconds self.timer = self.create_timer(timer_period, self.timer_callback) self.i = 0 def timer_callback(self): msg = WeatherComposite() msg.temperature = 15.0 self.publisher_.publish(msg) self.get_logger().info('Publishing: &quot;%s&quot;' % msg.temperature) def main(args=None): rclpy.init(args=args) minimal_publisher = MinimalPublisher() rclpy.spin(minimal_publisher) minimal_publisher.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p>The problem happens only when I try to send the temperature field inside the composed message. When I change the message type from WeatherComposite to Temperature it works.</p> <p>This is the message file &quot;WeatherComposite.msg&quot;:</p> <pre><code>sensor_msgs/Temperature temperature sensor_msgs/FluidPressure pressure proj_msgs/WaterFlowVelocity water_flow_velocity proj_msgs/WindVelocity wind_velocity proj_msgs/GeneralWeather weather_id </code></pre> <p>the proj_msgs are messages that I created. Since they are not relevant to the question, I don't post their definition (they are made out of the standard primitives).</p> <p>I know that it's bad that I have two temperature fields in the same file (one from Temperature and one from WeatherComposite). I did it only for the demonstration here, in my real code I am going to remove sensor_msgs/Temperature.</p> <p>It would be awesome if you could help me here. Thank you in advance.</p> <p>Edit:</p> <p>Ok, I played with it a bit after the help of ChuiV and it works now. What needed was indeed to change the line: <code>msg.temperature</code> to <code>msg.temperature.temperature</code></p> <p>Thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/410554/can%27t-publish-a-message-that-is-composed-of-several-fields/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/127516/arad2456/" rel="nofollow noreferrer">arad2456</a> on ROS Answers with karma: 1 on 2022-12-15</p> <p>Post score: 0</p>
Can't publish a message that is composed of several fields
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>There may be better ways, but we (at my company) tend to gravitate towards passing around the rclcpp::Node object and parameter namespaces. Then anything that needs to have some configuration can use the parameter namespace and node object to just declare it's own parameters and register callbacks for those parameter changes.</p> <p>In cases where these classes are specifically ros-agnostic, we'll pass in a shared_ptr configuration struct into the non-ros classes. Then from the ros node, we can still declare parameters, and callbacks that change values in that shared configuration struct.</p> <p>Added Examples:</p> <p>Configuration Struct:</p> <pre><code>struct ClassNConfiguration { int64_t field_a; std::string field_b; } </code></pre> <p>ClassN:</p> <pre><code>class ClassN { public: ClassN(std::shared_ptr&lt;ClassNConfiguration&gt; configuration) : configuration_(configuration) { ... } protected: std::shared_ptr&lt;ClassNConfiguration&gt; configuration_; } </code></pre> <p>Node Class:</p> <pre><code>class MyNode : rclcpp::Node { public: MyNode() : rclcpp::Node(&quot;my_node&quot;), class_n_config_(std::make_shared&lt;ClassNConfiguration&gt;()) { class_n_config_.field_a = declare_parameter(&quot;class_n.field_a&quot;, 42); class_n_config_.field_b = declare_parameter(&quot;class_n.field_b&quot;, &quot;hello ros2&quot;); class_n_ = std::make_shared&lt;ClassN&gt;(class_n_config_); } protected: std::shared_ptr&lt;ClassNConfiguration&gt; class_n_config_; std::shared_ptr&lt;ClassN&gt; class_n_; } </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/30013/chuiv/" rel="nofollow noreferrer">ChuiV</a> with karma: 1046 on 2022-12-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/54937/xibeisiber/" rel="nofollow noreferrer">xibeisiber</a> on 2022-12-18</strong>:<br /> Thanks very much for your reply.</p> <p>Could you please provide an example of the <em><strong>shared_ptr configuration struct</strong></em>? I am not sure how to implement it.</p> <p>Thanks for your kind help!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/54937/xibeisiber/" rel="nofollow noreferrer">xibeisiber</a> on 2022-12-21</strong>:<br /> Thanks a lot!</p>
102828
2022-12-15T21:22:41.000
|ros|ros2|parameter|yaml|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all,</p> <p>I want to pass a bunch of parameters to certain C++ class which is indirectly called in a ros2 node: <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16711572432239002.png" alt="image description" /></p> <p>Some parameters can be modified in runtime via HMI or other ways?</p> <p>Since ros2 can only load parameters in yaml file from a node(if I understand correctively), is there a convenient way to pass these parameters around? I saw elsewhere that somebody suggests using database db file to store these parameters and use orocos rtt::service to load them.</p> <p>Thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/410560/parameter-management-in-ros2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/54937/xibeisiber/" rel="nofollow noreferrer">xibeisiber</a> on ROS Answers with karma: 137 on 2022-12-15</p> <p>Post score: 1</p>
parameter management in ROS2
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The conversion function is named <code>pcl::fromROSMsg()</code> from ros package <code>pcl_conversions</code>. Also see answers to #q405219.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-17</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102830
2022-12-16T09:30:20.000
|ros|pcl|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am following the <a href="http://wiki.ros.org/pcl/Tutorials" rel="nofollow noreferrer">ROS PCL tutorials</a> , When I try to implement the <a href="https://pcl.readthedocs.io/projects/tutorials/en/latest/resampling.html#id1" rel="nofollow noreferrer">Smoothing and normal estimation based on polynomial</a> reconstruction algorithm I get the following error error</p> <blockquote> <p>C2664: 'void pcl::PCLBase::setInputCloud(const boost::shared_ptr&lt;const pcl::PointCloud&gt; &amp;)': cannot convert argument 1 from 'const pcl::PCLPointCloud2ConstPtr' to 'const boost::shared_ptr&lt;const pcl::PointCloud&gt; &amp;'</p> </blockquote> <blockquote> <pre><code> with [ PointInT=pcl::PointXYZ, PointT=pcl::PointXYZ ] and [ PointT=pcl::PointXYZ ] </code></pre> </blockquote> <p>How to pass PointCloud2 message to this algorithm?</p> <hr /> <p><a href="https://answers.ros.org/question/410586/how-to-pass-pointcloud2-message-to-pcl-smoothing-algorithm?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/115071/hossamalzomor/" rel="nofollow noreferrer">HossamAlzomor</a> on ROS Answers with karma: 5 on 2022-12-16</p> <p>Post score: 0</p>
How to pass Pointcloud2 message to PCL smoothing algorithm?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I will answer my own question here:</p> <p>I decided to spawn objects only in gazebo to simulate automated object pick up. To do this, I defined a SDF file using STL and import necessary classes from <strong>gazebo_msgs.srv</strong> to spawn and delete objects in the gazebo world. Whoever needs to do the same thing can refer my repository:</p> <p><a href="https://github.com/kidpaul94/kmr-iiwa-gripkit-cr-plus-l/tree/main/auto_pick/src" rel="nofollow noreferrer">https://github.com/kidpaul94/kmr-iiwa-gripkit-cr-plus-l/tree/main/auto_pick/src</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/72845/kidpaul/" rel="nofollow noreferrer">kidpaul</a> with karma: 38 on 2023-01-09</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102832
2022-12-19T16:55:40.000
|ros|gazebo|simulation|rviz|urdf|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all,</p> <p>I'm trying to generate a simulation that automatically executes grasping multiple times to collect success/fail of the specific grasp configuration. Currently, I have robot moveit package (rviz&amp;gazebo), <strong>STL files of objects</strong>, and goal end-effector poses with respect to the <strong>objects' coordinate systems</strong>.</p> <p>At the moment, my <strong>primary goal</strong> is to spawn an object and a robot simultaneously to use tf (from robot base to object) to define the goal pose of an end-effector for gazebo simulation.</p> <p>My initial idea of how to setup the simulation is to convert the object STL file to the URDF and load it as part of the robot in both rviz and gazebo. Is there any better idea to achieve the primary goal? I appreciate any comment, suggestion, and information.</p> <hr /> <p><a href="https://answers.ros.org/question/410679/the-best-way-to-spawn-objects-in-both-rviz-and-gazebo/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/72845/kidpaul/" rel="nofollow noreferrer">kidpaul</a> on ROS Answers with karma: 38 on 2022-12-19</p> <p>Post score: 0</p>
The best way to spawn objects in both rviz and gazebo
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>No you cannot have more than one message per msg file. The filename is the name of the message and everything inside of the file is the contents of the message.</p> <p>This sounds a bit like an XY problem. I would suggest that you consider asking a new question with more context if this is something beyond an idle curiosity about the design.</p> <p>For reference the format is defined here: <a href="http://wiki.ros.org/msg" rel="nofollow noreferrer">http://wiki.ros.org/msg</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2022-12-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/108548/fury.nerd/" rel="nofollow noreferrer">fury.nerd</a> on 2022-12-20</strong>:<br /> thanks for the explaination, as commented above, it is indeed some kind of &quot;idle curiosity&quot;, and this confirmation though is not happy to know but quite clear, i dont need to do more investigations.</p>
102834
2022-12-19T22:52:09.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>hi, as the below example:</p> <p><code>Child.msg</code>:</p> <pre> float32 x float32 y </pre> <p><code>Parent.msg</code>:</p> <pre> Child[2] child </pre> <p>is that possible to use only one <code>.msg</code> file to implement? thanks</p> <hr /> <p><a href="https://answers.ros.org/question/410681/is-that-possible-to-write-nested-msg-in-one-file?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/108548/fury.nerd/" rel="nofollow noreferrer">fury.nerd</a> on ROS Answers with karma: 78 on 2022-12-19</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2022-12-20</strong>:<br /> I don't know the definitive answer if its possible, but I've never seen such a thing done and would be exceptionally unusual. Its best not. But you could consult the idl generators if its even feasibly possible, but I doubt that it is.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/108548/fury.nerd/" rel="nofollow noreferrer">fury.nerd</a> on 2022-12-20</strong>:<br /> well, thanks for the comment, it is indeed some kind of &quot;idle curiosity&quot;, but somehow i just dont want to create too many <code>msg</code> files only use once, as exampled, if the <code>Child.msg</code> is only used by <code>Parent.msg</code>, it looks a little bit of wasting of managing/orginazing files...anyway, thanks for the comfirmation (negative comfirmation is also quit help for me)</p>
is that possible to write nested msg in one file?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Related ROS Q&amp;A: <a href="https://answers.ros.org/question/392970/libgazebo_ros_skid_steer_drive-syntax-for-urdf-in-ros2/" rel="nofollow noreferrer">https://answers.ros.org/question/392970/libgazebo_ros_skid_steer_drive-syntax-for-urdf-in-ros2/</a></p> <p>And a nice tutorial: <a href="https://medium.com/ieee-manipal/ros-slam-path-planning-5f5d0b2c4cbc" rel="nofollow noreferrer">https://medium.com/ieee-manipal/ros-slam-path-planning-5f5d0b2c4cbc</a></p> <p>You should have an RQT graph similar to this one</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1671622321748178.jpg" alt="image description" /></p> <p>Please check your steps and code, because something is possibly missing in it</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> with karma: 3064 on 2022-12-21</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/121744/jandisoon/" rel="nofollow noreferrer">jandisoon</a> on 2022-12-21</strong>:<br /> thank you it's verry helpfull</p>
102836
2022-12-20T07:17:30.000
|ros|navigation|move-base|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello I'm working on 4 wheels robot and I use <code>libgazebo_ros_skid_steer_drive.so </code> as a controller now in the navigation stack whenI show the rqt graph I found that the move_base doesn't send a cmd_vel did this have a relation with the controller<br /> <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16715385004864168.png" alt="image description" /></p> <hr /> <p><a href="https://answers.ros.org/question/410703/move_base-doesn%27t-send-cmd_vel/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121744/jandisoon/" rel="nofollow noreferrer">jandisoon</a> on ROS Answers with karma: 13 on 2022-12-20</p> <p>Post score: 0</p>
move_base doesn't send cmd_vel
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The name of the Python client library for ROS 2 is <code>rclpy</code>.</p> <p>You have:</p> <pre><code>import rclyp </code></pre> <p>you'll have to update all references to <code>rclyp</code> and replace them by <code>rclpy</code>.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2022-12-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/128287/fkaan/" rel="nofollow noreferrer">fkaan</a> on 2022-12-20</strong>:<br /> sleep is a important think. Thank you a lot</p>
102838
2022-12-20T09:10:43.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <pre><code> #!/usr/bin/env python3 import rclyp from rclyp.node import Node def main(args = None): rclyp.init(args = args) node = Node(&quot;py_test&quot;) node.get_logger().info(&quot;Hello ROS2&quot;) rclyp.shutdown() if __name__ == &quot;__main__&quot;: main() </code></pre> <p>Hi I am new at ROS2 trying to use this code but my terminal says :</p> <pre><code>&gt; user@user-VirtualBox:~/ros2_ws/src/my_py_pkg/my_py_pkg$ &gt; ./my_first_node.py Traceback (most &gt; recent call last): File &gt; &quot;/home/user/ros2_ws/src/my_py_pkg/my_py_pkg/./my_first_node.py&quot;, line 3, in &lt;module&gt; &gt; import rclyp ModuleNotFoundError: No module named 'rclyp' </code></pre> <p>I have tried <a href="https://answers.ros.org/question/355064/ros2-modulenotfounderror-no-module-named-rclpy_rclpy/" rel="nofollow noreferrer">this link</a> but It doesn't look like same error like I got.</p> <hr /> <p><a href="https://answers.ros.org/question/410708/modulenotfounderror:-no-module-named-%27rclyp%27/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/128287/fkaan/" rel="nofollow noreferrer">fkaan</a> on ROS Answers with karma: 1 on 2022-12-20</p> <p>Post score: 0</p>
ModuleNotFoundError: No module named 'rclyp'
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Both versions call the same templated method in nh. For the first version, the c++ compiler will guess the typename by looking at the types of the 2nd and 3rd arguments.</p> <p>P.S. Unrelated to your question, but for years now, the ros convention is to not use a leading slash on a frame name.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-21</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/77577/vicente-queiroz/" rel="nofollow noreferrer">Vicente Queiroz</a> on 2022-12-22</strong>:<br /> Thanks for the answer and the convention advice!</p>
102840
2022-12-20T09:45:23.000
|ros|c++|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have a node and I want assign 2 parameters from the Parameter Server. They are both strings:</p> <pre><code>nh.param(&quot;robot_frame&quot;, robotFrame, std::string(&quot;/base_link&quot;)); nh.param&lt;std::string&gt;(&quot;world_frame&quot;, worldFrame, &quot;/map&quot;); </code></pre> <p>When I compile, everything is OK. What I'm curious about is what is the underlying difference on how these 2 parameters are assigned? Or there is no difference at all?</p> <p>Thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/410710/what-is-the-difference-in-how-you-assign-these-node-parameters?-(c++)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/77577/vicente-queiroz/" rel="nofollow noreferrer">Vicente Queiroz</a> on ROS Answers with karma: 3 on 2022-12-20</p> <p>Post score: 0</p>
What is the difference in how you assign these node parameters? (C++)
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Further reading showed that both ekf's take care of map-&gt;odom, odm-&gt; base_link, and I have both of those broadcasted elsewhere which is a big no-no. Missed that detail the first time around.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/115712/chased11/" rel="nofollow noreferrer">chased11</a> with karma: 137 on 2022-12-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102842
2022-12-20T16:49:09.000
|ros|transform|navsat-transform-node|tf2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am having issues with my transforms it appears. This is my first time running the ekf_localization node. Launch file and errors below. My tf tree only shows odom-&gt; base link. The static publishers should take care of imu-&gt; base_link, base_link-&gt;base_footprint, odom-&gt; map</p> <p>I then have controller code that broadcasts odom-&gt;base_footprint, and navsat_transform should take care of utm-&gt;odom. This should have a completed tf tree, but I only see odom-&gt;base_link. Is there any apparent issues in my launch file? Thanks</p> <pre><code> launch&gt; &lt;node pkg=&quot;tf2_ros&quot; type=&quot;static_transform_publisher&quot; name=&quot;imu_broadcaster&quot; args=&quot;-.4064 .3048 .4572 0 0 0 base_link imu 30&quot;/&gt; &lt;node pkg=&quot;tf2_ros&quot; type=&quot;static_transform_publisher&quot; name=&quot;base_link_broadcaster&quot; args=&quot;0 0 0.889 0 0 0 base_footprint base_link 30&quot; /&gt; &lt;node pkg=&quot;tf2_ros&quot; type=&quot;static_transform_publisher&quot; name=&quot;map_to_odom&quot; args=&quot;0 0 0 0 0 0 map odom 30&quot; /&gt; &lt;!--Launch odom, imu, gps--&gt; &lt;!-- subscribes to cmd_vel topic --&gt; &lt;!-- publishes odom topic with base_link frame --&gt; &lt;!-- broadcasts odom-&gt;base_footprint transform --&gt; &lt;include file=&quot;$(find mc_driver)/launch/driver.launch&quot;/&gt; &lt;node name=&quot;imu_node&quot; pkg=&quot;imu&quot; type=&quot;imu&quot;&gt; &lt;remap from=&quot;imu/mag&quot; to=&quot;imu/mag&quot;/&gt; &lt;remap from=&quot;imu/data&quot; to=&quot;imu/data&quot;/&gt; &lt;param name=&quot;_baudrate&quot; value=&quot;921600&quot;/&gt; &lt;/node&gt; &lt;!-- GPS launches: publishes NavSatFix to /fix, which will be used with navsat_transform_node--&gt; &lt;!-- /gps/fix--&gt; &lt;node pkg=&quot;gps_fix_pub&quot; type=&quot;driver.py&quot; name=&quot;gps&quot;&gt; &lt;/node&gt; &lt;rosparam command=&quot;load&quot; file=&quot;<span class="math-container">$(find nav_pub)/param/ekf_params.yaml" /&gt; &lt;rosparam command="load" file="$</span>(find nav_pub)/param/navsat_params.yaml&quot; /&gt; &lt;node pkg=&quot;robot_localization&quot; type=&quot;ekf_localization_node&quot; name=&quot;ekf_se_odom&quot; clear_params=&quot;true&quot;/&gt; &lt;node pkg=&quot;robot_localization&quot; type=&quot;ekf_localization_node&quot; name=&quot;ekf_se_map&quot; clear_params=&quot;true&quot;&gt; &lt;remap from=&quot;odometry/filtered&quot; to=&quot;odometry/filtered_map&quot;/&gt; &lt;/node&gt; &lt;node pkg=&quot;robot_localization&quot; type=&quot;navsat_transform_node&quot; name=&quot;navsat_transform&quot; clear_params=&quot;true&quot; output=&quot;screen&quot;&gt; &lt;remap from=&quot;odometry/filtered&quot; to=&quot;odometry/filtered_map&quot;/&gt; &lt;/node&gt; &lt;/launch [ WARN] [1671570728.685366563]: Transform from base_link to map was unavailable for the time requested. Using latest instead. [ WARN] [1671570729.429466639]: Transform from odom to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570730.234656934]: Transform from base_footprint to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570731.460892075]: Transform from odom to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570731.479805854]: Transform from base_footprint to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570732.345719163]: Transform from base_footprint to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570733.494249460]: Transform from odom to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570733.679772610]: Transform from base_link to map was unavailable for the time requested. Using latest instead. [ WARN] [1671570734.885671028]: Transform from base_footprint to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570735.527168286]: Transform from odom to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570736.079708892]: Transform from base_link to map was unavailable for the time requested. Using latest instead. [ WARN] [1671570745.280298372]: Transform from base_footprint to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570745.599284651]: Transform from odom to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570748.767587672]: Failed to meet update rate! Took 0.10817311700000001307 [ WARN] [1671570748.794316663]: Failed to meet update rate! Took 0.10160054800000001274 [ WARN] [1671570749.690036014]: Transform from base_footprint to base_link was unavailable for the time requested. Using latest instead. [ WARN] [1671570749.691733300]: Transform from odom to base_link was unavailable for the time requested. Using latest instead. </code></pre> <hr /> <p><a href="https://answers.ros.org/question/410720/transform-error-in-ekf_localization/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/115712/chased11/" rel="nofollow noreferrer">chased11</a> on ROS Answers with karma: 137 on 2022-12-20</p> <p>Post score: 0</p>
transform error in ekf_localization
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>There is existing work along these lines. You should look into the <code>rosbridge_suite</code>, which provides a websocket for external apps to communicate with the ros system. I don't know the status of this package for ros2, but a google search does return some hits. Here is the ros1 wiki page as a starting point:</p> <p><a href="http://wiki.ros.org/rosbridge_suite" rel="nofollow noreferrer">http://wiki.ros.org/rosbridge_suite</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-21</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
102844
2022-12-21T12:13:31.000
|ros|python|ros2|communication|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>We have Python program that has been developed by a team and is the core program.</p> <p>This Python program calls a simulation made with ROS2, as a service, for some of the robot's moves.</p> <p>We could put the Python program in a ROS2 node but this will make everything more complicated for the Python team. Including debugging.</p> <p>We currently plan to have a web server to handle the communication between the two. One of the ROS2 nodes would be listening for requests from the Python program.</p> <p>Or is there some &quot;common way&quot; to do that more efficiently?</p> <p>Thanks</p> <hr /> <p><a href="https://answers.ros.org/question/410756/make-a-ros2-program-communicate-with-a-python-program/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/109521/thibd/" rel="nofollow noreferrer">thibd</a> on ROS Answers with karma: 33 on 2022-12-21</p> <p>Post score: 0</p>
Make a ROS2 program communicate with a Python program
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>&quot;turning_radius&quot; would be the first suspect I would check out. Right now it is set to 1 meter, which is consistent with the radius of the &quot;turn maneuver&quot; towards the end of the path you posted.</p> <p>Have you tried to set the turning radius parameter to 0? (Which I assume it should enable &quot;in place turn&quot; for your differential robot)</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/1108/martin-peris/" rel="nofollow noreferrer">Martin Peris</a> with karma: 5625 on 2022-12-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/41510/youssef_lah/" rel="nofollow noreferrer">Youssef_Lah</a> on 2022-12-28</strong>:<br /> when I set it to 0, the robot arrive to goal and stops, it does not rotate to meet the desired orientation.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/1108/martin-peris/" rel="nofollow noreferrer">Martin Peris</a> on 2023-01-19</strong>:<br /> You should checkout this <a href="https://github.com/ros-planning/navigation2/tree/main/nav2_smac_planner/lattice_primitives" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/tree/main/nav2_smac_planner/lattice_primitives</a> and make sure that your minimum control set contains in-place rotations. Another thing I would try is to lower the rotation_penalty to maybe 0.1 or 0.01 even, and see what happens</p> <p><strong>Comment by <a href="https://answers.ros.org/users/41510/youssef_lah/" rel="nofollow noreferrer">Youssef_Lah</a> on 2023-01-26</strong>:<br /> the minimum turning_radius value that I can set to generate the lattice file is 0.08, else the script got division by zero error, so I set it to 0.08 and I lowered the rotation_penalty and it worked. Thank you Martin.</p>
102846
2022-12-21T21:24:09.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>env: ros2 humble on ubuntu 22.04</p> <p>I am trying to use smac lattice planner for my differential/rectangular robot. I noticed that when the robot arrives near goal, it parks as a vehicle and it does not rotate on goal. in nav2 documentation it says that the planner is suitable for differential non-circular robot. How can I make the robot rotate on goal ? here is the screen and config:</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16716761737695816.png" alt="image description" /></p> <pre><code>planner_server: ros__parameters: expected_planner_frequency: 20.0 use_sim_time: False planner_plugins: [&quot;GridBased&quot;] GridBased: plugin: &quot;nav2_smac_planner/SmacPlannerLattice&quot; allow_unknown: true tolerance: 0.05 max_iterations: 1000000 max_on_approach_iterations: 1000 max_planning_time: 5.0 analytic_expansion_ratio: 3.5 analytic_expansion_max_length: 4.0 reverse_penalty: 1.0 change_penalty: 0.05 non_straight_penalty: 1.05 cost_penalty: 2.0 rotation_penalty: 1.0 retrospective_penalty: 0.015 lattice_filepath: &quot;path_to_file/output.json&quot; lookup_table_size: 20.0 cache_obstacle_heuristic: true allow_reverse_expansion: true smooth_path: False </code></pre> <p>and for the primitive config:</p> <pre><code>{ &quot;motion_model&quot;: &quot;diff&quot;, &quot;turning_radius&quot;: 1.0, &quot;grid_resolution&quot;: 0.05, &quot;stopping_threshold&quot;: 5, &quot;num_of_headings&quot;: 16 } </code></pre> <hr /> <p><a href="https://answers.ros.org/question/410769/smac-lattice-planner-for-differential-robot/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/41510/youssef_lah/" rel="nofollow noreferrer">Youssef_Lah</a> on ROS Answers with karma: 195 on 2022-12-21</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-12-24</strong>:<br /> You don't seem to be distinguishing between a Planner and a Controller. Do you think the problem is that the Planner is not generating the pose you want, or that the Controller is not executing it?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/41510/youssef_lah/" rel="nofollow noreferrer">Youssef_Lah</a> on 2022-12-28</strong>:<br /> the controller is following the exact path (as expected), but the generated path from the planner is not suitable for differential robot since differential robots can rotate in place, but if you see the screenshot, the robot will park as a vehicle to meet the requested orientation.</p>
smac lattice planner for differential robot
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>one of the missing part from my try, but I added that also in CMakeList <code>find_package(PCL COMPONENT REQUIRED)</code>, AND missed this part : <code>include_directories( include ${PCL_INCLUDE_DIRS} )</code> and before <code>ament_package()</code> add this - <code>ament_export_include_directories(include)</code> Now it is working.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/28335/gnykumar@gmail.com/" rel="nofollow noreferrer">gnykumar@gmail.com</a> with karma: 26 on 2022-12-26</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-12-26</strong>:<br /> Your ros app having a dependency on pcl_conversions in CMakeLists.txt should have been enough for your build to succeed. However, this is the correct workaround if that doesn't work for some reason.</p>
102848
2022-12-23T02:14:34.000
|ros2|docker|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Recently I started working in ROS2, while using some of pcl function I face below error.</p> <p>For <code>#include &lt;pcl_conversions/pcl_conversions.h&gt;</code> I am getting the fatal error</p> <pre><code>/usr/include/pcl_conversions/pcl_conversions.h:44:10: fatal error: pcl/conversions.h: No such file or directory 44 | #include &lt;pcl/conversions.h&gt; </code></pre> <p>Platform : Ubuntu 22.04</p> <p><code>ros-humble-pcl-conversions</code> <code>2.4.0-4jammy.20221207.034537 amd64</code> Provides conversions from PCL data types and ROS message types</p> <p><code>libpcl-dev</code> <code>1.12.1+dfsg-3build1amd64</code> Point Cloud Library - development files</p> <hr /> <p><a href="https://answers.ros.org/question/410802/ubuntu_22-:-ros2_humble-:/usr/include/pcl_conversions/pcl_conversions.h:fatal-error:-pcl/conversions.h:-no-such-file-or-directory/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/28335/gnykumar@gmail.com/" rel="nofollow noreferrer">gnykumar@gmail.com</a> on ROS Answers with karma: 26 on 2022-12-23</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-12-25</strong>:<br /> <code>libpcl-dev</code> is a system library. Do you have a <code>find_package(PCL REQUIRED ...)</code> statement in your CMakeLists.txt?</p>
ubuntu_22 : ROS2_humble :/usr/include/pcl_conversions/pcl_conversions.h:fatal error: pcl/conversions.h: No such file or directory
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>Stack trace is not useful but i have no idea how i could have more details at one line it is actually crashing inside libroscpp</p> <pre><code>#0 0x00007ffff7f0a36e in ros::NodeHandle::createTimer(ros::Duration, boost::function&lt;void (ros::TimerEvent const&amp;)&gt; const&amp;, bool, bool) const () from /lib/x86_64-linux-gnu/libroscpp.so.2d #1 0x0000555555558b97 in main (argc=1, argv=0x7fffffffe1e8) at /home/worker/main.cpp:11 </code></pre> </blockquote> <p>actually, it's <em>very</em> useful, and this most likely already shows the cause: <code>/lib/x86_64-linux-gnu/libroscpp.so.2d</code>.</p> <p>There are no artefacts from ROS Noetic proper which install into anything else but <code>/opt/ros/noetic</code>.</p> <p>In other words: the library <code>/lib/x86_64-linux-gnu/libroscpp.so.2d</code> is <strong>not</strong> part of ROS Noetic.</p> <blockquote> <p>To install i do</p> <pre><code>sudo sh -c 'echo &quot;deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main&quot; &gt; /etc/apt/sources.list.d/ros-latest.list' curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - sudo apt install ros-noetic-ros-base libroscpp-dev </code></pre> </blockquote> <p>Similar to the above: <code>libroscpp-dev</code> is not part of ROS Noetic (in fact, <code>libroscpp-dev</code> is not really part of any ROS version).</p> <p>All packages part of ROS Noetic will have the <code>ros-noetic-</code> prefix (like <code>ros-noetic-ros-base</code>).</p> <p>What's most likely happening is you're mixing ROS Noetic proper with the <a href="http://wiki.ros.org/UpstreamPackages" rel="nofollow noreferrer">UpstreamPackages</a>. That won't work reliably, as you've already found out. See also <a href="https://discourse.ros.org/t/upstream-packages-increasingly-becoming-a-problem/10902/" rel="nofollow noreferrer">“upstream packages” increasingly becoming a problem</a> on ROS Discourse.</p> <p>I'd recommend to purge all upstream variants of ROS packages and make sure you have a sane ROS Noetic install.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2022-12-24</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 3</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/128909/qualiticsbe/" rel="nofollow noreferrer">qualiticsbe</a> on 2022-12-27</strong>:<br /> Oh wow! Ok that was a huge help and i figured it out. Linking to <code>/lib/x86_64-linux-gnu/libroscpp.so.2d</code> was indeed the root cause of my problem.</p> <p>So first, i removed the package libroscpp-dev and only keep <code>ros-noetic-ros-base</code></p> <p>For cmake i do instead</p> <pre><code>find_package(libros REQUIRED COMPONENTS roscpp) </code></pre> <p>That way it links to <code>libroscpp.so</code> inside <code>/opt/ros/noetic</code>.<br /> I don't know why i have python prompt for a cpp binary that way but it's working so i don't mind.</p> <pre><code>-- Using PYTHON_EXECUTABLE: /usr/bin/python3 -- Using Debian Python package layout -- Found PY_em: /home/god_kane/.local/lib/python3.8/site-packages/em.py -- Using empy: /home/god_kane/.local/lib/python3.8/site-packages/em.py </code></pre> <p>Guess i fell into that upstream package trap like many other new ros user.</p> <p>Thanks!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/128909/qualiticsbe/" rel="nofollow noreferrer">qualiticsbe</a> on 2022-12-27</strong>:<br /> I now know why i used pkg_check_modules(libros REQUIRED roscpp) before, it was not to be annoyed with python. In a cross-compiling environment i can't compile because catkin bothers me about it while i really don't care about python. Can i ignore python completely while still linking the proper librairies?</p>
102850
2022-12-23T05:09:41.000
|ros|libroscpp|roscpp|timer|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>After introducing ROS to my program with success, i wanted to use it more and added timer.<br /> I am using the same code on both Ubuntu20/noetic and Ubuntu18/melodic without any issue.<br /> But with timer i have a problem. On melodic it works fine, on noetic it always segfault when i call createTimer.</p> <p>I tried the sample in the wiki for timers and that simple code also segfaults. I tried with different ways of calling createTimer with different callback binding style but all segfaults.</p> <pre><code>void callback1(const ros::TimerEvent&amp;) { ROS_INFO(&quot;Callback 1 triggered&quot;); } int main(int argc, char **argv) { ros::init(argc, argv, &quot;talker&quot;); ros::NodeHandle n; ros::Timer timer1 = n.createTimer(ros::Duration(0.1), callback1); ros::spin(); return 0; } </code></pre> <p>Some basics information</p> <pre><code>ROS_VERSION=1 ROS_PYTHON_VERSION=3 ROS_PACKAGE_PATH=/opt/ros/noetic/share ROS_ETC_DIR=/opt/ros/noetic/etc/ros ROS_MASTER_URI=http://localhost:11311 ROS_ROOT=/opt/ros/noetic/share/ros ROS_DISTRO=noetic </code></pre> <p>noetic is installed with apt, all default packages on a new fresh install of Ubuntu20 server All parameters to start roscore or my test program are defaults.</p> <p>Stack trace is not useful but i have no idea how i could have more details at one line it is actually crashing inside libroscpp</p> <pre><code>#0 0x00007ffff7f0a36e in ros::NodeHandle::createTimer(ros::Duration, boost::function&lt;void (ros::TimerEvent const&amp;)&gt; const&amp;, bool, bool) const () from /lib/x86_64-linux-gnu/libroscpp.so.2d #1 0x0000555555558b97 in main (argc=1, argv=0x7fffffffe1e8) at /home/worker/main.cpp:11 </code></pre> <p>To install i do</p> <pre><code>sudo sh -c 'echo &quot;deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main&quot; &gt; /etc/apt/sources.list.d/ros-latest.list' curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - sudo apt install ros-noetic-ros-base libroscpp-dev </code></pre> <p>To compile my code, i use cmake and link to roscpp using</p> <pre><code>pkg_check_modules(libros REQUIRED roscpp) target_include_directories(mybin PUBLIC <span class="math-container">${libros_INCLUDE_DIRS}) target_link_libraries(mybin $</span>{libros_LIBRARIES}) </code></pre> <p>Thanks for your help.</p> <hr /> <p><a href="https://answers.ros.org/question/410806/noetic-createtimer-always-segfault/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/128909/qualiticsbe/" rel="nofollow noreferrer">qualiticsbe</a> on ROS Answers with karma: 3 on 2022-12-23</p> <p>Post score: 0</p>
noetic createTimer always segfault
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You can nest message types inside message types, service types and action types in both ROS1 and ROS2.</p> <p>See section 2.1.1 of <a href="https://docs.ros.org/en/foxy/Concepts/About-ROS-Interfaces.html" rel="nofollow noreferrer">the documentation</a></p> <p>See <a href="https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Single-Package-Define-And-Use-Interface.html#extra-use-an-existing-interface-definition" rel="nofollow noreferrer">a tutorial</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/28405/clyde/" rel="nofollow noreferrer">clyde</a> with karma: 1247 on 2022-12-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 3</p>
102852
2022-12-23T08:50:30.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Greetings. Since it is possible that a array is a data structure for an action goal, I would assume that more complex data structures may also be possible. I would like to give my action server a list of poses so it can calculate and execute a path.</p> <p>How can I define a nested data structure inside my action in order to hold the poses?</p> <hr /> <p><a href="https://answers.ros.org/question/410809/actions-and-nested-goal-states/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/69326/notarobot/" rel="nofollow noreferrer">NotARobot</a> on ROS Answers with karma: 109 on 2022-12-23</p> <p>Post score: 0</p>
Actions and nested goal states
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You do not mention any other part of your system. The most likely cause is that there is no source of a clock message. And without a clock message time is not advancing as as such your timer callback will never be invoked.</p> <p>You can read about the design of simulated time here: <a href="https://design.ros2.org/articles/clock_and_time.html" rel="nofollow noreferrer">https://design.ros2.org/articles/clock_and_time.html</a></p> <p>The most common sources of simulated time are a simulator like Gazebo or rosbag when playing back data.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2022-12-28</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on 2022-12-28</strong>:<br /> I see. I thought that by default, /clock will be published by ROS.</p> <p>My problem is solved when I launch a Gazebo simulation. Thank you very much!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on 2022-12-28</strong>:<br /> Just one more question. Is it always a bad idea if I put 'use_sim_time'=true for all my node in ROS2?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on 2022-12-28</strong>:<br /> Just one more question. In the document</p> <p>”If the time on the clock jumps backwards, a callback handler will be invoked and be required to complete before any calls to the ROS time abstraction report the new time. Calls that come in before that must block. The developer has the opportunity to register callbacks with the handler to clear any state from their system if necessary before time will be in the past“”</p> <p>After looking at this issue, <a href="https://github.com/ros2/rclcpp/issues/528" rel="nofollow noreferrer">https://github.com/ros2/rclcpp/issues/528</a>. Can I assume that the callback handler has already been implemented in rclcpp and rcpy? Thank you once again!</p>
102854
2022-12-27T15:39:38.000
|ros|ros2|use-sim-time|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><strong>Publisher Node</strong></p> <pre><code>import rclpy from rclpy.node import Node from std_msgs.msg import String class MinimalPublisher(Node): def __init__(self): super().__init__('minimal_publisher') self.publisher_ = self.create_publisher(String, 'topic', 10) timer_period = 0.5 # seconds self.timer = self.create_timer(timer_period, self.timer_callback) self.i = 0 def timer_callback(self): msg = String() msg.data = 'Hello World: %d' % self.i self.publisher_.publish(msg) self.get_logger().info('Publishing: &quot;%s&quot;' % msg.data) # t = self._clock.now() # self.get_logger().info('The current time is &quot;%s&quot;' % t.to_msg() ) self.i += 1 def main(args=None): rclpy.init(args=args) minimal_publisher = MinimalPublisher() rclpy.spin(minimal_publisher) # Destroy the node explicitly # (optional - otherwise it will be done automatically # when the garbage collector destroys the node object) minimal_publisher.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p><strong>Launch File</strong></p> <pre><code>import launch import launch_ros.actions from launch.substitutions import LaunchConfiguration def generate_launch_description(): use_sim_time = LaunchConfiguration('use_sim_time', default='true') return launch.LaunchDescription([ launch_ros.actions.Node( package='py_pubsub', executable='talker', name='talker', parameters=[{'use_sim_time': use_sim_time}],), ]) </code></pre> <p><strong>Platform</strong> Ubuntu 20, Galactic</p> <p><strong>Problem</strong> Something I find strange. In my launch file, my <strong>talker</strong> node works as expected when I don't set 'use_sim_time'. However, once I add the 'use_sim_time' into the launch file. My <strong>talker</strong> seems stuck during the initalizing stage of launching.</p> <p>Thus, I am wondering what could cause it go wrong?</p> <p>Below is what I see in my console when I turn on the console when launching with use_sim_time</p> <pre><code>shouyu@shouyu-Nitro-AN515-55:~/ros2_ws<span class="math-container">$ . install/setup.bash shouyu@shouyu-Nitro-AN515-55:~/ros2_ws$</span> ros2 launch py_launch_example my_script_launch.py [INFO] [launch]: All log files can be found below /home/shouyu/.ros/log/2022-12-27-15-38-19-846893-shouyu-Nitro-AN515-55-93514 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [talker-1]: process started with pid [93516] </code></pre> <p><strong>Global variable</strong></p> <p>shouyu@shouyu-Nitro-AN515-55:~/ros2_ws$ env | grep ROS</p> <pre><code>ROS_VERSION=2 ROS_PYTHON_VERSION=3 ROS_LOCALHOST_ONLY=0 ROS_DISTRO=galactic </code></pre> <pre><code> --- [Originally posted](https://answers.ros.org/question/410888/node-stuck-at-launching-when-launch-with-use_sim_time/) by [sdu568](https://answers.ros.org/users/103946/sdu568/) on ROS Answers with karma: 45 on 2022-12-27 Post score: 0 --- ### Original comments **Comment by [sdu568](https://answers.ros.org/users/103946/sdu568/) on 2022-12-27**:\ By the way, below is my global variable shouyu@shouyu-Nitro-AN515-55:~/ros2_ws$ env | grep ROS ROS_VERSION=2 ROS_PYTHON_VERSION=3 ROS_LOCALHOST_ONLY=0 ROS_DISTRO=galactic </code></pre>
Node stuck at launching when launch with use_sim_time
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In simulation, I have seen this problem caused by the amount of friction between the wheels and the ground. You need to check the values for both the forward direction and the perpendicular direction (i.e. the robot's y-axis.) The values can't be too small and they can't be too large.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2023-01-26</strong>:<br /> Thank you for help. It work's now.</p>
102856
2022-12-28T03:22:08.000
|gazebo|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi. Sorry for all mistakes, English is not my native language. I have a two wheeled robot that works fine. I want to remake it to be four wheeled one. I know that there is four_wheel_steering_controller and ackerman_controller but I want to try this with diff_drive controller. For unknown for know reason after adapting urdf and control.yaml files with reference to husky robot (as far as I understand, they managed to make it work the way I want it to work) my robot can move but can't turn. So at some point it will hit the wall or any other obstacle. Appreciate any hints.</p> <hr /> <p><a href="https://answers.ros.org/question/410898/is-there-a-way-to-adapt-diff_drive_controller-for-four-wheel-robot?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on ROS Answers with karma: 95 on 2022-12-28</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-12-28</strong>:<br /> Is failure in simulation or with a real robot?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-12-29</strong>:<br /> In simulation.</p>
Is there a way to adapt diff_drive_controller for four wheel robot?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>&lt;link name=&quot;front_camera_link&quot;/&gt;</p> </blockquote> <p>You are closing the link tag. The <code>/</code> character should not be there.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-28</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2022-12-28</strong>:<br /> @Mike Scheutzow Thanks, it works now, I don't want to have to redo this entire question again in another thread so if it's allowed, I'm also trying to get the 'libgazebo_ros_camera.so` plugin for the front camera to work. I've checked my computer and know I have this plugin. it' simply not publishing.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-12-29</strong>:<br /> I have never used that camera plugin, but I would try an experiment: delete all the other cameras to see if a single camera works. The fact that you use the identical <code>name=</code> for all cameras is questionable to me.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2022-12-29</strong>:<br /> @Mike Scheutzow it works now, my format was wring I guess. Would you happen to know how to use the <code>buoyancy plugin</code> correctly?</p>
102858
2022-12-28T06:45:11.000
|urdf|ros-melodic|xml|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I try to run this urdf file:</p> <pre><code>&lt;?xml version=&quot;1.0&quot; ?&gt; &lt;robot name=&quot;wam-v&quot; xmlns:xacro=&quot;http://ros.org/wiki/xacro&quot;&gt; &lt;link name=&quot;base_link&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://freddy/mesh/WAM-V.dae&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;collision name=&quot;base_link_collision&quot;&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://freddy/mesh/WAM-V.dae&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;247.07&quot;/&gt; &lt;inertia ixx=&quot;200&quot; ixy=&quot;0.03&quot; ixz=&quot;3.09&quot; iyy=&quot;500&quot; iyz=&quot;-0.05&quot; izz=&quot;165.39&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;link name=&quot;base_footprint&quot;/&gt; &lt;joint name=&quot;base_link_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;0 0 1.84&quot;/&gt; &lt;parent link=&quot;base_footprint&quot;/&gt; &lt;child link=&quot;base_link&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;front_camera_link&quot;/&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;box size=&quot;0.05 0.05 0.05&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;box size=&quot;0.05 0.05 0.05&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;red&quot;/&gt; &lt;/visual&gt; &lt;inertial&gt; &lt;mass value=&quot;1e-5&quot; /&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;inertia ixx=&quot;1e-6&quot; ixy=&quot;0&quot; ixz=&quot;0&quot; iyy=&quot;1e-6&quot; iyz=&quot;0&quot; izz=&quot;1e-6&quot; /&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;front_camera_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;1.2 0 0&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;front_camera_link&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;left_camera_link&quot;/&gt; &lt;joint name=&quot;left_camera_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin rpy=&quot;0 0 1.57079632679&quot; xyz=&quot;0 0.5 0&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;left_camera_link&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;right_camera_link&quot;/&gt; &lt;joint name=&quot;right_camera_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin rpy=&quot;0 0 -1.57079632679&quot; xyz=&quot;0 -0.5 0&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;right_camera_link&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;rear_camera_link&quot;/&gt; &lt;joint name=&quot;rear_camera_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin rpy=&quot;0 0 3.14159265359&quot; xyz=&quot;-0.5 0 0&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;rear_camera_link&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;scan&quot;/&gt; &lt;joint name=&quot;scan_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&quot;1.5 0 -1&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;scan&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;right_motor&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://freddy/mesh/PROPELLER.dae&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;collision name=&quot;right_motor_collision&quot;&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://freddy/mesh/PROPELLER.dae&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;0.01&quot;/&gt; &lt;inertia ixx=&quot;0.00086&quot; ixy=&quot;0.00&quot; ixz=&quot;0.00&quot; iyy=&quot;0.00086&quot; iyz=&quot;0.00&quot; izz=&quot;0.0017&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;right_motor_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-1.5 -1.027 -1.705&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;right_motor&quot;/&gt; &lt;limit effort=&quot;0.5293&quot; velocity=&quot;1003.14159265359&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;left_motor&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://freddy/mesh/PROPELLER.dae&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;collision name=&quot;left_motor_collision&quot;&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://freddy/mesh/PROPELLER.dae&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;0.01&quot;/&gt; &lt;inertia ixx=&quot;0.00086&quot; ixy=&quot;0.00&quot; ixz=&quot;0.00&quot; iyy=&quot;0.00086&quot; iyz=&quot;0.00&quot; izz=&quot;0.0017&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;left_motor_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-1.5 1.027 -1.705&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;left_motor&quot;/&gt; &lt;limit effort=&quot;0.5293&quot; velocity=&quot;1003.14159265359&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;gps&quot;/&gt; &lt;joint name=&quot;gps_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;0.8 0 0&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;gps&quot;/&gt; &lt;/joint&gt; &lt;transmission name=&quot;right_motor_trans&quot;&gt; &lt;type&gt;transmission_interface/SimpleTransmission&lt;/type&gt; &lt;joint name=&quot;right_motor_joint&quot;&gt; &lt;hardwareInterface&gt;VelocityJointInterface&lt;/hardwareInterface&gt; &lt;/joint&gt; &lt;actuator name=&quot;right_motor_actuator&quot;&gt; &lt;hardwareInterface&gt;VelocityJointInterface&lt;/hardwareInterface&gt; &lt;mechanicalReduction&gt;30&lt;/mechanicalReduction&gt; &lt;/actuator&gt; &lt;/transmission&gt; &lt;transmission name=&quot;left_motor_trans&quot;&gt; &lt;type&gt;transmission_interface/SimpleTransmission&lt;/type&gt; &lt;joint name=&quot;left_motor_joint&quot;&gt; &lt;hardwareInterface&gt;VelocityJointInterface&lt;/hardwareInterface&gt; &lt;/joint&gt; &lt;actuator name=&quot;left_motor_actuator&quot;&gt; &lt;hardwareInterface&gt;VelocityJointInterface&lt;/hardwareInterface&gt; &lt;mechanicalReduction&gt;30&lt;/mechanicalReduction&gt; &lt;/actuator&gt; &lt;/transmission&gt; &lt;gazebo&gt; &lt;plugin filename=&quot;libgazebo_ros_control.so&quot; name=&quot;gazebo_ros_control&quot;&gt; &lt;robotNamespace&gt;wam_v&lt;/robotNamespace&gt; &lt;/plugin&gt; &lt;plugin filename=&quot;libsimple_buoyancy_plugin.so&quot; name=&quot;simple_buoyancy_base_right&quot;&gt; &lt;target_link&gt;base_footprint&lt;/target_link&gt; &lt;cob_x&gt;0.5&lt;/cob_x&gt; &lt;cob_y&gt;-1.05&lt;/cob_y&gt; &lt;cob_z&gt;0.5&lt;/cob_z&gt; &lt;bbox_x&gt;4.0&lt;/bbox_x&gt; &lt;bbox_y&gt;0.5&lt;/bbox_y&gt; &lt;bbox_z&gt;0.5&lt;/bbox_z&gt; &lt;publish_data&gt;true&lt;/publish_data&gt; &lt;bbox_prefix&gt;right_bbox&lt;/bbox_prefix&gt; &lt;force_offset_x&gt;0.03&lt;/force_offset_x&gt; &lt;force_offset_y&gt;-1.05&lt;/force_offset_y&gt; &lt;/plugin&gt; &lt;plugin filename=&quot;libsimple_buoyancy_plugin.so&quot; name=&quot;simple_buoyancy_base_left&quot;&gt; &lt;target_link&gt;base_footprint&lt;/target_link&gt; &lt;cob_x&gt;0.5&lt;/cob_x&gt; &lt;cob_y&gt;1.05&lt;/cob_y&gt; &lt;cob_z&gt;0.5&lt;/cob_z&gt; &lt;bbox_x&gt;4.0&lt;/bbox_x&gt; &lt;bbox_y&gt;0.5&lt;/bbox_y&gt; &lt;bbox_z&gt;0.5&lt;/bbox_z&gt; &lt;publish_data&gt;true&lt;/publish_data&gt; &lt;bbox_prefix&gt;left_bbox&lt;/bbox_prefix&gt; &lt;force_offset_x&gt;0.03&lt;/force_offset_x&gt; &lt;force_offset_y&gt;1.05&lt;/force_offset_y&gt; &lt;/plugin&gt; &lt;plugin filename=&quot;libsimple_buoyancy_plugin.so&quot; name=&quot;simple_buoyancy_motor_right&quot;&gt; &lt;target_link&gt;right_motor&lt;/target_link&gt; &lt;position_reference_link&gt;base_footprint&lt;/position_reference_link&gt; &lt;cob_x&gt;-1.5&lt;/cob_x&gt; &lt;cob_y&gt;-1&lt;/cob_y&gt; &lt;cob_z&gt;0.2&lt;/cob_z&gt; &lt;bbox_x&gt;0.1&lt;/bbox_x&gt; &lt;bbox_y&gt;0.2&lt;/bbox_y&gt; &lt;bbox_z&gt;0.2&lt;/bbox_z&gt; &lt;publish_data&gt;true&lt;/publish_data&gt; &lt;/plugin&gt; &lt;plugin filename=&quot;libsimple_buoyancy_plugin.so&quot; name=&quot;simple_buoyancy_motor_left&quot;&gt; &lt;target_link&gt;left_motor&lt;/target_link&gt; &lt;position_reference_link&gt;base_footprint&lt;/position_reference_link&gt; &lt;cob_x&gt;-1.5&lt;/cob_x&gt; &lt;cob_y&gt;1&lt;/cob_y&gt; &lt;cob_z&gt;0.2&lt;/cob_z&gt; &lt;bbox_x&gt;0.1&lt;/bbox_x&gt; &lt;bbox_y&gt;0.2&lt;/bbox_y&gt; &lt;bbox_z&gt;0.2&lt;/bbox_z&gt; &lt;publish_data&gt;true&lt;/publish_data&gt; &lt;/plugin&gt; &lt;plugin filename=&quot;libhector_gazebo_ros_gps.so&quot; name=&quot;novatel_gps_sim&quot;&gt; &lt;alwaysOn&gt;1&lt;/alwaysOn&gt; &lt;updateRate&gt;10&lt;/updateRate&gt; &lt;bodyName&gt;gps&lt;/bodyName&gt; &lt;topicName&gt;fix&lt;/topicName&gt; &lt;velocityTopicName&gt;fix_velocity&lt;/velocityTopicName&gt; &lt;frameId&gt;gps&lt;/frameId&gt; &lt;drift&gt;5.0 5.0 5.0&lt;/drift&gt; &lt;gaussianNoise&gt;0.1 0.1 0.1&lt;/gaussianNoise&gt; &lt;velocityDrift&gt;0 0 0&lt;/velocityDrift&gt; &lt;velocityGaussianNoise&gt;0.1 0.1 0.1&lt;/velocityGaussianNoise&gt; &lt;referenceLatitude&gt;135.52491&lt;/referenceLatitude&gt; &lt;referenceLongitude&gt;34.822634&lt;/referenceLongitude&gt; &lt;referenceHeading&gt;0&lt;/referenceHeading&gt; &lt;/plugin&gt; &lt;plugin filename=&quot;libsimple_driving_force_plugin.so&quot; name=&quot;simple_driving_force_left&quot;&gt; &lt;target_link&gt;left_motor&lt;/target_link&gt; &lt;target_joint&gt;left_motor_joint&lt;/target_joint&gt; &lt;driving_force_controller&gt;/wam_v/right_driving_force_controller&lt;/driving_force_controller&gt; &lt;joint_state_topic&gt;/wam_v/joint_states&lt;/joint_state_topic&gt; &lt;/plugin&gt; &lt;plugin filename=&quot;libsimple_driving_force_plugin.so&quot; name=&quot;simple_driving_force_right&quot;&gt; &lt;target_link&gt;right_motor&lt;/target_link&gt; &lt;target_joint&gt;right_motor_joint&lt;/target_joint&gt; &lt;driving_force_controller&gt;/wam_v/left_driving_force_controller&lt;/driving_force_controller&gt; &lt;joint_state_topic&gt;/wam_v/joint_states&lt;/joint_state_topic&gt; &lt;/plugin&gt; &lt;plugin filename=&quot;libgazebo_ros_imu.so&quot; name=&quot;imu_plugin&quot;&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;bodyName&gt;base_link&lt;/bodyName&gt; &lt;topicName&gt;imu&lt;/topicName&gt; &lt;serviceName&gt;imu_service&lt;/serviceName&gt; &lt;gaussianNoise&gt;0.0&lt;/gaussianNoise&gt; &lt;updateRate&gt;20.0&lt;/updateRate&gt; &lt;/plugin&gt; &lt;plugin filename=&quot;libwater_surface_friction_plugin.so&quot; name=&quot;imu_plugin&quot;&gt; &lt;target_link&gt;base_footprint&lt;/target_link&gt; &lt;mu_linear&gt;20&lt;/mu_linear&gt; &lt;mu_angular&gt;20&lt;/mu_angular&gt; &lt;/plugin&gt; &lt;/gazebo&gt; &lt;gazebo reference=&quot;front_camera_link&quot;&gt; &lt;sensor name=&quot;camera&quot; type=&quot;camera&quot;&gt; &lt;update_rate&gt;30.0&lt;/update_rate&gt; &lt;plugin filename=&quot;libgazebo_ros_camera.so&quot; name=&quot;camera_controller&quot;&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;updateRate&gt;0.0&lt;/updateRate&gt; &lt;cameraName&gt;/wam_v/camera/front&lt;/cameraName&gt; &lt;imageTopicName&gt;image_raw&lt;/imageTopicName&gt; &lt;cameraInfoTopicName&gt;camera_info&lt;/cameraInfoTopicName&gt; &lt;frameName&gt;front_camera_link&lt;/frameName&gt; &lt;hackBaseline&gt;0.07&lt;/hackBaseline&gt; &lt;distortionK1&gt;0.0&lt;/distortionK1&gt; &lt;distortionK2&gt;0.0&lt;/distortionK2&gt; &lt;distortionK3&gt;0.0&lt;/distortionK3&gt; &lt;distortionT1&gt;0.0&lt;/distortionT1&gt; &lt;distortionT2&gt;0.0&lt;/distortionT2&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; &lt;gazebo reference=&quot;right_camera_link&quot;&gt; &lt;sensor name=&quot;camera&quot; type=&quot;camera&quot;&gt; &lt;update_rate&gt;30.0&lt;/update_rate&gt; &lt;plugin filename=&quot;libgazebo_ros_camera.so&quot; name=&quot;camera_controller&quot;&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;updateRate&gt;0.0&lt;/updateRate&gt; &lt;cameraName&gt;/wam_v/camera/right&lt;/cameraName&gt; &lt;imageTopicName&gt;image_raw&lt;/imageTopicName&gt; &lt;cameraInfoTopicName&gt;camera_info&lt;/cameraInfoTopicName&gt; &lt;frameName&gt;right_camera_link&lt;/frameName&gt; &lt;hackBaseline&gt;0.07&lt;/hackBaseline&gt; &lt;distortionK1&gt;0.0&lt;/distortionK1&gt; &lt;distortionK2&gt;0.0&lt;/distortionK2&gt; &lt;distortionK3&gt;0.0&lt;/distortionK3&gt; &lt;distortionT1&gt;0.0&lt;/distortionT1&gt; &lt;distortionT2&gt;0.0&lt;/distortionT2&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; &lt;gazebo reference=&quot;left_camera_link&quot;&gt; &lt;sensor name=&quot;camera&quot; type=&quot;camera&quot;&gt; &lt;update_rate&gt;30.0&lt;/update_rate&gt; &lt;plugin filename=&quot;libgazebo_ros_camera.so&quot; name=&quot;camera_controller&quot;&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;updateRate&gt;0.0&lt;/updateRate&gt; &lt;cameraName&gt;/wam_v/camera/left&lt;/cameraName&gt; &lt;imageTopicName&gt;image_raw&lt;/imageTopicName&gt; &lt;cameraInfoTopicName&gt;camera_info&lt;/cameraInfoTopicName&gt; &lt;frameName&gt;left_camera_link&lt;/frameName&gt; &lt;hackBaseline&gt;0.07&lt;/hackBaseline&gt; &lt;distortionK1&gt;0.0&lt;/distortionK1&gt; &lt;distortionK2&gt;0.0&lt;/distortionK2&gt; &lt;distortionK3&gt;0.0&lt;/distortionK3&gt; &lt;distortionT1&gt;0.0&lt;/distortionT1&gt; &lt;distortionT2&gt;0.0&lt;/distortionT2&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; &lt;gazebo reference=&quot;rear_camera_link&quot;&gt; &lt;sensor name=&quot;camera&quot; type=&quot;camera&quot;&gt; &lt;update_rate&gt;30.0&lt;/update_rate&gt; &lt;plugin filename=&quot;libgazebo_ros_camera.so&quot; name=&quot;camera_controller&quot;&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;updateRate&gt;0.0&lt;/updateRate&gt; &lt;cameraName&gt;/wam_v/camera/rear&lt;/cameraName&gt; &lt;imageTopicName&gt;image_raw&lt;/imageTopicName&gt; &lt;cameraInfoTopicName&gt;camera_info&lt;/cameraInfoTopicName&gt; &lt;frameName&gt;rear_camera_link&lt;/frameName&gt; &lt;hackBaseline&gt;0.07&lt;/hackBaseline&gt; &lt;distortionK1&gt;0.0&lt;/distortionK1&gt; &lt;distortionK2&gt;0.0&lt;/distortionK2&gt; &lt;distortionK3&gt;0.0&lt;/distortionK3&gt; &lt;distortionT1&gt;0.0&lt;/distortionT1&gt; &lt;distortionT2&gt;0.0&lt;/distortionT2&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; &lt;joint name=&quot;velodyne_base_mount_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&quot;0.8 0 0.3&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;velodyne_base_link&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;velodyne_base_link&quot;&gt; &lt;inertial&gt; &lt;mass value=&quot;0.1&quot;/&gt; &lt;origin xyz=&quot;0 0 0&quot;/&gt; &lt;inertia ixx=&quot;0.1&quot; ixy=&quot;0&quot; ixz=&quot;0&quot; iyy=&quot;0.1&quot; iyz=&quot;0&quot; izz=&quot;0.1&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://velodyne_description/meshes/VLP16_base_1.dae&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://velodyne_description/meshes/VLP16_base_2.dae&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&quot;0 0 0.03585&quot;/&gt; &lt;geometry&gt; &lt;cylinder length=&quot;0.0717&quot; radius=&quot;0.0516&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;velodyne_base_scan_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&quot;0 0 0.0377&quot;/&gt; &lt;parent link=&quot;velodyne_base_link&quot;/&gt; &lt;child link=&quot;velodyne&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;velodyne&quot;&gt; &lt;inertial&gt; &lt;mass value=&quot;0.1&quot;/&gt; &lt;origin xyz=&quot;0 0 0&quot;/&gt; &lt;inertia ixx=&quot;0.1&quot; ixy=&quot;0&quot; ixz=&quot;0&quot; iyy=&quot;0.1&quot; iyz=&quot;0&quot; izz=&quot;0.1&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 -0.0377&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://velodyne_description/meshes/VLP16_scan.dae&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;/link&gt; &lt;!-- Gazebo requires the velodyne_gazebo_plugins package --&gt; &lt;gazebo reference=&quot;velodyne&quot;&gt; &lt;sensor name=&quot;velodyne-VLP16&quot; type=&quot;ray&quot;&gt; &lt;pose&gt;0 0 0 0 0 0&lt;/pose&gt; &lt;visualize&gt;false&lt;/visualize&gt; &lt;update_rate&gt;10&lt;/update_rate&gt; &lt;ray&gt; &lt;scan&gt; &lt;horizontal&gt; &lt;samples&gt;1875&lt;/samples&gt; &lt;resolution&gt;1&lt;/resolution&gt; &lt;min_angle&gt;-3.14159265359&lt;/min_angle&gt; &lt;max_angle&gt; 3.14159265359&lt;/max_angle&gt; &lt;/horizontal&gt; &lt;vertical&gt; &lt;samples&gt;16&lt;/samples&gt; &lt;resolution&gt;1&lt;/resolution&gt; &lt;min_angle&gt;-0.261799387799&lt;/min_angle&gt; &lt;max_angle&gt; 0.261799387799&lt;/max_angle&gt; &lt;/vertical&gt; &lt;/scan&gt; &lt;range&gt; &lt;min&gt;0.055&lt;/min&gt; &lt;max&gt;140.0&lt;/max&gt; &lt;resolution&gt;0.001&lt;/resolution&gt; &lt;/range&gt; &lt;noise&gt; &lt;type&gt;gaussian&lt;/type&gt; &lt;mean&gt;0.0&lt;/mean&gt; &lt;stddev&gt;0.0&lt;/stddev&gt; &lt;/noise&gt; &lt;/ray&gt; &lt;plugin filename=&quot;libgazebo_ros_velodyne_laser.so&quot; name=&quot;gazebo_ros_laser_controller&quot;&gt; &lt;topicName&gt;/velodyne_points&lt;/topicName&gt; &lt;frameName&gt;/velodyne&lt;/frameName&gt; &lt;min_range&gt;0.9&lt;/min_range&gt; &lt;max_range&gt;130.0&lt;/max_range&gt; &lt;gaussianNoise&gt;0.008&lt;/gaussianNoise&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; &lt;gazebo reference=&quot;scan&quot;&gt; &lt;material&gt;Gazebo/Blue&lt;/material&gt; &lt;turnGravityOff&gt;false&lt;/turnGravityOff&gt; &lt;sensor name=&quot;scan_sensor&quot; type=&quot;ray&quot;&gt; &lt;pose&gt;0 0 0 0 0 0&lt;/pose&gt; &lt;visualize&gt;false&lt;/visualize&gt; &lt;update_rate&gt;40&lt;/update_rate&gt; &lt;ray&gt; &lt;scan&gt; &lt;horizontal&gt; &lt;samples&gt;720&lt;/samples&gt; &lt;resolution&gt;1&lt;/resolution&gt; &lt;min_angle&gt;-1.570796&lt;/min_angle&gt; &lt;max_angle&gt;1.570796&lt;/max_angle&gt; &lt;/horizontal&gt; &lt;/scan&gt; &lt;range&gt; &lt;min&gt;1&lt;/min&gt; &lt;max&gt;30.0&lt;/max&gt; &lt;resolution&gt;0.001&lt;/resolution&gt; &lt;/range&gt; &lt;/ray&gt; &lt;plugin filename=&quot;libgazebo_ros_laser.so&quot; name=&quot;gazebo_ros_head_hokuyo_controller&quot;&gt; &lt;topicName&gt;/scan&lt;/topicName&gt; &lt;frameName&gt;scan&lt;/frameName&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; &lt;/robot&gt; </code></pre> <p>The error has something to do with the <code>front_camera_link</code>:</p> <pre><code>XML parsing error: mismatched tag: line 47, column 4 when processing file: /home/philip/cbs_ws/src/freddy/urdf/wam-v.urdf Check that: - Your XML is well-formed - You have the xacro xmlns declaration: xmlns:xacro=&quot;http://www.ros.org/wiki/xacro&quot; RLException: Invalid &lt;param&gt; tag: Cannot load command parameter [robot_description]: command [['/opt/ros/melodic/share/xacro/xacro.py', '/home/philip/cbs_ws/src/freddy/urdf/wam-v.urdf']] returned with code [2]. Param xml is &lt;param command=&quot;<span class="math-container">$(find xacro)/xacro.py $</span>(arg model)&quot; name=&quot;robot_description&quot;/&gt; The traceback for the exception was written to the log file </code></pre> <p>All tags seem to match to me.</p> <hr /> <p><a href="https://answers.ros.org/question/410906/error-with-urdf-file-at-launch/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on ROS Answers with karma: 167 on 2022-12-28</p> <p>Post score: 0</p>
error with urdf file at launch
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>@mirakim It would be helpful to see your YAML file with local planner configuration.</p> <p>You can read more about parameters here: <a href="https://wiki.ros.org/base_local_planner?distro=melodic" rel="nofollow noreferrer">https://wiki.ros.org/base_local_planner?distro=melodic</a></p> <p>If you are using TEB planner, check this: <a href="https://wiki.ros.org/teb_local_planner" rel="nofollow noreferrer">https://wiki.ros.org/teb_local_planner</a></p> <p>If DW, the first link has a section about it.</p> <p>The obstacles should be visible in the costmap, perhaps this piece of info is missing and is a source of error?</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> with karma: 3064 on 2022-12-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102860
2022-12-28T21:17:12.000
|navigation|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I am working with navigation robot in obstacle situation, using navigation stack.</p> <p>For the test, I put the robot, obstacle, target in the same line and see if it can avoid the obstacle and go to target, making a curve path.</p> <p>As I anticipate, the navigation global path is made in a curve to avoid the obstacle. However, the local path does not follow the global path and make the robot get bumped to the obstacle while taking much time to escaping from it.</p> <p>Is there any way to make the local path be aware of the global path?</p> <p>Thanks in advance!!</p> <hr /> <p><a href="https://answers.ros.org/question/410933/robot-gets-stuck-in-front-of-obstacle-while-using-navigation-stack/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on ROS Answers with karma: 21 on 2022-12-28</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2022-12-28</strong>:<br /> What do you mean when you say that the robot does not follow the path? Is it not moving at all, or is it moving incorrectly?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on 2022-12-28</strong>:<br /> @ljaniec Yes It moves incorrectly! And I figured out that the path I uploaded is global path while the local path keeps ignoring the obstacle. So I change the topic from 'robot does not follow path in collision' to 'local path ignores obstacle'.</p>
robot gets stuck in front of obstacle while using navigation stack
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><code>new_msg_cloud</code> is a reference-counted object. Could the source be passing the same top-level object repeatedly to your combine method? If so, you'll end up storing n copies of the same object in the deque, each one getting updated to point to the latest PointCloud data. The solution would be to make a standalone copy of the <code>new_msg_cloud</code> object before storing it in the deque.</p> <p>I would call data source re-writing of a ref-counted object in this way a bug. If it's your own code doing it, you should fix that.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-30</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102862
2022-12-29T03:07:58.000
|ros|pcl|pointcloud|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I'm trying to combine multiple point clouds in a sliding window fashion using a deque and then publish again the final accumulated (or concatenated) point cloud. I'm using the following code:</p> <pre><code>void combinePointClouds(pcl::PointCloud&lt;PointType&gt;::Ptr&amp; current_cloud, pcl::PointCloud&lt;PointType&gt;::Ptr&amp; new_msg_cloud, int max_scans, std::deque&lt;pcl::PointCloud&lt;PointType&gt;::Ptr&gt;&amp; point_cloud_deque, unsigned long msg_timebase_ns, ros::Publisher&amp; publisher) { // Add the new point cloud to the deque point_cloud_deque.push_front(new_msg_cloud); // Clear the current point cloud current_cloud-&gt;clear(); // Add the points from the last max_scans point clouds to the current point cloud for (auto it = point_cloud_deque.begin(); it != point_cloud_deque.end(); it++) { *current_cloud += **it; } // Publish the point cloud publishPointCloud(current_cloud, msg_timebase_ns, publisher); // If the deque has more than max_scans elements, remove the oldest element if (point_cloud_deque.size() &gt;= max_scans) { point_cloud_deque.pop_back(); } } void publishPointCloud(pcl::PointCloud&lt;PointType&gt;::Ptr&amp; pcl_ptr, unsigned long msg_timebase_ns, ros::Publisher&amp; publisher) { sensor_msgs::PointCloud2 pcl_ros_msg; pcl::toROSMsg(*pcl_ptr.get(), pcl_ros_msg); pcl_ros_msg.header.stamp.fromNSec(msg_timebase_ns); pcl_ros_msg.header.frame_id = &quot;livox&quot;; publisher.publish(pcl_ros_msg); } </code></pre> <p>I checked the size of the point cloud right before being published and it's correct (it contains as many points as I would expect concatenating the point clouds). I also echoed the topic where I publish the point cloud and the total number of points correspond to the size of the point cloud before being published.</p> <p>When I visualize the final point cloud using RViz I can only see the points from the last scanned point cloud. For instance, if the last scanned point cloud has 8 points and accumulating the last 3 scans I expect to see 24, the size of the final point cloud is 24 but RViz shows only the 8 points of the last scan.</p> <p>If I removed the for loop over the deque as well as</p> <pre><code>current_cloud-&gt;clear(); </code></pre> <p>and use directly the command</p> <pre><code>*current_cloud += *new_msg_cloud; </code></pre> <p>then the point clouds are accumulated one scan at a time.</p> <p>I also saved the accumulated point clouds in a pcd file in the last &quot;if&quot; to make sure that the deque contained at least N scans. When I visualize the pcd file it shows again only the point cloud related to the last scan. I don't understand why the point clouds stored in the deque don't seem to concatenate but to overwrite.</p> <p>I also tried using a list rather than a deque and the result didn't change.</p> <hr /> <p><a href="https://answers.ros.org/question/410940/noetic-and-c++:-concatenate-point-clouds-using-a-deque/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/130719/iacopo/" rel="nofollow noreferrer">Iacopo</a> on ROS Answers with karma: 3 on 2022-12-29</p> <p>Post score: 0</p>
Noetic and C++: concatenate point clouds using a deque
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This code is never spinning, which is required.</p> <p>Your <code>ros::spin()</code> is accomplishing nothing, because the code is in the while loop. You need to add a <code>ros::spinOnce()</code> inside the while loop, or create a <code>ros::AsyncSpinner()</code> object before entering the while loop.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2022-12-30</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/130732/vitorw/" rel="nofollow noreferrer">VitorW</a> on 2023-01-10</strong>:<br /> it's working. Thank you for your help.</p>
102864
2022-12-29T05:52:23.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Greeting. Sory if I made any mistake, English is not native language for me. I have three subscribers that supposed to change global variable but, as far as I understand, or they don't call or they don't change this variable. Sorry if this is something simple or obvious, but I spend quite amount of time trying to understand what is wrong.</p> <p>Header:</p> <pre><code>#include &lt;ros/ros.h&gt; #include &lt;geometry_msgs/Twist.h&gt; #include &lt;sensor_msgs/Range.h&gt; #include &lt;sensor_msgs/LaserScan.h&gt; #include &lt;math.h&gt; #include &lt;stdlib.h&gt; void onIRSensor0(const sensor_msgs::Range &amp;msg); void onIRSensor1(const sensor_msgs::Range &amp;msg); void onIRSensor2(const sensor_msgs::Range &amp;msg); void onLaserSensor(const sensor_msgs::LaserScan &amp;msg); geometry_msgs::Twist update_velocity(); float const MYROBOT_MAX_LIN_VEL = 0.6; float const MYROBOT_MAX_ANG_VEL = 2.0; int const MYROBOT_SPEED = 1; static int const SEGMENTS = 24; float dist_front_0; float dist_front_1; float dist_front_2; float target_linear_velocity = 0.0; float target_angular_velocity = 0.0; float distances[SEGMENTS] = {}; </code></pre> <p>Node itself:</p> <pre><code>#include &lt;auto_teleop_c.h&gt; float lerp(float a, float b, float coeff){ return float(a) + float(b-a) * float(coeff); } void onIRSensor0(const sensor_msgs::Range &amp;msg){ ROS_INFO(&quot;inside onIRSensor0&quot;); dist_front_0 = msg.range / msg.max_range; } void onIRSensor1(const sensor_msgs::Range &amp;msg){ ROS_INFO(&quot;inside onIRSensor1&quot;); dist_front_1 = msg.range / msg.max_range; } void onIRSensor2(const sensor_msgs::Range &amp;msg){ ROS_INFO(&quot;inside onIRSensor2&quot;); dist_front_2 = msg.range / msg.max_range; } void onLaserSensor(const sensor_msgs::LaserScan &amp;msg){ for (int i = 0; i &lt; SEGMENTS; i++){ distances[i] = 9999.0; } float angle = msg.angle_min; float r = 0.0; for (int i = 0; i &lt; msg.ranges.size(); i++){ if (isinf(msg.ranges[i])) float r = 12.0; else float r = msg.ranges[i]; float a = angle * 180 / M_PI; int idx = int(a / (360 / SEGMENTS)) % SEGMENTS; distances[idx] = std::min(distances[idx], r); angle = angle + msg.angle_increment; } } geometry_msgs::Twist update_velocity(){ if (dist_front_1 &lt; 0.8){ target_angular_velocity = MYROBOT_MAX_ANG_VEL; } else if (dist_front_0 &lt; 0.8){ target_linear_velocity = MYROBOT_MAX_LIN_VEL * dist_front_0; target_angular_velocity = MYROBOT_MAX_ANG_VEL * (1 - dist_front_0); } else if (dist_front_2 &lt; 0.8){ target_linear_velocity = MYROBOT_MAX_LIN_VEL * dist_front_2; target_angular_velocity = -MYROBOT_MAX_ANG_VEL * (1 - dist_front_2); } else{ ROS_INFO(&quot;Case 4&quot;); int best_idx = 12; float best_val = distances[best_idx]; for (int i = 8; i &lt;=16; i++){ if (distances[i] &gt; best_val){ best_val = distances[i]; best_idx = i; } } float coeff = float(best_idx - 6) / 12.0; target_angular_velocity = lerp(-float(MYROBOT_MAX_ANG_VEL), float(MYROBOT_MAX_ANG_VEL), coeff); target_linear_velocity = MYROBOT_MAX_LIN_VEL * (1.0 - abs(coeff - 0.5) * 2.0); ROS_INFO(&quot;target_angular_velocity : %f&quot;, target_angular_velocity); ROS_INFO(&quot;target_linear_velocity : %f&quot;, target_linear_velocity); } geometry_msgs::Twist twist; twist.linear.x = target_linear_velocity; twist.linear.y = 0.0; twist.linear.z = 0.0; twist.angular.x = 0.0; twist.angular.y = 0.0; twist.angular.z = target_angular_velocity; return twist; } int main(int argc, char **argv){ ros::init(argc, argv, &quot;keyboard_teleop&quot;); ros::NodeHandle nh; ros::Publisher pub = nh.advertise&lt;geometry_msgs::Twist&gt;(&quot;/controller/cmd_vel&quot;, 10); ros::Subscriber sub_front_0 = nh.subscribe(&quot;/myrobot/sensor/front_0&quot;, 1000, onIRSensor0); ros::Subscriber sub_front_1 = nh.subscribe(&quot;/myrobot/sensor/front_1&quot;, 1000, onIRSensor1); ros::Subscriber sub_front_2 = nh.subscribe(&quot;/myrobot/sensor/front_2&quot;, 1000, onIRSensor2); ros::Subscriber sub_lidar = nh.subscribe(&quot;/myrobot/rplidar/scan&quot;, 1000, onLaserSensor); ros::Rate rate(10); while (ros::ok()){ pub.publish(update_velocity()); rate.sleep(); } ros::spin(); return 0; } </code></pre> <hr /> <p><a href="https://answers.ros.org/question/410948/subscriber-not-working/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/130732/vitorw/" rel="nofollow noreferrer">VitorW</a> on ROS Answers with karma: 3 on 2022-12-29</p> <p>Post score: 0</p>
Subscriber not working
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I think RTABMap can generate visual odometry from camera instead of /odom from wheels, it's right in the tutorial page:</p> <blockquote> <p><a href="http://wiki.ros.org/rtabmap_ros/Tutorials/SetupOnYourRobot#Kinect" rel="nofollow noreferrer">http://wiki.ros.org/rtabmap_ros/Tutorials/SetupOnYourRobot#Kinect</a></p> </blockquote> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/65268/martinerk0/" rel="nofollow noreferrer">martinerk0</a> with karma: 36 on 2022-12-30</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/61268/devin1126/" rel="nofollow noreferrer">Devin1126</a> on 2022-12-30</strong>:<br /> Thank you! I will look through this article to hopefully gain a better understanding.</p>
102866
2022-12-29T11:58:06.000
|ros|navigation|raspberrypi|base-odometry|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I am currently trying to accomplish autonomous navigation with a simple four-wheeled differential drive robot by building a static 2D binary occupancy map using the RTAB-Map SLAM package and having it navigate from some initial pose to a goal pose in that pre-saved map. The robot possesses a Raspberry Pi 4 that interfaces with both an <a href="https://www.intelrealsense.com/depth-camera-d435/" rel="nofollow noreferrer">Intel Realsense D435 RGB-D Camera</a> and <a href="https://www.ebay.com/itm/394337111238" rel="nofollow noreferrer">360-degree LIDAR sensor</a> for mapping and odometry purposes. The robot, however, does not possess wheel encoders that would also contribute to odometry measurements, but to my understanding, it may still be possible to accomplish my goal without them. At this point, though, I am having trouble finding a clear solution to achieving this. If anyone could point me in the direction of an article or paper that describes this type of problem and a solution, I would truly appreciate it. Both the Raspberry Pi 4 and the remote laptop (Dell G5 15) interfacing with the robot are operating on Ubuntu 20.04 with ROS noetic.</p> <hr /> <p><a href="https://answers.ros.org/question/410954/is-rtab-map-slam-possible-with-my-robot%27s-current-configuration?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/61268/devin1126/" rel="nofollow noreferrer">Devin1126</a> on ROS Answers with karma: 7 on 2022-12-29</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-01-02</strong>:<br /> Unfortunately this appears to be a duplicate of #q410850.</p>
Is RTAB-Map SLAM Possible with My Robot's Current Configuration?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>add a getter function for the count_. Then, in main(), add a while loop that polls for getCount(). Break once it surpasses 10.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/128793/kacaroll/" rel="nofollow noreferrer">kacaroll</a> with karma: 41 on 2023-01-05</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102868
2022-12-29T20:40:34.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to stop this code if <code>count_</code> is larger than 10. How can I do it? This is the publiser_member_function.cpp:</p> <pre><code>#include &lt;chrono&gt; #include &lt;memory&gt; #include &quot;rclcpp/rclcpp.hpp&quot; #include &quot;std_msgs/msg/string.hpp&quot; using namespace std::chrono_literals; /* This example creates a subclass of Node and uses std::bind() to register a * member function as a callback from the timer. */ class MinimalPublisher : public rclcpp::Node { public: MinimalPublisher() : Node(&quot;minimal_publisher&quot;), count_(0) { publisher_ = this-&gt;create_publisher&lt;std_msgs::msg::String&gt;(&quot;topic&quot;, 10); timer_ = this-&gt;create_wall_timer( 500ms, std::bind(&amp;MinimalPublisher::timer_callback, this)); } private: void timer_callback() { auto message = std_msgs::msg::String(); message.data = &quot;Hello, world! &quot; + std::to_string(count_++); RCLCPP_INFO(this-&gt;get_logger(), &quot;Publishing: '%s'&quot;, message.data.c_str()); publisher_-&gt;publish(message); } rclcpp::TimerBase::SharedPtr timer_; rclcpp::Publisher&lt;std_msgs::msg::String&gt;::SharedPtr publisher_; size_t count_; }; int main(int argc, char * argv[]) { rclcpp::init(argc, argv); rclcpp::spin(std::make_shared&lt;MinimalPublisher&gt;()); rclcpp::shutdown(); return 0; } </code></pre> <hr /> <p><a href="https://answers.ros.org/question/410962/stop-publishing-in-condition/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/21033/young/" rel="nofollow noreferrer">Young</a> on ROS Answers with karma: 3 on 2022-12-29</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/26871/billy/" rel="nofollow noreferrer">billy</a> on 2023-01-02</strong>:<br /> This sounds like a general C++ question and not ROS. I suggest general C++ forums since general programming questions not encouraged here.</p>
stop publishing in condition
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Did you source the ROS2 in the terminal before these commands? Did you use <code>sudo</code> with some of the ROS commands during the installation or installing dependencies? Perhaps you did this (from <code>rosdep -h</code>):</p> <blockquote> <p><code>rosdep fix-permissions</code> Recursively change the permissions of the user's ros home directory. May require sudo. Can be useful to fix permissions after calling <code>rosdep update</code> with <code>sudo</code> accidentally.</p> </blockquote> <p>Please check it in your workspace (<code>sudo rosdep fix-permissions</code>). Can you check your user groups (<code>groups</code>) and show them?</p> <p>Some related Q&amp;A to check:</p> <ul> <li><a href="https://answers.ros.org/question/206727/permission-denied/" rel="nofollow noreferrer">https://answers.ros.org/question/206727/permission-denied/</a></li> <li><a href="https://www.theconstructsim.com/ros-beginner-mistakes-1-missing-execute-permission-on-the-python-file/" rel="nofollow noreferrer">https://www.theconstructsim.com/ros-beginner-mistakes-1-missing-execute-permission-on-the-python-file/</a></li> <li><a href="https://answers.ros.org/question/303073/rosserial-permission-denied/" rel="nofollow noreferrer">https://answers.ros.org/question/303073/rosserial-permission-denied/</a></li> <li><a href="https://answers.ros.org/question/281477/ioerror-errno-13-permission-denied-rosrosdepsourcescacheindex/" rel="nofollow noreferrer">https://answers.ros.org/question/281477/ioerror-errno-13-permission-denied-rosrosdepsourcescacheindex/</a></li> <li><a href="https://www.myzhar.com/blog/the-myzharbot-project/software/myzharbot-ros/ros-solving-annoying-permission-denied-gvfs-error-crawling-packages/" rel="nofollow noreferrer">https://www.myzhar.com/blog/the-myzharbot-project/software/myzharbot-ros/ros-solving-annoying-permission-denied-gvfs-error-crawling-packages/</a></li> <li><a href="https://answers.ros.org/question/342149/permission-denied-when-importing-tf/" rel="nofollow noreferrer">https://answers.ros.org/question/342149/permission-denied-when-importing-tf/</a></li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> with karma: 3064 on 2022-12-30</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102870
2022-12-30T05:34:13.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi guys,</p> <p>I have just made a fresh installation of ROS2 Galactic following the guide in the documentation. I need to use galactic for the time being because of other dependencies in a project.</p> <p>If I try to run basic ros2 commands like:</p> <pre><code>ros2 topic list </code></pre> <p>or</p> <pre><code>ros2 node list </code></pre> <p>I get the following error message:</p> <pre><code>Failed opening file /home/martin/.ros/log/python3_87631_1672396098403.log for writing: Permission denied </code></pre> <p>It seems that ros does not have permission to create a new file in the <code> .ros/log/</code> folder.</p> <p>Have anyone experienced something similar, or know a fix?</p> <p>Thanks!</p> <p><strong>System info</strong></p> <p>Linux 5.15.0-56-generic</p> <p>Ubuntu 20.04.5 LTS</p> <p>gcc 9.4.0</p> <p>ROS_VERSION=2</p> <p>ROS_PYTHON_VERSION=3</p> <p>ROS_LOCALHOST_ONLY=0</p> <p>ROS_DISTRO=galactic</p> <hr /> <p><a href="https://answers.ros.org/question/410967/permission-denied-when-using-basic-ros2-cli/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/90158/mashyke/" rel="nofollow noreferrer">MasHyke</a> on ROS Answers with karma: 23 on 2022-12-30</p> <p>Post score: 0</p>
Permission denied when using basic ROS2 CLI
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>ROS Noetic is the last ROS 1 distribution, and it is only supported in Ubuntu 20.04. You won't be able to use any ROS 1 packages in Ubuntu 22.04; you'll have to migrate your packages to ROS 2 Humble first. This is definitely not a trivial process, but here is a good place to start: <a href="https://docs.ros.org/en/humble/The-ROS2-Project/Contributing/Migration-Guide.html" rel="nofollow noreferrer">Migration Guide</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/26169/robustify/" rel="nofollow noreferrer">robustify</a> with karma: 956 on 2022-12-31</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> on 2022-12-31</strong>:<br /> Ok thank you for answering my question and thanks for providing the migration guide link. I have one more question, does ROS Noetic and ROS 2 Humble work on Ubuntu 20?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/26169/robustify/" rel="nofollow noreferrer">robustify</a> on 2023-01-01</strong>:<br /> ROS Noetic works on Ubuntu 20.04. ROS 2 Humble only works on 22.04. ROS 2 Foxy and ROS 2 Galactic work on Ubuntu 20.04, but Galactic just went end-of-life on December 9th.</p> <p><a href="http://wiki.ros.org/Distributions" rel="nofollow noreferrer">ROS 1 Distros</a></p> <p><a href="https://docs.ros.org/en/rolling/Releases.html" rel="nofollow noreferrer">ROS 2 Distros</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> on 2023-01-01</strong>:<br /> Ok got it, thank you for answering all my questions and providing the links for ROS 1 and ROS 2 version distributions.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/163841/cervalls/" rel="nofollow noreferrer">Cervalls</a> on 2023-07-19</strong>:<br /> Hello @Robo_guy, Regarding this project, how did it evolve. I actually find myself in the same situation. I had a Ubuntu 18 with ROS Melodic and migrated my workspace to a Ubuntu 20.04 with Ros Noetic machine. Minor issues with Python 2 and Python 3 came up. I am now looking to update to ROS 2 and am hesitating whether to go for:</p> <ol> <li>Ubuntu 20.04+ROS2 Foxy(+ROS1 Noetic) - conservative approach with EoL in June 2023 OR</li> <li>Ubuntu 22.04+ROS2 Humble - bolder approach</li> </ol> <p><strong>Comment by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> on 2023-07-21</strong>:<br /> Hi @Cervalls, it depends, I needed to upgrade since the ROS2 version supported on melodic at reached EOL and the projects I am working on require ROS 1 Noetic and ROS2 Foxy. Regarding your decision, you should see if you are going to need ROS 1 or only ROS2. If you are going to need only ROS 2 then go with Ubuntu 22.04+ROS2 Humble but if your work will involve using both ROS 1 and ROS 2 then go for Ubuntu 20.04+ROS2 Foxy(+ROS1 Noetic)</p>
102875
2022-12-31T00:53:36.000
|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello everyone, I am presently having Ubuntu 18 on my laptop with ROS Melodic installed and I want to upgrade to Ubuntu 22 and install ROS 2 Humble. I want to know if upgrading to higher Ubuntu versions causes any problems in the existing ROS codes and packages. I just want to upgrade my Ubuntu version, install ROS Noetic and install ROS 2 Humble. If anybody has upgraded their Ubuntu version, please let me know if you encountered any problems in running previous existing ROS Melodic or previous ROS version packages or it is safe to upgrade and all existing ROS packages run smoothly.</p> <hr /> <p><a href="https://answers.ros.org/question/410987/upgrade-from-ubuntu-18-to-ubuntu-22-and-install-ros-2-humble/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> on ROS Answers with karma: 115 on 2022-12-31</p> <p>Post score: 0</p>
Upgrade from Ubuntu 18 to Ubuntu 22 and install ROS 2 Humble
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi @Hongbo Miao, I am not sure why the launch folder is not shown in the tutorial but it will be inside the package <code>py_launch_example</code> After that, the launch file script that you will write later will be put inside this launch folder.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> with karma: 115 on 2023-01-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/4114/hongbo-miao/" rel="nofollow noreferrer">Hongbo Miao</a> on 2023-01-01</strong>:<br /> Thanks @Robo_guy ! I opened a pull request to update the document at <a href="https://github.com/ros2/ros2_documentation/pull/3264" rel="nofollow noreferrer">https://github.com/ros2/ros2_documentation/pull/3264</a> Please correct if I am wrong, thanks! </p> <p><strong>Comment by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> on 2023-01-02</strong>:<br /> Yes I checked, it is correct </p>
102877
2023-01-01T04:21:28.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In the <a href="https://docs.ros.org/en/humble/Tutorials/Intermediate/Launch/Launch-system.html" rel="nofollow noreferrer">launch file tutorial</a>, I am a little confused where should I put this <code>launch</code> folder, and what is the content of this folder?</p> <p>Can someone help clarify? Thanks!</p> <p><img src="https://user-images.githubusercontent.com/3375461/210166079-f3ee4383-0175-4b80-ae02-b7413471a44d.png" alt="image description" /></p> <hr /> <p><a href="https://answers.ros.org/question/410994/where-should-i-put-launch-folder?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/4114/hongbo-miao/" rel="nofollow noreferrer">Hongbo Miao</a> on ROS Answers with karma: 70 on 2023-01-01</p> <p>Post score: 0</p>
Where should I put launch folder?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I solved this problem. It was pretty trivial and silly.</p> <p>All I had to do was make a directory <code>resource/</code> in the place where <code>setup.py</code> and <code>package.xml</code> exists and create an empty file inside the <code>resource/</code> directory with the name same as the <strong>package</strong> name.</p> <p>I might have not included this directory when I did a <code>git add</code>. Hence, when I cloned this package I faced this error. I would still like to know the purpose of the <code>resource/</code> directory.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/70847/tsadarsh/" rel="nofollow noreferrer">tsadarsh</a> with karma: 78 on 2023-01-02</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/78090/bribri123/" rel="nofollow noreferrer">bribri123</a> on 2023-03-04</strong>:<br /> my resource folder was already there i just needed to rename the file inside</p>
102879
2023-01-02T00:03:19.000
|ros|ros2|colcon|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am using ROS2 Humble in Pop!_OS 22.04 LTS.</p> <p>This is very surprising to me. Until yesterday the <a href="https://github.com/tsadarsh/beaming" rel="nofollow noreferrer">package</a> (beaming: I am making this package for my robot) was building fine. But today when I tried doing a <code>colcon build</code> it fails with the following error:</p> <pre><code>Starting &gt;&gt;&gt; beaming stderr: beaming /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( error: can't copy 'resource/beaming': doesn't exist or not a regular file Failed &lt;&lt;&lt; beaming [1.37s, exited with code 1] Summary: 0 packages finished [2.06s] 1 package failed: beaming 1 package had stderr output: beaming </code></pre> <p>I made sure that I was sourcing the workspace before doing the <code>colcon build</code>. I found <a href="https://stackoverflow.com/questions/72072031/ros2-colcon-build-fails-cant-copy-doesnt-exist-or-not-a-regular-file">this</a> issue similar to mine but the same error shows up even after deleting <code>build/</code> and <code>install/</code> directories as proposed in the solutions. Is this is an issue with the <em>colcon</em> tool or something local in my workspace? How do I fix this?</p> <p>Thanks in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/411003/colcon-build-error:-can%27t-copy-%27resource/%3Cpkg-name%3E%27:-doesn%27t-exist-or-not-a-regular-file/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/70847/tsadarsh/" rel="nofollow noreferrer">tsadarsh</a> on ROS Answers with karma: 78 on 2023-01-02</p> <p>Post score: 0</p>
colcon build error: can't copy 'resource/<pkg-name>': doesn't exist or not a regular file
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am getting the values in the <code>accel/filtered</code> and <code>odometry/filtered</code> once I fixed my tf tree. I had to set the transforms between <code>odom</code> =&gt; <code>base_link</code>.</p> <p>If you are using wheel encoders, <a href="https://github.com/klintan/ros2_differential_drive" rel="nofollow noreferrer">this</a> may help you transform wheel ticks to odometry data and publish the <code>base_link</code> to <code>odom</code> transformation.</p> <p>If you are using an imu (I am using an integrated on: Intel Realsense D435i), <a href="https://github.com/CCNYRoboticsLab/imu_tools" rel="nofollow noreferrer">this</a> node publishes the required transformation. Check out <a href="https://github.com/IntelRealSense/realsense-ros/issues/2563#issuecomment-1351852527" rel="nofollow noreferrer">this</a> also.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/70847/tsadarsh/" rel="nofollow noreferrer">tsadarsh</a> with karma: 78 on 2023-01-04</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 3</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-04-15</strong>:\</p> <blockquote> <p>What should be published in /clock when using a real robot?</p> </blockquote> <p>I'll point out that this is not an answer to the question in the title of this post.</p>
102881
2023-01-03T02:04:26.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to visualise my robot's odometry. I have a physical 4-wheel robot with me. They publish when the encoder ticks and the IMU values. To get the fused data and the <code>tf</code> from <code>base_link</code> to <code>odom</code> frame I am using the <code>robot_localization</code> package. Unfortunately, there is no data being published in <code>odometry/filtered</code> and <code>accel/filtered</code>.</p> <p>This <a href="https://robotics.stackexchange.com/questions/23115/robot-localization-ekf-node-does-not-publish-on-odometry-filtered-ros2-foxy">issue</a> is similar to mine. The solution given there is to start Gazebo properly so that data gets published in the <code>clock/</code> topic. <strong>But I do not want to simulate in Gazebo.</strong> I have a physical robot with me!</p> <p>Setting <code>use_sim_time</code> to <em>False</em> doesn't solve the problem.</p> <p>This is my <code>eky.yaml</code> file used by the <em>robot_localization</em> node:</p> <pre><code>### ekf config file ### ekf_filter_node: ros__parameters: frequency: 30.0 two_d_mode: false publish_acceleration: true publish_tf: true #map_frame: map # Defaults to &quot;map&quot; if unspecified odom_frame: odom # Defaults to &quot;odom&quot; if unspecified base_link_frame: base_link # Defaults to &quot;base_link&quot; ifunspecified world_frame: odom # Defaults to the value ofodom_frame if unspecified odom0: encoder/odom odom0_config: [true, true, true, false, false, false, false, false, false, false, false, true, false, false, false] imu0: camera/imu imu0_config: [false, false, false, true, true, true, false, false, false, false, false, false, false, false, false] </code></pre> <p>Here is the <code>display.launch.py</code> file that I am using:</p> <pre><code>import os from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch.conditions import IfCondition, UnlessCondition from launch.substitutions import Command, LaunchConfiguration from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare from launch_ros.descriptions import ParameterValue def generate_launch_description(): # Set the path to this package. pkg_share = FindPackageShare(package='r23_description').find('r23_description') # Set the path to the RViz configuration settings default_rviz_config_path = os.path.join(pkg_share, 'rviz/rviz_basic_settings.rviz') # Set the path to the URDF file default_urdf_model_path = os.path.join(pkg_share, 'urdf/r23_description.urdf') # Launch configuration variables specific to simulation gui = LaunchConfiguration('gui') urdf_model = LaunchConfiguration('urdf_model') rviz_config_file = LaunchConfiguration('rviz_config_file') use_robot_state_pub = LaunchConfiguration('use_robot_state_pub') use_rviz = LaunchConfiguration('use_rviz') use_sim_time = LaunchConfiguration('use_sim_time') # Declare the launch arguments declare_urdf_model_path_cmd = DeclareLaunchArgument( name='urdf_model', default_value=default_urdf_model_path, description='Absolute path to robot urdf file') declare_rviz_config_file_cmd = DeclareLaunchArgument( name='rviz_config_file', default_value=default_rviz_config_path, description='Full path to the RVIZ config file to use') declare_use_joint_state_publisher_cmd = DeclareLaunchArgument( name='gui', default_value='True', description='Flag to enable joint_state_publisher_gui') declare_use_robot_state_pub_cmd = DeclareLaunchArgument( name='use_robot_state_pub', default_value='True', description='Whether to start the robot state publisher') declare_use_rviz_cmd = DeclareLaunchArgument( name='use_rviz', default_value='True', description='Whether to start RVIZ') declare_use_sim_time_cmd = DeclareLaunchArgument( name='use_sim_time', default_value='False', description='Use simulation (Gazebo) clock if true') # Specify the actions # Publish the joint state values for the non-fixed joints in the URDF file. start_joint_state_publisher_cmd = Node( condition=UnlessCondition(gui), package='joint_state_publisher', executable='joint_state_publisher', name='joint_state_publisher') # A GUI to manipulate the joint state values start_joint_state_publisher_gui_node = Node( condition=IfCondition(gui), package='joint_state_publisher_gui', executable='joint_state_publisher_gui', name='joint_state_publisher_gui') # Subscribe to the joint states of the robot, and publish the 3D pose of each link. start_robot_state_publisher_cmd = Node( condition=IfCondition(use_robot_state_pub), package='robot_state_publisher', executable='robot_state_publisher', parameters=[{'use_sim_time': use_sim_time, 'robot_description': ParameterValue(Command(['cat ',default_urdf_model_path,]), value_type=str)}], arguments=[default_urdf_model_path]) # Launch RViz start_rviz_cmd = Node( condition=IfCondition(use_rviz), package='rviz2', executable='rviz2', name='rviz2', output='screen', arguments=['-d', rviz_config_file]) robot_localization_node = Node( package='robot_localization', executable='ekf_node', name='ekf_filter_node', output='screen', parameters=[os.path.join(pkg_share, 'config/ekf.yaml'), {'use_sim_time': LaunchConfiguration('use_sim_time')}] ) DeclareLaunchArgument(name='use_sim_time', default_value='False', description='Flag to enable use_sim_time'), # Create the launch description and populate ld = LaunchDescription() # Declare the launch options ld.add_action(declare_urdf_model_path_cmd) ld.add_action(declare_rviz_config_file_cmd) ld.add_action(declare_use_joint_state_publisher_cmd) ld.add_action(declare_use_robot_state_pub_cmd) ld.add_action(declare_use_rviz_cmd) ld.add_action(declare_use_sim_time_cmd) # Add any actions ld.add_action(start_joint_state_publisher_cmd) ld.add_action(start_joint_state_publisher_gui_node) ld.add_action(start_robot_state_publisher_cmd) ld.add_action(robot_localization_node) ld.add_action(start_rviz_cmd) return ld </code></pre> <p>Here is the sample data from <a href="https://pastebin.com/n6V6SrUs" rel="nofollow noreferrer">IMU</a> and <a href="https://pastebin.com/utsPi33y" rel="nofollow noreferrer">Encoders</a>.</p> <p>What changes do I need to make in order to get the <code>robot_localization</code> node to publish the <code>odom/filtered</code>, <code>accel/filtered</code> and the <code>odom</code> =&gt; <code>base_link</code> transformations?</p> <hr /> <p><a href="https://answers.ros.org/question/411025/what-should-be-published-in-/clock-when-using-a-real-robot?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/70847/tsadarsh/" rel="nofollow noreferrer">tsadarsh</a> on ROS Answers with karma: 78 on 2023-01-03</p> <p>Post score: 1</p>
What should be published in /clock when using a real robot?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>My question solved. When I run the following command,</p> <pre><code>roslaunch xarm_gazebo lite6_beside_table.launch </code></pre> <p>I got the following result.</p> <pre><code>Started ['lite6_traj_controller'] successfully Started ['joint_state_controller'] successfully </code></pre> <p>When I run the following command,</p> <pre><code>roslaunch xarm_gazebo lite6_beside_table.launch velocity_control:=true </code></pre> <p>I got the following result.</p> <pre><code>Started ['lite6_traj_controller_velocity'] successfully Started ['joint_state_controller'] successfully </code></pre> <p>Thank you for your reply.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/106378/renox/" rel="nofollow noreferrer">Renox</a> with karma: 27 on 2023-01-14</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102883
2023-01-03T14:11:35.000
|roslaunch|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I couldn't understand the meaning of the following description(value) in the launch file. I couldn't understand a description that combines eval, if and else.</p> <pre><code>&lt;arg name=&quot;uf_traj_controller&quot; value=&quot;$(eval 'lite6_traj_controller_velocity' if arg('velocity_control') else 'lite6_traj_controller')&quot; /&gt; </code></pre> <p>Please tell me the meaning of description of value.</p> <p>A part of launch file</p> <pre><code>&lt;launch&gt; &lt;arg name=&quot;run_demo_traj&quot; default=&quot;false&quot;/&gt; &lt;arg name=&quot;effort_control&quot; default=&quot;false&quot;/&gt; &lt;arg name=&quot;velocity_control&quot; default=&quot;false&quot;/&gt; &lt;arg name=&quot;namespace&quot; default=&quot;ufactory&quot;/&gt; &lt;arg name=&quot;add_gripper&quot; default=&quot;false&quot; /&gt; &lt;!-- Load joint controller configurations from YAML file to parameter server --&gt; &lt;!-- Load trajectory controller for xArm by default --&gt; &lt;rosparam unless=&quot;<span class="math-container">$(arg run_demo_traj)" file="$</span>(find xarm_controller)/config/lite6_traj_controller.yaml&quot; command=&quot;load&quot; ns=&quot;<span class="math-container">$(arg namespace)"/&gt; &lt;arg name="uf_traj_controller" value="$</span>(eval 'lite6_traj_controller_velocity' if arg('velocity_control') else 'lite6_traj_controller')&quot; /&gt; &lt;node unless=&quot;<span class="math-container">$(arg run_demo_traj)" name="traj_controller_spawner" pkg="controller_manager" type="controller_manager" respawn="false" output="screen" ns="/$</span>(arg namespace)&quot; args=&quot;spawn $(arg uf_traj_controller) joint_state_controller&quot;/&gt; &lt;!-- run_demo: load the position controllers --&gt; &lt;rosparam if=&quot;<span class="math-container">$(arg run_demo_traj)" file="$</span>(find xarm_controller)/config/lite6_position_controllers.yaml&quot; command=&quot;load&quot; ns=&quot;<span class="math-container">$(arg namespace)"/&gt; &lt;node if="$</span>(arg run_demo_traj)&quot; name=&quot;position_controller_spawner&quot; pkg=&quot;controller_manager&quot; type=&quot;spawner&quot; respawn=&quot;false&quot; output=&quot;screen&quot; ns=&quot;/$(arg namespace)&quot; args=&quot;joint1_position_controller joint2_position_controller joint3_position_controller joint4_position_controller joint5_position_controller joint6_position_controller joint_state_controller&quot;/&gt; &lt;/launch&gt; </code></pre> <hr /> <p><a href="https://answers.ros.org/question/411038/please-tell-me-the-meaning-of-the-description-in-the-launch-file/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/106378/renox/" rel="nofollow noreferrer">Renox</a> on ROS Answers with karma: 27 on 2023-01-03</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-01-07</strong>:\</p> <blockquote> <p>if arg('velocity_control') else ...</p> </blockquote> <p>I didn't test it, but I do not think this reads the variable. I'd have written it: <code>$(arg velocity_control)</code></p> <p>Update: nope, looks like I'm wrong. According to <a href="https://wiki.ros.org/roslaunch/XML" rel="nofollow noreferrer">https://wiki.ros.org/roslaunch/XML</a> inside an eval the syntax is different, so this will work.</p>
Please tell me the meaning of the description in the launch file
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>After being pointed to the right links, found out that it is best practice to always use catkin_EXPORTED_TARGETS for any pkg that depends on any ROS message, service, etc... pkg1_EXPORTED_TARGETS is only required if pkg1 creates new messages, actions, headers, etc.. (non libs) pkg1_generate_messages_cpp is a subset of pkg1_EXPORTED_TARGETS catkin_EXPORTED_TARGETS does NOT include messages, actions, headers, etc... from the current project</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/128793/kacaroll/" rel="nofollow noreferrer">kacaroll</a> with karma: 41 on 2023-01-05</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102886
2023-01-04T21:01:07.000
|ros|ros-melodic|catkin|build|add-dependencies|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Let's suppose pkg1 creates new services, messages, and actions. If I want a cpp ROS node from within this pkg1 to ensure that the messages, services, and actions are all built before the cpp file is built, would I add: add_dependencies(cpp_file_target pkg1_EXPORTED_TARGETS) or add_dependencies(cpp_file_target pkg1_generate_messages_cpp)? Really, what's the difference in this case?</p> <p>Additionally, if pkg2 wanted to use messages from pkg1, and find_package() included pkg1, would a dependency on ${catkin_EXPORTED_TARGETS} be sufficient? Or would pkg2 need to depend on pkg1_generate_messages_cpp?</p> <p>I wasn't able to find a clear answer within the documentation and would appreciate guidance for best practices.</p> <hr /> <p><a href="https://answers.ros.org/question/411077/when-to-use-the-dependency-exported_targets-vs-generate_messages_cpp/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/128793/kacaroll/" rel="nofollow noreferrer">kacaroll</a> on ROS Answers with karma: 41 on 2023-01-04</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-01-05</strong>:<br /> I seem to remember this has been discussed before. See #q286311, #q201227 and #q52744 for instance. The second Q&amp;A links to relevant documentation. The third Q&amp;A's accepted answer has a bunch of comments which go into some more detail, <em>and</em> the second answer is the preferred way of doing things &quot;nowadays&quot; (note: the third Q&amp;A is from 2013).</p> <p>If you could read those (and perhaps find some additional info, use Google, append <code>site:answers.ros.org</code> to your query), and things are still unclear, please update your question and explain what is unclear exactly.</p> <p>Let's try to avoid duplicating discussions.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/128793/kacaroll/" rel="nofollow noreferrer">kacaroll</a> on 2023-01-05</strong>:<br /> Thanks for the tip. <a href="https://answers.ros.org/question/235035/add_dependencies_generate_messages_cpp-needed-when-depending-on-own-message-package/" rel="nofollow noreferrer">This additional discussion</a> along with your links answered my question:</p>
When to use the dependency EXPORTED_TARGETS vs generate_messages_cpp
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Yes, the reason is that the <code>JointState</code> message <a href="http://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/JointState.html" rel="nofollow noreferrer">http://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/JointState.html</a> is more like a <em>container</em> than a controller. You send an information (e.g. the position of a particular joint) and the robot move to that coordinate. The <em>velocity</em> field in the message are not changing the <em>velocity</em> (meant as a <em>state</em>) of the robot. But they are used more for &quot;information porpuses&quot;. If you want to change the speed/velocity of the robot for moving from point A to point B slower or quicker, then you can only control the <em>frequency</em> of the JointState message. By increasing or reducing the time lapse between two messages, you can <em>control</em> the speed/velocity for your robot around one or more joints. Is it clear?</p> <p><strong>EDIT</strong>: For instance, let's take the tutorial on this site and let change it to move quickly around the 3 joints: <a href="https://docs.ros.org/en/humble/Tutorials/Intermediate/URDF/Using-URDF-with-Robot-State-Publisher.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Tutorials/Intermediate/URDF/Using-URDF-with-Robot-State-Publisher.html</a></p> <p>Looking in the code, we find out, that a &quot;frequency&quot; has been passed as an argument to the method <code>loop_rate</code></p> <pre><code>... loop_rate = self.create_rate(30) ... </code></pre> <p>If we take the same code and replace the fixes value 30 with a variable:</p> <pre><code>... self.frequency = 30 ... loop_rate = self.create_rate(self.frequency) ... .... self.frequency += 10 # Or self.frequency -= 10 if you want to decrease your speed. ... </code></pre> <p>then you have indirectly changed the frequency at which you send the msg JointState</p> <p><strong>But pay attention</strong>: The example above is not professional and definetely not elegant. I personally would keep the loop_rate constant and change only the frequency at which the single joint state messages are sent. In pseudocode:</p> <pre><code>if (timecurrent - timeprevious) &gt; delta_time: # Where delta_time is a variable which can be changed according to your desired speed self.joint_pub.publish(joint_state) </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/19675/andromeda/" rel="nofollow noreferrer">Andromeda</a> with karma: 893 on 2023-01-09</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/116052/ramyun/" rel="nofollow noreferrer">ramyun</a> on 2023-01-09</strong>:<br /> Thank you for your comment about the velocity. I am actually new to this, can you please elaborate on your second comment (for the time lapse)? Because I think I did try increasing it and there was an overutilization of the channel. Maybe I did it the wrong way, I would appreciate any further details or any link that can guide me through it. Thanks again.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/19675/andromeda/" rel="nofollow noreferrer">Andromeda</a> on 2023-01-09</strong>:<br /> I edited my answer above</p>
102888
2023-01-05T09:52:20.000
|ros|moveit|python3|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am able to move a 2 arm ABB YuMi robot arm (7 joints and a gripper per arm) using the following function as intended (<a href="http://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/JointState.html" rel="nofollow noreferrer">http://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/JointState.html</a>)</p> <pre><code> def go_joint(self, position, arm, reuse_controller=False): if not reuse_controller: self.request_controller(arm) state = JointState() state.header = Header() state.header.stamp = rospy.Time.now() if arm == LEFT: state.name = ['yumi_robl_joint_1','yumi_robl_joint_2','yumi_robl_joint_3','yumi_robl_joint_4','yumi_robl_joint_5','yumi_robl_joint_6','yumi_robl_joint_7','gripper_l_joint'] else: state.name = ['yumi_robr_joint_1','yumi_robr_joint_2','yumi_robr_joint_3','yumi_robr_joint_4','yumi_robr_joint_5','yumi_robr_joint_6','yumi_robr_joint_7','gripper_r_joint'] state.position = position state.velocity = [10]*8 state.effort = [] self.cur_arm.go(state, wait=True) print(state) </code></pre> <p>However, despite the fact that the velocity is being registered (here is an print of the state)</p> <pre><code>header: seq: 0 stamp: secs: 1672929166 nsecs: 529814243 frame_id: '' name: - yumi_robl_joint_1 - yumi_robl_joint_2 - yumi_robl_joint_3 - yumi_robl_joint_4 - yumi_robl_joint_5 - yumi_robl_joint_6 - yumi_robl_joint_7 - gripper_l_joint position: [0.25920000672340393, -1.1437000036239624, 1.0319000482559204, 0.2806999981403351, -0.002400000113993883, 0.9562000036239624, -0.2125999927520752, 0.0] velocity: [10, 10, 10, 10, 10, 10, 10, 10] effort: [] </code></pre> <p>The speed of the movement is not changing. Any idea why this is happening ?</p> <hr /> <p><a href="https://answers.ros.org/question/411098/how-to-change-speed/velocity-when-moving-a-robot-using-jointstate?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/116052/ramyun/" rel="nofollow noreferrer">ramyun</a> on ROS Answers with karma: 3 on 2023-01-05</p> <p>Post score: 0</p>
How to change speed/velocity when moving a robot using JointState?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Turns out I had two problems:</p> <ol> <li><p>I had built in the wrong directory. Once I built in the correct directory <code>ros2 run</code> was able to find the script.</p> </li> <li><p>Once <code>ros2 run</code> did find it I get an &quot;Exec format error&quot; because I was missing <code>#! /bin/bash</code> at the top of the script.</p> </li> </ol> <p>With these two fixes, this is working!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/486/jbarry/" rel="nofollow noreferrer">jbarry</a> with karma: 280 on 2023-01-05</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102890
2023-01-05T12:53:11.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I would like to be able to run a bash script using <code>ros2 run &lt;my package&gt; &lt;my shell script&gt;</code>. I have added the shell script (<code>estop_nogui.sh</code>) to the <code>setup.py</code> of the package (it's a Python package) as follows:</p> <pre><code>entry_points={ 'console_scripts': [ 'spot_ros2 = spot_driver.spot_ros2:main', 'spot_commander = spot_driver.spot_commander:main', 'estop_gui = spot_driver.estop_gui:main', ], }, scripts = [ 'scripts/estop_nogui.sh', ], </code></pre> <p>This results in the file installed at <code>install/spot_driver/lib/spot_driver/</code>. It's an executable file but <code>ros2 run</code> can't find it. What else do I need to do for this?</p> <p>Thanks!</p> <p>-Jenny</p> <hr /> <p><a href="https://answers.ros.org/question/411104/ros2-run-bash-script-from-python-package/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/486/jbarry/" rel="nofollow noreferrer">jbarry</a> on ROS Answers with karma: 280 on 2023-01-05</p> <p>Post score: 0</p>
ros2 run bash script from Python package
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In short: you're using Python 2, which the main distribution(s) of <code>vcstool</code> no longer support.</p> <p>You'll either have to use Python 3 to run <code>vcstool</code>, or switch to the <a href="https://github.com/dirk-thomas/vcstool/commits/0.2.x" rel="nofollow noreferrer">0.2.x branch</a>.</p> <p>I'd suggest the former.</p> <p>Note this is mentioned <a href="https://github.com/dirk-thomas/vcstool/tree/daf389377310f7f31b2171f51a79af82c31bf3e2#python-27---34-support" rel="nofollow noreferrer">in the readme</a> of <code>vcstool</code>:</p> <blockquote> <h2>Python 2.7 / &lt;= 3.4 support</h2> <p>The latest version supporting Python 2.7 and Python &lt;= 3.4 is 0.2.x from the <a href="https://github.com/dirk-thomas/vcstool/tree/0.2.x" rel="nofollow noreferrer">0.2.x branch</a>.</p> </blockquote> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-01-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/125007/xdzye/" rel="nofollow noreferrer">xdzye</a> on 2023-01-06</strong>:<br /> Ok, thank you very much! I thought melodic is better to run with Python 2.7, or should i rebuild with Python3?</p> <p>I saw this thread: <a href="https://answers.ros.org/question/237613/how-to-define-ros-kinetic-to-use-python3-instead-of-python27/" rel="nofollow noreferrer">https://answers.ros.org/question/237613/how-to-define-ros-kinetic-to-use-python3-instead-of-python27/</a> and also your answer that suggests one can use basic functionality when building with python3, but I need opencv etc. to use rtabmap. Should I just stick to 2.7?</p> <p>I also found a gist that suggests another installation path for ros melodic with python3: <a href="https://gist.github.com/MBaranPeker/3005ed281cf03922d641ba98bf8088eb" rel="nofollow noreferrer">https://gist.github.com/MBaranPeker/3005ed281cf03922d641ba98bf8088eb</a> I dont really understand the sed commands in the gist so I cant judge if this would build all packages with Python3.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-01-08</strong>:<br /> It's perfectly possible to use Python 3 for <code>vcstool</code> while using Python 2 for Melodic.</p> <p>There is no need to build Melodic from source, nor for Python 3.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/125007/xdzye/" rel="nofollow noreferrer">xdzye</a> on 2023-01-18</strong>:<br /> Thank you, I got it working.</p>
102892
2023-01-06T03:49:35.000
|ros|ros-melodic|build-from-source|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I decided to build ROS Melodic from source instead and deleted all ROS Melodic packages and installation binaries.</p> <p>I've been following these steps: wiki.ros.org/melodic/Installation/Source</p> <p>Unfortunately it fails at <code>vcs import src &lt; melodic-desktop-full.rosinstall</code> with</p> <pre><code>Traceback (most recent call last): File &quot;/usr/local/bin/vcs&quot;, line 7, in &lt;module&gt; from vcstool.commands.vcs import main File &quot;/usr/local/lib/python2.7/dist-packages/vcstool/commands/__init__.py&quot;, line 1, in &lt;module&gt; from .branch import BranchCommand File &quot;/usr/local/lib/python2.7/dist-packages/vcstool/commands/branch.py&quot;, line 6, in &lt;module&gt; from .command import Command File &quot;/usr/local/lib/python2.7/dist-packages/vcstool/commands/command.py&quot;, line 6, in &lt;module&gt; from vcstool.executor import execute_jobs File &quot;/usr/local/lib/python2.7/dist-packages/vcstool/executor.py&quot;, line 31 file=stdout) ^ SyntaxError: invalid syntax </code></pre> <p>What can I do to fix this problem? I found nothing while searching for this.</p> <hr /> <p><a href="https://answers.ros.org/question/411112/building-ros-melodic-from-source-fails-at-vcs-import-src-%3C-melodic-desktop-full.rosinstall/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/125007/xdzye/" rel="nofollow noreferrer">xdzye</a> on ROS Answers with karma: 15 on 2023-01-06</p> <p>Post score: 0</p>
Building Ros Melodic from source fails at vcs import src < melodic-desktop-full.rosinstall
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Cheers for adding your config and sensor data. Very helpful.</p> <p>Right off the bat, you stated yourself that</p> <blockquote> <p>Pose from the visual SLAM. This is W.R.T. the starting position. Also, this is using the classic &quot;camera frame&quot; with Z facing forward.</p> </blockquote> <p>However, you have the <code>frame_id</code> of that pose data set to <code>odom</code>, and you also told the EKF that your <code>world_frame</code> was <code>odom</code>. ROS <a href="https://www.ros.org/reps/rep-0103.html" rel="nofollow noreferrer">assumes</a> a right-handed coordinate frame with +X forward, +Y left, and +Z up. While it's common for visual odometry sources to produce data in the camera frame, you need to account for that by (a) changing the <code>frame_id</code> in the visual odometry to be something like <code>camera</code> (you can name it whatever you want) and then (b) publishing a static transform (using, e.g., a <a href="https://wiki.ros.org/tf2_ros#Tools" rel="nofollow noreferrer">static_transform_publisher</a>) from <code>odom</code> to <code>camera</code> that captures the rotation from the coordinate frame I described to your camera frame.</p> <p>Secondly, you said you want to fuse the absolute orientation from your IMU with the position from your visual SLAM, but that's not going to work. Imagine that you start your robot facing 90 degrees in the ENU frame, so your initial pose in the world frame is (0, 0) with a heading of 90 degrees. Then you push the robot forward one meter. The visual odometry says your <code>(x, y)</code> position is now <code>(1, 0)</code>, but your IMU will say that your heading is still 90. So it will look like your robot moved laterally in the EKF output.</p> <p>If having a heading that is accurate w.r.t. the ENU frame is critical, then you need to change your visual slam input. You should either make it so that the visual slam node publishes velocity data and fuse that, or you should turn on <code>differential</code> mode for the visual slam data (all of it). In other words, fix the <code>frame_id</code> on your visual odometry, then do this:</p> <pre><code>imu0: &quot;imu/data&quot; imu0_differential: false imu0_relative: false imu0_queue_size: 100 imu0_remove_gravitational_acceleration: true imu0_config: [false, false, false, true, true, true, false, false, false, true, true, true, true, true, true] pose0: &quot;odometry/visual&quot; pose0_differential: true pose0_relative: false pose0_queue_size: 10 pose0_config: [true, true, true, true, true, true, false, false, false, false, false, false, false, false, false] </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3384/tom-moore/" rel="nofollow noreferrer">Tom Moore</a> with karma: 13689 on 2023-05-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/133412/mathislm/" rel="nofollow noreferrer">mathislm</a> on 2023-05-02</strong>:<br /> The second option is very similar to what I did: I'm adding to the slam's input an initial orientation that is the orientation of the IMU read at the start of the visual slam.</p>
102894
2023-01-06T04:25:21.000
|imu|navigation|ekf|robot-localization|ekf-localization-node|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I'm quite new to ROS and robot_localization so I'm getting confused really fast with TFs. I've been using for some time now a visual SLAM algorithm that works fine and I'd like to slowly improve my localization by fusing other data, hopefully I'm at the right place ! The first step I'd like to take is to fuse the IMU, especially to now have an absolute orientation w.r.t. gravity. Here is all the data I can have:</p> <ol> <li>Pose from the visual SLAM. This is W.R.T. the starting position. Also, this is using the classic &quot;camera frame&quot; with Z facing forward.</li> <li>The Linear acceleration and angular twist. This is expressed in the &quot;camera frame&quot;.</li> <li>The Orientation of the IMU W.R.T. the ENU frame, so this is an absolute orientation.</li> </ol> <p>It would be great if I could fuse my data like this:</p> <ul> <li>Fuse the absolute position from the SLAM with the acceleration from the IMU</li> <li>Fuse the absolute orientation from the IMU with the relative orientation of the SLAM (and angular twist from the IMU, though this is kind of &quot;duplicated data&quot; since it's already used to compute the orientation thanks to a madgwick filter).</li> </ul> <p>I managed to fuse the orientation using the &quot;differential&quot; parameter, but this orientation is not applied to my position ? Even though the base_link frame is beautifully tilted according to gravity, when I move the camera forward, base_link still goes up following world_frame Z axis, and not base_link Z axis. What could I have missed here ? Thanks in advance !</p> <p>Following the template of other questions asked here, I'm posting my config file and a sample of each of my messages.</p> <p>Here is my config file :</p> <pre><code>frequency: 10 sensor_timeout: 0.2 two_d_mode: false publish_tf: true world_frame: &quot;odom&quot; # map_frame: &quot;map&quot; odom_frame: &quot;odom&quot; base_link_frame: &quot;base_link&quot; print_diagnostics: true imu0: &quot;imu/data&quot; imu0_differential: false imu0_relative: false imu0_queue_size: 100 imu0_remove_gravitational_acceleration: true imu0_config: [ false, false, false, true, true, true, false, false, false, true, true, true, true, true, true] pose0: &quot;odometry/visual&quot; pose0_differential: true pose0_relative: false pose0_queue_size: 10 pose0_config: [ false, false, false, true, true, true, false, false, false, false, false, false, false, false, false] pose1: &quot;odometry/visual&quot; pose1_differential: false pose1_relative: false pose1_queue_size: 10 pose1_config: [ true, true, true, false, false, false, false, false, false, false, false, false, false, false, false] </code></pre> <p>Here is a sample of the visual SLAM message:</p> <pre><code>Pose message: header: seq: 1 stamp: 1672996698.261539459 frame_id: odom pose: pose: position: x: -4.2075920646311715245e-05 y: -0.00011147373152198269963 z: -0.0004081070655956864357 orientation: x: -1.1501989303764181268e-05 y: -9.490221587097517905e-06 z: 5.1159746290189072942e-05 w: 0.99999999858016019871 covariance[] covariance[0]: 1.0000000000000000623e-09 covariance[1]: 0 covariance[2]: 0 covariance[3]: 0 covariance[4]: 0 covariance[5]: 0 covariance[6]: 0 covariance[7]: 1.0000000000000000623e-09 covariance[8]: 0 covariance[9]: 0 covariance[10]: 0 covariance[11]: 0 covariance[12]: 0 covariance[13]: 0 covariance[14]: 1.0000000000000000623e-09 covariance[15]: 0 covariance[16]: 0 covariance[17]: 0 covariance[18]: 0 covariance[19]: 0 covariance[20]: 0 covariance[21]: 0.10000000000000000555 covariance[22]: 0 covariance[23]: 0 covariance[24]: 0 covariance[25]: 0 covariance[26]: 0 covariance[27]: 0 covariance[28]: 0.10000000000000000555 covariance[29]: 0 covariance[30]: 0 covariance[31]: 0 covariance[32]: 0 covariance[33]: 0 covariance[34]: 0 covariance[35]: 0.10000000000000000555 </code></pre> <p>Here is a sample of the IMU message : IMU message:</p> <pre><code>header: seq: 0 stamp: 1672996698.457345247 frame_id: imu orientation: x: -0.48278 y: 0.49618 z: -0.50431 w: 0.51614 orientation_covariance[] orientation_covariance[0]: 1e-06 orientation_covariance[1]: 0 orientation_covariance[2]: 0 orientation_covariance[3]: 0 orientation_covariance[4]: 1e-06 orientation_covariance[5]: 0 orientation_covariance[6]: 0 orientation_covariance[7]: 0 orientation_covariance[8]: 1e-06 angular_velocity: x: -0.0052141 y: -2.6929e-05 z: 8.508e-06 angular_velocity_covariance[] angular_velocity_covariance[0]: 0.001 angular_velocity_covariance[1]: 0 angular_velocity_covariance[2]: 0 angular_velocity_covariance[3]: 0 angular_velocity_covariance[4]: 0.001 angular_velocity_covariance[5]: 0 angular_velocity_covariance[6]: 0 angular_velocity_covariance[7]: 0 angular_velocity_covariance[8]: 0.001 linear_acceleration: x: -0.24852 y: -9.833 z: 0.40811 linear_acceleration_covariance[] linear_acceleration_covariance[0]: 0.001 linear_acceleration_covariance[1]: 0 linear_acceleration_covariance[2]: 0 linear_acceleration_covariance[3]: 0 linear_acceleration_covariance[4]: 0.001 linear_acceleration_covariance[5]: 0 linear_acceleration_covariance[6]: 0 linear_acceleration_covariance[7]: 0 linear_acceleration_covariance[8]: 0.001 </code></pre> <p>Also, my TF tree is super simple right now: map =&gt; (equal) odom =&gt; (set by robot_localisation) base_link =&gt; (equal) imu</p> <hr /> <p><a href="https://answers.ros.org/question/411114/%5Brobot-localization%5D-how-to-use-absolute-orientation-from-imu-with-absolut-positionning-from-visual-slam/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/133412/mathislm/" rel="nofollow noreferrer">mathislm</a> on ROS Answers with karma: 13 on 2023-01-06</p> <p>Post score: 1</p>
[Robot Localization] How to use absolute orientation from IMU with absolut positionning from visual SLAM
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>To include multiple instances of the same sensor type in the obstacle layer of the local costmap in ROS, you will need to follow these steps:</p> <p>1.Configure each sensor to publish its data to a separate topic. For example, if you have two LIDAR sensors that you want to include in the local costmap, you should configure each sensor to publish its data to a separate topic, such as /lidar_1/scan and /lidar_2/scan.</p> <p>2.Configure the costmap_2d node to subscribe to each of the sensor topics. You can do this by specifying the names of the sensor topics in the obstacle_layer section of the costmap_2d configuration file. For example, if you have two LIDAR sensors that you want to include in the local costmap, you should add the following lines to the obstacle_layer section of the configuration file:</p> <pre><code>obstacle_layer: ... observation_sources: scan scan_2 scan: {sensor_frame: lidar_1, data_type: LaserScan, topic: /lidar_1/scan} scan_2: {sensor_frame: lidar_2, data_type: LaserScan, topic: /lidar_2/scan} ... </code></pre> <p>3.Make sure that the costmap_2d node is correctly configured to transform the sensor data into the correct frame of reference. You can do this by specifying the correct sensor_frame and obstacle_layer_name parameters for each sensor in the obstacle_layer section of the costmap_2d configuration file. The sensor_frame parameter specifies the frame of reference for the sensor data, and the obstacle_layer_name parameter specifies the name of the layer in the costmap where the sensor data should be stored. I hope this helps clarify how to include multiple instances of the same sensor type in the obstacle layer of the local costmap. Let me know if you have any further questions or need more assistance.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/84595/shivam/" rel="nofollow noreferrer">Shivam</a> with karma: 66 on 2023-01-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/115712/chased11/" rel="nofollow noreferrer">chased11</a> on 2023-01-06</strong>:<br /> Awesome that's what I was looking for. Thanks!</p>
102896
2023-01-06T13:27:16.000
|slam|navigation|costmap|rtabmap|2dcostmap|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am trying to use 2 topics from RTABmap/obstacle_detection (obstacle, ground). Ground for the clearing and obstacle for marking.</p> <p>I am trying to follow <a href="https://answers.ros.org/question/219557/obstacle-avoidance-in-move_base-with-kinectxtion-depth-information/" rel="nofollow noreferrer">this</a> answer, and am not sure if I am doing it right.</p> <p>Below are my costmap params, I think i have it setup right but it looks like my local costmap is not updating, while my global costmap is. In my node graph it shows /ground being published to move_base but not /obstacles. Thanks!</p> <pre><code>local_costmap: global_frame: odom robot_base_frame: base_link update_frequency: 15.0 publish_frequency: 15.0 static_map: false rolling_window: true width: 8.0 height: 8.0 resolution: 0.025 origin_x: -2.0 origin_y: -2.0 plugins: - {name: obstacle_layer, type: &quot;costmap_2d::VoxelLayer&quot;} obstacle_layer: observation_sources: point_cloud_sensor laser_scan_sensor point_cloud_sensor: { sensor_frame: base_link, data_type: PointCloud2, topic: /obstacles, expected_update_rate: 0.5, marking: true, clearing: false, min_obstacle_height: -99999.0, max_obstacle_height: 99999.0} point_cloud_sensor: { sensor_frame: base_link, data_type: PointCloud2, topic: /ground, expected_update_rate: 0.5, marking: false, clearing: true, min_obstacle_height: -99999.0, max_obstacle_height: 99999.0 } </code></pre> <p>Global:</p> <pre><code> global_costmap: global_frame: map robot_base_frame: base_link update_frequency: 15 publish_frequency: 10 static_map: true </code></pre> <p>Common:</p> <pre><code>obstacle_range: 4 raytrace_range: 6 footprint: [[-0.6858, -0.762], [-0.6858, 0.762], [0.6858, 0.762], [0.6858, -0.762]] map_topic: map footprint_padding: 0.03 robot_radius: 1.1 inflation_radius: 0.35 transform_tolerance: 1 controller_patience: 2.0 NavfnROS: allow_unknown: true plugins: - {name: static_layer, type: &quot;costmap_2d::StaticLayer&quot;} - {name: obstacle_layer, type: &quot;costmap_2d::VoxelLayer&quot;} - {name: inflation_layer, type: &quot;costmap_2d::InflationLayer&quot;} recovery_behaviors: [ {name: conservative_clear, type: clear_costmap_recovery/ClearCostmapRecovery}, {name: aggressive_clear, type: clear_costmap_recovery/ClearCostmapRecovery} ] conservative_clear: reset_distance: 3.00 aggressive_clear: reset_distance: 1.84 </code></pre> <hr /> <p><a href="https://answers.ros.org/question/411131/how-to-have-more-than-1-of-the-same-sensor-types-in-obstacle-layer-of-local-costmap?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/115712/chased11/" rel="nofollow noreferrer">chased11</a> on ROS Answers with karma: 137 on 2023-01-06</p> <p>Post score: 0</p>
How to have more than 1 of the same sensor types in obstacle layer of local costmap?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Yes, you can see <a href="https://automaticaddison.com/sensor-fusion-using-the-robot-localization-package-ros-2/" rel="nofollow noreferrer">here</a> on the picture below, where the robot info goes.</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16732018001573048.jpg" alt="image description" /></p> <p>Yes, you can get it from <code>/tf</code> topic.</p> <p>You can read more about the state estimate here, in Nav2 documentation:</p> <ul> <li><a href="https://navigation.ros.org/concepts/index.html?highlight=odom#state-estimation" rel="nofollow noreferrer">https://navigation.ros.org/concepts/index.html?highlight=odom#state-estimation</a></li> </ul> <p>The goal of odometry is to provide a smooth and continuous local frame based on the robot's motion. However, it will drift over time as errors accumulate.</p> <p>On the other side, transformation <code>map-&gt;odom</code> can &quot;jump&quot; between values, but is usually more precise - it is provided by the positioning system (localization, mapping, SLAM).</p> <p>I don't know about any differences between the mentioned versions of ROS2 (Foxy, Galactic, Humble) - the interface is really similar or overall the same.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> with karma: 3064 on 2023-01-08</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
102898
2023-01-07T20:57:37.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I notice that the slam_toolbox for ROS2 foxy does not publish the topic pose (<a href="https://github.com/SteveMacenski/slam_toolbox/tree/foxy-devel" rel="nofollow noreferrer">https://github.com/SteveMacenski/slam_toolbox/tree/foxy-devel</a>). I have confirmed it on my own virtual machine with the apt-get package. As far as I know, SLAM means mapping and localization. Where does the robot pose goes if the toolbox doesn't publish it? Can I get it from the TF?<br /> May I use the pose map-&gt;Odom-&gt;base_link? Is it the same pose published on the pose topic for ROS galactic, humble and rolling?</p> <p>A similar question can be found on <a href="https://answers.ros.org/question/409825/slam_toolbox-no-pose-topic-published/" rel="nofollow noreferrer">this</a>.</p> <hr /> <p><a href="https://answers.ros.org/question/411147/the-slam_toolbox-for-ros2-foxy-does-not-publish-the-topic-pose./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/98868/bluebird/" rel="nofollow noreferrer">BlueBird</a> on ROS Answers with karma: 20 on 2023-01-07</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2023-01-09</strong>:<br /> Don't cross post (<a href="https://github.com/SteveMacenski/slam_toolbox/issues/564" rel="nofollow noreferrer">https://github.com/SteveMacenski/slam_toolbox/issues/564</a>).</p>
The slam_toolbox for ROS2 foxy does not publish the topic pose
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>So the issue turned out to be the fact that, this particular service launched as root, but we had established ssh with the remote machine as a user. Creating new keys and establishing it as the root seemed to fix the issue.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/114194/pran-seven/" rel="nofollow noreferrer">Pran-Seven</a> with karma: 11 on 2023-01-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102900
2023-01-09T05:09:56.000
|ros-melodic|roslaunch|ssh|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hey! So I have a setup where I want to launch my ROS nodes via a launch file, which in turn will ssh into a udoo board and the launch the necessary files for hardware communication. The launch file works great normally when I do roslaunch, and I have set up a passwordless connection between the PC running ROS and udoo, using the ssh-rsa protocol. I wanted to launch this on the robot upstart so used the robot-upstart package to create a service for launching. This is where my errors start, as the service does not be able to establish a ssh connection between the PC running ROS and the udoo board. The error is as follows:</p> <pre><code> Jan 09 15:12:26 seven-robot-2 systemd[1]: Started &quot;bringup test_ru_launch&quot;. Jan 09 15:12:26 seven-robot-2 root[3298]: test_ru_launch: Using workspace setup file /home/seven-robot-2/Seven_ROS/devel/setup.bash Jan 09 15:12:26 seven-robot-2 test_ru_launch-start[3297]: &lt;14&gt;Jan 9 15:12:26 root: test_ru_launch: Using workspace setup file /home/seven-robot-2/Seven_ROS/devel/setup.bash Jan 09 15:12:27 seven-robot-2 test_ru_launch-start[3297]: &lt;14&gt;Jan 9 15:12:27 root: test_ru_launch: Launching ROS_HOSTNAME=seven-robot-2, ROS_IP=, ROS_MASTER_URI=http://sevenrobot2:11311/, ROS_HOME=/root/.ros, ROS_LOG_DIR=/tmp Jan 09 15:12:27 seven-robot-2 test_ru_launch-start[3297]: ls: cannot access '/etc/ros/melodic/test_ru_launch.d/*.xacro': No such file or directory Jan 09 15:12:27 seven-robot-2 test_ru_launch-start[3297]: &lt;14&gt;Jan 9 15:12:27 root: test_ru_launch: Generated launchfile: /tmp/test_ru_launch.launch Jan 09 15:12:27 seven-robot-2 root[3359]: test_ru_launch: Started roslaunch as background process, PID 3358, ROS_LOG_DIR=/tmp Jan 09 15:12:27 seven-robot-2 test_ru_launch-start[3297]: &lt;14&gt;Jan 9 15:12:27 root: test_ru_launch: Started roslaunch as background process, PID 3358, ROS_LOG_DIR=/tmp Jan 09 15:12:28 seven-robot-2 test_ru_launch-start[3297]: xacro: in-order processing became default in ROS Melodic. You can drop the option. Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: remote[192.168.2.23-0]: failed to launch on udooqdl: Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: Unable to establish ssh connection to [root@192.168.2.23:22]: Server u'192.168.2.23' not found in known_hosts Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: RLException: unable to start remote roslaunch child: 192.168.2.23-0 Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: The traceback for the exception was written to the log file Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: ... logging to /tmp/edd14b60-9001-11ed-8c81-7c8334b0242e/roslaunch-seven-robot-2-3358.log Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: Checking log directory for disk usage. This may take a while. Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: Press Ctrl-C to interrupt Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: Done checking log file disk usage. Usage is &lt;1GB. Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: [31B blob data] Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: started roslaunch server http://seven-robot-2:46315/ Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: remote[192.168.2.23-0] starting roslaunch Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: remote[192.168.2.23-0]: creating ssh connection to 192.168.2.23:22, user[root] Jan 09 15:12:29 seven-robot-2 test_ru_launch-start[3297]: [192.168.2.23-0] killing on exit Jan 09 15:12:29 seven-robot-2 systemd[1]: test_ru_launch.service: Main process exited, code=exited, status=1/FAILURE Jan 09 15:12:29 seven-robot-2 systemd[1]: test_ru_launch.service: Failed with result 'exit-code'. Jan 09 15:12:29 seven-robot-2 systemd[1]: test_ru_launch.service: Service hold-off time over, scheduling restart. </code></pre> <p>The service and launch file is as follows:</p> <p>Service file:</p> <pre><code># THIS IS A GENERATED FILE, NOT RECOMMENDED TO EDIT. [Unit] Description=&quot;bringup test_ru_launch&quot; After=network.target Wants=network.target After=network-online.target Wants=network-online.target After=multi-user.target Wants=multi-user.target [Service] Type=simple ExecStart=/usr/sbin/test_ru_launch-start Restart=on-failure [Install] WantedBy=graphical.target </code></pre> <p>roslaunch file (part where ssh is established):</p> <pre><code>&lt;group&gt; &lt;machine name=&quot;udooqdl&quot; address=&quot;IP of the udoo&quot; user=&quot;root&quot; env-loader=&quot;/home/root/Seven_ROS/env_loader_udooqdl.sh&quot; default=&quot;true&quot;/&gt; &lt;rosparam file=&quot;<span class="math-container">$(find seven_robot_base)/params/robotParams.yaml" command="load" ns="$</span>(arg uavcanNs)/uavcan_ros_bridge&quot;/&gt; &lt;rosparam file=&quot;<span class="math-container">$(find seven_robot_localization)/params/diff_drive.yaml" command="load" ns="$</span>(arg uavcanNs)/uavcan_ros_bridge&quot;/&gt; &lt;include file=&quot;<span class="math-container">$(find uavcan_ros_bridge)/launch/uavcan_ros_bridge.launch"&gt; &lt;arg name="uavcanNs" value="$</span>(arg uavcanNs)&quot;/&gt; &lt;arg name=&quot;laser_enabled&quot; default=&quot;<span class="math-container">$(arg enable_Laser)"/&gt; &lt;arg name="publishuavcanTf" default="$</span>(arg publishcanTf)&quot;/&gt; &lt;arg name=&quot;enableMotors&quot; default=&quot;$(arg motors_enabled)&quot;/&gt; &lt;/include&gt; &lt;/group&gt; </code></pre> <p>Not sure what is causing the error, any help/suggestions is appreciated. Happy to provide more information if needed. I am running ROS melodic on Ubuntu 18.04. IP of the udoo is replaced by the actual IP address in the code.</p> <hr /> <p><a href="https://answers.ros.org/question/411174/ros-melodic-launching-on-a-remote-machine-with-robot-upstart/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/114194/pran-seven/" rel="nofollow noreferrer">Pran-Seven</a> on ROS Answers with karma: 11 on 2023-01-09</p> <p>Post score: 0</p>
ROS melodic launching on a remote machine with robot upstart
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>No. It is not possible, sorry. I made the same question here:</p> <p><a href="https://github.com/ros2/rosidl_typesupport/issues/128" rel="nofollow noreferrer">https://github.com/ros2/rosidl_typesupport/issues/128</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/13346/fmrico/" rel="nofollow noreferrer">fmrico</a> with karma: 85 on 2023-01-10</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 3</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/486/jbarry/" rel="nofollow noreferrer">jbarry</a> on 2023-01-10</strong>:<br /> Ah thanks! I googled a bunch but didn't find that. I wonder if pointing out that that solution isn't good for message loops would increase its likelihood of being added someday...</p>
102902
2023-01-09T16:00:19.000
|ros|ros2|messages|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>Is it possible to create a recursive message type in ROS2? E.g.: message Node.msg int64 id my_msgs/Node neighbors</p> <p>This is currently causing compiler errors in ROS2 Humble for me but I was wondering if there was a flag or something I could use?</p> <p>For more context, I'm working on writing a protobuf to ROS converter (which has generally been straightforward). However protobuf allows recursive messages and message loops (e.g. message A references message B which references message A). Figuring out a ROS equivalent to this if ROS doesn't allow recursive messages is going to be tricky!</p> <p>Thanks! -Jenny</p> <hr /> <p><a href="https://answers.ros.org/question/411194/recursive-message-definition-in-ros2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/486/jbarry/" rel="nofollow noreferrer">jbarry</a> on ROS Answers with karma: 280 on 2023-01-09</p> <p>Post score: 1</p>
Recursive message definition in ROS2
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <pre><code> m_client_topic_subs_.clear(); //std::vector&lt;rclcpp::SubscriptionBase::SharedPtr&gt; m_client_topic_subs_; for(int i = 0; i &lt; client_robots_num; i++){ auto topic_name = dynamicmap_topic_name + std::to_string(i); std::function&lt;void(const nav_interfaces::msg::DynamicMap::SharedPtr)&gt; callback = std::bind(&amp;DynamicMapManager::dynamicMapCB, this, std::placeholders::_1, topic_name); auto sub = m_node-&gt;create_subscription&lt;nav_interfaces::msg::DynamicMap&gt;(topic_name, 10, callback); m_client_topic_subs_.push_back(sub); } </code></pre> <p>callback defination is here, in callback we can print topic_name, it comes from 4 cameras.</p> <pre><code>void DynamicMapManager::dynamicMapCB(const nav_interfaces::msg::DynamicMap::SharedPtr dynamic_map_ptr, const std::string&amp; topic_name) </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5454/jxl/" rel="nofollow noreferrer">jxl</a> with karma: 252 on 2023-02-05</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102905
2023-01-09T22:14:36.000
|ros|ros2|rclcpp|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, I have <code>/camera_1</code>, <code>/camera_2</code>, <code>/camera_3</code> and <code>/camera_4</code> which are published by 4 client nodes. The 4 topics process are all the same (save received msg into one buffer variable ). Could I bind only one callback to 4 <code>rclcpp::Subscription</code> objects? Thanks for your help a lot!</p> <hr /> <p><a href="https://answers.ros.org/question/411201/the-same-msg-type-of-multiple-topic-names-can-use-only-one-callback-on-ros2?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/5454/jxl/" rel="nofollow noreferrer">jxl</a> on ROS Answers with karma: 252 on 2023-01-09</p> <p>Post score: 0</p>
the same msg type of multiple topic names can use only one callback on ros2?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'll answer my own question.</p> <p>Indeed, my controller PID gains were too off to follow the planned trajectory. After tuning those gains with trails and errors in the gazebo environment, errors became much more reasonable.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/72845/kidpaul/" rel="nofollow noreferrer">kidpaul</a> with karma: 38 on 2023-01-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102908
2023-01-10T00:44:52.000
|ros|moveit|gazebo-ros-control|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all,</p> <p>I've been using MoveIt motion planning (OMPL) to simulate pick&amp;place in the Gazebo environment. And I've noticed that the end-effector of the robot in the simulation is always off (~3cm) from given waypoints it needs to follow.</p> <p>At the first time, I tried to set a specific tolerance value using <strong>MoveGroupCommander.get_goal_position_tolerance</strong>, however it did not make much difference. Then, I tried to reduce <strong>eef_step</strong> when using <strong>compute_cartesian_path</strong>. It still did not work as expected.</p> <p>Right now, I'm suspecting that there is something wrong with my controller parameters that hinder the robot to reach to deisred waypoints. Are there any other factors that potentially cause this kind of behavior?</p> <hr /> <p><a href="https://answers.ros.org/question/411202/%5Bmoveit%5D-executed-motions-are-always-slightly-off-from-waypoints/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/72845/kidpaul/" rel="nofollow noreferrer">kidpaul</a> on ROS Answers with karma: 38 on 2023-01-10</p> <p>Post score: 0</p>
[MoveIt] Executed motions are always slightly off from waypoints
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>cout &lt;&lt; &quot;Duration_loop(ros Time): &quot; &lt;&lt; end1.sec - begin1.sec &lt;&lt; &quot;.&quot; &lt;&lt; end1.nsec - begin1.nsec &lt;&lt; &quot;s&quot; &lt;&lt; std::endl;</p> </blockquote> <p>Both the integer and decimal sides of this calculation are not valid. The correct way to calculate this is:</p> <pre><code>double d = (end1 - begin1).toSec(); </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-01-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/133828/tang/" rel="nofollow noreferrer">tang</a> on 2023-01-11</strong>:<br /> It works! Thank you very much for the explanation.</p>
102910
2023-01-10T05:45:00.000
|ros|ros-melodic|rostime|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi! I recently wanted to improve the computational efficiency of IPOPT solver and my costumed mpc_local_planner. Before that my mpc_local_node was taking 0.3-0.5s per iteration, which obviously does not meet the requirements of real-time control.</p> <p>So I checked the running time of each function of the code and found that IPOPT actually only uses 20-40ms to calculate the optimal solution.</p> <pre><code>Total seconds in IPOPT = 0.025 </code></pre> <p>And within the same function I used four different time output methods and found that ros::walltime and chrono::clock are exactly ten times different. Is chrono::clock the correct time? And ros::walltime is slowed down by a factor of 10 for some reason?</p> <p>Here is my Code for time output:</p> <pre><code> ros::Time end1 = ros::Time::now(); ros::WallTime wall_end = ros::WallTime::now(); auto t_end = std::chrono::high_resolution_clock::now(); cout &lt;&lt; &quot;Duration_loop(ros Time): &quot; &lt;&lt; end1.sec - begin1.sec &lt;&lt; &quot;.&quot; &lt;&lt; end1.nsec - begin1.nsec &lt;&lt; &quot;s&quot; &lt;&lt; std::endl; cout &lt;&lt; &quot;Duration_loop(ros WallTime): &quot; &lt;&lt; wall_end &lt;&lt; &quot;, &quot; &lt;&lt; wall_end.sec - wall_begin.sec &lt;&lt; &quot;.&quot; &lt;&lt; wall_end.nsec - wall_begin.nsec &lt;&lt; &quot;s&quot; &lt;&lt; std::endl; std::cout &lt;&lt; &quot;Duration loop(CPU Time): &quot; &lt;&lt; float( clock () - begin_time_2 ) / CLOCKS_PER_SEC &lt;&lt; &quot;s&quot; &lt;&lt; std::endl; std::cout &lt;&lt; &quot;Duration loop(Chrono CPU Time): &quot; &lt;&lt; std::chrono::duration&lt;double, std::milli&gt;(t_end-t_start).count() &lt;&lt; &quot;ms&quot;&lt;&lt; std::endl; </code></pre> <p>And the Output (chrono time is in ms):</p> <pre><code>Duration_loop(ros Time): 0.43000000s Duration_loop(ros WallTime): 1673347284.124544067, 0.43919478s Duration loop(CPU Time): 0.033641s Duration loop(Chrono CPU Time): 43.9134ms </code></pre> <p>I use <em>gazebo</em> and <code>use_sim_time = true</code>, so there are some differences between ros::Time and ros::Walltime.</p> <p>Could someone help me, and thank you very much in advance!</p> <hr /> <p><a href="https://answers.ros.org/question/411217/ros::walltime-differs-from-chrono::clock?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/133828/tang/" rel="nofollow noreferrer">tang</a> on ROS Answers with karma: 1 on 2023-01-10</p> <p>Post score: 0</p>
ros::Walltime differs from chrono::clock?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>**Typo and Misinterpretation, closing the question. **</p> <p>Detailed reason: There practically was no issue. I did get the data. I did a typo in my print statement to see if the problem is me not getting a cloud via the callback, after the original problem arose that my processing didn't work. That did not work because the point I retrieved from the rxp pointcloud file (riegl pointcloud file format) is for some reason in another scale/coordinate system than the points I get from the topic. After figuring out how to look at the topic pointcloud with rviz (I only get one single topic with the finished pointcloud, so I had to set a delay time) and taking point coordinates from there, everything worked fine. It was just that the coordinates I used before didn't exist in the pointcloud, and sadly I made a typo in my debug print, so it told me the data was empty even tho it wasn't.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/124217/sofie/" rel="nofollow noreferrer">Sofie</a> with karma: 16 on 2023-01-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102918
2023-01-13T10:39:02.000
|c++|pointcloud|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, I want to work with a sensor_msgs::PointCloud I am provided with by a laser scanner. I subscribed to the topic /riegl3d and the Callback is executed but the PointCloud is empty. For example the msg-&gt;points.size() is 0 (header id gets printed as riegl and channel name as intensity, while channel size is 0 too). When I do rostopic echo /riegl3d the topic is received and a lot of data printed, so the point cloud is not empty! Im honestly at a lost cause I subscribed to a PointCloud2 message exactly the same and everything worked. Im working with cpp and noetic on a linux system.</p> <p>The initialisation of my subscriber in the Class head:</p> <pre><code>ros::Subscriber rieglsub; </code></pre> <p>The subscriber in my class constructor:</p> <pre><code>rieglsub = n.subscribe(&quot;/riegl3d&quot;, 1000, &amp;SubscribeAndPublish::rieglCallback, this); </code></pre> <p>My Callback:</p> <pre><code>void rieglCallback(const sensor_msgs::PointCloudConstPtr&amp; msg) //TODO: msg empty { ROS_INFO(&quot;[IntensityCorrection] got riegl pointcloud with frame id: %s&quot;, msg-&gt;points.size().c_str()); //do something with pointcloud data } </code></pre> <hr /> <p><a href="https://answers.ros.org/question/411360/sensor_msgs::pointcloud-empty-in-callback-but-rostopic-echo-gives-values/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/124217/sofie/" rel="nofollow noreferrer">Sofie</a> on ROS Answers with karma: 16 on 2023-01-13</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-01-13</strong>:\</p> <blockquote> <p><code>msg-&gt;points.size().c_str()</code></p> </blockquote> <p>I'm confused. <code>std::vector::size()</code> returns a <code>size_t</code>. That doesn't have any <code>c_str()</code> method (it doesn't have any methods at all, as it's a primitive).</p> <p>Have you tried compiling this?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/45287/ignacio/" rel="nofollow noreferrer">ignacio</a> on 2023-01-13</strong>:<br /> what happens if you use <code>ROS_INFO_STREAM(&quot;[IntensityCorrection] got riegl pointcloud with frame id: &quot; &lt;&lt; msg-&gt;points.size());</code> instead?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/124217/sofie/" rel="nofollow noreferrer">Sofie</a> on 2023-01-14</strong>:<br /> sorry everyone I tried looking if I even get the id and had my code with msg-&gt;header.frame_id.c_str() before publishing the question. I wanted to change it back to my original problem of %ld msg-&gt;points.size() not getting anything. Didnt edit the question right tho, sorry for that. I already got further and now get data. Sorry for that</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-01-14</strong>:<br /> If you've solved your original issue, please don't just close your question. Post the solution as an answer and accept your own answer.</p> <p>That way future visitors would benefit from what you learned instead of coming to a question which was only closed with &quot;Oh I figured it out&quot; without any information as to how you solved your problem.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/124217/sofie/" rel="nofollow noreferrer">Sofie</a> on 2023-01-16</strong>:<br /> @gvdhoorn I closed it as irrelevant cause there practically was no issue. I did get the data. I did a typo in my print statement to see if the problem is me not getting a cloud via the callback, after the original problem arose that my processing didn't work. That did not work because the point I retrieved from the rxp pointcloud file (riegl pointcloud fileformat) is for some reason in another scale/coordinate system then the points I get from the topic. After figuring out how to look at the topic pointcloud with rviz (I only get one single topic with the finished pointcloud, so I had to set a delay time) and taking point coordinates from there, everything worked fine. It was just that the coordinates I used before didnt exist in the pointcloud, and sadly I made a typo in my debug print, so that it told me the data was empty eventho it wasnt. For the future I will be sure to state why I closed the question more clearly, even if there was no &quot;solution&quot; per se.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-01-16</strong>:\</p> <blockquote> <p>After figuring out how to look at the topic pointcloud with rviz (I only get one single topic with the finished pointcloud, so I had to set a delay time) and taking point coordinates from there, everything worked fine. It was just that the coordinates I used before didnt exist in the pointcloud</p> </blockquote> <p>so this would be your answer to post.</p> <p>Even &quot;typos&quot; and &quot;I misinterpreted something&quot; are valid answers.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/124217/sofie/" rel="nofollow noreferrer">Sofie</a> on 2023-01-16</strong>:<br /> @gvdhoorn Oh wait I didnt notice its reopened and im able to answer, gonna copy that to an answer and close it, thank u</p> <p><strong>Comment by <a href="https://answers.ros.org/users/124217/sofie/" rel="nofollow noreferrer">Sofie</a> on 2023-01-16</strong>:<br /> I cant accept my own answer XD I guess I will just close it without accepting it</p>
sensor_msgs::PointCLoud empty in Callback but rostopic echo gives values
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>First: even if you'd do this, I'm not sure how useful this would be.</p> <p>Without a corresponding snapshot of the rest of the packages (and perhaps even <code>rosdistro/rosdep</code> DB), you cannot really install any additional packages without running the risk of introducing ABI incompatibilities. All newer packages would be fetched from the current Rolling repositories, which would not have any older versions available. And IIRC, the snapshot repository does not serve Rolling binaries (edit: see <a href="https://discourse.ros.org/t/new-packages-for-ros-2-rolling-ridley-2023-01-06/29094/3" rel="nofollow noreferrer">this comment</a> by @nuclearsandwich on ROS Discourse fi).</p> <p>Having written that: you can do this by specifying the &quot;repo digest&quot; of an image, instead of just a tag (which is what <code>ros:rolling</code> is), similar to how you'd &quot;go back in history&quot; in a Git repository.</p> <p>As an example: <code>a06562802dbaf8db525a63218bd1a75f1ac4dd43f82c9c7891678c307b2a2ecf</code> is the hash of <code>osrf/ros:noetic-desktop</code> at around September last year. You can still fetch that image using:</p> <pre><code>docker pull osrf/ros@sha256:a06562802dbaf8db525a63218bd1a75f1ac4dd43f82c9c7891678c307b2a2ecf </code></pre> <p>Note: this is <em>not</em> the hash shown in the <code>IMAGE ID</code> column when you run <code>docker images</code>.</p> <p>The tricky part would be finding the hash of that &quot;older version of the ros::rolling docker image&quot;.</p> <p>If you still have a machine around which has the older version -- or had, and ran a <code>docker pull ros:rolling</code> updating it -- you could use <code>docker inspect &lt;IMAGE_ID&gt;</code> to inspect it. Look for <code>RepoDigests</code> (or run <code>docker inspect &lt;IMAGE_ID&gt; | jq -r '.[].RepoDigests'</code>).</p> <p>If you don't, you'd normally be out of luck I believe -- AFAIK, there is no API to get Dockerhub to list historical digests -- but apparently <a href="https://github.com/docker-library/repo-info" rel="nofollow noreferrer">docker-library/repo-info</a> keeps track of updates to Dockerhub (for official images). For <code>ros:rolling</code>, you'd have to check <a href="https://github.com/docker-library/repo-info/blob/master/repos/ros/remote/rolling.md" rel="nofollow noreferrer">ros/remote/rolling.md</a> (note: <em>not</em> a perma-link on purpose). To get historical hashes see <a href="https://github.com/docker-library/repo-info/commits/master/repos/ros/remote/rolling.md" rel="nofollow noreferrer">the commit history</a> of that file. <a href="https://github.com/docker-library/repo-info/blob/5d98a01cb78207c6d17ac3947ac81f6d4f5ecdb4/repos/ros/remote/rolling.md" rel="nofollow noreferrer">Here's the one for November 3, 2022</a> for instance. <code>docker pull ros@sha256:52e537f081689f869e17eba032a5823026460f47629f95bc67e21a5e56c2efc9</code> should get you <code>ros:rolling</code> as it was around that time.</p> <blockquote> <p>My Dockerfile starts with this:</p> <pre><code>FROM ros:rolling # Would like to roll this back one version </code></pre> </blockquote> <p>Use the same notation in <code>Dockerfile</code>s:</p> <pre><code>FROM ros@sha256:52e537f081689f869e17eba032a5823026460f47629f95bc67e21a5e56c2efc9 </code></pre> <p>this would build an image based on <code>ros:rolling</code> from around the 3rd of November 2022.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-01-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> on 2023-01-17</strong>:<br /> Confirmed you can cache these images yourself, but just like the snapshots discussion linked above, rolling is a moving target and there's no supported ways to get older versions. This is the point of rolling there's one version that we're all working on and we don't &quot;support&quot; older versions. That's the entire purpose of the distros to provide a stable target to develop against.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/21281/andyze/" rel="nofollow noreferrer">AndyZe</a> on 2023-01-24</strong>:<br /> Thanks for the advice. I'll do the common-sense thing and try to switch to Humble.</p>
102920
2023-01-15T18:10:46.000
|docker|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Due to nav2 not being quite up-to-date, I can't use nav2 with official ros::rolling docker image. Here's the nav2 issue that has details on that: <a href="https://github.com/ros-planning/navigation2/issues/3364" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/issues/3364</a></p> <p>While waiting for the nav2 issues to be fixed, is it possible to get an older version of the ros::rolling docker image?</p> <p>My Dockerfile starts with this:</p> <pre><code>FROM ros:rolling # Would like to roll this back one version </code></pre> <p>@tfoote</p> <hr /> <p><a href="https://answers.ros.org/question/411417/how-to-get-an-older-version-of-ros::rolling-docker-image/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/21281/andyze/" rel="nofollow noreferrer">AndyZe</a> on ROS Answers with karma: 2331 on 2023-01-15</p> <p>Post score: 0</p>
How to get an older version of ros::rolling Docker image
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Did you set up your sources?</p> <p><a href="https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html#setup-sources" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html#setup-sources</a></p> <p>Especially, the ROS 2 GPG key with apt and the repository added to your sources list.</p> <p>Debian packages for ROS 2 Humble Hawksbill are currently available for Ubuntu Jammy (Ubuntu 22.04). You are running Ubuntu MATE 20.04. Maybe this is the problem here?</p> <p>You can build it from source (check code tab with &quot;Ubuntu 20.04 LTS&quot;):</p> <ul> <li><a href="https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html#system-requirements" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html#system-requirements</a></li> <li><a href="https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html#install-development-tools-and-ros-tools" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html#install-development-tools-and-ros-tools</a></li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> with karma: 3064 on 2023-01-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102922
2023-01-15T21:56:41.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have been trying to follow the procedure at <a href="https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html</a> but am getting</p> <blockquote> <p>Err:6 <a href="http://packages.ros.org/ros2/ubuntu" rel="nofollow noreferrer">http://packages.ros.org/ros2/ubuntu</a> focal InRelease<br /> The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654</p> </blockquote> <p>Why is this happening and is there a way I can fix it? I am running Ubuntu MATE' 20.04 on my laptop.</p> <p>8-Dale</p> <hr /> <p><a href="https://answers.ros.org/question/411419/why-am-i-getting--no_pubkey-f42ed6fbab17c654??/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/134211/hybotics/" rel="nofollow noreferrer">hybotics</a> on ROS Answers with karma: 1 on 2023-01-15</p> <p>Post score: 0</p>
Why am I getting NO_PUBKEY F42ED6FBAB17C654?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>it is exactly the same for ROS 2 - I do it all the time while developing :-)</p> <p>Did you follow the tutorial?</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-01-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/113591/cullen-sun/" rel="nofollow noreferrer">Cullen SUN</a> on 2023-01-20</strong>:<br /> Thank you Steve for your reply. It turned out that i missed this step <code>ros2 launch nav2_bringup navigation_launch.py</code></p> <p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2023-01-20</strong>:<br /> That's a pretty important step :-)</p>
102924
2023-01-16T12:40:19.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>During ROS1, we can have gmapping and move_base node to do slam. While mapping, we can move robot around by setting goal in rviz window.</p> <p>However, I am not sure how to do this in ROS2 with <a href="https://github.com/SteveMacenski/slam_toolbox" rel="nofollow noreferrer">slam_toolbox</a>. According to <a href="https://navigation.ros.org/tutorials/docs/navigation2_with_slam.html#working-with-slam" rel="nofollow noreferrer">nav 2 tutorial</a>, this is possible. Unfortunately, my robot was not moving at all after receiving the goal_pose.</p> <hr /> <p><a href="https://answers.ros.org/question/411451/when-doing-mapping-with-slam_toolbox,-can-we-move-robot-with-goal-setting?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/113591/cullen-sun/" rel="nofollow noreferrer">Cullen SUN</a> on ROS Answers with karma: 3 on 2023-01-16</p> <p>Post score: 0</p>
When doing mapping with slam_toolbox, can we move robot with goal setting?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>So I realized what I wrong.</p> <p>The X-axis for the imu is pointing to the left side, not pointing forward. Is a very naive mistake of mine.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> with karma: 45 on 2023-01-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102926
2023-01-16T22:15:31.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello all,</p> <p>Currently, I am using a PhidgetSpatial 3/3/3 1042. However, I encounter strange yaw output when passing the reading of my IMU to imu_filter_magwick.</p> <h2>1</h2> <p>When I set &quot;world_frame&quot; to &quot;ned&quot;, my yaw value (after subscribe to /imu/rpy/filtered) gives 0 degree when facing <strong>east</strong> and -90 degree when facing <strong>north</strong>. On the other hand, If I select &quot;enu&quot;, my yaw value is 0 when facing <strong>north</strong>, and -90 when facing <strong>east</strong>.</p> <p>Originally, base on my reading from <a href="https://answers.ros.org/question/364998/should-imu-frame-follow-the-red-east-green-north-and-blue-up-convention/" rel="nofollow noreferrer">https://answers.ros.org/question/364998/should-imu-frame-follow-the-red-east-green-north-and-blue-up-convention/</a> I was expecting in 'ENU', yaw = 0 when face <strong>east</strong>, and yaw=-90 when face <strong>north</strong>. And in &quot;NED&quot; mode, yaw =0 when face <strong>north</strong> and yaw=90 when face <strong>east</strong></p> <h2>2</h2> <p>Aside from the weird 90 degree offset. Something I find also strange. In &quot;NED&quot; mode,my yaw = 0 +/- 5 degree when face <strong>east</strong>. However, my yaw = -75 degree when facing North. On the other hand, yaw = 180 degree when face <strong>west</strong>, yaw = 75 when face <strong>south</strong>.</p> <p>Thus, my question is why is the yaw offset rather huge when face <strong>south</strong> and <strong>north</strong>.</p> <h2>Atempt</h2> <ol> <li>Tried to calibrate IMU with the company's firmware.</li> </ol> <h1>Config file</h1> <pre><code>imu_filter: ros__parameters: stateless: false use_mag: true publish_tf: true # pueublish /odom to imu_link reverse_tf: false fixed_frame: &quot;odom&quot; constant_dt: 0.0 publish_debug_topics: false world_frame: &quot;ned&quot; gain: 0.1 zeta: 0.0 mag_bias_x: 0.0 mag_bias_y: 0.0 mag_bias_z: 0.0 orientation_stddev: 0.1 publish_debug_topics: true </code></pre> <hr /> <p><a href="https://answers.ros.org/question/411463/incorrect-yaw-from-imu_filter_magwick-at-enu-and-ned/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on ROS Answers with karma: 45 on 2023-01-16</p> <p>Post score: 0</p>
Incorrect Yaw from imu_filter_magwick at ENU and NED
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><a href="https://github.com/ros-controls/ros_controllers/blob/noetic-devel/diff_drive_controller/src/diff_drive_controller.cpp#L251" rel="nofollow noreferrer">https://github.com/ros-controls/ros_controllers/blob/noetic-devel/diff_drive_controller/src/diff_drive_controller.cpp#L251</a></p> <p>Seems like setting <code>enable_odom_tf</code> to false in your URDF under the diff drive controller plugin.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-01-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/134452/li-wei-yang/" rel="nofollow noreferrer">Li-Wei Yang</a> on 2023-01-18</strong>:<br /> Thank you, this solves my problem. It turns out that in my launch file, I loaded .yaml for params</p> <pre><code> &lt;rosparam command=&quot;load&quot; file=&quot;$(find robot_description)/config/control.yaml&quot; /&gt; &lt;node name=&quot;base_controller_spawner&quot; pkg=&quot;controller_manager&quot; type=&quot;spawner&quot; args=&quot;robot_base_joint_publisher robot_base_velocity_controller&quot; /&gt; </code></pre> <p>So simply change URDF is not enough, for others' reference.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2023-01-19</strong>:<br /> @Li-Wei Yang Is your project open-sourced and/or available to check online?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/134452/li-wei-yang/" rel="nofollow noreferrer">Li-Wei Yang</a> on 2023-01-21</strong>:<br /> I just push it to GitHub. <a href="https://github.com/liver121888/postoffice_sim" rel="nofollow noreferrer">https://github.com/liver121888/postoffice_sim</a> The manipulator is from chapter 5 of <a href="https://github.com/PacktPublishing/ROS-Robotics-Projects-SecondEdition" rel="nofollow noreferrer">https://github.com/PacktPublishing/ROS-Robotics-Projects-SecondEdition</a> I made a lot of changes, though, cuz the original code is a mess and uncomplete.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2023-01-22</strong>:<br /> @Li-Wei Yang Thank you</p>
102928
2023-01-17T09:44:38.000
|ros|gazebo|navigation|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I was trying to fuse AMCL pose with imu and odom in Gazebo for a classic mobile manipulator. The mobile manipulator has diff_drive_controller to publish odom topic (/robot_base_velocity_controller/odom)</p> <p>My mobile manipulator does not define base_footprint, so I use base_link instead.</p> <p>My knowledge to tf is that, map-&gt;odom-&gt;base_link-&gt;other links, AMCL will deal with map-&gt;odom part, and ekf_localization_node deal with the odom-&gt;base_link part, and robot_state_publisher deal with other links.</p> <p>But roswtf would give off below error:</p> <pre><code>ERROR TF multiple authority contention: * node [/base_to_odom_ekf] publishing transform [base_link] with parent [odom] already published by node [/gazebo] * node [/gazebo] publishing transform [base_link] with parent [odom] already published by node [/base_to_odom_ekf] </code></pre> <p>Is there a way to turn off robot_state_publisher for a certain tf? Or I configured the tf wrong.</p> <p>In main.launch file:</p> <pre><code>&lt;node name=&quot;robot_state_publisher&quot; pkg=&quot;robot_state_publisher&quot; type=&quot;robot_state_publisher&quot; respawn=&quot;false&quot; output=&quot;screen&quot;&gt; &lt;node pkg=&quot;robot_localization&quot; type=&quot;ekf_localization_node&quot; name=&quot;base_to_odom_ekf&quot;&gt; &lt;remap from=&quot;odometry/filtered&quot; to=&quot;odom&quot; /&gt; &lt;rosparam command=&quot;load&quot; file=&quot;$(find postoffice_sim)/config/ekf/base_to_odom.yaml&quot; /&gt; &lt;/node&gt; </code></pre> <p>base_to_odom.yaml:</p> <pre><code>frequency: 50 two_d_mode: true odom0: /robot_base_velocity_controller/odom odom0_config: [false, false, false, false, false, false, true, true, false, false, false, true, false, false, false] imu0: imu_data imu0_config: [false, false, false, false, false, true, false, false, false, false, false, true, false, false, false] pose0: amcl_pose pose0_config: [true, true, true, true, true, false, false, false, false, false, false, false, false, false, false] publish_tf: true map_frame: map odom_frame: odom base_link_frame: base_link world_frame: odom </code></pre> <hr /> <p><a href="https://answers.ros.org/question/411483/amcl-+-robot_localization-conflicts-in-tf-with-gazebo/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/134452/li-wei-yang/" rel="nofollow noreferrer">Li-Wei Yang</a> on ROS Answers with karma: 13 on 2023-01-17</p> <p>Post score: 1</p>
AMCL + Robot_localization conflicts in TF with Gazebo
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Perhaps there is a flaw in the way the message was created. You may be successful if you try the following std_msgs/String has the string in a field called data, not the string itself.</p> <pre><code>// const msg = new Message(msg_data); const msg = new Message({ data: msg_data}); </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/59801/miura/" rel="nofollow noreferrer">miura</a> with karma: 1908 on 2023-01-21</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102930
2023-01-17T10:53:45.000
|ros|roslib|rosbridge-server|roslibjs|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have a dictionary and I tried to <code>JSON.stringify()</code> to turn it into a string which looks like this: <code>{&quot;p_01_08&quot;:{},&quot;p_01_09&quot;:{},&quot;p_01_10&quot;:{},&quot;p_01_11&quot;:{},&quot;p_01_12&quot;:{},&quot;p_01_13&quot;:{},&quot;p_01_14&quot;:{},&quot;p_02_07&quot;:{},&quot;p_02_08&quot;:{},&quot;p_02_09&quot;:{},&quot;p_02_10&quot;:{},&quot;p_02_11&quot;:{},&quot;p_02_12&quot;:{},&quot;p_02_13&quot;:{},&quot;p_02_14&quot;:{},&quot;p_02_15&quot;:{},&quot;p_03_07&quot;:{},&quot;p_03_08&quot;:{},&quot;p_03_09&quot;:{},&quot;p_03_10&quot;:{},&quot;p_03_11&quot;:{},&quot;p_03_12&quot;:{},&quot;p_03_13&quot;:{},&quot;p_03_14&quot;:{},&quot;p_03_15&quot;:{},&quot;p_04_07&quot;:{},&quot;p_04_08&quot;:{},&quot;p_04_09&quot;:{},&quot;p_04_10&quot;:{},&quot;p_04_11&quot;:{},&quot;p_04_12&quot;:{},&quot;p_04_13&quot;:{},&quot;p_04_14&quot;:{},&quot;p_04_15&quot;:{},&quot;p_05_07&quot;:{},&quot;p_05_08&quot;:{},&quot;p_05_09&quot;:{},&quot;p_05_10&quot;:{},&quot;p_05_11&quot;:{},&quot;p_05_12&quot;:{},&quot;p_05_13&quot;:{},&quot;p_05_14&quot;:{},&quot;p_05_15&quot;:{},&quot;p_06_07&quot;:{},&quot;p_06_08&quot;:{},&quot;p_06_09&quot;:{},&quot;p_06_10&quot;:{},&quot;p_06_11&quot;:{},&quot;p_06_12&quot;:{},&quot;p_06_13&quot;:{},&quot;p_06_14&quot;:{},&quot;p_06_15&quot;:{},&quot;p_07_08&quot;:{},&quot;p_07_09&quot;:{},&quot;p_07_10&quot;:{},&quot;p_07_11&quot;:{},&quot;p_07_12&quot;:{},&quot;p_07_13&quot;:{},&quot;p_07_14&quot;:{}}</code></p> <p>Then I tried to use <code>roslib.js</code> to publish that Dictionary string:</p> <pre><code>import {store} from './store.js'; import { Ros, Message, Topic } from &quot;roslib&quot;; export default class ROSInterface { constructor() { this.ros = new Ros({ url: &quot;ws://localhost:9090&quot;, }); } createMessage = (msg_data) =&gt; { const msg = new Message(msg_data); return msg; } createTopic = (topic_name, msg_type) =&gt; { const topic_ = new Topic({ ros: this.ros, name: topic_name, messageType: msg_type, }); return topic_; } init=()=&gt; { this.model_topic = this.createTopic('/model', 'std_msgs/String'); this.lego_map_topic = this.createTopic('/lego_map', 'std_msgs/String'); this.rate = 10; // 10hz } publish=()=&gt; { this.interval = setInterval(this.publish_topics, 1000/this.rate) } publish_topics=()=&gt; { // model console.log(JSON.stringify(store.model)); let model_msg_ = this.createMessage(JSON.stringify(store.model)); this.model_topic.publish(model_msg_); // lego_map let lego_map_msg_ = this.createMessage(JSON.stringify(store.lego_map)); this.model_topic.publish(lego_map_msg_); } stopPublish=()=&gt; { clearInterval(this.interval); } } </code></pre> <p>But Whenever I use the <code>publish()</code> method I get the following error on the <code>rosbridge server</code> terminal <code>roslaunch rosbridge_server rosbridge_websocket.launch</code>: <code>publish: Message type std_msgs/String does not have a field 0</code>, Can you please tell me how can I advertise and publish the topic correctly? thanks in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/411492/publish-json-roslib/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/71460/bhomaidan/" rel="nofollow noreferrer">bhomaidan</a> on ROS Answers with karma: 114 on 2023-01-17</p> <p>Post score: 0</p>
publish json roslib
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Ok, i solved the problem! Basically, since i was using a VM with NAT network, the VM wasn't seen as another device on the net. Hence i changed the VM network configuration to Net with Bridge and this assigns an IP to the VM as it was another computer. Now everything works fine!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/127837/andi/" rel="nofollow noreferrer">andi</a> with karma: 26 on 2023-01-25</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2023-01-26</strong>:<br /> Nice to hear that it was just a VM configuration as it was suggested :)</p>
102932
2023-01-17T13:48:45.000
|ros|ros2|communication|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all, i'm having a really bad time with ROS2 communication between 2 machines:</p> <ol> <li>my laptop where i run a VM with ubuntu focal ( ip 192.168.1.24)</li> <li>Raspi 4 with Ubuntu focal as well running ROS2 (ip 192.168.1.42) I set the ROS_DOMAIN_ID=5 on both machines. The problem is that when i try to make a communication between the 2, ie running a listener node on Raspi and a talker node on the VM, nothing happens! Neither when i run the ros2 multicast send / receive doesn't give any responses!! Surfing on internet, i found that it might be a UDB multicast communication problem, but unfortunately i didn't found any solutin!! Any ideas? Thanks.</li> </ol> <p>This is the ip addr on the VM:</p> <pre><code> andi@andi-vm:~$ ip addr 1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp0s3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 08:00:27:14:e4:9a brd ff:ff:ff:ff:ff:ff inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3 valid_lft 86173sec preferred_lft 86173sec inet6 fe80::5ae5:7f99:50fa:1e8d/64 scope link noprefixroute valid_lft forever preferred_lft forever </code></pre> <p>and this is on the Raspi:</p> <pre><code>andi@andi-raspi:~$ ip addr 1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: &lt;NO-CARRIER,BROADCAST,MULTICAST,UP&gt; mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether dc:a6:32:e9:fa:20 brd ff:ff:ff:ff:ff:ff 3: wlan0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether dc:a6:32:e9:fa:21 brd ff:ff:ff:ff:ff:ff inet 192.168.1.42/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0 valid_lft 86228sec preferred_lft 86228sec inet6 2a02:8428:1d60:fc01:fc52:84a0:d7fd:e5c9/64 scope global dynamic noprefixroute valid_lft 604783sec preferred_lft 604783sec inet6 fe80::4d6:4e0:eaf9:fbd7/64 scope link noprefixroute valid_lft forever preferred_lft forever </code></pre> <hr /> <p><a href="https://answers.ros.org/question/411498/how-to-enable-udp-multicast-communication?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/127837/andi/" rel="nofollow noreferrer">andi</a> on ROS Answers with karma: 26 on 2023-01-17</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/134593/ryanf55/" rel="nofollow noreferrer">ryanf55</a> on 2023-01-18</strong>:<br /> Can you show the network configuration (ip addr) on Linux, or similar on your OS? You need to make sure multicast is enabled on your network interface.</p> <p>At the ROS level, the default settings already have it enabled.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/127837/andi/" rel="nofollow noreferrer">andi</a> on 2023-01-19</strong>:<br /> I updated the question with this info.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2023-01-19</strong>:<br /> Can you ping the PC with VM and RPi normally? The addition of the VM layer could be to blame for the problem - what software are you using for VMs? Can you check if the VM config has the networking enabled/bridged?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/127837/andi/" rel="nofollow noreferrer">andi</a> on 2023-01-19</strong>:<br /> Yes i can ping the Pc by both VM and Raspi. The VM has Ubuntu focal. The thing is that from the Raspi i cannot ping the VM ip which is 10.0.2.15 (the one assigned to the VM), but i do ping the PC (192.168.1.24). In the VM Network conf i have the Virtual-Box Host-Only Ethernet Adapter with address 192.168.56.1. So i guess that the problem is in the assignement of the VM ip address. I do not know that much on how does this work!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/19675/andromeda/" rel="nofollow noreferrer">Andromeda</a> on 2023-01-21</strong>:<br /> Can you check, whether your ports (on both sides) are open or not? Check here: <a href="https://docs.ros.org/en/galactic/Concepts/About-Domain-ID.html" rel="nofollow noreferrer">https://docs.ros.org/en/galactic/Concepts/About-Domain-ID.html</a> which UDP ports should be open according to your <code>ROS_DOMAIN_ID</code></p> <p><strong>Comment by <a href="https://answers.ros.org/users/19675/andromeda/" rel="nofollow noreferrer">Andromeda</a> on 2023-01-21</strong>:<br /> Which VM do you use? VirtualBox? If yes, check this document: <a href="https://nsrc.org/workshops/2014/sanog23-virtualization/raw-attachment/wiki/Agenda/ex-virtualbox-portforward-ssh.htm" rel="nofollow noreferrer">https://nsrc.org/workshops/2014/sanog23-virtualization/raw-attachment/wiki/Agenda/ex-virtualbox-portforward-ssh.htm</a></p>
How to enable UDP multicast communication?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Actually turns out I had to follow the setup instructions for ROS2 from the tutorials here: <a href="https://docs.ros.org/en/humble/Tutorials.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Tutorials.html</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/134474/jlichong/" rel="nofollow noreferrer">jlichong</a> with karma: 16 on 2023-01-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102934
2023-01-17T20:07:54.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Running <code>python3 rrbot_system_position_only.launch.py</code> from here <a href="https://github.com/ros-controls/ros2_control_demos/blob/master/ros2_control_demo_bringup/launch/rrbot_system_position_only.launch.py" rel="nofollow noreferrer">https://github.com/ros-controls/ros2_control_demos/blob/master/ros2_control_demo_bringup/launch/rrbot_system_position_only.launch.py</a>. But following the error message appears</p> <pre><code>Traceback (most recent call last): File &quot;/home/ros2_control_demos/ros2_control_demo_bringup/launch/rrbot_system_position_only.launch.py&quot;, line 15, in &lt;module&gt; from launch import LaunchDescription ModuleNotFoundError: No module named 'launch' </code></pre> <p>I already tried the solution suggested in <a href="https://answers.ros.org/question/389046/importerror-no-module-named-launch/" rel="nofollow noreferrer">https://answers.ros.org/question/389046/importerror-no-module-named-launch/</a> but that did not work. Can you guys please help me solve this error? Thank you.</p> <hr /> <p><a href="https://answers.ros.org/question/411503/modulenotfounderror:-no-module-named-%27launch%27/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/134474/jlichong/" rel="nofollow noreferrer">jlichong</a> on ROS Answers with karma: 16 on 2023-01-17</p> <p>Post score: 0</p>
ModuleNotFoundError: No module named 'launch'
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Googling this specific value <code>0.087890625</code> I got <a href="https://forum.arduino.cc/t/28bjy-48-stepper-motor-angle-printing-to-time/919924/4" rel="nofollow noreferrer">this Arduino forum post</a> - it looks like it is connected to the step motor and its number of steps per revolution.</p> <p>One of the answers from the link:</p> <blockquote> <p>64 steps per revolution (5.625° steps) and 1:64 gearing gives 4096 steps per output shaft revolution (0.087890625° steps).</p> </blockquote> <p>P.S. Be a bit careful with enlarging the wheel radius - calculate how much you can enlarge it before the motor gives up.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> with karma: 3064 on 2023-01-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102936
2023-01-18T04:23:42.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to enlarge my wheel using the physical turtlebot3. I'm learning how robotis made the package by looking at the code, anyone know where is the value 0.087890625[deg] derived or get from? is it the Goal Position?</p> <p>// 0.087890625[deg] * 3.14159265359 / 180 = 0.001533981f</p> <p>you can see this in the joint state or odometry.cpp file in opencr code</p> <p>Thanks ROScommunity in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/411528/turtlebot3-package---ros2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/130069/n000oob/" rel="nofollow noreferrer">n000oob</a> on ROS Answers with karma: 15 on 2023-01-18</p> <p>Post score: 0</p>
Turtlebot3 package - ROS2
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This was a bug related to issue <a href="https://github.com/ros2/rmw_fastrtps/issues/656" rel="nofollow noreferrer">#656</a> in rmw_fastrtps. See the issue I opened on <a href="https://github.com/ros-controls/ros2_control/issues/923" rel="nofollow noreferrer">ros2_control/issues/923</a>.</p> <p>The bug is now fixed.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/108956/sam_prt/" rel="nofollow noreferrer">Sam_Prt</a> with karma: 28 on 2023-07-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102938
2023-01-18T06:28:55.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I am having issues with a ros2_control on humble distro and ubuntu 22.04. I have a custom hardware system that communicates with the hardware with TCP/IP. I implemented the communication using asio, running in a thread. I am using a custom controller that basically is the forward_command_controller, without the realtime buffers. It subscribes to a single Float64MultiArray commands topic.</p> <p>For some reason, the controllers subscriber stops receiving topics after a few messages. This results in the commands not being updated and sent to the hardware.</p> <p>I suspect that using asio in a thread inside the ros2_control architecture might be causing problems but I am not certain.</p> <p>Fell free to ask for more information. Any help would be appreciated !</p> <p>EDIT: I tested with a minimal example with and without asio running in a thread and the result is the same. The topics stop being received after some short time. So the issue seems unrelated to asio.</p> <hr /> <p><a href="https://answers.ros.org/question/411534/ros2_control/asio-:-topics-stops-being-received/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/108956/sam_prt/" rel="nofollow noreferrer">Sam_Prt</a> on ROS Answers with karma: 28 on 2023-01-18</p> <p>Post score: 0</p>
ros2_control/asio : topics stops being received
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Apparently, I had some missing packages. I solved this issue by running:</p> <pre><code>sudo apt install ros-humble-nav* </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/70847/tsadarsh/" rel="nofollow noreferrer">tsadarsh</a> with karma: 78 on 2023-01-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102940
2023-01-19T05:19:34.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am going through the <a href="https://navigation.ros.org/getting_started/index.html#installation" rel="nofollow noreferrer">Getting Started</a> in Nav2 Docs. I have installed <code>navigation2</code>, <code>nav2-bringup</code> and <code>turtlebot3</code> packages using the following commands:</p> <pre><code>sudo apt install ros-humble-navigation2 sudo apt install ros-humble-nav2-bringup sudo apt install ros-humble-turtlebot3* </code></pre> <p>As per the tutorial I source and exported the required environment variables by:</p> <pre><code>source /opt/ros/humble/setup.bash export TURTLEBOT3_MODEL=waffle export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models </code></pre> <p>But when I launch the <code>nav2_bringup</code> using the following launch command I get the below listed error:</p> <blockquote> <p>This code block was moved to the following github gist: <a href="https://gist.github.com/answers-se-migration-openrobotics/77fe00b8702ce7e729c5d1af7e017e68" rel="nofollow noreferrer">https://gist.github.com/answers-se-migration-openrobotics/77fe00b8702ce7e729c5d1af7e017e68</a></p> </blockquote> <p>I get a Rviz and Gazebo windows opened without any TurtleBot. How do I resolve the <strong>nav2_behaviors/AssistedTeleop with base class type nav2_core::Behavior does not exist</strong> exception and the <strong>spawn service</strong> failure?</p> <p>Thank you in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/411574/failed-to-create-behavior-assisted_teleop-of-type-nav2_behaviors/assistedteleop/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/70847/tsadarsh/" rel="nofollow noreferrer">tsadarsh</a> on ROS Answers with karma: 78 on 2023-01-19</p> <p>Post score: 0</p>
Failed to create behavior assisted_teleop of type nav2_behaviors/AssistedTeleop
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>I can compute world -&gt; map with (world -&gt; tag) * (map -&gt; tag)^(-1) for these specific tags, right?</p> </blockquote> <p>Yes, that is correct. If using c++, you'll probably want to create <code>tf::Transform</code> objects for this calculation; you'll use the <code>setOrigin()</code>, <code>setRotation()</code> and <code>inverse()</code> methods.</p> <p><a href="https://docs.ros.org/en/api/tf/html/c++/classtf_1_1Transform.html" rel="nofollow noreferrer">https://docs.ros.org/en/api/tf/html/c++/classtf_1_1Transform.html</a></p> <blockquote> <p>Would that be the best solution?</p> </blockquote> <p>Yes.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-01-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-01-22</strong>:<br /> Edited to remove my &quot;4x4 matrix&quot; comment. It turns out that internally tf::Transform uses a different representation.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/125007/xdzye/" rel="nofollow noreferrer">xdzye</a> on 2023-01-22</strong>:<br /> Ok, thank you!</p> <p>What would be the best to deal with different estimated transforms between different tags/different ROS times? Should I just average them? I'm currently using Python and I noticed inverse() is not defined in that API. Guess I will need to implement my own inverse function or I switch over to the C++ API.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-01-22</strong>:<br /> For python, look in <code>tf.transformations</code>. This old question #q229329 has inverse example.</p> <p>For multiple reference points, to get started I'd just average them. If that turns out to give poor results, you could look at some kind of outlier-removal.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/125007/xdzye/" rel="nofollow noreferrer">xdzye</a> on 2023-01-22</strong>:<br /> Thank you very much. In the meantime I also got it working using Marker/Priors. They actually do support rotation as well, I just set the rotation parameters with wrong values.</p>
102945
2023-01-19T10:40:45.000
|slam|navigation|ros-melodic|rtabmap|rtabmap-ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm running RTABMap and mapping is working correctly with Lidar, odometry and RGBD sensor data. In order to overlay the generated map with a CAD model, I need to transform the map frame into the CAD models/lab environments custom coordinate system.<br /> I'm using Apriltag markers with known (a priori) coordinates relative to the custom coordinate system and detect them while mapping. The translation part of the transformation from <code>map_frame</code> to my custom coordinate system origin is working fine with the help of <code>Marker/Priors</code> in RTABMap (see <a href="https://github.com/introlab/rtabmap_ros/issues/867" rel="nofollow noreferrer">original question here</a>). See <a href="https://github.com/introlab/rtabmap/blob/master/corelib/include/rtabmap/core/Parameters.h#L788" rel="nofollow noreferrer">this</a> for the documentation regarding the parameter in RTABMap. Basically what this param does is, that one can input global coordinates and RTABMap will translate the <code>map_frame</code> according to the local tag detection coordinates and their corresponding global coordinates. Unfortunately, <code>Marker/Priors</code> will not rotate the <code>map_frame</code> into my custom coordinate system, because this is breaking <a href="https://www.ros.org/reps/rep-0105.html" rel="nofollow noreferrer">REP105</a>/<a href="https://www.ros.org/reps/rep-0103.html" rel="nofollow noreferrer">3</a> by using custom coordinate systems instead of ROS coordinate system definitions and that's why it is not supported in RTABMap.</p> <p>Is there a way to add the correct rotation manually while or after mapping by checking for the <code>map_frame</code> orientation and comparing the differences to the fixed custom coordinate system and then applying the right rotation angles?</p> <p>Or, can I guarantee by modifying the <code>map_frame</code>that a fixed coordinate direction related to my environment is always present in the <code>map_frame</code>, based on the cardinal directions or other constraints? Normally, the direction and origin of the ROS coordinate frame is dependend on the starting angle/direction of the camera.<br /> A small example, I want to achieve that the <code>x</code>-axis always points to the north, y always points to the east etc. while or after the mapping process. This would help, because I would just need to rotate axes in a static transform, because the rotation would be constant with this solution for every scan I do.<br /> For better visualization, I quote this comment from <a href="https://answers.ros.org/question/382051/the-relationship-of-earth-frame-and-map-frame/" rel="nofollow noreferrer">https://answers.ros.org/question/382051/the-relationship-of-earth-frame-and-map-frame/</a>:</p> <blockquote> <p>If you build a map with <code>rtabmap</code> and save it, you can then calculate the static rotation needed based on where the map x-axis ended up. Doing this dynamically is more difficult: you will need to read the initial magnetic orientation of the robot once before you begin the rtabmap mapping procedure.</p> </blockquote> <p>I've tried to find out how I can implement it this way by asking the following question under the above mentioned answers.ros post:</p> <blockquote> <p>Can you explain to me how to calculate the static rotation from RTABMap map_frame to my own custom coordinate system? How do I find out, where the axes of the ROS coordinate system point to after running rtabmap and/or dynamically and how much I need to rotate it to fit my custom coordinate system?<br /> The translation part is already working inside RTABMap with the help of <code>Marker/Priors</code> parameter by setting global coordinates for the known accurate positions of the markers and detecting exactly these markers in local coordinates in the <code>map_frame</code>. This translates the coordinate origin to the right origin of my global coordinate system. Unfortunately, the rotation does not work. Can I do this with the help of your suggestion and export/apply the rotation somehow on to the <code>map_frame</code> while mapping or afterwards?</p> </blockquote> <p>Unfortunately the thread was locked before and I guess that notifications aren't sent to the users anymore. That's why I quoted it here to give a better context of my thought process and research and to maybe get it answered here as well.</p> <p>If this should be in seperate posts, I apologize for this and will change it accordingly. I will initially post it like this, because I think all these questions are related closely to each other.</p> <p>Edit: The RTABMap parameter Marker/Priors supports computing these rotations as well contrary to my belief.</p> <p>Best regards<br /> xdzye</p> <hr /> <p><a href="https://answers.ros.org/question/411584/transform-the-map-frame-into-custom-global-coordinate-system/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/125007/xdzye/" rel="nofollow noreferrer">xdzye</a> on ROS Answers with karma: 15 on 2023-01-19</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-01-20</strong>:\</p> <blockquote> <p>Marker/Priors will not rotate the map_frame into my custom coordinate system, because this is breaking REP105/3 by using custom coordinate systems instead of ROS coordinate system</p> </blockquote> <p>Are you using a right-hand coordinate system or not?</p> <p>If the answer is yes, are you aware that <code>tf2</code> is designed to easily handle this situation?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/125007/xdzye/" rel="nofollow noreferrer">xdzye</a> on 2023-01-20</strong>:<br /> Hello Mike, yes - the custom coordinate system is right-handed.</p> <p>No, im not aware. I was working with tf1 mostly and only recently started using tf2. Can you provide me with a link?</p> <p>Thank you very much for helping!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-01-21</strong>:<br /> Feature-wise, tf1 is similar to tf2 - the methods just got cleaned up. You can create a new Frame, publish the transform between it and an existing frame, and you're done. Then tf2 provides methods to convert a pose from one frame to another. So where is your confusion?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/125007/xdzye/" rel="nofollow noreferrer">xdzye</a> on 2023-01-22</strong>:<br /> My confusion lies in the fact that the rotation between my coordinate system and the ROS coordinate system provided by RTABMap is always different, because the origin and direction of the ROS coordinate system is relative to the camera direction and angle at which the SLAM algorithm is started on the robot. I don't know the transformation itself and need to compute it. Thats why I was asking if there is a way to have a fixed direction for example in cardinal directions so that the rotation is always the same and I can just apply a static transform for all starting points. Otherwise I do have the tf map -&gt; tag from Apriltag package and I also measured world -&gt; tag for some specific tags, which would mean I can compute world -&gt; map with (world -&gt; tag) * (map -&gt; tag)^(-1) for these specific tags, right? Would that be the best solution?</p>
Transform the map frame into custom global coordinate system
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, already found the answer to my follow up question <a href="https://stackoverflow.com/questions/17314100/code-coverage-report-without-running-test#:%7E:text=There%20is%20no%20tool%20available,any%20claim%20will%20be%20flawed.">here</a> Thank you!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/134804/anya/" rel="nofollow noreferrer">anya</a> with karma: 16 on 2023-01-25</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/59801/miura/" rel="nofollow noreferrer">miura</a> on 2023-01-27</strong>:<br /> It was good.</p>
102947
2023-01-19T20:52:19.000
|ros|c++|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am new in ROS and I apologize if the question might be simple or common sense. I am trying to use this package (<a href="https://github.com/mikeferguson/code_coverage" rel="nofollow noreferrer">code_coverage)</a> for measuring code coverage for ROS package but unfortunately no success on generating .gcda files.</p> <p>Already added the following in the CMakeLists.txt if (CATKIN_ENABLE_TESTING AND ENABLE_COVERAGE_TESTING) find_package(code_coverage REQUIRED) APPEND_COVERAGE_COMPILER_FLAGS() endif()</p> <p>Currently using catkin_make to build catkin_make -DENABLE_COVERAGE_TESTING=ON -DCMAKE_BUILD_TYPE=Debug</p> <p>But only .gcno and .o files were generated.</p> <p>Tried to do gcov *.gcno but results are example Lines executed:0.00% of 117.</p> <p>Been trying to build also using gcc but still no luck because it cannot find the header file.</p> <p>Is there other necessary steps or settings to make?</p> <p>Any thoughts or inputs are highly appreciated. Thank you!</p> <hr /> <p><a href="https://answers.ros.org/question/411602/code_coverage-for-ros-usage/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/134804/anya/" rel="nofollow noreferrer">anya</a> on ROS Answers with karma: 16 on 2023-01-19</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/59801/miura/" rel="nofollow noreferrer">miura</a> on 2023-01-20</strong>:<br /> Are the tests running? To calculate coverage, tests must be run.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/134804/anya/" rel="nofollow noreferrer">anya</a> on 2023-01-22</strong>:<br /> Thank you for your reply Miura !</p> <p>Yes I was able to do catkin_make run_tests. But is it normal to take a long time for the result?</p> <p>Also, just one more question, after running the tests, will it displays the coverage of all the package? or only the package with tests? In my source, there are package that do not have tests folders inside the package. Basically I wanted to know the coverage of all the code. But I'm not sure if it will calculate all the coverage of the codes if without test package.</p>
code_coverage for ROS usage