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>There is <a href="https://github.com/DLu/simple_actions" rel="nofollow noreferrer">DLu/simple_actions</a>:</p> <blockquote> <p>A simple version of the <code>rclpy</code>/<code>rclcpp</code> action libraries.</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 2022-10-12</p> <p>This answer was <strong>NOT 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-10-13</strong>:<br /> Thank you, I'll check</p>
102522
2022-10-11T10:07:28.000
|ros|ros2|simpleactionclient|
<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. Is there SimpleActionServer and SimpleActionClient implementation for ros2? I found nav2_util::SimpleActionServer, but it's not working for some reason right now on my system so I don't know if it works like actionlib::SimpleActionServer from ros1. I found nothing about SimpleActionClient for ros2. I'd appreciate any help, especially if you could give an example.</p> <hr /> <p><a href="https://answers.ros.org/question/407744/what-is-simpleactionserver-and-simpleactionclient-for-ros2?/" 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-10-11</p> <p>Post score: 0</p>
What is SimpleActionServer and SimpleActionClient for ros2?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>apt show ros-noetic-moveit</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> with karma: 1999 on 2022-10-11</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/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on 2022-10-11</strong>:<br /> this command is giving an error E: Invalid operation show I am using ros noetic</p> <p><strong>Comment by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> on 2022-10-11</strong>:<br /> Which Linux distro are you using? Ubuntu?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on 2022-10-11</strong>:<br /> Yes, I am using Ubuntu 20.04</p> <p><strong>Comment by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> on 2022-10-11</strong>:<br /> You se this command apt show ros-noetic-MoveIt</p>
102525
2022-10-11T10:14:32.000
|ros|moveit|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, I am new to ros, I would like to know how can I check moveit version of ROS. I am using ROS noetic</p> <hr /> <p><a href="https://answers.ros.org/question/407746/how-to-check-moveit-version/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-10-11</p> <p>Post score: 0</p>
How to check moveit version
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi there, when using ROS2 you probably want to rely on <code>Nav2</code>(<a href="https://navigation.ros.org/" rel="nofollow noreferrer">https://navigation.ros.org/</a>). This is the &quot;successor&quot; of the ROS Navigation stack we had for ROS1.</p> <p>Check <a href="https://navigation.ros.org/about/ros1_comparison.html#ros1-comparison" rel="nofollow noreferrer">ros1-to-ros2</a> for further information about changes in the navigation stack when moving from ros1 to ros2.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/118643/francocipollone/" rel="nofollow noreferrer">francocipollone</a> with karma: 16 on 2022-10-12</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/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-13</strong>:<br /> Thanks, I check it and I think, that it is what I need</p>
102527
2022-10-11T11:30:34.000
|ros|simpleactionclient|move-base-msgs|
<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 migrating my project from Noetic to Foxy and I have there code, that looks like this</p> <hr /> <pre><code>typedef actionlib::SimpleActionClient&lt;move_base_msgs::MoveBaseAction&gt; MoveBaseClient; </code></pre> <hr /> <p>And I have problems with understanding, how it should look on Foxy. There are no MoveBaseAction.h header for ros2, or at least I could't find it. I appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/407759/is-there-an-implementation-for-move_base_msgs::movebaseaction-for-ros2?/" 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-10-11</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/139792/nadavis/" rel="nofollow noreferrer">nadavis</a> on 2023-06-13</strong>:<br /> Hi, i have the same issue, did you find a solution?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2023-07-13</strong>:<br /> Hi. Sorry to disapoint, but no. I marked Nav2 as right answer because it is more or less what I was looking for, but, in the end, we simply using code that does not involve actionlib for now.</p>
Is there an implementation for move_base_msgs::MoveBaseAction for ros2?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Thank you ! I followed the following commands to add public ssh key to my github</p> <pre><code>cd ~/.ssh ssh-keygen -t rsa -b 4096 -C &quot;your email id &quot; eval $(ssh-agent -s) ssh-add </code></pre> <p>Open VS Code and copy ssh</p> <pre><code>cd ~/.ssh code . login into github go to setting go to ssh and gp keys add new key paste it </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> with karma: 61 on 2022-10-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102529
2022-10-11T12:45:24.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to do eye-to-hand using the following package <a href="https://ros-planning.github.io/moveit_tutorials/doc/hand_eye_calibration/hand_eye_calibration_tutorial.html" rel="nofollow noreferrer">https://ros-planning.github.io/moveit_tutorials/doc/hand_eye_calibration/hand_eye_calibration_tutorial.html</a> , however when I am cloning the git repository I am getting this error</p> <pre><code>git clone git@github.com:ros-planning/moveit_calibration.git Cloning into 'moveit_calibration'... git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. </code></pre> <p>Please make sure you have the correct access rights and the repository exists.</p> <hr /> <p><a href="https://answers.ros.org/question/407766/cannot-clone-a-package-from-github-(publickey)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-10-11</p> <p>Post score: 0</p>
Cannot clone a package from github (publickey)
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You can also use the stuff from irobot create 3 <a href="https://iroboteducation.github.io/create3_docs/" rel="nofollow noreferrer">https://iroboteducation.github.io/create3_docs/</a></p> <p>They also have gazebo simulation</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> with karma: 1999 on 2022-10-12</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102532
2022-10-12T05:19:04.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 languafe. I hope that this question is not too much to ask, but is there any open source projects on ROS2, preferebly Foxy, that anyone could check. I'm relative new to ROS and especially ROS2 and I would be very grateful for links on such projects. I have problems with understanding controllers and how they work and I'm reading tutorials about them now but real working example would be an invaluable help.</p> <hr /> <p><a href="https://answers.ros.org/question/407796/is-there-any-open-source-projects-on-ros2?/" 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-10-12</p> <p>Post score: 0</p>
Is there any open source projects on ros2?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>But ofcourse lots of errors and lots of problems when compiling.</p> </blockquote> <p>You should have posted those errors in the question. Anyway, there is only 1 big problem which is fixed below:</p> <pre><code>service_server = n.advertiseService(&quot;add_two_ints&quot;, &amp;SubscribeAndPublish::add, this); </code></pre> <p>You forgot to pass <code>this</code> while calling <code>advertiseService( ... )</code>. Below is the complete working code:</p> <pre><code>#include &quot;ros/ros.h&quot; #include &quot;beginner_tutorials/AddTwoInts.h&quot; #include &quot;std_msgs/String.h&quot; #include &lt;sstream&gt; class SubscribeAndPublish { public: SubscribeAndPublish() { chatter_pub = n.advertise&lt;std_msgs::String&gt;(&quot;chatter&quot;, 1000); service_server = n.advertiseService(&quot;add_two_ints&quot;, &amp;SubscribeAndPublish::add, this); } bool add(beginner_tutorials::AddTwoInts::Request&amp; req, beginner_tutorials::AddTwoInts::Response&amp; res) { std_msgs::String msg; if (req.a == 1) { msg.data = &quot;hello world&quot;; chatter_pub.publish(msg); } res.sum = req.a + req.b; ROS_INFO(&quot;request: x=%ld, y=%ld&quot;, (long int)req.a, (long int)req.b); ROS_INFO(&quot;sending back response: [%ld]&quot;, (long int)res.sum); return true; } private: ros::NodeHandle n; ros::Publisher chatter_pub; ros::ServiceServer service_server; }; // End of class SubscribeAndPublish int main(int argc, char** argv) { ros::init(argc, argv, &quot;add_two_ints_server&quot;); SubscribeAndPublish SAPObject; ROS_INFO(&quot;Ready to add two ints.&quot;); ros::spin(); return 0; } </code></pre> <p>This is how, I executed it:</p> <ul> <li><p>Terminal 1</p> <pre><code> $ roscore </code></pre> </li> <li><p>Terminal 2</p> <pre><code> $ rosrun beginner_tutorials subscribe_and_publish [ INFO] [1665654555.498672244]: Ready to add two ints. [ INFO] [1665654646.303484866]: request: x=1, y=2 [ INFO] [1665654646.303565863]: sending back response: [3] [ INFO] [1665654648.388244758]: request: x=1, y=2 [ INFO] [1665654648.388283809]: sending back response: [3] [ INFO] [1665654661.012366878]: request: x=11, y=22 [ INFO] [1665654661.012465383]: sending back response: [33] </code></pre> </li> <li><p>Terminal 3</p> <pre><code> $ rostopic echo /chatter data: &quot;hello world&quot; --- data: &quot;hello world&quot; --- </code></pre> </li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-10-13</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/103351/sajid1122/" rel="nofollow noreferrer">sajid1122</a> on 2022-10-13</strong>:<br /> thank you!</p>
102534
2022-10-12T23:41:15.000
|ros|service|publish|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>So what i wanted to do is, send a service call to this service and then i wanted this service to publish to another topic. So i was experimenting this with the code as follows. But ofcourse lots of errors and lots of problems when compiling. Please help :)</p> <p>i was following the format which i saw in this link <a href="https://answers.ros.org/question/59725/publishing-to-a-topic-via-subscriber-callback-function/" rel="nofollow noreferrer">https://answers.ros.org/question/59725/publishing-to-a-topic-via-subscriber-callback-function/</a></p> <pre><code>#include &quot;ros/ros.h&quot; #include &quot;practice/AddTwoInts.h&quot; #include &quot;std_msgs/String.h&quot; #include &lt;sstream&gt; class SubscribeAndPublish { public: SubscribeAndPublish() { chatter_pub = n.advertise&lt;std_msgs::String&gt;(&quot;chatter&quot;, 1000); service = n.advertiseService(&quot;add_two_ints&quot;, &amp;SubscribeAndPublish::add); } bool add(practice::AddTwoInts::Request &amp;req, practice::AddTwoInts::Response &amp;res) { if(req.a == 1) { msg.data = &quot;hello world&quot;; chatter_pub.publish(msg); } res.sum = req.a + req.b; ROS_INFO(&quot;request: x=%ld, y=%ld&quot;, (long int)req.a, (long int)req.b); ROS_INFO(&quot;sending back response: [%ld]&quot;, (long int)res.sum); return true; } private: ros::NodeHandle n; ros::Publisher chatter_pub; ros::ServiceServer service; std_msgs::String msg; };//End of class SubscribeAndPublish int main(int argc, char **argv) { ros::init(argc, argv, &quot;add_two_ints_server&quot;); SubscribeAndPublish SAPObject; ROS_INFO(&quot;Ready to add two ints.&quot;); ros::spin(); return 0; } </code></pre> <hr /> <p><a href="https://answers.ros.org/question/407843/service-server-and-publisher-using-same-node/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/103351/sajid1122/" rel="nofollow noreferrer">sajid1122</a> on ROS Answers with karma: 19 on 2022-10-12</p> <p>Post score: 0</p>
Service Server and Publisher using same Node
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I spent some time trying to understand this issue.</p> <p>I realized it is a bug in the <code>humble</code> branch of the <code>moveit2_tutorials</code>. So I used the <code>main</code> branch and compiled the workspace as well. It worked without any issues.</p> <p>Please see the bug report <a href="https://github.com/ros-planning/moveit2_tutorials/pull/485" rel="nofollow noreferrer">here</a>.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-10-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/119094/lucb/" rel="nofollow noreferrer">LucB</a> on 2022-10-14</strong>:<br /> I changed the code in my src/main.cpp file to the source code of the <a href="https://github.com/ros-planning/moveit2_tutorials/blob/main/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp" rel="nofollow noreferrer">main branch</a>. Now it works.</p> <p>Thanks!!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-14</strong>:<br /> I am glad you made it work!</p>
102536
2022-10-13T01:52:45.000
|ros|ros2|c++|pick-and-place|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm using ros2 humble. I try to run the pick and place source code from the <a href="https://moveit.picknik.ai/humble/doc/tutorials/pick_and_place_with_moveit_task_constructor/pick_and_place_with_moveit_task_constructor.html" rel="nofollow noreferrer">Moveit2 tutorial</a>.</p> <p>At first i run</p> <pre><code>ros2 launch moveit2_tutorials mtc_demo.launch.py </code></pre> <p>after i start</p> <pre><code>ros2 launch moveit2_tutorials pick_place_demo.launch.py </code></pre> <p>In RViz the pandas arm and a green cylinder spawns and I get following output.</p> <pre><code>ros2 launch moveit2_tutorials pick_place_demo.launch.py [INFO] [launch]: All log files can be found below /home/luca/.ros/log/2022-10-13-08-33-46-627618-Lenovo-V15-G2-ALC-5420 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [mtc_tutorial-1]: process started with pid [5421] [mtc_tutorial-1] [INFO] [1665642826.962234071] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0.00403836 seconds [mtc_tutorial-1] [INFO] [1665642826.962293297] [moveit_robot_model.robot_model]: Loading robot model 'panda'... [mtc_tutorial-1] Link panda_link1 had 1 children [mtc_tutorial-1] Link panda_link2 had 1 children [mtc_tutorial-1] Link panda_link3 had 1 children [mtc_tutorial-1] Link panda_link4 had 1 children [mtc_tutorial-1] Link panda_link5 had 1 children [mtc_tutorial-1] Link panda_link6 had 1 children [mtc_tutorial-1] Link panda_link7 had 1 children [mtc_tutorial-1] Link panda_link8 had 1 children [mtc_tutorial-1] Link panda_hand had 2 children [mtc_tutorial-1] Link panda_leftfinger had 0 children [mtc_tutorial-1] Link panda_rightfinger had 0 children [mtc_tutorial-1] terminate called after throwing an instance of 'moveit::task_constructor::Property::undeclared' [mtc_tutorial-1] what(): Property 'hand': undeclared [mtc_tutorial-1] Stack trace (most recent call last): [mtc_tutorial-1] #16 Object &quot;&quot;, at 0xffffffffffffffff, in [mtc_tutorial-1] #15 Object &quot;/home/.../ws_moveit2/install/moveit2_tutorials/lib/moveit2_tutorials/mtc_tutorial&quot;, at 0x5635b0c89044, in _start [mtc_tutorial-1] #14 Source &quot;../csu/libc-start.c&quot;, line 392, in __libc_start_main_impl [0x7f5663c68e3f] [mtc_tutorial-1] #13 Source &quot;../sysdeps/nptl/libc_start_call_main.h&quot;, line 58, in __libc_start_call_main [0x7f5663c68d8f] [mtc_tutorial-1] #12 Source &quot;/home/.../ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp&quot;, line 375, in main [0x5635b0c8e743] [mtc_tutorial-1] 372: }); [mtc_tutorial-1] 373: [mtc_tutorial-1] 374: mtc_task_node-&gt;setupPlanningScene(); [mtc_tutorial-1] &gt; 375: mtc_task_node-&gt;doTask(); [mtc_tutorial-1] 376: [mtc_tutorial-1] 377: spin_thread-&gt;join(); [mtc_tutorial-1] 378: rclcpp::shutdown(); [mtc_tutorial-1] #11 Source &quot;/home/.../ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp&quot;, line 69, in doTask [0x5635b0c895ec] [mtc_tutorial-1] 67: void MTCTaskNode::doTask() [mtc_tutorial-1] 68: { [mtc_tutorial-1] &gt; 69: task_ = createTask(); [mtc_tutorial-1] 70: [mtc_tutorial-1] 71: try [mtc_tutorial-1] 72: { [mtc_tutorial-1] #10 Source &quot;/home/.../ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp&quot;, line 152, in createTask [0x5635b0c8a615] [mtc_tutorial-1] 149: // In fact, `task` itself is a SerialContainer by default. [mtc_tutorial-1] 150: { [mtc_tutorial-1] 151: auto grasp = std::make_unique&lt;mtc::SerialContainer&gt;(&quot;pick object&quot;); [mtc_tutorial-1] &gt; 152: task.properties().exposeTo(grasp-&gt;properties(), { &quot;eef&quot;, &quot;hand&quot;, &quot;group&quot;, &quot;ik_frame&quot; }); [mtc_tutorial-1] 153: // clang-format off [mtc_tutorial-1] 154: grasp-&gt;properties().configureInitFrom(mtc::Stage::PARENT, [mtc_tutorial-1] 155: { &quot;eef&quot;, &quot;hand&quot;, &quot;group&quot;, &quot;ik_frame&quot; }); [mtc_tutorial-1] #9 Object &quot;/home/.../ws_moveit2/install/moveit_task_constructor_core/lib/libmoveit_task_constructor_core.so&quot;, at 0x7f566458faf9, in moveit::task_constructor::PropertyMap::exposeTo(moveit::task_constructor::PropertyMap&amp;, std::set&lt;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::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;) const [mtc_tutorial-1] #8 Object &quot;/home/.../ws_moveit2/install/moveit_task_constructor_core/lib/libmoveit_task_constructor_core.so&quot;, at 0x7f566458fa98, in moveit::task_constructor::PropertyMap::exposeTo(moveit::task_constructor::PropertyMap&amp;, 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; const&amp;) const [mtc_tutorial-1] #7 Object &quot;/home/.../ws_moveit2/install/moveit_task_constructor_core/lib/libmoveit_task_constructor_core.so&quot;, at 0x7f566453ab85, in moveit::task_constructor::PropertyMap::property(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) [clone .cold] [mtc_tutorial-1] #6 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f5663f37517, in __cxa_throw [mtc_tutorial-1] #5 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f5663f372b6, in std::terminate() [mtc_tutorial-1] #4 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f5663f3724b, in [mtc_tutorial-1] #3 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f5663f2bbbd, in [mtc_tutorial-1] #2 Source &quot;./stdlib/abort.c&quot;, line 79, in abort [0x7f5663c677f2] [mtc_tutorial-1] #1 Source &quot;../sysdeps/posix/raise.c&quot;, line 26, in raise [0x7f5663c81475] [mtc_tutorial-1] #0 | Source &quot;./nptl/pthread_kill.c&quot;, line 89, in __pthread_kill_internal [mtc_tutorial-1] | Source &quot;./nptl/pthread_kill.c&quot;, line 78, in __pthread_kill_implementation [mtc_tutorial-1] Source &quot;./nptl/pthread_kill.c&quot;, line 44, in __pthread_kill [0x7f5663cd5a7c] [mtc_tutorial-1] Aborted (Signal sent by tkill() 5421 1000) [ERROR] [mtc_tutorial-1]: process has died [pid 5421, exit code -6, cmd '/home/luca/ws_moveit2/install/moveit2_tutorials/lib/moveit2_tutorials/mtc_tutorial --ros-args --params-file /tmp/launch_params_uvqqf67l </code></pre> <p>How can i solve this?</p> <hr /> <p><a href="https://answers.ros.org/question/407851/moveit2-tutorial-error-pick-and-place/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/119094/lucb/" rel="nofollow noreferrer">LucB</a> on ROS Answers with karma: 42 on 2022-10-13</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-13</strong>:<br /> It can not find the property 'hand'. Did you define it? For example</p> <pre><code> const auto&amp; hand_group_name = &quot;hand&quot;; ... task.setProperty(&quot;eef&quot;, hand_group_name); </code></pre> <p>Feel free to look at <a href="https://github.com/ros-planning/moveit2_tutorials/blob/1563a2e15fa2f19a8a0c3bb5c0b6848ae3106751/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp" rel="nofollow noreferrer">moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/119094/lucb/" rel="nofollow noreferrer">LucB</a> on 2022-10-13</strong>:<br /> Since i'm launching</p> <pre><code>ros2 launch moveit2_tutorials pick_place_demo.launch.py </code></pre> <p>i assume exactly this <a href="https://github.com/ros-planning/moveit2_tutorials/blob/1563a2e15fa2f19a8a0c3bb5c0b6848ae3106751/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp" rel="nofollow noreferrer">file</a> will be started, right?</p> <p>Here is the path of the file</p> <pre><code>/home/.../ws_moveit2/src/moveit2_tutorials/doc/tutorial/pick_and_place_with_moveit_task_constructor/src </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/119094/lucb/" rel="nofollow noreferrer">LucB</a> on 2022-10-13</strong>:<br /> I'm not sure about what it is launching because in the Launchfile</p> <pre><code>/home/.../ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/launch/pick_place_demo.launch.py </code></pre> <p>it says the executable mtc_tutorial is in the package moveit2_tutorials.</p> <pre><code>from launch import LaunchDescription from launch_ros.actions import Node from moveit_configs_utils import MoveItConfigsBuilder def generate_launch_description(): moveit_config = MoveItConfigsBuilder(&quot;moveit_resources_panda&quot;).to_dict() # MTC Demo node pick_place_demo = Node( #package=&quot;mtc_tutorial&quot;, #executable=&quot;mtc_tutorial&quot;, package=&quot;moveit2_tutorials&quot;, executable=&quot;mtc_tutorial&quot;, output=&quot;screen&quot;, parameters=[ moveit_config, ], ) return LaunchDescription([pick_place_demo]) </code></pre> <p>But i cant find the executable mtc_tutorial in there.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-13</strong>:\</p> <blockquote> <p>But i cant find the executable <code>mtc_tutorial</code> in there ...</p> </blockquote> <p>It is mentioned <a href="https://github.com/ros-planning/moveit2_tutorials/blob/1563a2e15fa2f19a8a0c3bb5c0b6848ae3106751/doc/tutorials/pick_and_place_with_moveit_task_constructor/CMakeLists.txt#L1-L3" rel="nofollow noreferrer">moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/CMakeLists.txt#L1-L3</a></p>
MoveIt2 tutorial error Pick and Place
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You may start with <a href="https://control.ros.org/master/doc/getting_started/getting_started.html" rel="nofollow noreferrer">https://control.ros.org/master/doc/getting_started/getting_started.html</a> And <a href="https://control.ros.org/master/doc/differences_to_ros1/differences_to_ros1.html" rel="nofollow noreferrer">https://control.ros.org/master/doc/differences_to_ros1/differences_to_ros1.html</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> with karma: 1999 on 2022-10-13</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/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-14</strong>:<br /> Thank you for reply. I read those two yesterday, and maybe I miss something, but there are no answer for this particular question in there. All that I get is assumption, that JointTrajectoryController is doing something similar to JointStateInterface, but still, maybe I am wrong here</p> <p><strong>Comment by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> on 2022-10-14</strong>:<br /> As here written <a href="https://github.com/ros-controls/ros2_control/issues/61" rel="nofollow noreferrer">github</a></p> <pre><code>ros_control's JointStateInterface, EffortJointInterface, PositionJointInterface, VelocityJointInterface, *InterfaceProvider functionalities have been replaced by RobotHardware. </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-16</strong>:<br /> Oh, I see. Thank you for your help. You already answered my question, but still do you happen to know where to look this RobotHardware? I't is a little strange for me, but there are no RobotHardware in hardware_interface or joint_limits_interface.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> on 2022-10-16</strong>:<br /> You may find something here: <a href="https://github.com/ros-controls/ros2_control_demos/tree/master/ros2_control_demo_hardware" rel="nofollow noreferrer">demo hardware</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-16</strong>:<br /> I couldn't find any RobotHardware uses there. Still, thank you for your help.</p>
102538
2022-10-13T06:00:39.000
|ros|ros2|hardware-interface|
<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 have folloing lines of code in my ros1 project</p> <hr /> <pre><code>hardware_interface::JointStateInterface js_interface_; hardware_interface::EffortJointInterface ej_interface_; hardware_interface::PositionJointInterface pj_interface_; hardware_interface::VelocityJointInterface vj_interface_; </code></pre> <hr /> <p>I have a problem with understanding, how this lines should look in ros2 Foxy. I'll appreciate any help. As far as I know EffortJointInterface can be used in Galactic and all newer version, but I could be wrong.</p> <hr /> <p><a href="https://answers.ros.org/question/407866/is-there-an-implementation-of-jointstateinterface,-effortjointinterface,-positionjointinterface-and-velocityjointinterface-in-ros2?/" 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-10-13</p> <p>Post score: 0</p>
Is there an implementation of JointStateInterface, EffortJointInterface, PositionJointInterface and VelocityJointInterface in ros2?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>If the answer is solved with this</p> <pre><code>conda deactivate </code></pre> <p>Then close the question</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> with karma: 1999 on 2022-10-18</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/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-10-19</strong>:<br /> @duck-development Normally we don't &quot;close&quot; questions on this site unless there is a problem with it, for example if it is off-topic or a duplicate.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> on 2022-10-19</strong>:<br /> It was for @j-sohn. And I mean mark the question as answered. So other see how to sove this kind of question</p>
102540
2022-10-13T09:34:28.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all,</p> <p>I just started my journey to learn ROS2 and worked through the humble tutorial (I am using Ubuntu 22.04.). I tried to follow the instruction <a href="https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html" rel="nofollow noreferrer">to create a workspace</a> and everything worked fine until step 5 where this error occured.</p> <pre><code>[0.392s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces: 'turtlesim' is in: /opt/ros/humble If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time. If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur. If you understand the risks and want to override a package anyways, add the following to the command line: --allow-overriding turtlesim This may be promoted to an error in a future release of colcon-override-check. Starting &gt;&gt;&gt; turtlesim --- stderr: turtlesim Traceback (most recent call last): File &quot;/opt/ros/humble/share/rosidl_generator_py/cmake/../../../lib/rosidl_generator_py/rosidl_generator_py&quot;, line 8, in &lt;module&gt; from rosidl_generator_py import generate_py ImportError: cannot import name 'generate_py' from 'rosidl_generator_py' (/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/__init__.py) gmake[2]: *** [turtlesim__py/CMakeFiles/turtlesim__py.dir/build.make:121: rosidl_generator_py/turtlesim/_turtlesim_s.ep.rosidl_typesupport_fastrtps_c.c] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:706: turtlesim__py/CMakeFiles/turtlesim__py.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... gmake: *** [Makefile:146: all] Error 2 --- Failed &lt;&lt;&lt; turtlesim [25.5s, exited with code 2] Summary: 0 packages finished [25.7s] 1 package failed: turtlesim 1 package had stderr output: turtlesim </code></pre> <p>In one <a href="https://github.com/colcon/colcon-core/issues/465" rel="nofollow noreferrer">post</a> I read, it was suggested not to source before creating a workspace, however this didn't help and I got this error. Where I noticed the issue with the &quot;rosidl_generator_py&quot; module.</p> <pre><code>Starting &gt;&gt;&gt; turtlesim --- stderr: turtlesim Traceback (most recent call last): File &quot;/opt/ros/humble/share/rosidl_generator_py/cmake/../../../lib/rosidl_generator_py/rosidl_generator_py&quot;, line 8, in &lt;module&gt; from rosidl_generator_py import generate_py ModuleNotFoundError: No module named 'rosidl_generator_py' gmake[2]: *** [turtlesim__py/CMakeFiles/turtlesim__py.dir/build.make:121: rosidl_generator_py/turtlesim/_turtlesim_s.ep.rosidl_typesupport_fastrtps_c.c] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:706: turtlesim__py/CMakeFiles/turtlesim__py.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... gmake: *** [Makefile:146: all] Error 2 --- Failed &lt;&lt;&lt; turtlesim [0.37s, exited with code 2] Summary: 0 packages finished [0.47s] 1 package failed: turtlesim 1 package had stderr output: turtlesim </code></pre> <p>After reading another <a href="https://stackoverflow.com/questions/72752937/ros2-importerror-cannot-import-name-generate-py-from-rosidl-generator-py">post</a>, it was possible to create a workspace as I commented the required package &quot;rosidl_default_generators&quot; in the CMakeLists.txt file. However, I would like to know if there is a better way to fix this problem.</p> <pre><code>[0.358s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces: 'turtlesim' is in: /opt/ros/humble If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time. If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur. If you understand the risks and want to override a package anyways, add the following to the command line: --allow-overriding turtlesim This may be promoted to an error in a future release of colcon-override-check. Starting &gt;&gt;&gt; turtlesim Finished &lt;&lt;&lt; turtlesim [1.62s] Summary: 1 package finished [1.77s] </code></pre> <hr /> <p><a href="https://answers.ros.org/question/407879/humble-tutorial-creating-a-workspace/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/120382/j-sohn/" rel="nofollow noreferrer">j-sohn</a> on ROS Answers with karma: 13 on 2022-10-13</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-14</strong>:<br /> Are you using environments like <code>conda</code> etc? I followed the tutorial and face no issues. Can you please execute the following command and share the output: <code>printenv | grep PYTHONPATH</code></p> <p><strong>Comment by <a href="https://answers.ros.org/users/120382/j-sohn/" rel="nofollow noreferrer">j-sohn</a> on 2022-10-14</strong>:<br /> Thanks for the hint! Yes, I use anaconda. I deactivated the environment through <code>conda deactivate</code> and it solved the problem. Everything works fine now! Thanks a lot!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-15</strong>:<br /> Glad you made it work!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-10-15</strong>:<br /> @ravijoshi You comment was a very nice intuition.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/135060/iwasinnam/" rel="nofollow noreferrer">iwasinnam</a> on 2023-01-22</strong>:<br /> I don't have conda so this solution didn't work for me. But commenting out rosidl_default_generators did work, and it's good enough for me</p>
Humble tutorial creating a workspace
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>As part of the standard set of linters that you get when you use <code>ament_lint_auto</code> or call the linters manually from the CLI is one that checks for copyrights in all of your source code files. This will check C / C++ / CMake / Python files for a header containing a software license as good general practice in software development (for some licenses, like BSD and Apache 2.0 that require it in every source file). There's nothing special about launch files, they're still python files that have copyrights attached to them like any other type of software - so you're probably just seeing that error because you have copyrights everywhere else but didn't include them in your launch files.</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-10-14</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/17921/vkuehn/" rel="nofollow noreferrer">vKuehn</a> on 2022-10-15</strong>:<br /> thanks a lot. that explains it. Thought the most open source projects have one license file valid for the source at a whole.</p>
102542
2022-10-14T01:38:32.000
|ros2|roslaunch|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>After copy and paste working source files from an ubuntu humble to ubuntu foxy the launch didn't work.</p> <p>So I did</p> <pre><code>colcon test colcon test-result --verbose </code></pre> <p>the long list with mainly flake8 issues starts with</p> <pre><code>could not find copyright notice </code></pre> <p>for the launch files but I can't find any notice in the documentation about launchfile copyrights. why does this happens ?</p> <hr /> <p><a href="https://answers.ros.org/question/407905/why-need-launchfiles-a-copyright-?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/17921/vkuehn/" rel="nofollow noreferrer">vKuehn</a> on ROS Answers with karma: 116 on 2022-10-14</p> <p>Post score: 0</p>
Why need launchfiles a copyright?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>AFAIK, you cannot change the default used by <code>ros-foxy-rmw-implementation</code>, as it's hard-coded into the <code>.cmake</code> file you already found.</p> <p>The way this was implemented (not by me) is that <em>at build time</em> of <code>rmw_implementation</code>, the <code>RMW_IMPLEMENTATION</code> environment variable is checked, and if set, it gets used (<a href="https://github.com/ros2/rmw_implementation/blob/8c3c133eb070a4f19259f027cc2cea720b28eff0/rmw_implementation/CMakeLists.txt#L62-L63" rel="nofollow noreferrer">here</a>) to populate a <code>target_compile_definitions(... DEFAULT_RMW_IMPLEMENTATION=...)</code> for the <code>rmw_implementation</code> target (which then gets <code>install(... export ...)</code>-ed later on, resulting in the <code>rmw_implementationExport.cmake</code> file you found).</p> <p>That file is used/loaded by <code>rmw_implementation_cmake</code> (<a href="https://github.com/ros2/rmw/blob/b635eec56ab3841965f2c1db39e0143d51304c79/rmw_implementation_cmake/cmake/get_default_rmw_implementation.cmake" rel="nofollow noreferrer">here</a> fi) to determine which value it should return in case the <code>RMW_IMPLEMENTATION</code> environment variable isn't set.</p> <p>While you probably have your reasons, I must point out the intended way for this to be used is to set the <code>RMW_IMPLEMENTATION</code> environment variable before starting any nodes. Regardless of what the value of <code>DEFAULT_RMW_IMPLEMENTATION</code> is, the RMW corresponding to <code>RMW_IMPLEMENTATION</code> will be loaded (unless the <code>RMW_IMPLEMENTATION_DISABLE_RUNTIME_SELECTION</code> CMake option of <code>rmw_implementation</code> was set when it was built).</p> <p>Note also that AFAIK, setting <code>RMW_IMPLEMENTATION</code> at build time will <em>not</em> affect anything other than the value returned by CMake functions like <code>get_default_rmw_implementation(..)</code> and the value passed to the compiler. There don't appear to be any other code paths taken or code excluded or included based on that value anywhere in the core packages (in other words: the core ROS 2 packages will behave exactly the same, whether or not you set that variable, as all RMWs are loaded at runtime anyway, including any default, if configured).</p> <p>Having written that: the direct answer to your question would seem to be: you can change the value which ends up in <code>DEFAULT_RMW_IMPLEMENTATION</code> by setting the <code>RMW_IMPLEMENTATION</code> environment variable during the build of the <code>rmw_implementation</code> package. You might also be able to pass the value to CMake as a <code>--cmake-arg</code> using <code>-DRMW_IMPLEMENTATION=...</code> (<a href="https://github.com/ros2/rmw_implementation/blob/8c3c133eb070a4f19259f027cc2cea720b28eff0/rmw_implementation/CMakeLists.txt#L37-L42" rel="nofollow noreferrer">this</a> seems to suggest that). This would make it somewhat more manageable, as CMake args can be more easily stored in files.</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-10-15</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/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-10-15</strong>:<br /> This was also discussed in <a href="https://discourse.ros.org/t/change-the-default-dds-implementation/2813/2" rel="nofollow noreferrer">Change the default DDS implementation</a> on ROS Discourse, which seems like it answers your question as well. I took the time to add some more detail and link to some of the files involved.</p>
102544
2022-10-14T09:55:35.000
|ros2|cmake|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>When I build things with colcon I see compiler invocations like this:</p> <pre><code>g++ -DDEFAULT_RMW_IMPLEMENTATION=rmw_fastrtps_cpp ... </code></pre> <p>I would like to override that preprocessor definition. How do I do that? Something like this has no effect:</p> <pre><code>export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp </code></pre> <p>On a Ubuntu 20.04 host with foxy installed, this is the only file that mentions <code>DEFAULT_RMW_IMPLEMENTATION</code>:</p> <pre><code>$ grep -rl 'DEFAULT_RMW_IMPLEMENTATION' /opt/ros/foxy /opt/ros/foxy/share/rmw_implementation/cmake/rmw_implementationExport.cmake </code></pre> <p>Within that file, here is the section that sets the <code>CPPFLAGS</code>:</p> <pre><code>$ grep -nC2 'DEFAULT_RMW_IMPLEMENTATION' /opt/ros/foxy/share/rmw_implementation/cmake/rmw_implementationExport.cmake 55- 56-set_target_properties(rmw_implementation::rmw_implementation PROPERTIES 57: INTERFACE_COMPILE_DEFINITIONS &quot;DEFAULT_RMW_IMPLEMENTATION=rmw_fastrtps_cpp&quot; 58- INTERFACE_LINK_LIBRARIES &quot;rcpputils::rcpputils;rcutils::rcutils;rmw::rmw&quot; 59-) </code></pre> <p>Here is the package that provides that file:</p> <pre><code>$ dpkg -S /opt/ros/foxy/share/rmw_implementation/cmake/rmw_implementationExport.cmake ros-foxy-rmw-implementation: /opt/ros/foxy/share/rmw_implementation/cmake/rmw_implementationExport.cmake </code></pre> <p>Here is the version of that package at the time of this writing:</p> <pre><code>$ apt-cache policy ros-foxy-rmw-implementation ros-foxy-rmw-implementation: Installed: 1.0.3-1focal.20220922.205522 Candidate: 1.0.3-1focal.20220922.205522 Version table: *** 1.0.3-1focal.20220922.205522 500 500 http://packages.ros.org/ros2/ubuntu focal/main amd64 Packages 100 /var/lib/dpkg/status </code></pre> <p>Short of changing the content of this <code>*.cmake</code> file for this package, how do I change the default rmw implementation definition used by the preprocessor?</p> <hr /> <p><a href="https://answers.ros.org/question/407949/how-to-override-default_rmw_implementation-?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/118515/realtime-neil/" rel="nofollow noreferrer">realtime-neil</a> on ROS Answers with karma: 1 on 2022-10-14</p> <p>Post score: 0</p>
How to override DEFAULT_RMW_IMPLEMENTATION?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>As far as I know, these are not standard terms - this particular rviz plugin made them up.</p> <p>So, from looking at the values, I think that <code>Position</code> and <code>Orientation</code> are the pose of <code>ee_link</code> relative to the <code>Fixed Frame</code>, and <code>Relative Position</code> and <code>Relative Orientation</code> are the pose of <code>ee_link</code> relative to the <code>ee_link</code> parent, <code>wrist_3_link</code>.</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-10-15</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/4955/croco/" rel="nofollow noreferrer">CroCo</a> on 2022-10-15</strong>:<br /> Thank you for the answer. What do you mean by &quot;made them up&quot;? It seems to me this is the result of tf structure from reading urdf file. The problem I'm facing is that my controller provides slightly different values (i.e. <code>0.5 - 0.5i + 0.5j + 0.5k</code>). The i-component appears negative whereas in RViz appears positive. For the position, they are same but the orientation at some configurations appears different.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-10-16</strong>:<br /> &quot;made them up&quot; was about the terminology, the labels given to those two poses.</p> <p>I expect that rviz plugin is using the tf2_ros Buffer.lookup_transform() to get the values it displays, so they are almost certainly correct.</p> <p>If your code gets a different result (after being normalized), you have a bug somewhere. Open a new question if you can clearly describe the problem.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-10-16</strong>:<br /> P.S. the python method <code>tf.transformations.euler_from_quaternion([x,y,z,w])</code> is very useful for debugging these kind of problems. It returns the euler <code>(roll, pitch, yaw)</code> in radians.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/4955/croco/" rel="nofollow noreferrer">CroCo</a> on 2022-10-16</strong>:<br /> In my controller, I'm using the standard DH parameters for UR5. It seems I need to modify this table so that both the controller and the RViz/Gazebo are identical. This is my only thought.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/4955/croco/" rel="nofollow noreferrer">CroCo</a> on 2022-10-16</strong>:<br /> Please take a look at my question <a href="https://answers.ros.org/question/405892/x-y-axes-for-ur5-appear-reversed/" rel="nofollow noreferrer">https://answers.ros.org/question/405892/x-y-axes-for-ur5-appear-reversed/</a></p>
102546
2022-10-14T16:35:59.000
|ros|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm trying to understand the relative position and orientation. Take a look at the below picture. The end-effector frame (i.e. the top right frame) for the UR5 is shown. Its relative orientation is shown in RViz as <code>x=0,y=0,z=0.707,w=0.707</code>. My understanding for relative orientation is with respect to the previous frame (i.e. the top left frame in the picture), but it seems to me the orientation is carried out by 90 deg around y-axis of that frame but the result shows the orientation about z-axis by 90 deg. What is exactly the relative and absolute position and orientation in ros?</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16657830829412241.png" alt="image description" /></p> <hr /> <p><a href="https://answers.ros.org/question/407961/clarification-about-relative-orientation-of-ur5/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/4955/croco/" rel="nofollow noreferrer">CroCo</a> on ROS Answers with karma: 155 on 2022-10-14</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/120024/nils_iseke/" rel="nofollow noreferrer">nils_iseke</a> on 2022-10-15</strong>:<br /> I would assume that the colours of the axes are: X-Axis = Red Y-Axis = Green Z-Axis = Blue Therefore the rotation between the left upper and the right upper frame is a rotation around the z-axis by +90° (right hand rule).</p>
Clarification about relative orientation of UR5
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Folks! I have solved the problem! Not sure if this is the correct way, but it works now.</p> <p>The following was added as a &quot;global&quot; variable declaration (yes, yes global are a bad idea, I know!)</p> <pre><code>unsigned int num_handles = 1 + 1; // 1 subscriber, 1 publisher (but what about timer?? </code></pre> <p>After that, this line:</p> <pre><code>RCCHECK(rclc_executor_init(&amp;executor, &amp;support.context, 1, &amp;allocator)); </code></pre> <p>has been changed as follows:</p> <pre><code>RCCHECK(rclc_executor_init(&amp;executor, &amp;support.context, num_handles, &amp;allocator)); </code></pre> <p>Yeah, I know I could have hardcoded it, but at least this provides some context and clarity in the source code. Currently I'm cleaning this code up and then I will create a pull request to the github repo, for everyone else in this community to find and use. Hopefully my struggles with this and the contributions to the original repo will help someone else in the future!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> with karma: 120 on 2022-10-14</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102548
2022-10-14T17:32:59.000
|ros|ros2|embedded|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone, Working on a ROS Robot project and I only have the weekends to work on this. So far I have wasted away 3 consecutive weekends bashing on a simple issue.</p> <p>Anyone kind enough to take a quick look? I promise it is a very simple question, any of you experts likely can answer within a few minutes of your valuable time, saving me hours of headache!</p> <p>Thanks to any kind soul providing advice! I will merge my working code back into the github repository under examples, so other can benefit from this as well! Don't believe me? Check out my pull requests on this repo: <a href="https://github.com/micro-ROS/micro_ros_platformio/pulls" rel="nofollow noreferrer">https://github.com/micro-ROS/micro_ros_platformio/pulls</a></p> <p>Issue with the implementation of a publisher and subscriber in same program: Meaning if I delete everything related to the subscriber / publisher, running the other one works.</p> <p>This is achieved, following the &quot;Teensy with Arduino&quot; tutorial on micro.ros.org</p> <pre><code>Ubuntu 22.04.1 with ROS2 Humble install (desktop) Visual Studio Code Version: 1.71.2 PlatformIO Core 6.1.4·Home 3.4.3 Platform Teensy 4.1 and micro_ROS </code></pre> <p>The line of code below causes it to get stuck in the &quot;error_loop&quot;. (around line 121)</p> <pre><code>RCCHECK(rclc_executor_add_subscription(&amp;executor, &amp;subscriber, &amp;msg_sub, &amp;subscription_callback, ON_NEW_DATA)); </code></pre> <p>Here the entire source code:</p> <pre><code>#include &lt;Arduino.h&gt; #include &lt;Wire.h&gt; #include &lt;micro_ros_platformio.h&gt; #include &lt;rcl/rcl.h&gt; #include &lt;rclc/rclc.h&gt; #include &lt;rclc/executor.h&gt; #include &lt;std_msgs/msg/int32.h&gt; #if !defined(MICRO_ROS_TRANSPORT_ARDUINO_SERIAL) #error This example is only avaliable for Arduino framework with serial transport. #endif // debug #ifndef DebugMonitor #define DebugMonitor Serial6 #endif #define debug(x) DebugMonitor.print(x) #define debugln(x) DebugMonitor.println(x) //publisher rcl_publisher_t publisher; std_msgs__msg__Int32 msg_pub; // subscriber rcl_subscription_t subscriber; std_msgs__msg__Int32 msg_sub; // publisher and subscriber common rcl_node_t node; rclc_support_t support; rcl_allocator_t allocator; rclc_executor_t executor; rcl_timer_t timer; #define LED_PIN 13 #define RCCHECK(fn){rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){debugln(&quot;error: &quot;);debugln(temp_rc);debugln(RCL_RET_OK);error_loop();}} #define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}} // Error handle loop void error_loop() { while(1) { digitalWrite(LED_PIN, !digitalRead(LED_PIN)); delay(500); } } void timer_callback(rcl_timer_t * timer, int64_t last_call_time) { RCLC_UNUSED(last_call_time); if (timer != NULL) { RCSOFTCHECK(rcl_publish(&amp;publisher, &amp;msg_pub, NULL)); msg_pub.data++; } } void subscription_callback(const void * msgin) { const std_msgs__msg__Int32 * msg = (const std_msgs__msg__Int32 *)msgin; digitalWrite(LED_PIN, (msg-&gt;data == 0) ? LOW : HIGH); debugln(&quot;=================================&quot;); debugln(&quot; RECEIVED:&quot;); debugln(&quot;=================================&quot;); debugln(msg-&gt;data); } void setup() { // Configure serial transport Serial.begin(115200); set_microros_serial_transports(Serial); // Debug DebugMonitor.begin(115200); pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN, HIGH); delay(2000); allocator = rcl_get_default_allocator(); //create init_options RCCHECK(rclc_support_init(&amp;support, 0, NULL, &amp;allocator)); debugln(&quot;Debug 0&quot;); // create node RCCHECK(rclc_node_init_default(&amp;node, &quot;uros_platformio_node&quot;, &quot;&quot;, &amp;support)); debugln(&quot;Debug 1&quot;); // create publisher RCCHECK(rclc_publisher_init_default( &amp;publisher, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), &quot;micro_ros_platformio_node_publisher&quot;)); debugln(&quot;Debug 2&quot;); // create subscriber RCCHECK(rclc_subscription_init_default( &amp;subscriber, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), &quot;micro_ros_platformio_node_subscriber&quot;)); debugln(&quot;Debug 3&quot;); // create timer, const unsigned int timer_timeout = 1000; RCCHECK(rclc_timer_init_default( &amp;timer, &amp;support, RCL_MS_TO_NS(timer_timeout), timer_callback)); debugln(&quot;Debug 4&quot;); // create executor RCCHECK(rclc_executor_init(&amp;executor, &amp;support.context, 1, &amp;allocator)); debugln(&quot;Debug 5&quot;); RCCHECK(rclc_executor_add_timer(&amp;executor, &amp;timer)); debugln(&quot;Debug 6&quot;); // RCCHECK(rclc_executor_add_subscription(&amp;executor, &amp;subscriber, &amp;msg_sub, &amp;subscription_callback, ON_NEW_DATA)); debugln(&quot;Debug 7&quot;); msg_pub.data = 0; } void loop() { delay(100); RCSOFTCHECK(rclc_executor_spin_some(&amp;executor, RCL_MS_TO_NS(100))); debugln(&quot;Scan&quot;); } </code></pre> <p>Thank you, Thank you for helping!</p> <hr /> <p><a href="https://answers.ros.org/question/407962/simple-microros-pub/sub-failing-at-init/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> on ROS Answers with karma: 120 on 2022-10-14</p> <p>Post score: 0</p>
Simple microROS pub/sub failing at init
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Closed! Thanks to Acuadros95. Here is what needed to be done to successfully add the example_interface package.</p> <ol> <li>clone the correct branch into ws/extra_packages -&gt; git clone -b humble <a href="https://github.com/ros2/example_interfaces.git" rel="nofollow noreferrer">https://github.com/ros2/example_interfaces.git</a></li> <li>ensure the package.xml file is not missing</li> <li>clean</li> <li>delete .pio directory (alternatively: pio run --target clean_microros)</li> <li>pio lib install</li> <li>pio run</li> </ol> <p>==&gt; compiled without errors, took a while, didn't try to hold my breath (wouldn't be writing this)</p> <p>Looking forward to merging this back as an example</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> with karma: 120 on 2022-10-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102550
2022-10-15T01:26:50.000
|ros|ros2|embedded|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Can anyone please point me to the documentation of how to add extra_packages to a platformio project? My project is currently built via the below commands in platformio:</p> <pre><code>pio lib install # Install dependencies pio run # Build the firmware pio run --target upload # Flash the firmware </code></pre> <p>I'm developing for micro-ROS, but there are gaps in the library and it seems impossible to find how to add custom packages. As above mentioned, I'm not using colcon build ... as one would normally when developing for ROS2, since I'm building with platformio for micro-ROS.</p> <p>I do understand I need to &quot;place&quot; any additional packages into the &quot;/workspace/extra_packages/&quot; directory. But there are no clear instructions on how to achieve this, so that dependencies are properly established.</p> <p>As per the documentation: <a href="https://github.com/micro-ROS/micro_ros_platformio#extra-packages" rel="nofollow noreferrer">https://github.com/micro-ROS/micro_ros_platformio#extra-packages</a></p> <pre><code>Extra packages Colcon packages can be added to the build process using this two methods: Package directories copied on the &lt;Project_directory&gt;/extra_packages folder. Git repositories included on the &lt;Project_directory&gt;/extra_packages/extra_packages.repos yaml file. This should be used for example when adding custom messages types or custom micro-ROS packages. </code></pre> <p>I have the following:</p> <pre><code> 1. copy the &quot;example_interfaces&quot; directory (ros2/example_interfaces) into /workspace/extra_packages 2. used git clone in the empty /workspace/extra_packages on another attempt </code></pre> <p>In both cases I manually went through the included .h files and fixed all &quot;path-issues&quot; where there have been red squiggles (as you might be familiar with the syntax highlighting and error indication in VS-Code)</p> <p>But still when using the above &quot;build-steps&quot; it fails with the following message:</p> <pre><code>.pio/build/teensy41/src/main.cpp.o: In function `setup': main.cpp:(.text.setup+0x54): undefined reference to `rosidl_typesupport_c__get_service_type_support_handle__example_interfaces__srv__AddTwoInts' collect2: error: ld returned 1 exit status *** [.pio/build/teensy41/firmware.elf] Error 1 </code></pre> <p>And yes I did do a clean before, also deleted the .pio directory to force re-download of everything and also followed the pio run --target clean_microros # Clean library</p> <p>But whatever I try, it simply won't compile. The entire source code can be found below. Attempt here is to create a simple service to add two numbers.</p> <pre><code>#include &lt;Arduino.h&gt; #include &lt;Wire.h&gt; #include &lt;micro_ros_platformio.h&gt; #include &lt;../extra_packages/example_interfaces/srv/add_two_ints.h&gt; #include &lt;stdio.h&gt; #include &lt;rcl/error_handling.h&gt; #include &lt;rclc/rclc.h&gt; #include &lt;rclc/executor.h&gt; #include &lt;std_msgs/msg/int64.h&gt; rcl_node_t node; rclc_support_t support; rcl_allocator_t allocator; rclc_executor_t executor; rcl_service_t service; rcl_wait_set_t wait_set; example_interfaces__srv__AddTwoInts_Response res; example_interfaces__srv__AddTwoInts_Request req; #define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){while(1){};}} #define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}} void service_callback(const void * req, void * res){ example_interfaces__srv__AddTwoInts_Request * req_in = (example_interfaces__srv__AddTwoInts_Request *) req; example_interfaces__srv__AddTwoInts_Response * res_in = (example_interfaces__srv__AddTwoInts_Response *) res; //printf(&quot;Service request value: %d + %d.\n&quot;, (int) req_in-&gt;a, (int) req_in-&gt;b); res_in-&gt;sum = req_in-&gt;a + req_in-&gt;b; } void setup() { //set_microros_transports(); set_microros_serial_transports(Serial); delay(1000); allocator = rcl_get_default_allocator(); // create init_options RCCHECK(rclc_support_init(&amp;support, 0, NULL, &amp;allocator)); // create node RCCHECK(rclc_node_init_default(&amp;node, &quot;add_twoints_client_rclc&quot;, &quot;&quot;, &amp;support)); // create service RCCHECK(rclc_service_init_default(&amp;service, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, AddTwoInts), &quot;/addtwoints&quot;)); // create executor RCCHECK(rclc_executor_init(&amp;executor, &amp;support.context, 1, &amp;allocator)); RCCHECK(rclc_executor_add_service(&amp;executor, &amp;service, &amp;req, &amp;res, service_callback)); } void loop() { delay(100); RCSOFTCHECK(rclc_executor_spin_some(&amp;executor, RCL_MS_TO_NS(100)));} </code></pre> <p>I do believe the solution is rather simple and won't take much effort by a seasoned expert. Whoever the forthcoming, generous expert will be, please let me know, how I can thank you and buy a coffee for your troubles.</p> <hr /> <p><a href="https://answers.ros.org/question/407967/adding-extra_package-platformio-project/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> on ROS Answers with karma: 120 on 2022-10-15</p> <p>Post score: 0</p>
adding extra_package platformio project
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Try this command to get the right branch</p> <pre><code>git clone https://github.com/ros-perception/pointcloud_to_laserscan.git --branch indigo-devel --single-branch </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> with karma: 1999 on 2022-10-17</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/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> on 2022-10-19</strong>:<br /> As in younoutput is something with <code>ament_cmake</code> you definitely has the main brunch and not the indigo-devel.</p> <p>You may delete the workspace a new wine clonen with the cmd from my answer and compile again.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2022-10-20</strong>:<br /> @duck-development thanks! I forogt I had to explicitly type the <code>branch</code> comand</p>
102552
2022-10-15T16:20:06.000
|ros|pointcloud-to-laserscan|ros-kinetic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm looking for the pointcloud_to_laserscan package for ROS1 kinetic. Does anyone know a repo for this? I tried the link on the ROS wiki but couldn't find a kinetic branch. I try the indigo branch as adviced but find problems in both trying to <code>catkin_make</code> and <code>catkin_build</code> (Yes I am aware I can't interchange the two once I have built with one. I simply made two separate workspaces and did the following tests). For workspace made by <code>catkin_make</code>. The package in question gives this error when I try to catkin_make:</p> <pre><code>Base path: /home/turtlebot/testws Source space: /home/turtlebot/testws/src Build space: /home/turtlebot/testws/build Devel space: /home/turtlebot/testws/devel Install space: /home/turtlebot/testws/install #### #### Running command: &quot;make cmake_check_build_system&quot; in &quot;/home/turtlebot/testws/build&quot; #### -- Using CATKIN_DEVEL_PREFIX: /home/turtlebot/testws/devel -- Using CMAKE_PREFIX_PATH: /home/turtlebot/catkin_ws/devel;/opt/ros/kinetic -- This workspace overlays: /home/turtlebot/catkin_ws/devel;/opt/ros/kinetic -- Found PythonInterp: /usr/bin/python2 (found suitable version &quot;2.7.12&quot;, minimum required is &quot;2&quot;) -- Using PYTHON_EXECUTABLE: /usr/bin/python2 -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/turtlebot/testws/build/test_results -- Found gtest sources under '/usr/src/gmock': gtests will be built -- Found gmock sources under '/usr/src/gmock': gmock will be built -- Found PythonInterp: /usr/bin/python2 (found version &quot;2.7.12&quot;) -- Using Python nosetests: /usr/bin/nosetests-2.7 -- catkin 0.7.29 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~ traversing 1 packages in topological order: -- ~~ - pointcloud_to_laserscan (plain cmake) -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_workspace.cmake:100 (message): This workspace contains non-catkin packages in it, and catkin cannot build a non-homogeneous workspace without isolation. Try the 'catkin_make_isolated' command instead. Call Stack (most recent call first): CMakeLists.txt:69 (catkin_workspace) -- Configuring incomplete, errors occurred! See also &quot;/home/turtlebot/testws/build/CMakeFiles/CMakeOutput.log&quot;. See also &quot;/home/turtlebot/testws/build/CMakeFiles/CMakeError.log&quot;. Makefile:318: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Error 1 </code></pre> <p>For the workspace made with <code>catkin build</code> this error occurs when I try to build:</p> <pre><code>----------------------------------------------------------------------------- Profile: default Extending: [env] /home/turtlebot/catkin_ws/devel:/opt/ros/kinetic Workspace: /home/turtlebot/test_ws ----------------------------------------------------------------------------- Build Space: [exists] /home/turtlebot/test_ws/build Devel Space: [exists] /home/turtlebot/test_ws/devel Install Space: [unused] /home/turtlebot/test_ws/install Log Space: [exists] /home/turtlebot/test_ws/logs Source Space: [exists] /home/turtlebot/test_ws/src DESTDIR: [unused] None ----------------------------------------------------------------------------- Devel Space Layout: linked Install Space Layout: None ----------------------------------------------------------------------------- Additional CMake Args: None Additional Make Args: None Additional catkin Make Args: None Internal Make Job Server: True Cache Job Environments: False ----------------------------------------------------------------------------- Whitelisted Packages: None Blacklisted Packages: None ----------------------------------------------------------------------------- Workspace configuration appears valid. ----------------------------------------------------------------------------- [build] Found '1' packages in 0.0 seconds. [build] Updating package table. [build] Warning: Skipping package `pointcloud_to_laserscan` because it has an unsupported package build type: `ament_cmake` [build] Note: Available build types: [build] - `catkin` [build] - `cmake` [build] Summary: All 0 packages succeeded! [build] Ignored: 1 packages were skipped or are blacklisted. [build] Warnings: None. [build] Abandoned: None. [build] Failed: None. [build] Runtime: 0.0 seconds total. turtlebot@turtlebot-ThinkPad-X280:~/test_ws/src$ catkin build ----------------------------------------------------------------------------- Profile: default Extending: [cached] /home/turtlebot/catkin_ws/devel:/opt/ros/kinetic Workspace: /home/turtlebot/test_ws ----------------------------------------------------------------------------- Build Space: [exists] /home/turtlebot/test_ws/build Devel Space: [exists] /home/turtlebot/test_ws/devel Install Space: [unused] /home/turtlebot/test_ws/install Log Space: [exists] /home/turtlebot/test_ws/logs Source Space: [exists] /home/turtlebot/test_ws/src DESTDIR: [unused] None ----------------------------------------------------------------------------- Devel Space Layout: linked Install Space Layout: None ----------------------------------------------------------------------------- Additional CMake Args: None Additional Make Args: None Additional catkin Make Args: None Internal Make Job Server: True Cache Job Environments: False ----------------------------------------------------------------------------- Whitelisted Packages: None Blacklisted Packages: None ----------------------------------------------------------------------------- Workspace configuration appears valid. ----------------------------------------------------------------------------- [build] Found '1' packages in 0.0 seconds. [build] Package table is up to date. [build] Warning: Skipping package `pointcloud_to_laserscan` because it has an unsupported package build type: `ament_cmake` [build] Note: Available build types: [build] - `catkin` [build] - `cmake` [build] Summary: All 0 packages succeeded! [build] Ignored: 1 packages were skipped or are blacklisted. [build] Warnings: None. [build] Abandoned: None. [build] Failed: None. [build] Runtime: 0.0 seconds total. </code></pre> <p>he For the <code>catkin_make</code> error. I googled it, I tried to make sense of what the internet was informing me was the cause. I initially assumed that perhaps the cmake versions of the package and that of the workspace differed and therefore the root of the problem. They do differ , for the package: <code>cmake_minimum_required(VERSION 3.5)</code> for workspace: <code>cmake_minimum_required(VERSION 3.0.2)</code></p> <p>I tried to make the versions the same by simple eddting but it didnt seem to work. Or maybe I did it wrong.</p> <p>As for the <code>catkin build</code> error. It sems the package is simply skipped when building so. I'm at a loss but still trying to google stuff. Please help.</p> <hr /> <p><a href="https://answers.ros.org/question/407993/pointcloud_to_laserscan-for-ros1-kinetic/" 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-10-15</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-10-19</strong>:<br /> Can you add output of <code>git status</code> in the package folder? You have</p> <blockquote> <p>Warning: Skipping package <code>pointcloud_to_laserscan</code> because it has an unsupported package build type: <code>ament_cmake</code></p> </blockquote> <p>so it is ROS2 version... <a href="https://github.com/ros-perception/pointcloud_to_laserscan/blob/indigo-devel/package.xml" rel="nofollow noreferrer">Branch <code>indigo</code> has <code>catkin</code></a></p> <p>Did you try suggested <code>catkin_make_isolated</code>?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2022-10-19</strong>:<br /> @ljaniec The ROS wiki link akes me to ROS2 version as I told you, you can try it yourself. How do I output the git status?I did not try catkin_make_isolated.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2022-10-19</strong>:<br /> Can you use git? You have to check out to the correct repository branch - <code>git clone https://github.com/ros-perception/pointcloud_to_laserscan.git</code> in your <code>catkin_ws</code> folder, then in the folder you use <code>git status</code> - you should see <code>On branch rolling</code>. Use <code>git checkout indigo-devel</code>, then <code>git status</code> again - you should see <code>On branch indigo-devel</code> this time. This is ROS1 version you have to try to build &amp; report what you see when the package is built.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2022-10-20</strong>:<br /> @ljaniec you were right, I forgot I have to type the command to clone the repo from a specific branch that is not the master. Now that I clone the correctly, I am trying to use it woth turtlebot and kinect camera but the <code>pointcloud_to_laserscan</code> node is unable to receive data from the <code>pointcloud</code> topic. I made another question about it <a href="https://answers.ros.org/question/408246/using-pointcloud_to_laserscan-package-with-turtlebot-and-kinect-camera/" rel="nofollow noreferrer">here</a> if you have the time.</p>
pointcloud_to_laserscan for ROS1 kinetic
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>There are established conventions for the frame's x, y and z-axis for a camera image. Please read this page:</p> <p><a href="https://www.ros.org/reps/rep-0103.html" rel="nofollow noreferrer">https://www.ros.org/reps/rep-0103.html</a></p> <p>If you are in a hurry, search for <code>_optical</code>.</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-10-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/117137/wugeshenhuaking/" rel="nofollow noreferrer">wugeshenhuaking</a> on 2022-10-17</strong>:<br /> @Mike Scheutzow Does this mean that I must transform the point cloud released by this coordinate system into a common coordinate system under ROS. Then I can do related work, such as filtering too high or too low point clouds. Then transform the processed point cloud inverse coordinates back to _optical frame.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-10-17</strong>:<br /> <em>Does this mean that I must transform the point cloud released by this coordinate system into a common coordinate system under ROS</em></p> <p>Yes, but it is easy to implement if the camera is in your TF tree: use <code>tf2_ros Buffer.transform()</code> to convert each point into the TF frame you want to work in (typically <code>base_link</code> or <code>map</code>.)</p> <p>For a robot-mounted camera, your TF usually looks something like <code>base_link -&gt; camera_base -&gt; camera_optical</code>. The <code>camera_optical</code> origin is at corner of the image sensor inside the camera body.</p> <p>Typically you won't need to transform the data points back to <code>camera_optical</code> frame, but nothing stops you from doing so.</p>
102554
2022-10-16T06:55:28.000
|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I found a strange problem when I used the turbobot3 simulation.Why The point cloud direction published by camera_rgb_optical_frame is upward.</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1665921286389351.png" alt="image description" /></p> <hr /> <p><a href="https://answers.ros.org/question/408011/about-the-point-cloud-coordinate-system-issued-by-the-rgb-d-camera/" 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-10-16</p> <p>Post score: 0</p>
About the Point Cloud Coordinate System Issued by the RGB-D Camera
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>sudo pip install -U rosdep rosinstall_generator vcstool rosinstall</p> <p>pip install -U rosdep rosinstall_generator vcstool rosinstall</p> <p>pip install --upgrade setuptools</p> <p>rosdep update</p> <p>These commands fixed the bad setup, whatever it was!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/18431/rodolfo8/" rel="nofollow noreferrer">Rodolfo8</a> with karma: 299 on 2022-10-16</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/3/tfoote/" rel="nofollow noreferrer">tfoote</a> on 2022-10-16</strong>:<br /> You're mixing python 2 and 3. Pip installing likely overlayed a python3 version of rosdep so you're only using python3 now. Note that you will have to keep everything in your pip environment up to date manually now.</p>
102556
2022-10-16T16:26:59.000
|ros-melodic|rosdep|ubuntu|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This is on Ros Melodic on an Nvidia Jetson TX1 with Ubuntu 18.04. I'm trying to install the dependencies for the Zed-Ros-Wrapper.</p> <p>Did my installation get corrupted? I removed and reinstalled Rosdep but that didn't change this error from coming up.</p> <pre><code>uriah@uriah-jetson:~$ rosdep update Traceback (most recent call last): File &quot;/usr/bin/rosdep&quot;, line 6, in &lt;module&gt; from pkg_resources import load_entry_point File &quot;/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py&quot;, line 1380 raise SyntaxError(e) from e ^ SyntaxError: invalid syntax </code></pre> <hr /> <p><a href="https://answers.ros.org/question/408031/rosdep-refuses-to-run/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/18431/rodolfo8/" rel="nofollow noreferrer">Rodolfo8</a> on ROS Answers with karma: 299 on 2022-10-16</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/18431/rodolfo8/" rel="nofollow noreferrer">Rodolfo8</a> on 2022-10-16</strong>:<br /> uriah@uriah-jetson:~$ rosdep update</p> <p>Traceback (most recent call last):</p> <p>File &quot;/usr/bin/rosdep&quot;, line 6, in </p> <pre><code>from pkg_resources import load_entry_point </code></pre> <p>File &quot;/usr/local/lib/python3.6/dist-packages/pkg_resources/<strong>init</strong>.py&quot;, line 1380</p> <pre><code>raise SyntaxError(e) from e ^ </code></pre> <p>SyntaxError: invalid syntax</p> <p><strong>Comment by <a href="https://answers.ros.org/users/18431/rodolfo8/" rel="nofollow noreferrer">Rodolfo8</a> on 2022-10-16</strong>:<br /> It begins to look like the Python 2.7 is trying to use Numpy from Python 3.6 and is getting confused, perhaps</p>
rosdep refuses to run
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It seems that my alias formatting for an alias i made previously in the bashrc file was wrong.</p> <p>Solution: Remove your alias. Close your terminal and open a new terminal. However, if you want to remove the alias on your current terminal you can run as follows</p> <pre><code>unalias alias-name </code></pre> <p>Read more here: <a href="https://askubuntu.com/questions/325368/how-do-i-remove-an-alias">https://askubuntu.com/questions/325368/how-do-i-remove-an-alias</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/103351/sajid1122/" rel="nofollow noreferrer">sajid1122</a> with karma: 19 on 2022-10-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102558
2022-10-16T21:16:39.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I was following the installation steps of ros2 galactic on ubuntu 20.04 according to the ros documentation. Found here: <a href="https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html" rel="nofollow noreferrer">https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html</a>. I followed everything all the way up to</p> <pre><code># Replace &quot;.bash&quot; with your shell if you're not using bash # Possible values are: setup.bash, setup.sh, setup.zsh source /opt/ros/galactic/setup.bash </code></pre> <p>Then i get the error</p> <pre><code>bash: cd: too many arguments </code></pre> <p>I currently have absolutely no idea why this is happening, did some searches online and it seems that no one has had this problem before me.</p> <hr /> <p><a href="https://answers.ros.org/question/408039/can%27t-source-ros-galactic/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/103351/sajid1122/" rel="nofollow noreferrer">sajid1122</a> on ROS Answers with karma: 19 on 2022-10-16</p> <p>Post score: 0</p>
Can't source ROS galactic
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I looked at <a href="https://github.com/tentone/tello-ros2/blob/a651a1fb376c87e16de9f7f616185f62b7caf344/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp#L20" rel="nofollow noreferrer">the source code</a> and found something strange. A <a href="https://docs.ros2.org/foxy/api/rclcpp/classrclcpp_1_1Node.html#a82f97ad29e3d54c91f6ef3265a8636d1" rel="nofollow noreferrer">subscription</a> must be defined with a QoS, which is surprisingly not mentioned in the code. Therefore, please edit the source code (<a href="https://github.com/tentone/tello-ros2/blob/a651a1fb376c87e16de9f7f616185f62b7caf344/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp#L20" rel="nofollow noreferrer">tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp</a>) by adding appropriate QoS. An example is shown below:</p> <pre><code>m_image_subscriber = this-&gt;create_subscription&lt;ImageMsg&gt;(&quot;camera&quot;, 10, std::bind(&amp;MonocularSlamNode::GrabImage, this, std::placeholders::_1)); </code></pre> <p>Please inform us if the problem persists.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-10-17</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/120573/damiano/" rel="nofollow noreferrer">damiano</a> on 2022-10-17</strong>:<br /> Thanks, indeed I arrived to the same solution after googling and I found some similar question posted on another github repository. Similarly, I fixed the error on the create_publisher function as well. Thank you!</p>
102560
2022-10-17T03:52:55.000
|ros|ros2|rclcpp|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I'm trying to run orbslam2 on a tello drone using ros 2 (foxy distro, ubuntu 20.04). For the purpose, I am trying to use this repository:</p> <p><a href="https://github.com/tentone/tello-ros2" rel="nofollow noreferrer">https://github.com/tentone/tello-ros2</a></p> <p>What I managed to do successfully so far is:</p> <ul> <li><p>Install all dependencies, running scripts/install.sh</p> </li> <li><p>Build the 3 packages of the repository (tello/tello_control/tello_msg) running scripts/build.sh, which is basically running colcon build on the 3 packages:</p> <p>colcon build --symlink-install --packages-select tello tello_control tello_msg</p> </li> <li><p>Build the ORBSLAM-2 package, through the instructions in the scripts/orbslam.sh script</p> </li> </ul> <p>Now I am trying to compile the nodes in the slam/src/orbslam2 folder. However when I run colcon build in that folder, I get the following error:</p> <pre><code> /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp: In constructor ‘MonocularSlamNode::MonocularSlamNode(ORB_SLAM2::System*, const string&amp;, const string&amp;)’: /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:20:141: error: no matching function for call to ‘MonocularSlamNode::create_subscription&lt;ImageMsg&gt;(const char [7], std::_Bind_helper&lt;false, void (MonocularSlamNode::*)(std::shared_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;), MonocularSlamNode*, const std::_Placeholder&lt;1&gt;&amp;&gt;::type)’ 20 | m_image_subscriber = this-&gt;create_subscription&lt;ImageMsg&gt;(&quot;camera&quot;, std::bind(&amp;MonocularSlamNode::GrabImage, this, std::placeholders::_1)); | ^ In file included from /opt/ros/foxy/include/rclcpp/executors/single_threaded_executor.hpp:28, from /opt/ros/foxy/include/rclcpp/executors.hpp:22, from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146, from /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.hpp:10, from /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:1: /opt/ros/foxy/include/rclcpp/node.hpp:213:3: note: candidate: ‘template&lt;class MessageT, class CallbackT, class AllocatorT, class CallbackMessageT, class SubscriptionT, class MessageMemoryStrategyT&gt; std::shared_ptr&lt;SubscriptionT&gt; rclcpp::Node::create_subscription(const string&amp;, const rclcpp::QoS&amp;, CallbackT&amp;&amp;, const rclcpp::SubscriptionOptionsWithAllocator&lt;AllocatorT&gt;&amp;, typename MessageMemoryStrategyT::SharedPtr)’ 213 | create_subscription( | ^~~~~~~~~~~~~~~~~~~ /opt/ros/foxy/include/rclcpp/node.hpp:213:3: note: template argument deduction/substitution failed: /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:20:141: note: candidate expects 5 arguments, 2 provided 20 | m_image_subscriber = this-&gt;create_subscription&lt;ImageMsg&gt;(&quot;camera&quot;, std::bind(&amp;MonocularSlamNode::GrabImage, this, std::placeholders::_1)); | ^ /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:22:85: error: no matching function for call to ‘MonocularSlamNode::create_publisher&lt;ImageMsg&gt;(const char [16])’ 22 | m_annotated_image_publisher = this-&gt;create_publisher&lt;ImageMsg&gt;(&quot;annotated_frame&quot;); | ^ In file included from /opt/ros/foxy/include/rclcpp/executors/single_threaded_executor.hpp:28, from /opt/ros/foxy/include/rclcpp/executors.hpp:22, from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146, from /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.hpp:10, from /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:1: /opt/ros/foxy/include/rclcpp/node.hpp:184:3: note: candidate: ‘template&lt;class MessageT, class AllocatorT, class PublisherT&gt; std::shared_ptr&lt;PublisherT&gt; rclcpp::Node::create_publisher(const string&amp;, const rclcpp::QoS&amp;, const rclcpp::PublisherOptionsWithAllocator&lt;AllocatorT&gt;&amp;)’ 184 | create_publisher( | ^~~~~~~~~~~~~~~~ /opt/ros/foxy/include/rclcpp/node.hpp:184:3: note: template argument deduction/substitution failed: /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:22:85: note: candidate expects 3 arguments, 1 provided 22 | m_annotated_image_publisher = this-&gt;create_publisher&lt;ImageMsg&gt;(&quot;annotated_frame&quot;); | ^ /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:24:71: error: no matching function for call to ‘MonocularSlamNode::create_publisher&lt;MarkerMsg&gt;(const char [13])’ 24 | m_map_publisher = this-&gt;create_publisher&lt;MarkerMsg&gt;(&quot;ORB_SLAM_map&quot;); | ^ In file included from /opt/ros/foxy/include/rclcpp/executors/single_threaded_executor.hpp:28, from /opt/ros/foxy/include/rclcpp/executors.hpp:22, from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146, from /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.hpp:10, from /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:1: /opt/ros/foxy/include/rclcpp/node.hpp:184:3: note: candidate: ‘template&lt;class MessageT, class AllocatorT, class PublisherT&gt; std::shared_ptr&lt;PublisherT&gt; rclcpp::Node::create_publisher(const string&amp;, const rclcpp::QoS&amp;, const rclcpp::PublisherOptionsWithAllocator&lt;AllocatorT&gt;&amp;)’ 184 | create_publisher( | ^~~~~~~~~~~~~~~~ /opt/ros/foxy/include/rclcpp/node.hpp:184:3: note: template argument deduction/substitution failed: /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:24:71: note: candidate expects 3 arguments, 1 provided 24 | m_map_publisher = this-&gt;create_publisher&lt;MarkerMsg&gt;(&quot;ORB_SLAM_map&quot;); | ^ /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:15:78: warning: unused parameter ‘strVocFile’ [-Wunused-parameter] 15 | MonocularSlamNode::MonocularSlamNode(ORB_SLAM2::System* pSLAM, const string &amp;strVocFile, const string &amp;strSettingsFile) | ~~~~~~~~~~~~~~^~~~~~~~~~ /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp: In member function ‘void MonocularSlamNode::PublishFrame()’: /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:252:63: error: no matching function for call to ‘rclcpp::Publisher&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;::publish(sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;::SharedPtr)’ 252 | m_annotated_image_publisher-&gt;publish(rosImage.toImageMsg()); | ^ In file included from /opt/ros/foxy/include/rclcpp/topic_statistics/subscription_topic_statistics.hpp:31, from /opt/ros/foxy/include/rclcpp/subscription.hpp:50, from /opt/ros/foxy/include/rclcpp/any_executable.hpp:25, from /opt/ros/foxy/include/rclcpp/memory_strategy.hpp:24, from /opt/ros/foxy/include/rclcpp/memory_strategies.hpp:18, from /opt/ros/foxy/include/rclcpp/executor_options.hpp:20, from /opt/ros/foxy/include/rclcpp/executor.hpp:33, from /opt/ros/foxy/include/rclcpp/executors/multi_threaded_executor.hpp:26, from /opt/ros/foxy/include/rclcpp/executors.hpp:21, from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146, from /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.hpp:10, from /home/huangpan1/tello_1410/tello-ros2/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp:1: /opt/ros/foxy/include/rclcpp/publisher.hpp:185:3: note: candidate: ‘void rclcpp::Publisher&lt;MessageT, AllocatorT&gt;::publish(std::unique_ptr&lt;MessageT, typename std::conditional&lt;std::is_same&lt;typename std::allocator_traits&lt;typename std::allocator_traits&lt;_Alloc&gt;::rebind_traits&lt;MessageT&gt;::allocator_type&gt;::rebind_alloc&lt;MessageT&gt;, typename std::allocator&lt;void&gt;::rebind&lt;_Tp1&gt;::other&gt;::value, std::default_delete&lt;_Tp&gt;, rclcpp::allocator::AllocatorDeleter&lt;typename std::allocator_traits&lt;_Alloc&gt;::rebind_traits&lt;MessageT&gt;::allocator_type&gt; &gt;::type&gt;) [with MessageT = sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;; AllocatorT = std::allocator&lt;void&gt;; typename std::conditional&lt;std::is_same&lt;typename std::allocator_traits&lt;typename std::allocator_traits&lt;_Alloc&gt;::rebind_traits&lt;MessageT&gt;::allocator_type&gt;::rebind_alloc&lt;MessageT&gt;, typename std::allocator&lt;void&gt;::rebind&lt;_Tp1&gt;::other&gt;::value, std::default_delete&lt;_Tp&gt;, rclcpp::allocator::AllocatorDeleter&lt;typename std::allocator_traits&lt;_Alloc&gt;::rebind_traits&lt;MessageT&gt;::allocator_type&gt; &gt;::type = std::default_delete&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;]’ 185 | publish(std::unique_ptr&lt;MessageT, MessageDeleter&gt; msg) | ^~~~~~~ /opt/ros/foxy/include/rclcpp/publisher.hpp:185:53: note: no known conversion for argument 1 from ‘sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;::SharedPtr’ {aka ‘std::shared_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;’} to ‘std::unique_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;, std::default_delete&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt; &gt;’ 185 | publish(std::unique_ptr&lt;MessageT, MessageDeleter&gt; msg) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /opt/ros/foxy/include/rclcpp/publisher.hpp:209:3: note: candidate: ‘void rclcpp::Publisher&lt;MessageT, AllocatorT&gt;::publish(const MessageT&amp;) [with MessageT = sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;; AllocatorT = std::allocator&lt;void&gt;]’ 209 | publish(const MessageT &amp; msg) | ^~~~~~~ /opt/ros/foxy/include/rclcpp/publisher.hpp:209:28: note: no known conversion for argument 1 from ‘sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;::SharedPtr’ {aka ‘std::shared_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;’} to ‘const sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;&amp;’ 209 | publish(const MessageT &amp; msg) | ~~~~~~~~~~~~~~~~~^~~ /opt/ros/foxy/include/rclcpp/publisher.hpp:226:3: note: candidate: ‘void rclcpp::Publisher&lt;MessageT, AllocatorT&gt;::publish(const rcl_serialized_message_t&amp;) [with MessageT = sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;; AllocatorT = std::allocator&lt;void&gt;; rcl_serialized_message_t = rcutils_uint8_array_t]’ 226 | publish(const rcl_serialized_message_t &amp; serialized_msg) | ^~~~~~~ /opt/ros/foxy/include/rclcpp/publisher.hpp:226:44: note: no known conversion for argument 1 from ‘sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;::SharedPtr’ {aka ‘std::shared_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;’} to ‘const rcl_serialized_message_t&amp;’ {aka ‘const rcutils_uint8_array_t&amp;’} 226 | publish(const rcl_serialized_message_t &amp; serialized_msg) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ /opt/ros/foxy/include/rclcpp/publisher.hpp:232:3: note: candidate: ‘void rclcpp::Publisher&lt;MessageT, AllocatorT&gt;::publish(const rclcpp::SerializedMessage&amp;) [with MessageT = sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;; AllocatorT = std::allocator&lt;void&gt;]’ 232 | publish(const SerializedMessage &amp; serialized_msg) | ^~~~~~~ /opt/ros/foxy/include/rclcpp/publisher.hpp:232:37: note: no known conversion for argument 1 from ‘sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;::SharedPtr’ {aka ‘std::shared_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;’} to ‘const rclcpp::SerializedMessage&amp;’ 232 | publish(const SerializedMessage &amp; serialized_msg) | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ /opt/ros/foxy/include/rclcpp/publisher.hpp:246:3: note: candidate: ‘void rclcpp::Publisher&lt;MessageT, AllocatorT&gt;::publish(rclcpp::LoanedMessage&lt;MessageT, AllocatorT&gt;&amp;&amp;) [with MessageT = sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;; AllocatorT = std::allocator&lt;void&gt;]’ 246 | publish(rclcpp::LoanedMessage&lt;MessageT, AllocatorT&gt; &amp;&amp; loaned_msg) | ^~~~~~~ /opt/ros/foxy/include/rclcpp/publisher.hpp:246:58: note: no known conversion for argument 1 from ‘sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;::SharedPtr’ {aka ‘std::shared_ptr&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;’} to ‘rclcpp::LoanedMessage&lt;sensor_msgs::msg::Image_&lt;std::allocator&lt;void&gt; &gt;, std::allocator&lt;void&gt; &gt;&amp;&amp;’ 246 | publish(rclcpp::LoanedMessage&lt;MessageT, AllocatorT&gt; &amp;&amp; loaned_msg) </code></pre> <p>And similar errors on lines 22 and 24 of the same file, stating that there is no matching function for create_publisher: <a href="https://github.com/tentone/tello-ros2/blob/main/slam/src/orbslam2/src/monocular/monocular-slam-node.cpp#L20" rel="nofollow noreferrer">link text</a></p> <p>As far as I understand, the monocular-slam-node is declared inside the src/monocular/monocular-slam-node.hpp header as a rclcpp::Node, at this line: <a href="https://github.com/tentone/tello-ros2/blob/main/slam/src/orbslam2/src/monocular/monocular-slam-node.hpp#L22" rel="nofollow noreferrer">https://github.com/tentone/tello-ros2/blob/main/slam/src/orbslam2/src/monocular/monocular-slam-node.hpp#L22</a> So it should inherit the methods of rclcpp::Node, among which the create_subscription and create_publisher methods, but somehow it seems there is a mismatch between the number of arguments passed to the call to those methods...</p> <p>I already sourced the environment, source /opt/ros/foxy/local_setup.bash.</p> <p>Can someone please help me understand what is wrong here? Thank you very much!</p> <p>EDITED: Added more info</p> <hr /> <p><a href="https://answers.ros.org/question/408053/error:--no-matching-function-for-call-to-create_subscription/" 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-10-17</p> <p>Post score: 0</p>
error: no matching function for call to create_subscription
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This issue ha been resolved using <code>tf.TransformListener()</code> and publishing the transformed data into base frame. Example code:</p> <pre><code> (trans,rot) = listener.lookupTransform('/link_base', '/marker_1', rospy.Time(0)) val = np.array([trans[0],trans[1],trans[2],rot[0],rot[1],rot[2],rot[3]],dtype=np.float64) marker_wrt_base.publish(val) </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> with karma: 61 on 2022-11-03</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102562
2022-10-17T09:28:24.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have calibrated my camera using <a href="https://github.com/IFL-CAMP/easy_handeye" rel="nofollow noreferrer">easy_handeye</a> and using <a href="https://github.com/IFL-CAMP/easy_handeye/blob/master/easy_handeye/launch/publish.launch" rel="nofollow noreferrer">publish.launch</a> to launch the calibration result. However, I would like to know how I can use this calibration result for my code, where I want to pick and place objects using a robotic arm.</p> <p>Here is the list of publisher that is publishing the result of hand-eye calibration and subscriber that are subscribing the result.</p> <pre><code>$ rostopic info /tf_static Type: tf2_msgs/TFMessage Publishers: * /xarm_realsense_handeyecalibration_eye_on_hand/handeye_publisher_akumar_ThinkPad_P17_Gen_2i_114376_5000672119570238070 (http://akumar-ThinkPad-P17-Gen-2i:40065/) * /robot_state_publisher (http://akumar-ThinkPad-P17-Gen-2i:34185/) * /camera/realsense2_camera_manager (http://akumar-ThinkPad-P17-Gen-2i:39165/) * /xarm_realsense_handeyecalibration_eye_on_hand/handeye_publisher_akumar_ThinkPad_P17_Gen_2i_114681_6997610453558885147 (http://akumar-ThinkPad-P17-Gen-2i:38563/) Subscribers: * /move_group (http://akumar-ThinkPad-P17-Gen-2i:44351/) * /xarm_move_group_planner (http://akumar-ThinkPad-P17-Gen-2i:38529/) * /rviz_akumar_ThinkPad_P17_Gen_2i_114681_6050782860401126934 (http://akumar-ThinkPad-P17-Gen-2i:36855/) </code></pre> <p>After seeing the above output, I feel that <code>xarm_move_group_planner</code> or <code>move_group</code> uses the calibration result internally. Therefore, I do not need additional subscribers and publishers to transform the data. Please correct me if I am wrong.</p> <hr /> <p><a href="https://answers.ros.org/question/408075/how-to-use-calibration-result-of-easy_handeye/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-10-17</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-18</strong>:\</p> <blockquote> <p>How can I use this calibration result for my code, where I want to pick and place objects using a robotic arm?</p> </blockquote> <p>I strongly recommend going through <a href="http://docs.ros.org/en/kinetic/api/moveit_tutorials/html/index.html" rel="nofollow noreferrer">MoveIt Tutorials</a>. Once you get the idea, you may ask specific question.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on 2022-10-19</strong>:<br /> I would like to use the calibrated result (camera on base) in moveIt python api, how can I use that ? Please let me know if you want me to be more detailed. I followed few tutorial and let me be more clear, I have calibrated eye on base result and got the yaml file, I would like to know do I have to write any code or just need to publish the data(<a href="https://github.com/IFL-CAMP/easy_handeye/blob/master/easy_handeye/launch/publish.launch" rel="nofollow noreferrer">https://github.com/IFL-CAMP/easy_handeye/blob/master/easy_handeye/launch/publish.launch</a>) and the moveit api would itself use the data to do the required transform.</p>
How to use calibration result of easy_handeye
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I had o give the necessary parameters with a launchfile:</p> <pre><code>import launch import os import sys from launch_ros.actions import Node from launch.substitutions import PathJoinSubstitution, Command, FindExecutable from launch_ros.substitutions import FindPackageShare def get_robot_description(): joint_limit_params = PathJoinSubstitution( [FindPackageShare(&quot;ur_description&quot;), &quot;config&quot;, &quot;ur3e&quot;, &quot;joint_limits.yaml&quot;] ) kinematics_params = PathJoinSubstitution( [FindPackageShare(&quot;ur_description&quot;), &quot;config&quot;, &quot;ur3e&quot;, &quot;default_kinematics.yaml&quot;] ) physical_params = PathJoinSubstitution( [FindPackageShare(&quot;ur_description&quot;), &quot;config&quot;, &quot;ur3e&quot;, &quot;physical_parameters.yaml&quot;] ) visual_params = PathJoinSubstitution( [FindPackageShare(&quot;ur_description&quot;), &quot;config&quot;, &quot;ur3e&quot;, &quot;visual_parameters.yaml&quot;] ) robot_description_content = Command( [ PathJoinSubstitution([FindExecutable(name=&quot;xacro&quot;)]), &quot; &quot;, PathJoinSubstitution([FindPackageShare(&quot;ur_description&quot;), &quot;urdf&quot;, &quot;ur.urdf.xacro&quot;]), &quot; &quot;, &quot;robot_ip:=172.17.0.2&quot;, &quot; &quot;, &quot;joint_limit_params:=&quot;, joint_limit_params, &quot; &quot;, &quot;kinematics_params:=&quot;, kinematics_params, &quot; &quot;, &quot;physical_params:=&quot;, physical_params, &quot; &quot;, &quot;visual_params:=&quot;, visual_params, &quot; &quot;, &quot;safety_limits:=&quot;, &quot;true&quot;, &quot; &quot;, &quot;safety_pos_margin:=&quot;, &quot;0.15&quot;, &quot; &quot;, &quot;safety_k_position:=&quot;, &quot;20&quot;, &quot; &quot;, &quot;name:=&quot;, &quot;ur&quot;, &quot; &quot;, &quot;ur_type:=&quot;, &quot;ur3e&quot;, &quot; &quot;, &quot;prefix:=&quot;, '&quot;&quot;', &quot; &quot;, ] ) robot_description = {&quot;robot_description&quot;: robot_description_content} return robot_description def get_robot_description_semantic(): # MoveIt Configuration robot_description_semantic_content = Command( [ PathJoinSubstitution([FindExecutable(name=&quot;xacro&quot;)]), &quot; &quot;, PathJoinSubstitution([FindPackageShare(&quot;ur_moveit_config&quot;), &quot;srdf&quot;, &quot;ur.srdf.xacro&quot;]), &quot; &quot;, &quot;name:=&quot;, # Also ur_type parameter could be used but then the planning group names in yaml # configs has to be updated! &quot;ur&quot;, &quot; &quot;, &quot;prefix:=&quot;, '&quot;&quot;', &quot; &quot;, ] ) robot_description_semantic = { &quot;robot_description_semantic&quot;: robot_description_semantic_content } return robot_description_semantic def generate_launch_description(): # generate_common_hybrid_launch_description() returns a list of nodes to launch robot_description = get_robot_description() robot_description_semantic = get_robot_description_semantic() demo_node = Node( package=&quot;hello_moveit_ur&quot;, executable=&quot;hello_moveit_ur&quot;, name=&quot;hello_moveit_ur&quot;, output=&quot;screen&quot;, parameters=[ robot_description, robot_description_semantic, ], ) return launch.LaunchDescription([demo_node]) </code></pre> <p>When I start</p> <p><code>ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur3e robot_ip:=192.168.1.102 launch_rviz:=false initial_joint_controller:=joint_trajectory_controller</code> then activate the external control urcap then <code>ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur3e launch_rviz:=true</code> then <code>ros2 launch hello_moveit_ur hello_moveit_ur_launch.py</code> the Robot moves to the target position.</p> <p>The topic was also discussed here: <a href="https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/issues/457" rel="nofollow noreferrer">https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/issues/457</a></p> <p>My files can be found here: <a href="https://github.com/LucaBross/simple_moveit2_universal_robot" rel="nofollow noreferrer">https://github.com/LucaBross/simple_moveit2_universal_robot</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/119094/lucb/" rel="nofollow noreferrer">LucB</a> with karma: 42 on 2022-10-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102564
2022-10-18T01:58:41.000
|ros|ros2|universal-robots|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I`m using ros2 humble. I also installed the <a href="https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver" rel="nofollow noreferrer">ROS2 Universal Robot Driver</a>.</p> <p>I can start the connection to the UR</p> <pre><code>ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur3e robot_ip:=192.168.1.102 launch_rviz:=false initial_joint_controller:=joint_trajectory_controller </code></pre> <p>and in a second Terminal:</p> <pre><code>ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur3e launch_rviz:=true </code></pre> <p>then i can plan and execute the path to a desired position and the robot moves. Now i want to move the Robot with my own script. Therefore i was working on a tutorial. Now I got the <a href="https://moveit.picknik.ai/humble/doc/tutorials/your_first_project/your_first_project.html" rel="nofollow noreferrer">moveit2 tutorial</a> running.</p> <p>So far i have the problem, that i don't know what i need to change to get the UR running instead of the pandas arm? I'm not sure which packages or header i have to include or launch files i have to change etc. .</p> <p>Can anyone give me an advice on how to get started on this? Or does anyone have a different approach to move the UR with my own written package and inverse kinematics?</p> <p>Update: I created a new package <code>hello_moveit_ur</code> like in the <a href="https://moveit.picknik.ai/humble/doc/tutorials/your_first_project/your_first_project.html" rel="nofollow noreferrer">tutorial</a> explained. Then i modified the sourcecode:</p> <pre><code>#include &lt;memory&gt; #include &lt;rclcpp/rclcpp.hpp&gt; #include &lt;moveit/move_group_interface/move_group_interface.h&gt; int main(int argc, char * argv[]) { // Initialize ROS and create the Node rclcpp::init(argc, argv); auto const node = std::make_shared&lt;rclcpp::Node&gt;( &quot;hello_moveit&quot;, rclcpp::NodeOptions().automatically_declare_parameters_from_overrides(true) ); // Create a ROS logger auto const logger = rclcpp::get_logger(&quot;hello_moveit&quot;); // Create the MoveIt MoveGroup Interface using moveit::planning_interface::MoveGroupInterface; auto move_group_interface = MoveGroupInterface(node, &quot;ur_manipulator&quot;); //CHANGE // Set a target Pose auto const target_pose = []{ geometry_msgs::msg::Pose msg; msg.orientation.w = 1.0; msg.position.x = 0.28; msg.position.y = -0.2; msg.position.z = 0.5; return msg; }(); move_group_interface.setPoseTarget(target_pose); // Create a plan to that target pose auto const [success, plan] = [&amp;move_group_interface]{ moveit::planning_interface::MoveGroupInterface::Plan msg; auto const ok = static_cast&lt;bool&gt;(move_group_interface.plan(msg)); return std::make_pair(ok, msg); }(); // Execute the plan if(success) { move_group_interface.execute(plan); } else { RCLCPP_ERROR(logger, &quot;Planing failed!&quot;); } // Shutdown ROS rclcpp::shutdown(); return 0; } </code></pre> <p>There i changed the MoveGroupInterface to <code>&quot;ur_manipulator&quot;</code>. Also in the <code>package.xml</code> i added <code>&lt;depend&gt;ros_ur_dirver&lt;/depend&gt;</code>.</p> <p>After building and sourcing i start the simulation</p> <pre><code>docker run --rm -it -p 5900:5900 -p 6080:6080 -v <span class="math-container">${HOME}/.ursim/urcaps:/urcaps -v $</span>{HOME}/.ursim/programs:/ursim/programs --name ursim universalrobots/ursim_e-series </code></pre> <p>then the ur driver</p> <pre><code>ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur3e robot_ip:=172.17.0.2 launch_rviz:=false initial_joint_controller:=joint_trajectory_controller </code></pre> <p>then the external control file in the simulation. Then ur moveit config</p> <pre><code>ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur3e launch_rviz:=true </code></pre> <p>then my new package</p> <pre><code>ros2 run hello_moveit_ur hello_moveit_ur </code></pre> <p>and the Terminal returns:</p> <pre><code>ros2 run hello_moveit_ur hello_moveit_ur [ERROR] [1666102107.906278553] [hello_moveit]: Could not find parameter robot_description_semantic and did not receive robot_description_semantic via std_msgs::msg::String subscription within 10.000000 seconds. Error: Could not parse the SRDF XML File. Error=XML_ERROR_EMPTY_DOCUMENT ErrorID=13 (0xd) Line number=0 at line 715 in /home/luca/ws_moveit2/src/srdfdom/src/model.cpp [ERROR] [1666102107.910497801] [moveit_rdf_loader.rdf_loader]: Unable to parse SRDF [FATAL] [1666102107.910725623] [move_group_interface]: Unable to construct robot model. Please make sure all needed information is on the parameter server. terminate called after throwing an instance of 'std::runtime_error' what(): Unable to construct robot model. Please make sure all needed information is on the parameter server. [ros2run]: Aborted </code></pre> <p>What am i missing?</p> <hr /> <p><a href="https://answers.ros.org/question/408096/using-universal-robot-instead-of-pandas-arm-in-moveit2-tutorial/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/119094/lucb/" rel="nofollow noreferrer">LucB</a> on ROS Answers with karma: 42 on 2022-10-18</p> <p>Post score: 1</p>
Using Universal Robot instead of Pandas Arm in MoveIt2 tutorial
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>If you do not need the battery you may stick with old notebook and install full ubuntu as @gvdhoorn recommended. But you could use ros with you Mac book if you need more portability.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> with karma: 1999 on 2022-10-18</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-10-19</strong>:<br /> I would not recommend anyone to use ROS on a Mac. Or at least not with macOS in the mix.</p> <p>Neither ROS 1 nor ROS 2 (at the moment).</p> <hr /> <p>Edit: unless perhaps using Conda/Robostack. But even then.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> on 2022-10-19</strong>:<br /> Is Mac and Linux vm on top a good choice?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-10-20</strong>:<br /> I would not recommend anyone to use a VM to run ROS, but if you have no other choice: sure, you could do that.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> on 2022-10-20</strong>:<br /> depend what you do, you could just use an Pi4 and take a powerbank and you have a poortable device.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/121101/cassi.d/" rel="nofollow noreferrer">Cassi.D</a> on 2022-10-20</strong>:<br /> Thank you for all the advice. Will be in the lab later today and give installing Ubuntu 22.04 and ROS 2 a try.</p> <p>Running ROS 2 on my Mac is not so much an option, as I need my Macbook daily and don't want to risk running into troubles. Reason in the first place to not use a Windows Laptop, as it needs to be reliable.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/121101/cassi.d/" rel="nofollow noreferrer">Cassi.D</a> on 2022-10-29</strong>:<br /> Hi everyone, just a quick update on the install. Everything went moderately smooth and I now have ROS 2 and Ubuntu on my old laptop. Performance is sub-optimal, but it will be alrighty for now. for example the &gt;colcon_build command on my laptop took almost 30s, while in the tutorial it showed 5s.</p> <p>*cass~</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-10-30</strong>:<br /> Building software is IO-bound in many cases (lots of small files to read, write, update).</p> <p>If your laptop doesn't have an SSD, but still a regular HDD, replace the HDD with an SSD. It should help alleviate the IO bottleneck quite a bit.</p> <p>It won't magically make your CPU or RAM or GPU any faster of course.</p> <p>Note that this is not ROS-specific: all IO interactions (ie: everything needing to access files) will go faster.</p> <p>Also make sure to install the correct drivers for any GPU that may be present (nvidia fi).</p>
102566
2022-10-18T02:58:58.000
|ros|ros2|windows|ubuntu|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone!</p> <p>Getting started with ROS and looking for the best possible strategy in terms of IT setup.</p> <p>We have dedicated machines in the lab for the duration of the semester, but I wanted to also have the option to use ROS outside of the lab.</p> <p>I have an older HP laptop, I recently updated to Windows 11, and it's been nothing but painfully slow and the battery won't last for more than 20 minutes. Being aware that ROS is recommended for Ubuntu / Linux, a fellow grad suggested Linux Subsystem or a virtual machine?</p> <p>Is that a vital option, or would I be best off to part ways with Windows 11 and use the entire hard drive for Ubuntu and ROS? The laptop has nothing important on it, I’m barely using it, as my Mac-book is my daily computer.</p> <p>Thank you for any expert insights. *cass~</p> <hr /> <p><a href="https://answers.ros.org/question/408100/pc-installation-system-win11-for-ros?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121101/cassi.d/" rel="nofollow noreferrer">Cassi.D</a> on ROS Answers with karma: 3 on 2022-10-18</p> <p>Post score: 0</p>
PC installation system Win11 for ROS?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Can you please try again after adding a space between <code>sensor_frame:</code> and <code>base_scan</code> as shown below:</p> <pre><code>laser_scan_sensor: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true} </code></pre> <p>Please report if the problem persists.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-10-18</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/108968/kostas-tzias/" rel="nofollow noreferrer">Kostas Tzias</a> on 2022-10-19</strong>:<br /> Yeah that worked i guess it is white space sensitive</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-19</strong>:<br /> Well, it is a YAML file, so you must use space. Anyway, I am glad that it worked. You may upvote the answer by clicking on the ^ icon located on the left side of the answer.</p>
102568
2022-10-18T05:06:10.000
|ros|navigation|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In my <strong>costmap_common_param.yaml</strong> file i've placed these two lines :</p> <pre><code>observation_sources: laser_scan_sensor laser_scan_sensor: {sensor_frame:base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true} </code></pre> <p>When i am launching my nav_pkg i get this <strong>error</strong> :</p> <pre><code>load_parameters: unable to set parameters (last param was [/move_base/TrajectoryPlannerROS/holonomic_robot=False]): cannot marshal None unless allow_none is enabled </code></pre> <p>I've been searching for a while and i <strong>found</strong> a <strong>comment</strong> which says that this error means one of the parameters is null (undefined or an empty string). It also says to add the following line when roslaunching the nav_pkg :</p> <pre><code>--dump-params </code></pre> <p>Indeed when i did it i found this :</p> <pre><code>/move_base/global_costmap/laser_scan_sensor/sensor_frame:base_scan: null </code></pre> <p>But i have no ideas why is this happening and also i don't know how to fix it. Any suggestions ?</p> <hr /> <p><a href="https://answers.ros.org/question/408109/navigation-stack-error-while-launching/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/108968/kostas-tzias/" rel="nofollow noreferrer">Kostas Tzias</a> on ROS Answers with karma: 9 on 2022-10-18</p> <p>Post score: 0</p>
Navigation stack error while launching
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I've solved this with the following steps:</p> <ul> <li> <ol> <li>modify <code>setup.py</code> to ensure my <code>yolov5</code> folder also be compiled into <code>/install</code></li> </ol> </li> <li> <ol start="2"> <li>modify <code>from xxx import xxx</code> in ALL the relevant scripts in <code>yolov5</code>, add <code>'&lt;package_name&gt;.&lt;submodule_name&gt;.</code> ahead of folder name, like:</li> </ol> <p>from utils.plots import Annotator, colors, save_one_box</p> <h1>--&gt; MODIFY: add '&lt;package_name&gt;.&lt;submodule_name&gt;. ahead</h1> <p>from yolov5_detect.yolov5.utils.plots import Annotator, colors, save_one_box</p> </li> </ul> <p>With this the node can just struggle to run. It's not very elegant. I'm looking for a more efficient way to do so.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/121140/junmeng/" rel="nofollow noreferrer">junmeng</a> with karma: 36 on 2022-10-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
102570
2022-10-18T15:37:56.000
|python|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm trying to port my work from ROS1 (noetic) to ROS2 (galactic). I've met some problem when I try to implement some custom algorithms (YOLOv5, which is a little complicate, contains many subfolders and scripts) to my image subscriber.<br /> Under ROS1 since the Python node is exactly the executable python script itself, there would be no problems with the imported scripts. But ROS2, via <code>colcon build</code>, the node files to be executed are generated to <code>/colcon_ws/install</code>. Therefore there would be problems about linking our custom python modules to the ros node.</p> <p>I've already tried to modify the <code>setup.py</code> following these blogs:</p> <ul> <li><p><a href="https://answers.ros.org/question/367793/including-a-python-module-in-a-ros2-package/" rel="nofollow noreferrer">Including a Python module in a ROS2 package</a></p> </li> <li><p><a href="https://answers.ros.org/question/349790/ros2-python-relative-import-of-my-scritps/" rel="nofollow noreferrer">ROS2 Python relative import of my scritps</a><br /> and now my <code>setup.py</code> looks like:</p> <p>from setuptools import setup from setuptools import find_packages</p> <p>package_name = 'yolov5_detect' submodules = 'yolov5_detect/yolov5'</p> <p>setup( name=package_name, version='0.0.0', # packages=[package_name, submodules], packages=find_packages(), # include_package_data=True, data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), ], install_requires=['setuptools'], zip_safe=True, maintainer='jun', maintainer_email='mengjun6025@163.com', description='TODO: Package description', license='TODO: License declaration', tests_require=['pytest'], entry_points={ 'console_scripts': [ 'webcam_yolo_pub=yolov5_detect.webcam_yolo_pub:main', 'webcam_yolo_sub=yolov5_detect.webcam_yolo_sub:main' ], }, )</p> </li> </ul> <p>the folder structure:</p> <pre><code>yolov5_detect └── yolov5_detect ├── image_utils.py ├── __init__.py ├── webcam_yolo_pub.py ├── webcam_yolo_sub.py └── yolov5 └── \utils └── \models ├── MANIFEST.in ├── package.xml ├── resource │   └── yolov5_detect ├── setup.cfg ├── setup.py </code></pre> <p>and in <code>/install</code> the folder <code>yolov5</code> is also successfully built. Still, when I run the subscriber node, it complains:</p> <pre><code><span class="math-container">$ ~/ros2_guyue/colcon_ws$</span> ros2 run yolov5_detect webcam_yolo_sub Traceback (most recent call last): File &quot;/home/jun/ros2_guyue/colcon_ws/install/yolov5_detect/lib/yolov5_detect/webcam_yolo_sub&quot;, line 33, in &lt;module&gt; sys.exit(load_entry_point('yolov5-detect==0.0.0', 'console_scripts', 'webcam_yolo_sub')()) File &quot;/home/jun/ros2_guyue/colcon_ws/install/yolov5_detect/lib/yolov5_detect/webcam_yolo_sub&quot;, line 25, in importlib_load_entry_point return next(matches).load() File &quot;/usr/lib/python3.8/importlib/metadata.py&quot;, line 77, in load module = import_module(match.group('module')) File &quot;/usr/lib/python3.8/importlib/__init__.py&quot;, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1014, in _gcd_import File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 991, in _find_and_load File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 975, in _find_and_load_unlocked File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 671, in _load_unlocked File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 848, in exec_module File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed File &quot;/home/jun/ros2_guyue/colcon_ws/install/yolov5_detect/lib/python3.8/site-packages/yolov5_detect/webcam_yolo_sub.py&quot;, line 12, in &lt;module&gt; from yolov5.detect_ros import Yolov5Detector ModuleNotFoundError: No module named 'yolov5' </code></pre> <p>the &quot;import&quot; part of my ros node script:</p> <pre><code>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import rclpy from rclpy.node import Node from sensor_msgs.msg import Image from cv_bridge import CvBridge import cv2 import numpy as np from yolov5.detect_ros import Yolov5Detector from image_utils import * </code></pre> <p>the &quot;import&quot; part of the custom class script <code>detect_ros.py</code>:</p> <pre><code>from utils.plots import Annotator, colors, save_one_box from utils.general import (check_img_size, non_max_suppression, scale_coords, LOGGER) from utils.torch_utils import select_device, time_sync from models.common import DetectMultiBackend import os ... </code></pre> <hr /> <p><a href="https://answers.ros.org/question/408142/cannot-run-a-ros2-node-containing-my-custom-.py-scripts/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121140/junmeng/" rel="nofollow noreferrer">junmeng</a> on ROS Answers with karma: 36 on 2022-10-18</p> <p>Post score: 0</p>
Cannot run a ROS2 node containing my custom .py scripts
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>By default in linux, the current working directory for roslaunch is <code>$HOME/.ros/</code>. If you did not specify a full path when you opened the file, the file was probably created 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-10-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/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-19</strong>:<br /> Thank you for your help. You are right, I found it there</p>
102572
2022-10-19T02:12:46.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi. Sorry for my mistakes. English is not my native language. I created a node, that subscribes to topic with data from sensors, then find with tf::TransformListener and tf::StampedTransform robot position, combines this data and writes it in csv file, also it prints in terminal robot position. Then I run this code with rosrun everything works as it should work, but then I run it with roslaunch it only prints position in the terminal with no data written in file. Appreciate any help. This is how looks my launch file</p> <hr /> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;launch&gt; &lt;node pkg=&quot;minicar_current_pose&quot; type=&quot;minicar_current_pose_node&quot; name=&quot;minicar_current_pose_node&quot; output=&quot;screen&quot;&gt; &lt;/node&gt; &lt;/launch&gt; </code></pre> <hr /> <hr /> <p><a href="https://answers.ros.org/question/408167/node-works-differently-with-using-launch-file./" 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-10-19</p> <p>Post score: 0</p>
Node works differently with using launch file
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <ul> <li>your testmap.png file needs to be in the same directory as testmap.yaml</li> <li>if you use rosrun as a beginner, your current directory in the Terminal should be where the testmap.yaml file is located. (Later on, you can put the map in a ros package, but that takes more work to set up.)</li> <li>have you installed <code>ros-noetic-map-server</code> from apt? You should do so.</li> </ul> <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-10-19</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/113638/donguri/" rel="nofollow noreferrer">donguri</a> on 2022-10-19</strong>:<br /> testmap.png and testmap.yaml are in the same directory.</p> <p>I moved the current directory of the terminal to the location where the testmap.yaml file is located and ran rosrun again using all three methods, but the same error occurred.</p> <pre><code>$ cd catkin_ws/src/navigation/map_server/test/ Method 1. $ rosrun map_server map_server testmap.yaml [ERROR] [1666234839.837396681]: [registerPublisher] Failed to contact master at [localhost:11311]. Retrying... Method 2. $ rosrun map_server testmap.yaml [rosrun] Couldn't find executable named testmap.yaml below /home/usr/catkin_ws/src/navigation/map_server [rosrun] Found the following, but they're either not files, [rosrun] or not executable: [rosrun] /home/usr/catkin_ws/src/navigation/map_server/test/testmap.yaml </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/113638/donguri/" rel="nofollow noreferrer">donguri</a> on 2022-10-19</strong>:<br /> I continue.</p> <pre><code>Method 3. $ rosrun testmap.yaml Usage: rosrun [--prefix cmd] [--debug] PACKAGE EXECUTABLE [ARGS] rosrun will locate PACKAGE and try to find an executable named EXECUTABLE in the PACKAGE tree. If it finds it, it will run it with ARGS. </code></pre> <p>When I run <code>sudo apt-get ros-noetic-map-server</code> I get the following error</p> <pre><code>E: 不正な操作(It means Illegal operation in Japanese.) ros-noetic-map-server </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/113638/donguri/" rel="nofollow noreferrer">donguri</a> on 2022-10-19</strong>:<br /> Sorry! I solved!!!</p> <p>Thank you, Mike Scheutzow!!!!!!!!!!!</p> <p>I forgot to activate <code>roscore.</code> I solved the problem by starting <code>roscore</code>, going to the location where the yaml file is located, and running <code>rosrun map_server map_server testmap.yaml</code>.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-10-20</strong>:<br /> The correct command is:</p> <pre><code>sudo apt-get install ros-noetic-map-server </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/113638/donguri/" rel="nofollow noreferrer">donguri</a> on 2022-10-21</strong>:<br /> Thank you, Mike Scheutzow! I made a mistake. Thank you for correction.</p>
102574
2022-10-19T05:00:54.000
|ros|navigation|mapping|map-server|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I wrote my question because I have looked at past ROSAnswers and could not find a solution.</p> <p>Also, I have recently started learning ROS and would appreciate any pointers as to what I may be doing wrong.</p> <p><strong>[I want to do]</strong></p> <p>I want to use map_server to create a global cost map and reflect it in Rviz.</p> <p>And finally, we would like to have a real robot running within the global cost map we have created.</p> <p><strong>[I did]</strong></p> <p>I gitclone navigation from the following site to Ubuntu 20.04.</p> <p><a href="https://github.com/ros-planning/navigation" rel="nofollow noreferrer">https://github.com/ros-planning/navigation</a></p> <p>I am trying to get the &quot;testmap.yaml&quot; in &quot;home/catkin_ws/src/navigation/map_server/test&quot; to work.</p> <p>So I ran the following code and got the following error.</p> <pre><code>$rosrun map_server map_server testmap.yaml [ERROR] [1666166341.180193818]: Map_server could not open testmap.yaml. </code></pre> <p>I also thought maybe the address was not set up correctly so I ran the following code and got the following message.</p> <pre><code>$rosrun map_server test testmap.yaml [rosrun] Couldn't find executable named test below /home/usr/catkin_ws/src/navigation/map_server [rosrun] Found the following, but they're either not files, [rosrun] or not executable: [rosrun] /home/usr/catkin_ws/src/navigation/map_server/test </code></pre> <p>The testmap.yaml is as follows. I have not changed anything since gitclone because I wanted to test run it.</p> <pre><code>image: testmap.png resolution: 0.1 origin: [2.0, 3.0, 1.0] negate: 0 occupied_thresh: 0.65 free_thresh: 0.196 </code></pre> <p>I expect the following message to appear.</p> <pre><code>[INFO][3698178.3892394] Laoding map from image &quot;testmap.png&quot; [INFO][3698178.3892498] Read a XXX X XXX map @ 0.050m/cell </code></pre> <p>Please let me know if you have any solutions to these problems. Also, what do I have to do for the message I expect to get?</p> <p>Thank you.</p> <hr /> <p><a href="https://answers.ros.org/question/408177/%5Bmap_server-in-noetic%5Dmap_server-could-not-open-testmap.yaml-error-has-occured!!/" 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-10-19</p> <p>Post score: 0</p>
[map_server in Noetic]Map_server could not open testmap.yaml error has occured!
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>i find the solution. the problem was that my node was killed to close to the publish. the solution is to add sleep at the node class distractor or at the end of the main.</p> <p><code>rclcpp::sleep_for(std::chrono::seconds(1));</code></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/91210/bodka/" rel="nofollow noreferrer">bodka</a> with karma: 16 on 2022-10-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102576
2022-10-19T05:11:36.000
|ros|ros2|rviz|visualization-msgs|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all. I am using ros2 foxy. I am trying to publish a marker to rviz, but it does not visualize it.</p> <p>the marker code:</p> <pre><code> visualization_msgs::msg::Marker marker; marker.id = 0; marker.header.frame_id = &quot;base_link&quot;; marker.frame_locked = true; marker.header.stamp = this-&gt;get_clock()-&gt;now(); marker.ns = &quot;visual_box&quot;; marker.type = visualization_msgs::msg::Marker::CUBE; marker.action =visualization_msgs::msg::Marker::ADD; marker.pose=object_pos; marker.scale.x = object_size.x/100.0f; marker.scale.y = object_size.y/100.0f; marker.scale.z = (object_size.z)/100.0f; marker.color.a = alpa; // Don't forget to set the alpha! marker.color.r = rand()%100/100.0f; marker.color.g = rand()%100/100.0f; marker.color.b = rand()%100/100.0f; this-&gt;box_marker_pub-&gt;publish(marker); </code></pre> <p>the msg is getting publish, if i echo it from the terminal i get:</p> <pre><code>picko@picko-koby:~/pickommerce_ws$ ros2 topic echo /packing_algorithm/visual_boxing header: stamp: sec: 1666173251 nanosec: 528962951 frame_id: base_link ns: visual_box id: 0 type: 1 action: 0 pose: position: x: 0.555 y: 0.555 z: 0.5449999928474427 orientation: x: 0.0 y: 0.0 z: 0.0 w: 1.0 scale: x: 1.1100000143051147 y: 1.1100000143051147 z: 1.1100000143051147 color: r: 0.8299999833106995 g: 0.8600000143051147 b: 0.7699999809265137 a: 0.5 lifetime: sec: 0 nanosec: 0 frame_locked: true points: [] colors: [] text: '' mesh_resource: '' mesh_use_embedded_materials: false --- </code></pre> <p>the fix frame in rviz set to base_link. any idea?</p> <hr /> <p><a href="https://answers.ros.org/question/408178/cant-see-markers-in-rviz2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/91210/bodka/" rel="nofollow noreferrer">bodka</a> on ROS Answers with karma: 16 on 2022-10-19</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-10-20</strong>:<br /> @bodka the convention on this site is to not close questions unless there is a problem with it e.g. it is off-topic or an exact duplicate question. Instead, if an answer successfully helped you solve your problem, you should click on the &quot;check mark&quot; symbol in the gray circle on the left side of the answer. The icon will turn green to indicate which answer you selected.</p>
cant see markers in rviz2
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This question with its answers seems to be connected:</p> <ul> <li><a href="https://answers.ros.org/question/81836/intialpose-is-in-what-reference/" rel="nofollow noreferrer">https://answers.ros.org/question/81836/intialpose-is-in-what-reference/</a></li> </ul> <blockquote> <p>[Initial pose in RVIZ] is being sent in the frame that you set as the fixed frame in rviz.</p> </blockquote> <p>and</p> <blockquote> <p>The pose sent is in reference to the fixed frame in RVIZ - and therefore, you should almost certainly have your fixed frame set to <code>/map</code> as AMCL is determining the transform from <code>base_link-&gt;odom-&gt;map</code>, and the pose you send should be where <code>base_link</code> is in terms of map (so that the <code>initial_odom-&gt;map transform</code> can be determined)</p> </blockquote> <p>Can you check your fixed frame in RViz? <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16661835185165271.png" alt="image description" /></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-10-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102578
2022-10-19T06:31:59.000
|ros|navigation|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I launch navigation launch file with all the parameters and when i press the 2D pose estimate in rviz i get this error :</p> <pre><code> Ignoring initial pose in frame &quot;odom&quot;; initial poses must be in the global frame, &quot;map&quot; </code></pre> <p>I don't really know what it means and i don't why is this happening . Do you need any of the param files to investigate this error ? let me know .</p> <hr /> <p><a href="https://answers.ros.org/question/408190/navigation-stack-error/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/108968/kostas-tzias/" rel="nofollow noreferrer">Kostas Tzias</a> on ROS Answers with karma: 9 on 2022-10-19</p> <p>Post score: 0</p>
navigation stack error
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>As in the comment:</p> <blockquote> <p>Maybe is it a problem of ROS spinning? Can you add a few <code>ros::spinOnce();</code> and <code>ros::Duration(1).sleep();</code> in the code? You should also wait to send the first point to travel until every publisher/subscriber is set up correctly.</p> </blockquote> <p>It is connected with e.g. <a href="https://answers.ros.org/question/383696/what-is-first-publisher-or-subscriber/" rel="nofollow noreferrer">this question</a> &quot;What is first ? Publisher or Subscriber?&quot;</p> <blockquote> <p>Which among the following nodes should be started first? Publisher or Subscriber.</p> </blockquote> <p>and its answers:</p> <ul> <li><p>&quot;In general it should not matter. You can start publishers and subscribers at any time. However, note that ROS is expecting messages as a constant message stream, e.g., like from a sensor. They are not buffered in some central instance. This explains why it misses receiving initial messages. It just wasn't there to listen.&quot;</p> </li> <li><p>&quot;This is a common topic in IPC (interprocess communication). In general, the publish/subscribe model can be thought of like a radio broadcast where there is some time between initialization of a node and when it is functional. If you start the publisher first, then there will be a brief period of time when the node is broadcasting messages and the subscriber is not able to listen yet as it hasn't initialized fully. This can technically still happen with the subscriber starting first as the initialization time is not the same for publisher and subscribers (depends on implementation).&quot;</p> </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-10-21</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102580
2022-10-19T11:26:33.000
|ros|gazebo|rviz|turtlebot|ros-kinetic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am trying to create a home service robot using a turtlebot. In it the robot should start at origin at travel to point 1 where a marker has been displayed, stay there for 5 seconds and the marker will disappear indicating pick up and then travel to point 2 and stay there for 5 seconds after which marker would reappear indicating drop.</p> <p>After launching my robot, I cannot view the marker at point 1, but my code for marker is functioning and the robot travels to point 1 and the terminal indicates me of a pickup and then it travels to point 2 where the terminal is indicating drop off and I can see then see the marker. Can someone please explain why am I not able to see the marker at point 1 as well?</p> <p>The primary problem is in the <code>add_markers.cpp</code> file as it is the main file which is publishing the markers, on running a rostopic echo on <code>/visualization_marker</code> topic, I found that for the point A it is not publishing any information but it is doing so for point B which is perplexing me.</p> <p><a href="http://github.com/coder-yeti/home_service_robot" rel="nofollow noreferrer">My workspace</a> and <a href="https://github.com/coder-yeti/home_service_robot/blob/main/add_markers/src/add_markers.cpp" rel="nofollow noreferrer"><code>add_markers.cpp</code> code</a>.</p> <hr /> <p><a href="https://answers.ros.org/question/408209/why-is-my-marker-getting-displayed-at-location-2-but-not-location-1?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/78625/gentle_yeti/" rel="nofollow noreferrer">gentle_yeti</a> on ROS Answers with karma: 3 on 2022-10-19</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-21</strong>:<br /> I suggest creating and sharing a <a href="https://en.wikipedia.org/wiki/Minimal_reproducible_example" rel="nofollow noreferrer">minimal reproducible example</a>.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2022-10-21</strong>:<br /> Maybe is it a problem of ROS spinning? Can you add a few <code>ros::spinOnce();</code> and <code>ros::Duration(1).sleep();</code> in the code? You should also wait to send the first point to travel until every publisher/subscriber is set up correctly</p> <p><strong>Comment by <a href="https://answers.ros.org/users/78625/gentle_yeti/" rel="nofollow noreferrer">gentle_yeti</a> on 2022-10-21</strong>:<br /> @ljaniec , yes it worked!!! I understand the issue now. The add_marker was launching the first marker and then removing it before the set up could start, I put up a ros::Duration(1).sleep(); and it worked perfectly, thank you so much for the answer.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/78625/gentle_yeti/" rel="nofollow noreferrer">gentle_yeti</a> on 2022-10-21</strong>:<br /> @ravijoshi I apologize for not sharing in a easy to view way, I am still learning a lot of things and I will definitely keep this in mind the next time</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2022-10-21</strong>:<br /> @gentle_yeti</p> <ul> <li><p>I will move this to the answer, so you can upvote and accept it, so it will be marked as solved in the queue, ok? I will also link related question with it answers.</p> </li> <li><p>You gave us the whole workspace with packages, it worked for me as MWE (but there was quite a lot of additional stuff, to be honest - the less code there is to analyze for others, the better).</p> </li> </ul> <p><strong>Comment by <a href="https://answers.ros.org/users/78625/gentle_yeti/" rel="nofollow noreferrer">gentle_yeti</a> on 2022-10-21</strong>:<br /> @ljaniec okay, sure I'll do so. Okay, I understand, I'll keep it in mind to focus only on the required code and remove any additional stuff present, thanks for pointing that out, I didn't know about that.</p>
Why is my marker getting displayed at location 2 but not location 1?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>catkin_make does not add package to /opt/ros/noetic</p> </blockquote> <p>that's correct.</p> <p>It's not supposed to.</p> <p>A <code>catkin_make</code> invocation only manages the workspace the command is invoked in. It will not create, update nor delete any files in any other workspaces.</p> <blockquote> <p>When I cd into <code>~/catkin_ws</code> then do <code>catkin_make</code> this is the output:</p> <pre><code>#### </code></pre> </blockquote> <pre><code>#### Running command: &quot;make cmake_check_build_system&quot; in &quot;home/ubuntu/catkin_ws/build&quot; #### #### #### Running command: &quot;make -j4 -14&quot; in &quot;home/ubuntu/catkin_ws/build&quot; #### </code></pre> <p>if that's the only output, it's likely your package is either:</p> <ul> <li>not a package (ie: doesn't contain the required <code>package.xml</code> or <code>CMakeList.txt</code>), or</li> <li>not in the right directory (ie: the <code>src</code> space of the workspace)</li> </ul> <p>A <code>catkin_make</code> invocation on a workspace with a package in it should result in much more logging output.</p> <p>If Catkin doesn't actually build any packages, it's to be expected <code>rospack</code> can't <code>find</code> it either.</p> <blockquote> <p>I also know the package has been added to my <code>/home/ubuntu/noetic/&lt;package name&gt;</code> [..]</p> </blockquote> <p>could you clarify what you mean by this? That directory would not have any special meaning to <code>catkin_make</code>, so I'm not sure what you're trying to say.</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-10-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/121372/meropis/" rel="nofollow noreferrer">meropis</a> on 2022-10-21</strong>:<br /> I think my package is not in the right place. I’ll try putting it into the /src directory and report back. In terms of what I meant by the package location, thats where it was created for me. I think this is my issue and the above will solve it. Update - it worked. Thank you for your assistance.</p>
102582
2022-10-20T08:53:21.000
|catkin-make|rospack|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><strong>Info:</strong></p> <ul> <li>ROS Distro: noetic</li> <li>OS: Ubuntu Server 20.04.5 LTS</li> <li>Architecture: ARM64 (raspberry pi 4B 8GB)</li> </ul> <p>I am following <a href="http://wiki.ros.org/ROS/Tutorials/CreatingPackage" rel="nofollow noreferrer">this tutorial</a> on how to create a simple ROS package. I think all has worked up until the 4th stage of the process. When I cd into <code>~/catkin_ws</code> then do <code>catkin_make</code> this is the output:</p> <pre><code>#### #### Running command: &quot;make cmake_check_build_system&quot; in &quot;home/ubuntu/catkin_ws/build&quot; #### #### #### Running command: &quot;make -j4 -14&quot; in &quot;home/ubuntu/catkin_ws/build&quot; #### </code></pre> <p>Sourcing it using <code>. ~/catkin_ws/devel/setup.bash</code> (I have also tried <code>source ~/catkin_ws/devel/setup.bash</code>)</p> <p>Then, when I try to use <code>rospack</code> to locate the package with <code>rospack find &lt;package name&gt;</code> it cannot be found. I also know the package has been added to my <code>/home/ubuntu/noetic/&lt;package name&gt;</code> including the <code>package.xml</code> file containing the dependencies I added etc.</p> <p>I'm unsure if this is helpful information, but within the <code>/opt/ros/noetic/</code> directory there is no <code>devel</code> directory. Does this mean that the <code>catkin_make</code> is potentially failing but not telling me?</p> <p>What am I doing wrong?</p> <hr /> <p><a href="https://answers.ros.org/question/408261/catkin_make-does-not-add-package-to-/opt/ros/noetic/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121372/meropis/" rel="nofollow noreferrer">meropis</a> on ROS Answers with karma: 3 on 2022-10-20</p> <p>Post score: 0</p>
catkin_make does not add package to /opt/ros/noetic
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You need a Node to create a subscriber. See <a href="https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Publisher-And-Subscriber.html" rel="nofollow noreferrer">this</a> tutorial for an example.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/54884/thejeeb/" rel="nofollow noreferrer">thejeeb</a> with karma: 118 on 2022-10-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/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-21</strong>:<br /> Thank you, for your help. I'll try it</p>
102584
2022-10-20T09:17:42.000
|ros|
<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 am porting my project from Noetic to Foxy and I have flowing code:</p> <pre><code>bool STMRobotHW::initialize(ros::NodeHandle nh) { ... hw_feedback_sub = nh.subscribe(&quot;hw_feedback&quot;, 1000, &amp;STMRobotHW::feedbackCallback, this); } void STMRobotHW::feedbackCallback(const minicar_control::Feedback &amp;fb_msg) { .... } </code></pre> <p>I have hard time understanding how this subscribe should look in Foxy if there are no obj parameter parameter for create_subscribe in ROS 2, or at least I couldn't find any. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/408262/problem-with-using-subscriber-from-initialize-method./" 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-10-20</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-20</strong>:<br /> Please look at <a href="https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Publisher-And-Subscriber.html" rel="nofollow noreferrer">Writing a simple publisher and subscriber (C++)</a> tutorial suggested by @thejeeb. Furthermore, you can look at <a href="https://github.com/ros2/examples/tree/foxy" rel="nofollow noreferrer">ros2/examples</a> and <a href="https://github.com/ros2/demos/tree/foxy" rel="nofollow noreferrer">ros2/demos</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-21</strong>:<br /> Thank you for help</p>
Problem with using subscriber from initialize method
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Thank you very much for the replies. Since it doesn't seem to be ROS, I built a completely new Docker container. <br> In the new container it works! <br> Now I just need to figure out what is wrong with my main Docker container. But thats another story.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/121380/quirky_franklin/" rel="nofollow noreferrer">quirky_franklin</a> with karma: 31 on 2022-10-27</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 2022-10-27</strong>:<br /> You should create an issue with this problem on the ROS Github (I think <a href="https://github.com/osrf/docker_images/issues" rel="nofollow noreferrer">this one?</a>), especially if the C++ example works in your docker and the Python one isn't.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/92002/oferbar/" rel="nofollow noreferrer">oferbar</a> on 2022-11-22</strong>:<br /> For what its worth, I had the exact same problem with my Foxy container. Solved when I worked in a Galactic workspace without container.</p>
102586
2022-10-20T12:35:16.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I am trying to use MultithreadExecutor in my ROS2 foxy application but it is not working. So I tried the demo code from the guide <a href="https://docs.ros.org/en/foxy/How-To-Guides/Using-callback-groups.html" rel="nofollow noreferrer">&quot;Using callback groups&quot;</a> to see if it works. Even if I copy everything 1 to 1 I get the error (shown in the guide) as if I use a SingleThreadExecutor or no callback groups.</p> <p>I am using a Python package with the identical Python code from the demo. I am using a Docker container with Ubuntu 20.04 and ros-foxy-desktop installed. (C++ code worked but unfortunately can't program well in it).</p> <p>Server:</p> <pre><code>import rclpy from rclpy.node import Node from std_srvs.srv import Empty class ServiceNode(Node): def __init__(self): super().__init__('service_node') self.srv = self.create_service(Empty, 'test_service', callback=self.service_callback) def service_callback(self, request, result): self.get_logger().info('Received request, responding...') return result def main(): rclpy.init() node = ServiceNode() try: node.get_logger().info(&quot;Starting server node, shut down with CTRL-C&quot;) rclpy.spin(node) except KeyboardInterrupt: node.get_logger().info('Keyboard interrupt, shutting down.\n') node.destroy_node() rclpy.shutdown() </code></pre> <p>Client:</p> <pre><code>import rclpy from rclpy.executors import MultiThreadedExecutor from rclpy.callback_groups import MutuallyExclusiveCallbackGroup, ReentrantCallbackGroup from rclpy.node import Node from std_srvs.srv import Empty class CallbackGroupDemo(Node): def __init__(self): super().__init__('client_node') client_cb_group = MutuallyExclusiveCallbackGroup() timer_cb_group = MutuallyExclusiveCallbackGroup() self.client = self.create_client(Empty, 'test_service', callback_group=client_cb_group) self.call_timer = self.create_timer(1, self._timer_cb, callback_group=timer_cb_group) def _timer_cb(self): self.get_logger().info('Sending request') _ = self.client.call(Empty.Request()) self.get_logger().info('Received response') def main(): rclpy.init() node = CallbackGroupDemo() executor = MultiThreadedExecutor(num_threads=3) executor.add_node(node) try: node.get_logger().info('Beginning client, shut down with CTRL-C') executor.spin() except KeyboardInterrupt: node.get_logger().info('Keyboard interrupt, shutting down.\n') node.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <hr /> <p><a href="https://answers.ros.org/question/408276/%22using-callback-groups%22-demo-is-not-working/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121380/quirky_franklin/" rel="nofollow noreferrer">quirky_franklin</a> on ROS Answers with karma: 31 on 2022-10-20</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-26</strong>:<br /> I am not sure which guide you are talking about. Therefore, may I request you share the URL of the source code, please?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/121380/quirky_franklin/" rel="nofollow noreferrer">quirky_franklin</a> on 2022-10-26</strong>:<br /> Of course here is the link: <a href="https://docs.ros.org/en/foxy/How-To-Guides/Using-callback-groups.html" rel="nofollow noreferrer">https://docs.ros.org/en/foxy/How-To-Guides/Using-callback-groups.html</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-27</strong>:<br /> Your code works fine! Just recompile your workspace, and try again please!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2022-10-27</strong>:<br /> Maybe it's a problem with your ROS2 configuration, this tutorial worked for me without problems. As @ravijoshi suggested, remove folders <code>build</code>, <code>log</code> and <code>install</code> from your <code>ros2_ws</code> and use <code>colcon build --symlink install</code> and <code>source ~/ros2_ws/install/setub.bash</code> again.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/121380/quirky_franklin/" rel="nofollow noreferrer">quirky_franklin</a> on 2022-10-27</strong>:<br /> Still the same errors:</p> <pre><code>$python3 service.py [INFO] [1666868240.642108465] [service_node]: Starting server node, shut down with CTRL-C [INFO] [1666868284.343087130] [service_node]: Received request, responding... [INFO] [1666868995.025454979] [service_node]: Keyboard interrupt, shutting down. $python3 client.py Test [INFO] [1666868283.362897658] [client_node]: Beginning client, shut down with CTRL-C [INFO] [1666868284.341332508] [client_node]: Sending request ^C[INFO] [1666868997.601692748] [client_node]: Keyboard interrupt, shutting down. </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/92002/oferbar/" rel="nofollow noreferrer">oferbar</a> on 2022-11-21</strong>:<br /> I'm having the same issue. I tried to reproduce the exact code in my ROS workspace (foxy container) without any luck. For some reason, any MultiThreadExecutor example that I tried to reproduce with Python this week seems to fail. By fail, I mean that it act like SingleThreadExecutor. I'm starting to believe that there is a wider problem here.</p> <p>Edit:</p> <p>After a few more frustrating hours, I managed to successfully reproduce the demos in Galactic workspace (without container), while the same code wouldn't work in a Foxy container.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-11-22</strong>:<br /> @oferbar: I remember verifying the code. As per my comments, you can noticed that it worked fine. I suspect something wrong with the installation or environment. It could an interesting task to identify it in great details.</p>
"Using Callback Groups" demo is not working
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, I resolved this issue, for future users.</p> <pre><code> 1. Open rviz window. 2. Go to add and add anything you would like to work with like Motion Planning, Image etc. 3. Subscribe to the particular topic if needed. 3. Go to files and save configuration as -&gt; name.rviz 4. Open your launch file &lt;node type=&quot;rviz&quot; name=&quot;rviz&quot; pkg=&quot;rviz&quot; args=&quot;-d $(find package_name)/launch/name.rviz &quot; /&gt; </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> with karma: 61 on 2022-10-24</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102588
2022-10-20T16:40:42.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to write a launch file that can launch RVIZ with image stream by subscribing to a specific topic. Please guide me through this. I can do it manually right now by clicking on the icon and then subscribing to the topic.</p> <hr /> <p><a href="https://answers.ros.org/question/408283/image-in-rviz-using-code/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-10-20</p> <p>Post score: 0</p>
Image in rviz using code
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Alright, I figured it out.</p> <p>I aliased the word &quot;done&quot; in my .bashrc to a command. As I am not familiar with bash scripting I was not aware that this is a control word in bash. Anyway, there are no warnings when you do this, bash just switches out all of the &quot;done&quot; lines in bash scripts for whatever you aliased. This caused the syntax error to occur, because bash was expecting a for loop to be closed with a done. It reached the bracket before it saw a done (because of the alias) and therefore had an error.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/121399/piperdaniel1/" rel="nofollow noreferrer">piperdaniel1</a> with karma: 16 on 2022-10-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102590
2022-10-20T18:01:35.000
|ros|bash|setup.sh|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm running Ubuntu 22.04 on my desktop computer (9th gen intel i5 processor, nvidia gtx 1080 gpu). I followed the instructions to install the Ros 2 Rolling Ubuntu binaries for my system (from this page: <a href="https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html" rel="nofollow noreferrer">https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html</a>). I made it to the Environment setup section. After running <code>source /opt/ros/rolling/setup.bash</code> I got the following errors:</p> <p><code>bash: setup.sh: line 59: syntax error near unexpected token }'</code></p> <p><code>bash: setup.sh: line 59: }'</code></p> <p>I tried reinstalling everything from the binaries again, restarting my system, and inspecting the <code>setup.sh</code> file but was unable to find out what was happening. It doesn't help that I am not very familiar with these kinds of more complicated shell scripts.</p> <p>In case it matters, here is my setup.sh (sorry for pastebin link, not sure how to do a code block here): <a href="https://pastebin.com/Dr5efb3P" rel="nofollow noreferrer">https://pastebin.com/Dr5efb3P</a></p> <hr /> <p><a href="https://answers.ros.org/question/408289/setup.sh-syntax-error-on-source/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121399/piperdaniel1/" rel="nofollow noreferrer">piperdaniel1</a> on ROS Answers with karma: 16 on 2022-10-20</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-21</strong>:<br /> I am not sure why <code>source /opt/ros/rolling/setup.bash</code> is failing. However, instead of Rolling, can you please try Humble Hawksbill? BTW, which shell are you using? Here is my system:</p> <pre><code><span class="math-container">$ echo "$</span>SHELL&quot; /bin/bash </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/121399/piperdaniel1/" rel="nofollow noreferrer">piperdaniel1</a> on 2022-10-22</strong>:<br /> Thanks for your help! Luckily I figured out the issue.</p>
setup.sh syntax error on source
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Answer to this is adding a custom .meta file. This is done by declaring it in the platfomio.ini as so:</p> <pre><code>board_microros_user_meta = custom.meta </code></pre> <p>Here the entire platformio.ini:</p> <pre><code>[env:teensy41] platform = teensy board = teensy41 framework = arduino board_microros_transport = serial monitor_port = /dev/ttyUSB0 board_microros_distro = humble board_microros_user_meta = custom.meta lib_deps = https://github.com/micro-ROS/micro_ros_platformio </code></pre> <p>The the file needs to be created in the root directory of the project</p> <pre><code>(&lt;workspace&gt;/custom.meta) </code></pre> <p>The contents can be copied from an example found in the documentation and should look like the below: {</p> <pre><code> &quot;names&quot;: { &quot;rmw_microxrcedds&quot;: { &quot;cmake-args&quot;: [ &quot;-DRMW_UXRCE_MAX_NODES=1&quot;, &quot;-DRMW_UXRCE_MAX_PUBLISHERS=10&quot;, &quot;-DRMW_UXRCE_MAX_SUBSCRIPTIONS=5&quot;, &quot;-DRMW_UXRCE_MAX_SERVICES=2&quot;, &quot;-DRMW_UXRCE_MAX_CLIENTS=1&quot;, &quot;-DRMW_UXRCE_MAX_HISTORY=4&quot;, &quot;-DRMW_UXRCE_TRANSPORT=custom&quot; ] } } } </code></pre> <p>This can be found in the documentation under <a href="https://github.com/micro-ROS/micro_ros_platformio#other-configuration" rel="nofollow noreferrer">https://github.com/micro-ROS/micro_ros_platformio#other-configuration</a></p> <p><strong>Note:</strong> the common.meta file makes general adjustments to the library and shall not be modified by the user. Same applies to the colcon.meta. These should NOT be modified manually. AFAIK.</p> <p>Will sanitize this combined subscriber, publisher, and 2x service example before creating pull request to main.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> with karma: 120 on 2022-10-21</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102592
2022-10-20T18:32:21.000
|ros|ros2|embedded|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone,</p> <p>I've gotten myself into another (programming) pickle here and would kindly ask for your expert advise.</p> <p>Attempting to continue building the examples library, I have successfully created the following examples, which all work subscriber publisher and subscriber service (addTwoInts) publisher, subscriber, service (addTwoInts)</p> <p>Now I'm attempting to add another service, but for some reason it fails, upon attempting to initialise the second service. Instead of creating the service, it gets stuck inside the error_handler and flashes the LED for ever.</p> <p>This is the line that fails.</p> <pre><code>RCCHECK(rclc_service_init_default(&amp;service_setBool, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), &quot;/setbool&quot;)); </code></pre> <p>Callback, service instance and executor have all been added as it should.</p> <p>Would you kindly take a look at the source code below and let me know what I am missing. Would appreciate your help.</p> <p>Thank you!</p> <p>Complete source code:</p> <pre><code>#include &lt;Arduino.h&gt; #include &lt;Wire.h&gt; #include &lt;micro_ros_platformio.h&gt; #include &lt;example_interfaces/srv/add_two_ints.h&gt; #include &lt;example_interfaces/srv/set_bool.h&gt; #include &lt;stdio.h&gt; #include &lt;rcl/error_handling.h&gt; #include &lt;rcl/rcl.h&gt; #include &lt;rclc/rclc.h&gt; #include &lt;rclc/executor.h&gt; #include &lt;std_msgs/msg/int32.h&gt; #include &lt;std_msgs/msg/int64.h&gt; #include &lt;std_msgs/msg/bool.h&gt; #if !defined(MICRO_ROS_TRANSPORT_ARDUINO_SERIAL) #error This example is only avaliable for Arduino framework with serial transport. #endif // ============================================================================ // INSTANCES, OBJECTS // ============================================================================ // publisher and subscriber common rcl_node_t node; rclc_support_t support; rcl_allocator_t allocator; rclc_executor_t executor; rcl_timer_t timer; unsigned int num_handles = 4; // 1 subscriber, 1 publisher, 2 service // service addTwoInts rcl_service_t service_addTwoInts; // service setBool rcl_service_t service_setBool; rcl_wait_set_t wait_set; //publisher rcl_publisher_t publisher; std_msgs__msg__Int32 msg_pub; // subscriber rcl_subscription_t subscriber; std_msgs__msg__Int32 msg_sub; example_interfaces__srv__AddTwoInts_Response res; example_interfaces__srv__AddTwoInts_Request req; example_interfaces__srv__SetBool_Response res_setBool; example_interfaces__srv__SetBool_Request req_setBool; // ============================================================================ // DEFINES // ============================================================================ // I/O - Definitions #define LED_PIN 13 // cleartext substitutions // debug #ifndef DebugMonitor #define DebugMonitor Serial6 #endif #define debug(x) DebugMonitor.print(x) #define debugln(x) DebugMonitor.println(x) // ============================================================================ // FUNCTION PROTOTYPES // ============================================================================ #define RCCHECK(fn){rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}} #define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}} // Error handle loop void error_loop() { while(1) { digitalWrite(LED_PIN, !digitalRead(LED_PIN)); delay(500); } } // -------------------------------------------------------- // timer callback (currently just increments msg_pub.data) void timer_callback(rcl_timer_t * timer, int64_t last_call_time) { RCLC_UNUSED(last_call_time); if (timer != NULL) { RCSOFTCHECK(rcl_publish(&amp;publisher, &amp;msg_pub, NULL)); msg_pub.data++; } } // -------------------------------------------------------- // subscriber callback void subscription_callback(const void * msgin) { const std_msgs__msg__Int32 * msg = (const std_msgs__msg__Int32 *)msgin; digitalWrite(LED_PIN, (msg-&gt;data == 0) ? LOW : HIGH); } // -------------------------------------------------------- // srv.addTwoInts callback void service_addTwoInts_callback(const void * req, void * res) { example_interfaces__srv__AddTwoInts_Request * req_in = (example_interfaces__srv__AddTwoInts_Request *) req; example_interfaces__srv__AddTwoInts_Response * res_in = (example_interfaces__srv__AddTwoInts_Response *) res; //printf(&quot;Service request value: %d + %d.\n&quot;, (int) req_in-&gt;a, (int) req_in-&gt;b); res_in-&gt;sum = req_in-&gt;a + req_in-&gt;b; } // -------------------------------------------------------- // srv.setBool callback void service_setBool_callback(const void * req_setBool, void * res_setBool) { bool previousState = digitalRead(LED_PIN); example_interfaces__srv__SetBool_Request * req_in = (example_interfaces__srv__SetBool_Request *) req_setBool; example_interfaces__srv__SetBool_Response * res_in = (example_interfaces__srv__SetBool_Response *) res_setBool; digitalWrite(LED_PIN, (req_in-&gt;data == 0) ? LOW:HIGH); if (previousState != digitalRead(LED_PIN)) { res_in-&gt;success = true; } else { res_in-&gt;success = false; } } // ============================================================================ // SETUP // ============================================================================ void setup() { set_microros_serial_transports(Serial); // Debug DebugMonitor.begin(115200); // I/O setup pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN, HIGH); delay(1000); allocator = rcl_get_default_allocator(); // create init_options RCCHECK(rclc_support_init(&amp;support, 0, NULL, &amp;allocator)); // create node RCCHECK(rclc_node_init_default(&amp;node, &quot;uros_platformio_node&quot;, &quot;&quot;, &amp;support)); // create service addTwoInts RCCHECK(rclc_service_init_default(&amp;service_addTwoInts, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, AddTwoInts), &quot;/addtwoints&quot;)); // create service setBool RCCHECK(rclc_service_init_default(&amp;service_setBool, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), &quot;/setbool&quot;)); // create publisher RCCHECK(rclc_publisher_init_default(&amp;publisher, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), &quot;micro_ros_platformio_node_publisher&quot;)); // create subscriber RCCHECK(rclc_subscription_init_default(&amp;subscriber, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), &quot;micro_ros_platformio_node_subscriber&quot;)); // create timer, const unsigned int timer_timeout = 1000; RCCHECK(rclc_timer_init_default(&amp;timer, &amp;support, RCL_MS_TO_NS(timer_timeout), timer_callback)); // create executor //RCCHECK(rclc_executor_init(&amp;executor, &amp;support.context, 1, &amp;allocator)); RCCHECK(rclc_executor_init(&amp;executor, &amp;support.context, num_handles, &amp;allocator)); RCCHECK(rclc_executor_add_service(&amp;executor, &amp;service_addTwoInts, &amp;req, &amp;res, service_addTwoInts_callback)); RCCHECK(rclc_executor_add_service(&amp;executor, &amp;service_setBool, &amp;req_setBool, &amp;res_setBool, service_setBool_callback)); RCCHECK(rclc_executor_add_subscription(&amp;executor, &amp;subscriber, &amp;msg_sub, &amp;subscription_callback, ON_NEW_DATA)); RCCHECK(rclc_executor_add_timer(&amp;executor, &amp;timer)); msg_pub.data = 0; } // ============================================================================ // MAIN LOOP // ============================================================================ void loop() { delay(100); RCSOFTCHECK(rclc_executor_spin_some(&amp;executor, RCL_MS_TO_NS(100))); } </code></pre> <p>EDIT: I have added some debug code to get to the bottom of this problem, as per the <code>RCCHECK</code>. See below for details:</p> <pre><code>#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){debugln(temp_rc); error_loop();}} </code></pre> <p>The output I receive in the debug console is</p> <pre><code>1 </code></pre> <p>Tracing RCL_RET_OK back to where it is defined, I found the following in file types.h:</p> <pre><code>/// Success return code. #define RCL_RET_OK RMW_RET_OK /// Unspecified error return code. #define RCL_RET_ERROR RMW_RET_ERROR /// Timeout occurred return code. #define RCL_RET_TIMEOUT RMW_RET_TIMEOUT /// Failed to allocate memory return code. #define RCL_RET_BAD_ALLOC RMW_RET_BAD_ALLOC /// Invalid argument return code. #define RCL_RET_INVALID_ARGUMENT RMW_RET_INVALID_ARGUMENT /// Unsupported return code. #define RCL_RET_UNSUPPORTED RMW_RET_UNSUPPORTED </code></pre> <p>Hovering with the mouse over the individual #defines, the tooltip revealed the &quot;1&quot; seen in my debug output resolves to</p> <pre><code>RMW_RET_ERROR </code></pre> <p>with the comment above:</p> <pre><code>/// Unspecified error return code. </code></pre> <p>Not really helpful, but with some luck somebody in the community has been across this and is willing to provide some insight.</p> <p>Much appreciated!</p> <hr /> <p><a href="https://answers.ros.org/question/408294/rclc-node-fails-to-initialize-multiple-services/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> on ROS Answers with karma: 120 on 2022-10-20</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> on 2022-10-21</strong>:<br /> Added an edit to post, too long for comment here.</p> <p>Basically traced RCCHECK back to</p> <pre><code>/// Unspecified error return code. RMW_RET_ERROR </code></pre> <p>Anyone kind enough here to provide some insight why this fails? Thank you!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> on 2022-10-21</strong>:<br /> Just did a test to verify that both services are able to run. Commenting one or the other out and compiling / downloading the code works without issues. So I'm guessing there is an issue with the way the second service is initialized. Nothing in the source code tells me that these functions need to be unique, or that they would interfere with one another. Here is, how both services are initialized:</p> <pre><code>RCCHECK(rclc_service_init_default(&amp;service_addTwoInts, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, AddTwoInts), &quot;/addtwoints&quot;)); RCCHECK(rclc_service_init_default(&amp;service_setBool, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), &quot;/setbool&quot;)); </code></pre> <p>Any thoughts?</p>
rclc node fails to initialize multiple services
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The problem is not with the <code>tf</code> or ROS. You are using <code>%d</code> as a format string, which will round float values to integers. Coincidentally, our values are less than 1. Thus, they are rounded to 0.</p> <p>I am surprised and confused at the same time after seeing the following statement:</p> <pre><code> rospy.logdebug( &quot;tx: %f, ty: %f, tz: %f, rx: %f, ry: %f, rz: %f&quot;, tx, ty, tz, rx, ry, rz ) </code></pre> <p>I recommend, using the following statement instead:</p> <pre><code> rospy.logdebug(trans) </code></pre> <p>Below is the code snippet:</p> <pre><code>#!/usr/bin/env python import rospy import tf2_ros class UR3TfListener(object): def __init__(self): self.tf_buffer = tf2_ros.Buffer() self.listener = tf2_ros.TransformListener(self.tf_buffer) self.timer = rospy.Timer(rospy.Duration(1), self.tfListenerCallback) def tfListenerCallback(self, event): try: trans = self.tf_buffer.lookup_transform(&quot;tool0&quot;, &quot;base_link&quot;, rospy.Time()) except ( tf2_ros.LookupException, tf2_ros.ConnectivityException, tf2_ros.ExtrapolationException, ): rospy.logdebug(&quot;Can't transform&quot;) return tx = trans.transform.translation.x ty = trans.transform.translation.y tz = trans.transform.translation.z rx = trans.transform.rotation.x ry = trans.transform.rotation.y rz = trans.transform.rotation.z rospy.logdebug(trans) rospy.logdebug( &quot;tx: %f, ty: %f, tz: %f, rx: %f, ry: %f, rz: %f&quot;, tx, ty, tz, rx, ry, rz ) if __name__ == &quot;__main__&quot;: rospy.init_node(&quot;tf_listener&quot;, anonymous=False, log_level=rospy.DEBUG) tf_listener = UR3TfListener() rospy.spin() </code></pre> <p>I used random values to publish a transformation as shown below:</p> <pre><code>ravi@dell:~/ros_ws$ rosrun tf2_ros static_transform_publisher 0.4 0.2 0.3 0.1 0.2 0.3 base_link tool0 [ INFO] [1666599679.602630460]: Spinning until killed publishing base_link to tool0 </code></pre> <p>Then, I run your code to print the transformation. Please see below:</p> <pre><code>ravi@dell:~/ros_ws$ rosrun beginner_tutorials tf.py [DEBUG] [1666600470.164958]: init_node, name[/tf_listener], pid[71067] [DEBUG] [1666600470.167868]: binding to 0.0.0.0 0 [DEBUG] [1666600470.170540]: bound to 0.0.0.0 38651 [DEBUG] [1666600470.173766]: ... service URL is rosrpc://dell:38651 [DEBUG] [1666600470.176383]: [/tf_listener/get_loggers]: new Service instance [DEBUG] [1666600470.181235]: ... service URL is rosrpc://dell:38651 [DEBUG] [1666600470.183920]: [/tf_listener/set_logger_level]: new Service instance [DEBUG] [1666600470.191242]: ... service URL is rosrpc://dell:38651 [DEBUG] [1666600470.195970]: [/tf_listener/tf2_frames]: new Service instance [DEBUG] [1666600470.211223]: node[/tf_listener, http://dell:39269/] entering spin(), pid[71067] [DEBUG] [1666600470.220975]: connecting to tm 58745 [DEBUG] [1666600470.312265]: header: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: &quot;tool0&quot; child_frame_id: &quot;base_link&quot; transform: translation: x: -0.3500360106436593 y: -0.2633910550476512 z: -0.31320910487014486 rotation: x: -0.14357217502739192 y: -0.10602051106179562 z: -0.03427079855048211 w: 0.9833474432563559 [DEBUG] [1666600470.316059]: tx: -0.350036, ty: -0.263391, tz: -0.313209, rx: -0.143572, ry: -0.106021, rz: -0.034271 </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-10-24</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/78722/diegoc/" rel="nofollow noreferrer">DiegoC</a> on 2022-10-24</strong>:<br /> Thank you so much for your answer, it solved my problem. And thanks to everyone who helped.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-24</strong>:<br /> Glad you made it work. May I ask you to upvote the answer by clicking on ^ icon in the left side, please?</p>
102594
2022-10-20T20:48:58.000
|ros|ros-melodic|tf2-ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello everyone,</p> <p>I want to get the transform from <code>tool0</code> frame to <code>base_link</code> frame of the UR3 robot but I'm having problems.</p> <p>Below is the code I'm using to get the transform:</p> <pre><code>#!/usr/bin/env python import rospy import tf2_ros class UR3TfListener(object): def tfListenerCallback(self, event): if self.tf_buffer.can_transform('tool0','base_link',rospy.Time(0)): trans = self.tf_buffer.lookup_transform('tool0','base_link',rospy.Time(0)) else: rospy.logdebug(&quot;Can't transform&quot;) tx = trans.transform.translation.x ty = trans.transform.translation.y tz = trans.transform.translation.z rx = trans.transform.rotation.x ry = trans.transform.rotation.y rz = trans.transform.rotation.z rospy.logdebug(&quot;tx: %d, ty: %d, tz: %d, rx: %d, ry: %d, rz: %d&quot;, tx, ty, tz, rx, ry, rz) def __init__(self): self.tf_buffer = tf2_ros.Buffer() self.listener = tf2_ros.TransformListener(self.tf_buffer) rospy.Timer(rospy.Duration(0.1),self.tfListenerCallback) if __name__ == '__main__': rospy.init_node('tf_listener', anonymous=False, log_level=rospy.DEBUG) tf_listener = UR3TfListener() rospy.spin() </code></pre> <p>The problem that I'm having is that the transform that I'm getting is something like this</p> <pre><code>[DEBUG] [1666494690.406768, 199.024000]: tx: 0, ty: 0, tz: 0, rx: 0, ry: 0, rz:0 </code></pre> <p>And the transform shouldn't be 0 as the frames look like following:</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16664115223422448.png" alt="image description" /></p> <h3>Edit 1: /tf and /tf_static echo result</h3> <p>When I run <code>rostopic echo /tf -n 1</code> I get:</p> <pre><code> transforms: - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;upper_arm_link&quot; child_frame_id: &quot;forearm_link&quot; transform: translation: x: -0.24365 y: 0.0 z: 0.0 rotation: x: 0.0 y: 0.0 z: 9.38252996394e-06 w: 0.999999999956 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;robotiq_85_left_inner_knuckle_link&quot; child_frame_id: &quot;robotiq_85_left_finger_tip_link&quot; transform: translation: x: 0.04303959807 y: -0.03759940821 z: 0.0 rotation: x: 0.0 y: 0.0 z: -1.31530571e-05 w: 0.999999999913 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;robotiq_85_base_link&quot; child_frame_id: &quot;robotiq_85_left_inner_knuckle_link&quot; transform: translation: x: 0.06142 y: 0.0127 z: 0.0 rotation: x: 0.999999999913 y: -1.31530571e-05 z: -1.36017806871e-18 w: -1.03411553546e-13 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;robotiq_85_base_link&quot; child_frame_id: &quot;robotiq_85_left_knuckle_link&quot; transform: translation: x: 0.05490451627 y: 0.03060114443 z: 0.0 rotation: x: 0.999999999913 y: -1.31530571e-05 z: -1.36017806871e-18 w: -1.03411553546e-13 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;robotiq_85_right_inner_knuckle_link&quot; child_frame_id: &quot;robotiq_85_right_finger_tip_link&quot; transform: translation: x: 0.04303959807 y: -0.03759940821 z: 0.0 rotation: x: 0.0 y: 0.0 z: -1.31530571e-05 w: 0.999999999913 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;robotiq_85_base_link&quot; child_frame_id: &quot;robotiq_85_right_inner_knuckle_link&quot; transform: translation: x: 0.06142 y: -0.0127 z: 0.0 rotation: x: 0.0 y: 0.0 z: 1.31530571e-05 w: 0.999999999913 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;robotiq_85_base_link&quot; child_frame_id: &quot;robotiq_85_right_knuckle_link&quot; transform: translation: x: 0.05490451627 y: -0.03060114443 z: 0.0 rotation: x: 0.0 y: 0.0 z: 1.31530571e-05 w: 0.999999999913 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;shoulder_link&quot; child_frame_id: &quot;upper_arm_link&quot; transform: translation: x: 0.0 y: 0.0 z: 0.0 rotation: x: 0.707106780406 y: -3.47311703923e-05 z: 3.47311703852e-05 w: 0.707106780261 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;base_link_inertia&quot; child_frame_id: &quot;shoulder_link&quot; transform: translation: x: 0.0 y: 0.0 z: 0.1519 rotation: x: 0.0 y: 0.0 z: 0.000111316041149 w: 0.999999993804 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;forearm_link&quot; child_frame_id: &quot;wrist_1_link&quot; transform: translation: x: -0.21325 y: 0.0 z: 0.11235 rotation: x: 0.0 y: 0.0 z: -3.7381721399e-05 w: 0.999999999301 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;wrist_1_link&quot; child_frame_id: &quot;wrist_2_link&quot; transform: translation: x: 0.0 y: -0.08535 z: -1.75055776238e-11 rotation: x: 0.707106779389 y: 5.14315299095e-05 z: -5.1431529899e-05 w: 0.707106779244 - header: seq: 0 stamp: secs: 11 nsecs: 296000000 frame_id: &quot;wrist_2_link&quot; child_frame_id: &quot;wrist_3_link&quot; transform: translation: x: 0.0 y: 0.0819 z: -1.67979707954e-11 rotation: x: -0.70710678032 y: 3.64346550716e-05 z: 3.64346552104e-05 w: 0.707106780175 --- </code></pre> <p>And when I run <code>rostopic echo /tf_static -n 1</code> I get:</p> <pre><code>transforms: - header: seq: 0 stamp: secs: 0 nsecs: 20000000 frame_id: &quot;base_link&quot; child_frame_id: &quot;base&quot; transform: translation: x: 0.0 y: 0.0 z: 0.0 rotation: x: 0.0 y: 0.0 z: 1.0 w: -1.03411553555e-13 - header: seq: 0 stamp: secs: 0 nsecs: 20000000 frame_id: &quot;base_link&quot; child_frame_id: &quot;base_link_inertia&quot; transform: translation: x: 0.0 y: 0.0 z: 0.0 rotation: x: 0.0 y: 0.0 z: 1.0 w: -1.03411553555e-13 - header: seq: 0 stamp: secs: 0 nsecs: 20000000 frame_id: &quot;flange&quot; child_frame_id: &quot;tool0&quot; transform: translation: x: 0.0 y: 0.0 z: 0.0 rotation: x: 0.5 y: 0.499999999998 z: 0.5 w: 0.500000000002 - header: seq: 0 stamp: secs: 0 nsecs: 20000000 frame_id: &quot;robotiq_coupler&quot; child_frame_id: &quot;ur_gripper_tip_link&quot; transform: translation: x: 0.0 y: 0.0 z: 0.1441 rotation: x: 0.0 y: 0.0 z: 0.0 w: 1.0 - header: seq: 0 stamp: secs: 0 nsecs: 20000000 frame_id: &quot;robotiq_coupler&quot; child_frame_id: &quot;robotiq_85_base_link&quot; transform: translation: x: 0.0 y: 0.0 z: 0.004 rotation: x: 0.707106781185 y: 7.31230107717e-14 z: 0.707106781188 w: -7.3123010772e-14 - header: seq: 0 stamp: secs: 0 nsecs: 20000000 frame_id: &quot;robotiq_85_left_knuckle_link&quot; child_frame_id: &quot;robotiq_85_left_finger_link&quot; transform: translation: x: -0.00408552455 y: -0.03148604435 z: 0.0 rotation: x: 0.0 y: 0.0 z: 0.0 w: 1.0 - header: seq: 0 stamp: secs: 0 nsecs: 20000000 frame_id: &quot;robotiq_85_right_knuckle_link&quot; child_frame_id: &quot;robotiq_85_right_finger_link&quot; transform: translation: x: -0.00408552455 y: -0.03148604435 z: 0.0 rotation: x: 0.0 y: 0.0 z: 0.0 w: 1.0 - header: seq: 0 stamp: secs: 0 nsecs: 20000000 frame_id: &quot;tool0&quot; child_frame_id: &quot;robotiq_coupler&quot; transform: translation: x: 0.0 y: 0.0 z: 0.004 rotation: x: 0.0 y: 0.0 z: -0.707106781185 w: 0.707106781188 - header: seq: 0 stamp: secs: 0 nsecs: 20000000 frame_id: &quot;world&quot; child_frame_id: &quot;base_link&quot; transform: translation: x: 0.0 y: 0.0 z: 0.0 rotation: x: 0.0 y: 0.0 z: 0.0 w: 1.0 - header: seq: 0 stamp: secs: 0 nsecs: 20000000 frame_id: &quot;wrist_3_link&quot; child_frame_id: &quot;flange&quot; transform: translation: x: 0.0 y: 0.0 z: 0.0 rotation: x: -0.499999999998 y: -0.5 z: -0.5 w: 0.500000000002 --- </code></pre> <p>Finally here you can see the different frames between <code>base_link</code>and <code>tool0</code> from <code>rosrun tf2_tools view_frames.py</code></p> <p><a href="https://imgur.com/ncc0kDO" rel="nofollow noreferrer">tf tree image</a></p> <p>I'm using Ros Melodic in Ubuntu 18.04. I hope someone can help!</p> <hr /> <p><a href="https://answers.ros.org/question/408299/tf2_ros-lookup_transform-giving-wrong-transformation/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/78722/diegoc/" rel="nofollow noreferrer">DiegoC</a> on ROS Answers with karma: 3 on 2022-10-20</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-21</strong>:<br /> How did you print or note that transformation? Unfortunately, I don't see any print statement in your code snippet. On the other hand, the code is incomplete. Thus, I can not reproduce it here. Nevertheless, you may try the following sample code: <a href="http://wiki.ros.org/tf2/Tutorials/Writing%20a%20tf2%20listener%20%28Python%29" rel="nofollow noreferrer">http://wiki.ros.org/tf2/Tutorials/Writing%20a%20tf2%20listener%20%28Python%29</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/78722/diegoc/" rel="nofollow noreferrer">DiegoC</a> on 2022-10-22</strong>:<br /> I based my code on the tf2 tutorials, also I edited my question and put the entire code.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-10-23</strong>:<br /> Please show us the message (including the header) that is being published on /tf.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/78722/diegoc/" rel="nofollow noreferrer">DiegoC</a> on 2022-10-23</strong>:<br /> I updated the question with the messages from <code>/tf</code> and <code>/tf_static</code> and the tf tree</p>
tf2_ros lookup_transform giving wrong transformation
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I manage to solve this problem. The issue was feedbackCallback method. Wrong version:</p> <hr /> <pre><code>void feedbackCallback(const minicar_control::msg::Feedback &amp;fb_msg); </code></pre> <hr /> <p>Right version:</p> <hr /> <pre><code>void feedbackCallback(const minicar_control::msg::Feedback::SharedPtr fb_msg); </code></pre> <hr /> <p>@ravijoshi, thank you for your help. I didn't thought, that callback will not be executed.</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-10-24</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/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-24</strong>:<br /> I am glad you made it work. This is why I encourage creating a <a href="https://en.wikipedia.org/wiki/Minimal_reproducible_example" rel="nofollow noreferrer">minimal reproducible example</a></p>
102597
2022-10-21T06:29:05.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 have a subscriber that looks like this</p> <hr /> <pre><code>rclcpp::Subscription&lt;minicar_control::msg::Feedback&gt;::SharedPtr hw_feedback_sub; ... hw_feedback_sub = this-&gt;create_subscription&lt;minicar_control::msg::Feedback&gt;(&quot;hw_feedback&quot;, 1000, std::bind(&amp;STMRobotHW::feedbackCallback, this, _1)); </code></pre> <hr /> <p>As far as I know this should work, but this is how problem looks in VS Code:</p> <blockquote> <p>operand types are: std::shared_ptr&lt;rclcpp::Subscription&lt;minicar_control::msg::Feedback, std::allocator, rclcpp::message_memory_strategy::MessageMemoryStrategy&lt;minicar_control::msg::Feedback, std::allocator&gt;&gt;&gt; = std::shared_ptr&lt;rclcpp::Subscription&lt;const minicar_control::msg::Feedback &amp;, std::allocator, rclcpp::message_memory_strategy::MessageMemoryStrategy&lt;const minicar_control::msg::Feedback &amp;, std::allocator&gt;&gt;&gt;</p> </blockquote> <p>I think, that this can be solved by removing hw_feedback_sub from header and use auto like this</p> <hr /> <pre><code>auto hw_feedback_sub = this-&gt;create_subscription&lt;minicar_control::msg::Feedback&gt;(&quot;hw_feedback&quot;, 1000, std::bind(&amp;STMRobotHW::feedbackCallback, this, _1)); </code></pre> <hr /> <p>But I want to know where I overlook mistake. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/408331/litle-problem-with-assigning-subscriber./" 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-10-21</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-21</strong>:<br /> The <code>rclcpp::Subscription</code> should be a class member. Removing it from header and using <code>auto</code> (the way you suggested), may avoid the error, but the callback will not be executed. On the other hand, I can not reproduce the error, as the code is incomplete. I suggest creating a <a href="https://en.wikipedia.org/wiki/Minimal_reproducible_example" rel="nofollow noreferrer">minimal reproducible example</a></p>
Litle problem with assigning subscriber
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In almost all cases (especially for beginners) it is better to build a package from ground up, than converting it from ROS1 to ROS2. Especially, as it will be easier when following the ROS2 tutorials, and having an example ROS1 package as template. It will provide guidance on two levels.</p> <ol> <li>The workflow</li> <li>The logic needed for your package (conversion required tho)</li> </ol> <p>So my advice, start fresh forget copy&amp;paste. It ain't gonna do you any favs!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> with karma: 120 on 2022-10-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102599
2022-10-23T03:00:49.000
|ros|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hey y'all, pointcloud here again getting into more trouble.</p> <p>I'm trying to create a tutorial on converting a ROS1 package to ROS2, as I need it for my project and it would be possibly helpful for other people as well to have an example on an actual package, rather than a &quot;tutorial built custom package&quot;.</p> <p>In order to make it more applicable to a wider range of packages.</p> <p>including a ROS1 package in my micro-ros project fails to build, likely because the conversion is incomplete. So here are the steps I have taken..</p> <p>I have been following a tutorial regarding porting ROS1 to ROS2. It can be found here: <a href="https://industrial-training-master.readthedocs.io/en/melodic/_source/session7/ROS1-to-ROS2-porting.html" rel="nofollow noreferrer">https://industrial-training-master.readthedocs.io/en/melodic/_source/session7/ROS1-to-ROS2-porting.html</a></p> <pre><code>1. &lt;micro-ros_ws&gt;/extra_packages git clone https://github.com/TFmini/TFmini-ROS.git 2. modified the CMakeLists.txt (see below before / after) 3. modified the package.xml (see below before / after) 4. modified TFmini.cpp, replacing #include &lt;ros/ros.h&gt; with #include &lt;rclcpp/rclcpp.hpp&gt; 5. &lt;--- This is where my understanding of converting ROS1 package to ROS2 stops ---&gt; 6. build of course fails, as I'm likely missing some steps </code></pre> <p>I believe the issue is with my understanding of converting the ROS1 package properly. I can see the tutorial I'm following converts it straight into ROS2 using cpp as base language, whereas I'm writing a tutorial converting into a micro-ros environment. And that is a quite different task.</p> <p>Starting to wonder if it would be best to just start writing my whole entire package from the beginning?! Rather than converting an old ROS1 package..</p> <p>ORIGINAL CMakeLists.txt</p> <pre><code>cmake_minimum_required(VERSION 2.8.3) project(tfmini_ros) find_package(catkin REQUIRED COMPONENTS sensor_msgs roscpp ) find_package(Boost REQUIRED COMPONENTS system) catkin_package( INCLUDE_DIRS include ) include_directories(${catkin_INCLUDE_DIRS} include) add_executable(tfmini_ros_node src/TFmini_ros_node.cpp src/TFmini.cpp ) target_link_libraries(tfmini_ros_node ${catkin_LIBRARIES} ) set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} -std=c++11 -std=gnu++11&quot;) install(TARGETS tfmini_ros_node tfmini_ros_node RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} ) install(DIRECTORY include DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} FILES_MATCHING PATTERN &quot;*.h&quot; ) install(FILES launch/tfmini.launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) </code></pre> <p>Modified CMakeLists.txt</p> <pre><code>cmake_minimum_required(VERSION 3.8) project(tfmini_ros) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES &quot;Clang&quot;) add_compile_options(-Wall -Wextra -Wpedantic) endif() find_package(sensor_msgs REQUIRED) find_package(rosidl_default_generators REQUIRED) rosidl_generate_interfaces(${PROJECT_NAME} &quot;msg/Range.msg&quot; DEPENDENCIES sensor_msgs ) if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) set(ament_cmake_copyright_FOUND TRUE) set(ament_cmake_cpplint_FOUND TRUE) ament_lint_auto_find_test_dependencies() endif() ament_package() </code></pre> <p>The original package.xml</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;package&gt; &lt;name&gt;tfmini_ros&lt;/name&gt; &lt;version&gt;0.0.1&lt;/version&gt; &lt;description&gt;The TFmini_ros package&lt;/description&gt; &lt;maintainer email=&quot;wenquan@todo.todo&quot;&gt;wenquan&lt;/maintainer&gt; &lt;license&gt;TODO&lt;/license&gt; &lt;author &gt;TAN&lt;/author&gt; &lt;buildtool_depend&gt;catkin&lt;/buildtool_depend&gt; &lt;build_depend&gt;sensor_msgs&lt;/build_depend&gt; &lt;build_depend&gt;roscpp&lt;/build_depend&gt; &lt;run_depend&gt;boost&lt;/run_depend&gt; &lt;export&gt; &lt;/export&gt; &lt;/package&gt; </code></pre> <p>My modifed package.xml</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;?xml-model href=&quot;http://download.ros.org/schema/package_format3.xsd&quot; schematypens=&quot;http://www.w3.org/2001/XMLSchema&quot;?&gt; &lt;package format=&quot;3&quot;&gt; &lt;name&gt;tfmini_ros&lt;/name&gt; &lt;version&gt;0.0.1&lt;/version&gt; &lt;description&gt;The TFmini_ros2 package&lt;/description&gt; &lt;maintainer email=&quot;mail@gmail.com&quot;&gt;administrator&lt;/maintainer&gt; &lt;license&gt;License declaration&lt;/license&gt; &lt;!-- Unsure if sensor_msgs needs to be &quot;depend&quot; or &quot;build_depend&quot; --&gt; &lt;depend&gt;sensor_msgs&lt;/build_depend&gt; &lt;!--&lt;build_depend&gt;sensor_msgs&lt;/build_depend&gt;--&gt; &lt;build_depend&gt;roscpp&lt;/build_depend&gt; &lt;exec_depend&gt;rosidl_default_runtime&lt;/exec_depend&gt; &lt;member_of_group&gt;rosidl_interface_packages&lt;/member_of_group&gt; &lt;!-- --&gt; &lt;buildtool_depend&gt;ament_cmake&lt;/buildtool_depend&gt; &lt;test_depend&gt;ament_lint_auto&lt;/test_depend&gt; &lt;test_depend&gt;ament_lint_common&lt;/test_depend&gt; &lt;export&gt; &lt;build_type&gt;ament_cmake&lt;/build_type&gt; &lt;/export&gt; &lt;/package&gt; </code></pre> <p>Any ideas what exactly is missing? Do I need to install a version of ros1 first to enable usage of ros1 packages?</p> <p>Thanks team</p> <hr /> <p><a href="https://answers.ros.org/question/408393/colcon-fails-building-ros1-package/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> on ROS Answers with karma: 120 on 2022-10-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-10-23</strong>:<br /> Could I ask you to please update the title of your question to better reflect your actual question?</p> <p>&quot;severely fails&quot; doesn't really convey they fact you're trying to build a ROS 1 Catkin package in a ROS 2 workspace with Colcon.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> on 2022-10-23</strong>:<br /> Hey dude, updated not only the title, but rather the entire question to make more sense. It was probably too early when I wrote that initial post :-/</p> <p>However, I almost certainly believe it is better to start from scratch creating a package and using the existing ROS1 version as a template, than trying to convert....</p> <p>Especially for beginners, I believe that is the better approach, as it teaches not only interpreting older packages, but also gets newcomers into building and creating own packages. On top of that using a template (even if it's an older version) it does give some guidance.</p> <p>Thanks, I will leave this as official and add an answer.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-10-24</strong>:<br /> I'm not sure I understand what you did.</p> <p><code>TFmini/TFmini-ROS.git</code> doesn't seem to build any messages itself.</p> <p>The <code>Range</code> message is already provided by the <code>sensor_msgs</code> package. Why are you building it in the package you converted? You also don't appear to be building any of the source files of the original package any more.</p>
colcon fails building ros1 package
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In the end I solved this problem with modifying not the node that starts on arduino but subscription node that I run on pc. For those who are curious, as far as I could find, there are no way to handle exception without try catch block.</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-10-27</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102602
2022-10-24T05:12:05.000
|ros|arduino|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, Sorry for the mistakes, as English is not my native language. I have a code having the following lines:</p> <pre><code>tf::TransformListener listener; tf::StampedTransform transform; while (ros.ok()) { try { listener.lookupTransform(&quot;/map&quot;, &quot;/base_link&quot;, ros::Time(0), transform); } catch (tf::TransformException ex) { ROS_ERROR(&quot;Transform problem -&gt; %s&quot;, ex.what()); } } </code></pre> <p>I need to handle <code>tf::TransformException</code> without <code>try</code> and <code>catch</code> block because this part of code should be executed on Arduino. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/408435/tf::transformlistener-for-arduino/" 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-10-24</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-10-26</strong>:<br /> If your idea is to call TransformListener.lookupTransform() on the Arduino, that is a bad idea. The operation is too heavy for a rs-232 serial link and small cpu unless you have no other choice. Please edit your description and explain more clearly what you think the Arduino needs to do. Publishing sensor data does not require knowing any transforms for the ros system.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-27</strong>:<br /> Thank you for reply. I have a node that finds robot position, than subscribes to data from topic that contains data from sensors. That data is published by arduino. My thought was to make sure that arduino is started publish data in same time as node, that subscribes to that data is run so no data from sensors is missed.</p>
tf::TransformListener for Arduino
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This is a first pass at adapting the image_geometry code: <a href="https://github.com/lucasw/image_manip/blob/master/image_manip/src/utility.cpp#L39-L105" rel="nofollow noreferrer">https://github.com/lucasw/image_manip/blob/master/image_manip/src/utility.cpp#L39-L105</a> - very little testing so far though:</p> <pre><code>std::vector image_points; cv::Matx33d intrinsic; cv::Mat distortion; image_manip::cameraInfoToCV(msg, intrinsic, distortion); cv::Mat rvec, tvec = cv::Mat_&lt;double&gt;::zeros(3, 1); cv::Rodrigues(R_.t(), r_vec); cv::projectPoints(vector_of_3d_points_in_camera_frame, rvec, tvec, intrinsic, distortion, image_points); </code></pre> <p>Copy of the function code:</p> <pre><code>// adapted from https://github.com/ros-perception/vision_opencv/blob/noetic/image_geometry/src/pinhole_camera_model.cpp fromCameraInfo void cameraInfoToCV(const sensor_msgs::CameraInfo::ConstPtr&amp; msg, cv::Matx33d&amp; K_, // Describe current image (includes binning, ROI) cv::Mat_&lt;double&gt;&amp; D_) // Unaffected by binning, ROI - they are in ideal camera coordinates { // TODO(lucasw) this can't be const auto cam_info = *msg; cv::Matx34d P_; // Describe current image (includes binning, ROI) int d_size = cam_info.D.size(); D_ = (d_size == 0) ? cv::Mat_&lt;double&gt;() : cv::Mat_&lt;double&gt;(1, d_size, cam_info.D.data()); auto K_full_ = cv::Matx33d(&amp;cam_info.K[0]); // TODO(lucasw) not actually using P_full_ auto P_full_ = cv::Matx34d(&amp;cam_info.P[0]); // Binning = 0 is considered the same as binning = 1 (no binning). const uint32_t binning_x = cam_info.binning_x ? cam_info.binning_x : 1; const uint32_t binning_y = cam_info.binning_y ? cam_info.binning_y : 1; // ROI all zeros is considered the same as full resolution. sensor_msgs::RegionOfInterest roi = cam_info.roi; if (roi.x_offset == 0 &amp;&amp; roi.y_offset == 0 &amp;&amp; roi.width == 0 &amp;&amp; roi.height == 0) { roi.width = cam_info.width; roi.height = cam_info.height; } // If necessary, create new K_ and P_ adjusted for binning and ROI /// @todo Calculate and use rectified ROI const bool adjust_binning = (binning_x &gt; 1) || (binning_y &gt; 1); const bool adjust_roi = (roi.x_offset != 0) || (roi.y_offset != 0); if (!adjust_binning &amp;&amp; !adjust_roi) { K_ = K_full_; P_ = P_full_; } else { K_ = K_full_; P_ = P_full_; // ROI is in full image coordinates, so change it first if (adjust_roi) { // Move principal point by the offset /// @todo Adjust P by rectified ROI instead K_(0,2) -= roi.x_offset; K_(1,2) -= roi.y_offset; P_(0,2) -= roi.x_offset; P_(1,2) -= roi.y_offset; } if (binning_x &gt; 1) { const double scale_x = 1.0 / binning_x; K_(0,0) *= scale_x; K_(0,2) *= scale_x; P_(0,0) *= scale_x; P_(0,2) *= scale_x; P_(0,3) *= scale_x; } if (binning_y &gt; 1) { const double scale_y = 1.0 / binning_y; K_(1,1) *= scale_y; K_(1,2) *= scale_y; P_(1,1) *= scale_y; P_(1,2) *= scale_y; P_(1,3) *= scale_y; } } } </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/120/lucasw/" rel="nofollow noreferrer">lucasw</a> with karma: 8729 on 2022-10-24</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102604
2022-10-24T08:24:57.000
|ros|c++|opencv|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Are there existing functions to convert from camera info arrays of K and D to intrinsic and distortion cv::Mats that can be passed into opencv functions like <code>projectPoints()</code>?</p> <p>I'm interested in C++ mainly but python would also be useful.</p> <p>I have my own implementations including <a href="https://github.com/lucasw/image_manip/blob/d61a01452ac4d46da132494f2c1516703ea83899/image_manip/src/distort.cpp#L41-L72https://github.com/lucasw/image_manip/blob/master/image_manip/src/distort.cpp#L72-L103" rel="nofollow noreferrer">https://github.com/lucasw/image_manip/blob/d61a01452ac4d46da132494f2c1516703ea83899/image_manip/src/distort.cpp#L41-L72https://github.com/lucasw/image_manip/blob/master/image_manip/src/distort.cpp#L72-L103</a> but ideally it would do the right thing with binning and roi.</p> <p><a href="https://github.com/ros-perception/vision_opencv/blob/noetic/image_geometry/src/pinhole_camera_model.cpp#L97-L223" rel="nofollow noreferrer">https://github.com/ros-perception/vision_opencv/blob/noetic/image_geometry/src/pinhole_camera_model.cpp#L97-L223</a> looks like what I want but the class interface is in the way and it can't be used directly (and I'm not interested in subclassing it)- there's even a usage of projectPoints: <a href="https://github.com/ros-perception/vision_opencv/blob/noetic/image_geometry/src/pinhole_camera_model.cpp#L360-L382" rel="nofollow noreferrer">https://github.com/ros-perception/vision_opencv/blob/noetic/image_geometry/src/pinhole_camera_model.cpp#L360-L382</a> - but I want to do something different with projecting points than that. I can rip that code out and make it functional and will leave it in image_manip so other packages could use it- unless that exists somewhere already.</p> <hr /> <p><a href="https://answers.ros.org/question/408439/convert-camerainfo-k-&amp;-d-to-opencv-format-convenience-functions?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/120/lucasw/" rel="nofollow noreferrer">lucasw</a> on ROS Answers with karma: 8729 on 2022-10-24</p> <p>Post score: 0</p>
Convert CameraInfo K & D to OpenCV format convenience functions?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I deleted the folders <code>log</code>, <code>install</code> and <code>build</code> in the Workspaces which caused the <code>not found</code>.<br /> Then i build the packages again and the <code>not found</code> was gone.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/119094/lucb/" rel="nofollow noreferrer">LucB</a> with karma: 42 on 2022-11-08</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102606
2022-10-24T09:32:29.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I created a test workspace. Now i deleted that, because i dont need it anymore.</p> <p>I had the workspace automatically sourced in my <code>~/.bashrc</code>: <code>/home/luca/workspace/test_ws/install/setup.bash</code>. Now i deleted that again from my <code>~/.bashrc</code>.</p> <p>Still when i open a terminal i get this message</p> <pre><code>not found: &quot;/home/luca/workspace/test_ws/install/local_setup.bash&quot; not found: &quot;/home/luca/workspace/test_ws/install/local_setup.bash&quot; </code></pre> <p>How can i solve this?</p> <hr /> <p><a href="https://answers.ros.org/question/408440/not-found:-local_setup.bash/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/119094/lucb/" rel="nofollow noreferrer">LucB</a> on ROS Answers with karma: 42 on 2022-10-24</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/120024/nils_iseke/" rel="nofollow noreferrer">nils_iseke</a> on 2022-10-25</strong>:<br /> Maybe you also wrote it in your /etc/bash.bashrc file.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/119094/lucb/" rel="nofollow noreferrer">LucB</a> on 2022-10-25</strong>:<br /> i checked <code>etc/bash.bashrc</code> file and der is no <code>source</code> in there.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/120024/nils_iseke/" rel="nofollow noreferrer">nils_iseke</a> on 2022-10-25</strong>:<br /> Hm, ok you could execute <code>cd ~ &amp;&amp; cat .bashrc | grep source</code> and <code>cd /etc &amp;&amp; cat bash.bashrc | grep source</code> to see which ROS related files are sourced. I am assuming that you are using the bash shell <code>echo $SHELL</code>?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/119094/lucb/" rel="nofollow noreferrer">LucB</a> on 2022-10-25</strong>:<br /> cd ~ &amp;&amp; cat .bashrc | grep source</p> <pre><code># sources /etc/bash.bashrc). source /opt/ros/humble/setup.bash source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash source ~/workspace/ros_ur_driver/install/setup.bash source ~/ws_moveit2/install/setup.bash source ~/workspace/ros_tutorial/install/setup.bash source ~/workspace/ur_control/install/setup.bash </code></pre> <p>cd /etc &amp;&amp; cat bash.bashrc | grep source</p> <pre><code># this file has to be sourced in /etc/profile. </code></pre> <p>echo $SHELL</p> <pre><code>/bin/bash </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/120024/nils_iseke/" rel="nofollow noreferrer">nils_iseke</a> on 2022-10-26</strong>:<br /> I would just comment out all the sourcing lines, to see if they are part of the problem.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/119094/lucb/" rel="nofollow noreferrer">LucB</a> on 2022-10-29</strong>:<br /> Right now there is three times the <code>not found</code>. I commented out the last three sources</p> <pre><code>#source ~/ws_moveit2/install/setup.bash #source ~/workspace/ros_tutorial/install/setup.bash #source ~/workspace/ur_control/install/setup.bash </code></pre> <p>then the <code>not found</code> disappears. For each source one disappears.</p> <p>Is there a way the source them without executing the <code>&quot;/home/luca/workspace/test_ws/install/local_setup.bash&quot;</code>?</p>
not found: local_setup.bash
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>For future users, this issue can be easily resolved adding box in the urdf file . I used the following code</p> <pre><code>&lt;link name=&quot;ground_plane_box&quot;&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;1.0 1.0 0.5&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;Grey&quot;&gt; &lt;color rgba=&quot;0.7 0.7 0.7 1.0&quot;/&gt; &lt;/material&gt; &lt;/visual&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;1.0 1.0 0.5&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;ground_plane_box&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;world&quot; /&gt; &lt;child link=&quot;ground_plane_box&quot; /&gt; &lt;origin xyz=&quot;0 0 -0.25&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;/joint&gt; </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> with karma: 61 on 2022-10-26</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102608
2022-10-24T14:27:19.000
|ros|moveit|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am using xarm6 (<a href="https://github.com/xArm-Developer/xarm_ros/issues/129" rel="nofollow noreferrer">https://github.com/xArm-Developer/xarm_ros/issues/129</a>) when I am using moveit to plan a random path sometimes it reaches below the base (ground) and plans the path there, hence strikes the ground when execute on real robot. Please advice what should I do to avoid it ?</p> <hr /> <p><a href="https://answers.ros.org/question/408451/arm-striked-the-ground-while-using-moveit/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-10-24</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-10-25</strong>:<br /> Two questions:</p> <ol> <li>did you model &quot;the ground&quot;, or is your robot alone, floating in space, with no other geometry?</li> <li>did you plan to a random, <em>valid</em> joint pose, or just a random one?</li> </ol> <p><strong>Comment by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on 2022-10-25</strong>:\</p> <ol> <li>I am using the specified pakage of xarm to move the real arm, so I am not sure about the answer to your question, however in moveit it seems like it's fixed from the base.</li> <li>I did random valid.</li> </ol> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-10-25</strong>:\</p> <blockquote> <p>I am using the specified pakage of xarm to move the real arm, so I am not sure about the answer to your question, however in moveit it seems like it's fixed from the base.</p> </blockquote> <p>then the answer is most likely: &quot;no, there is no ground plane modelled&quot;.</p> <p>In that case MoveIt did exactly as I would expect: it doesn't know anything about your scene, so no &quot;ground&quot; or ground plane. It only knows about your robot, hanging there in completely empty space. It will assume it's free to move the robot through all that empty space. Including the space occupied by the ground or table your robot is standing on.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on 2022-10-25</strong>:<br /> Hi ! Thank you for your response, any suggestions in how can I fix it without creating a new moveit package?</p>
Arm striked the ground while using moveit
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It seems a bit complicated but I managed to instantiate <code>urdf::Model</code> by following the below steps:</p> <ol> <li><strong>Get the value of <code>robot_description</code> as string:</strong> This requires extra effort. Remember, ROS 2 does not have a centralized parameter server. So, getting a parameter from another node is tricky. You can read more about the procedure at <a href="https://answers.ros.org/question/340600/how-to-get-ros2-parameter-hosted-by-another-node/?answer=342528#post-id-342528" rel="nofollow noreferrer">this link</a>.</li> <li><strong>Use the string as input to build URDF model:</strong> We can use <code>initString()</code> method.</li> </ol> <h2>Code</h2> <pre><code>// license removed for brevity #include &lt;urdf/model.h&gt; #include &lt;chrono&gt; #include &lt;memory&gt; #include &lt;rclcpp/rclcpp.hpp&gt; using namespace std::chrono_literals; class MinimalPublisher : public rclcpp::Node { public: MinimalPublisher() : Node(&quot;minimal_publisher&quot;) { parameters_client_ = std::make_shared&lt;rclcpp::SyncParametersClient&gt;(this, &quot;/robot_state_publisher&quot;); while (!parameters_client_-&gt;wait_for_service(1s)) { if (!rclcpp::ok()) { RCLCPP_ERROR(this-&gt;get_logger(), &quot;Interrupted while waiting for the service. Exiting.&quot;); rclcpp::shutdown(); } RCLCPP_INFO(this-&gt;get_logger(), &quot;Service not available, waiting again...&quot;); } std::string urdf_string; auto parameters = parameters_client_-&gt;get_parameters({ &quot;robot_description&quot; }); for (auto&amp; parameter : parameters) { if (parameter.get_name() == &quot;robot_description&quot;) { urdf_string = parameter.value_to_string(); break; } } urdf::Model urdfModel; urdfModel.initString(urdf_string); RCLCPP_INFO_STREAM(this-&gt;get_logger(), &quot;Name:&quot; &lt;&lt; urdfModel.getName()); } private: std::shared_ptr&lt;rclcpp::SyncParametersClient&gt; parameters_client_; }; int main(int argc, char* argv[]) { rclcpp::init(argc, argv); rclcpp::spin(std::make_shared&lt;MinimalPublisher&gt;()); rclcpp::shutdown(); return 0; } </code></pre> <h2>Run</h2> <ol> <li><p>First, I published a URDF using <a href="https://docs.ros.org/en/foxy/Tutorials/Intermediate/URDF/Building-a-Visual-Robot-Model-with-URDF-from-Scratch.html" rel="nofollow noreferrer">urdf_tutorial</a>. Please see the command below:</p> <pre><code>ravi@dell:~$ ros2 launch urdf_tutorial display.launch.py model:=/opt/ros/foxy/share/urdf_tutorial/urdf/06-flexible.urdf </code></pre> </li> <li><p>Next, I confirmed that the <code>robot_description</code> is available as shown below:</p> <pre><code>ravi@dell:~$ ros2 param list /joint_state_publisher: delta publish_default_efforts publish_default_positions publish_default_velocities rate source_list use_mimic_tags use_sim_time use_smallest_joint_limits /robot_state_publisher: frame_prefix ignore_timestamp publish_frequency robot_description use_sim_time use_tf_static /rviz2: use_sim_time </code></pre> </li> <li><p>Finally, I executed my node which prints URDF model name</p> <pre><code>ravi@dell:~/ros2_ws$ ros2 run examples_rclcpp_minimal_publisher publisher_member_function Parsing robot urdf xml string. [INFO] [1666688084.856405837] [minimal_publisher]: Name:visual </code></pre> </li> <li><p>Just for sake of completeness, below is the robot name queried from the terminal:</p> <pre><code>ravi@dell:~$ ros2 param get /robot_state_publisher robot_description | grep robot &lt;robot name=&quot;visual&quot;&gt; &lt;/robot&gt; </code></pre> </li> </ol> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-10-25</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/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-25</strong>:<br /> Thank you so much for you time and help!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/40559/robotdreams/" rel="nofollow noreferrer">RobotDreams</a> on 2022-10-27</strong>:<br /> Is your example code on GitHub somewhere? I want to launch robot state and joint publishers on my robot (not on the Remote Desktop), passing path to the URDF file as a param to the launcher. It seems like your answer is needed for my situation.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-27</strong>:<br /> @RobotDreams: I am out of work now! Give me a day or two, I will upload the complete package to GitHub.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-28</strong>:<br /> @RobotDreams : Here you go: <a href="https://github.com/ravijo/minimal_publisher" rel="nofollow noreferrer">ravijo/minimal_publisher</a></p>
102610
2022-10-25T01:26:20.000
|ros2|urdf|
<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. In ROS 1 we can use this lines:</p> <pre><code>urdf::Model urdfModel; urdfModel.initParam(&quot;robot_description&quot;) </code></pre> <p>Is there a way to load robot URDF description from parameter in ROS 2 Foxy? I found <code>initXml()</code>, <code>initFile()</code> and <code>initString()</code> methods and that's all. Maybe I'm looking in the wrong place. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/408470/is-there-a-way-to-load-urdf-from-parameter-in-ros2?/" 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-10-25</p> <p>Post score: 0</p>
Is there a way to load urdf from parameter in ros2?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>so thankful for your answer.Actually I made a stupid mistake.I forgot to push that start button in Gazebo...anyway thank you for your answer again!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/121802/marvelousluke/" rel="nofollow noreferrer">marvelousluke</a> with karma: 20 on 2023-02-27</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102612
2022-10-25T04:33:09.000
|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am new to ROS and I am working on <a href="https://emanual.robotis.com/docs/en/platform/openmanipulator_x/overview/" rel="nofollow noreferrer">OpenMANIPULATOR-X</a>. Problems showed up as I try to use RViz. Error occurred to Robot Status showing <code>No tf from some link to some link</code>.</p> <p>I know <code>joint_state_publisher</code> should be responsible for this and as I tapped command <code>rostopic list</code>, the topic <code>joint_states</code> is listed. The same happens to the node <code>joint_state_publisher</code> when I gave the command <code>rosnode list</code>.</p> <p>However, when I input <code>rosrun tf view_frames</code>,I get a frame with only two links which indicates obviously that my <code>joint_state_publisher</code> is not working properly.</p> <p>So I am really in need of someone who can help with this issue.</p> <hr /> <p><a href="https://answers.ros.org/question/408482/no-tf-from-some-link-to-some-link/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121802/marvelousluke/" rel="nofollow noreferrer">marvelousluke</a> on ROS Answers with karma: 20 on 2022-10-25</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-26</strong>:\</p> <ol> <li>It would be more helpful to see the actual message instead of &quot;some link&quot; in <code>No tf from some link to some link</code>.</li> <li>Please edit your question and add a link to the repository you followed for the package installation.</li> </ol> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-10-27</strong>:<br /> Just a quick note: <code>joint_state_publisher</code> publishes <code>JointState</code> msgs, it does not broadcast TF transforms. That's <code>robot_state_publisher</code>'s job.</p> <p>And actually, if you have a &quot;robot driver&quot; node, I would not expect a <code>joint_state_publisher</code> instance in the node graph (unless it's used to combine different topics into a single one).</p>
No tf from some link to some link
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>There are a couple things which confuse me about your post:</p> <ol> <li>you don't say anything about the OS you're using (although it's likely a Debian/Ubuntu (derivative), because of the use of <code>apt</code>)</li> <li>you tagged this <code>noetic</code>, but then install <code>ros-geometry-msgs</code>, which is <strong>not</strong> a package in ROS Noetic (as that would be called <code>ros-noetic-geometry-msgs</code>)</li> <li>you show paths to <code>/usr</code>, which are not normally paths used by / present in ROS distribution packages</li> <li>you <em>also</em> show paths to <code>/opt/ros/noetic</code>, which is indeed where normal ROS Noetic package would end up</li> <li>you appear to be manually specifying absolute include paths using <code>add_compile_options(..)</code>. That's never really a good idea, but probably an attempt to get things working?</li> </ol> <p>All-in-all, it's a bit messy.</p> <p>Could it be you've (inadvertently) installed some <a href="http://wiki.ros.org/UpstreamPackages" rel="nofollow noreferrer">UpstreamPackages</a>?</p> <p>If so, and you did not intent to: I'd suggest removing them and installing their Noetic counterparts.</p> <p>If this is an OS that doesn't have binary packages of ROS Noetic and you used the upstream packages on purposes: don't mix-and-match. It doesn't work (reliably) as you've found out.</p> <p>Also: don't manually manipulate your <code>CMAKE_PREFIX_PATH</code>. If you find you have to do that, something else is not configured correctly. Manually changing it is not the solution.</p> <p>PS: and pedantic, but: &quot;<strong>CMake</strong> can't find geometry_msgs [..]&quot;, not &quot;Catkin can't find [..]&quot;. It's all CMake. This has nothing to do with Catkin.</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-10-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/101969/thealmightysand/" rel="nofollow noreferrer">TheAlmightySand</a> on 2022-10-25</strong>:<br /> The issue was the ros-geometry-msgs package. Uninstalling that and installing ros-<strong>noetic</strong>-geometry-msgs, like you said (and then adding it as a dependency in my package.xml) fixed the issue. Thank you!</p>
102614
2022-10-25T11:56:58.000
|catkin|geometry-msgs|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have run <code>sudo apt install -y ros-geometry-msgs</code>, but when I try to build my project with it, I get this error:</p> <pre><code>CMake Error at /opt/ros/noetic/share/genmsg/cmake/genmsg-extras.cmake:271 (message): Could not find 'share/geometry_msgs/cmake/geometry_msgs-msg-paths.cmake' (searched in '/home/tjpowell/Robot_files/RobotCodeRospy/test3/devel; /home/tjpowell/Robot_files/RobotCodeRoscpp/test3/devel;/opt/ros/noetic'). </code></pre> <p><code>echo $CMAKE_PREFIX_PATH</code>:</p> <pre><code>/home/tjpowell/Robot_files/RobotCodeRospy/test3/devel: /home/tjpowell/Robot_files/RobotCodeRoscpp/test3/devel: /opt/ros/noetic: /usr/share/geometry_msgs/cmake </code></pre> <p>When I print <code>$CMAKE_PREFIX_PATH</code> at the beginning of <code>CMakeLists.txt</code> using <code>cmake_print_variables</code>, it gives the above value as well, with <code>/usr/share/geometry_msgs/cmake</code>.</p> <p><code>ls /usr/share/geometry_msgs/cmake</code>:</p> <pre><code>geometry_msgs-msg-extras.cmake geometry_msgs-msg-paths.cmake geometry_msgsConfig-version.cmake geometry_msgsConfig.cmake </code></pre> <p><code>package.xml</code>:</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;package format=&quot;2&quot;&gt; &lt;name&gt;test3_abhi&lt;/name&gt; &lt;version&gt;0.0.0&lt;/version&gt; &lt;description&gt;The test3_abhi package&lt;/description&gt; &lt;buildtool_depend&gt;catkin&lt;/buildtool_depend&gt; &lt;build_depend&gt;roscpp&lt;/build_depend&gt; &lt;build_depend&gt;rospy&lt;/build_depend&gt; &lt;build_depend&gt;std_msgs&lt;/build_depend&gt; &lt;build_depend&gt;message_generation&lt;/build_depend&gt; &lt;build_export_depend&gt;message_runtime&lt;/build_export_depend&gt; &lt;build_export_depend&gt;roscpp&lt;/build_export_depend&gt; &lt;build_export_depend&gt;rospy&lt;/build_export_depend&gt; &lt;build_export_depend&gt;std_msgs&lt;/build_export_depend&gt; &lt;exec_depend&gt;roscpp&lt;/exec_depend&gt; &lt;exec_depend&gt;rospy&lt;/exec_depend&gt; &lt;exec_depend&gt;std_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;message_runtime&lt;/exec_depend&gt; &lt;export&gt; &lt;/export&gt; &lt;/package&gt; </code></pre> <p>My <code>CMakeLists.txt</code>:</p> <pre><code>cmake_minimum_required(VERSION 3.0.2) project(test3_abhi) include(CMakePrintHelpers) set (geometry_msgs_DIR &quot;/usr/share/geometry_msgs/cmake&quot;) cmake_print_variables(CMAKE_PREFIX_PATH) find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation geometry_msgs ) ## * add a build_depend add_service_files( FILES TSP.srv ) ## Generate added messages and services with any dependencies listed here generate_messages( DEPENDENCIES std_msgs geometry_msgs ) catkin_package( INCLUDE_DIRS include # LIBRARIES test3_abhi CATKIN_DEPENDS roscpp rospy std_msgs geometry_msgs message_runtime # DEPENDS system_lib ) include_directories( # include <span class="math-container">${catkin_INCLUDE_DIRS} ) set(CMAKE_EXE_LINKER_FLAGS $</span>{CMAKE_EXE_LINKER_FLAGS} &quot;-fopenmp&quot;) add_compile_options( -I/opt/ros/noetic/include -I/usr/local/include/dynamixel-sdk) add_executable(test3_printemo src/test3_printemo.cpp include/abhi.cpp) target_link_libraries(test3_printemo <span class="math-container">${catkin_LIBRARIES} #$</span>{OpenCV_LIBS} Qt5Widgets Qt5Gui Qt5Test Qt5Concurrent Qt5Core dxl_x64_cpp boost_system pcl_visualization pcl_common pthread phidget21 realsense2 hdf5_serial blas hdf5_serial_hl boost_filesystem boost_thread opencv_highgui opencv_ximgproc opencv_photo opencv_calib3d opencv_imgcodecs opencv_imgproc opencv_core) add_executable(tsp src/TSPSrv.cpp include/abhi.cpp) target_link_libraries(tsp <span class="math-container">${catkin_LIBRARIES} #$</span>{OpenCV_LIBS} Qt5Widgets Qt5Gui Qt5Test Qt5Concurrent Qt5Core dxl_x64_cpp boost_system pcl_visualization pcl_common pthread phidget21 realsense2 hdf5_serial blas hdf5_serial_hl boost_filesystem boost_thread opencv_highgui opencv_ximgproc opencv_photo opencv_calib3d opencv_imgcodecs opencv_imgproc opencv_core) </code></pre> <hr /> <p><a href="https://answers.ros.org/question/408502/catkin-can%27t-find-geometry_msgs-even-though-it%27s-on-cmake_prefix_path/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/101969/thealmightysand/" rel="nofollow noreferrer">TheAlmightySand</a> on ROS Answers with karma: 3 on 2022-10-25</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-26</strong>:<br /> @TheAlmightySand: Welcome to ROS Answers. You do not need to close your question upon receiving the answer. Instead, you upvote and click on the checkmark ✓ to accept the correct answer. You have already accepted the correct answer below. Therefore, please ignore my message. Just remember not to close your questions in the future.</p>
catkin can't find geometry_msgs even though it's on CMAKE_PREFIX_PATH
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The release of Foxy I was using had an out of date version of rcl_action (the release was using 1.1.11, current is 1.1.14). Upgrading the rcl/rcl_action package fixed the crash.</p> <p>The problem was better described in this issue: <a href="https://github.com/ros2/rcl/issues/926" rel="nofollow noreferrer">Expiring multiple action results causes crash · Issue #926 · ros2/rcl (github.com)</a></p> <p>And the solution was merged in this PR: <a href="https://github.com/ros2/rcl/pull/931" rel="nofollow noreferrer">fix expired goals capacity of action server by spiralray · Pull Request #931 · ros2/rcl (github.com)</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/121834/bchurch8/" rel="nofollow noreferrer">bchurch8</a> with karma: 16 on 2022-10-26</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102616
2022-10-25T14:38:36.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Running Foxy in C++ on Windows 10.</p> <p>I have an app that creates a simulated UR5 robotic arm and can move this arm around based on user input. The movement planning and execution is all handled by a moveit_cpp instance. The app can be set up to continuously run a series of arm movements, cycling through a series of positions.</p> <p>When the app is set up to move continuously, it will work as expected at first, but after 15 minutes of continuous running the following crash occurs at the end of ServerBase::execute_check_expired_goals() of rclcpp_action/server.cpp:</p> <p>Unhandled exception at 0x00007FFDF9E12449 (rclcpp_action.dll) in test_main.exe: Stack cookie instrumentation code detected a stack-based buffer overrun</p> <p>The only action present is a joint_trajectory_controller/follow_joint_trajectory action, with one server (joint_trajectory_controller) and one client (moveit_simple_controller_manager). It is this action that controls the actual movement of the robot.</p> <p>The crash also happens right around 15 minutes regardless of the frequency of movements. I'm not sure if this is a joint_trajectory_controller issue or a problem with rclcpp_action, but any help would be greatly appreciated.</p> <hr /> <p><a href="https://answers.ros.org/question/408509/rclcpp-action-server-stack-overrun-crash---ros2-foxy/" 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-10-25</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/120024/nils_iseke/" rel="nofollow noreferrer">nils_iseke</a> on 2022-10-26</strong>:<br /> Could you provide a minimal working example, so that one could reproduce your error? That would help to try to solve your issue.</p>
RCLCPP Action Server Stack Overrun Crash - ROS2 Foxy
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You would use <code>PoseWithCovarianceStamped</code>.</p> <p>This is a similar discussion as with <code>Point2D</code> (which doesn't exist) vs <code>Pose2D</code> (which is depecated) vs <code>Pose</code>.</p> <p>You could choose to either leave the orientation <code>0</code>, or set a standard &quot;up&quot; quaternion (or &quot;down&quot;) or whatever makes sense in your case. Just make sure to make it a valid quaternion (so don't leave <code>w==0</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-10-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/39714/somebody-un/" rel="nofollow noreferrer">somebody un</a> on 2022-10-26</strong>:<br /> In this case, I don't like the idea that the <code>PoseWithCovarianceStamped</code> then carries a mathematically valid quaternion message that could be interpreted as being a true sensor reading.</p> <p>Should one use a sentinel value in the covariance matrix to indicate the data is meaningless, the way the <a href="https://docs.ros2.org/foxy/api/sensor_msgs/msg/Imu.html" rel="nofollow noreferrer">Imu message</a> does?</p> <p>Something like setting the covariance matrix to:</p> <p>[</p> <pre><code>1e-6 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-6, 0.0, 0.0, 0.0, o.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, </code></pre> <p>]</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-10-26</strong>:<br /> There is already a convention to set the first element of covariance to -1 if covariance is unknown. However, in general this does NOT get interpreted as orientation itself being &quot;unknown&quot;. As @gvdhoorn suggests, just set the orientation to identity if you don't need that field today.</p>
102618
2022-10-25T17:58:12.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have a sensor that measures a 3D translation between two frames, and it has some measurement uncertainty. I'd like to represent this with a ROS message, which I expected to exist in the form of <code>PointWithCovarianceStamped</code>.</p> <p>Its minimal effort to define such a custom message myself. I could also use <code>PoseWithCovarianceStamped</code>, however my sensor doesn't provide any orientation data.</p> <p>I'm asking whether the smart people who use ROS have an existing standard approach for handling this that I'm not aware of. Having a point measurement with uncertainty and without orientation data seems like a common enough situation that it would be in the standard set of ROS packages.</p> <hr /> <p><a href="https://answers.ros.org/question/408512/point-with-covariance/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/39714/somebody-un/" rel="nofollow noreferrer">somebody un</a> on ROS Answers with karma: 5 on 2022-10-25</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-10-26</strong>:\</p> <blockquote> <p>I'm asking whether the smart people who use ROS have an existing standard approach for handling this that I'm not aware of.</p> </blockquote> <p>probably not your intention, but &quot;the smart people who use ROS&quot; almost reads like it has a sarcastic tone to it.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/39714/somebody-un/" rel="nofollow noreferrer">somebody un</a> on 2022-10-26</strong>:<br /> Correct, not my intention. I'm asking because as I learn ROS, I very frequently encounter a builtin solution to a problem I thought I had to solve myself (example: the abundance of features in launch files &amp; node lifecycles)</p> <p><strong>Comment by <a href="https://answers.ros.org/users/39714/somebody-un/" rel="nofollow noreferrer">somebody un</a> on 2022-10-26</strong>:<br /> Its impressive and I want to become aware of as many of these features &amp; best practices as I can :)</p>
Point With Covariance
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Maybe you can get your anwser by reading through the <a href="https://april.eecs.umich.edu/media/pdfs/olson2011tags.pdf" rel="nofollow noreferrer">paper</a>, where the implementation is explained. Maybe one explanation is, that during the quad detection process only close enough lines are considered.</p> <blockquote> <p>Robustness to occlusions and segmentation errors is handled by adjusting the “close enough” threshold: by making the threshold large, significant gaps around the edges can be handled. Our threshold for “close enough” is twice the length of the line plus five additional pixels. This is a large threshold which leads to a low false negative rate, but also results in a high false positive rate.</p> </blockquote> <p>That would explain why reducing the resolution helps detecting the closer tag.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/120024/nils_iseke/" rel="nofollow noreferrer">nils_iseke</a> with karma: 76 on 2022-10-26</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102620
2022-10-26T03:48:43.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I can detect AprilTags that are &quot;far&quot; from the camera, ie. small on the image and even a little blur, but the detection fails when the tags are close to the camera and when the image is clean and neat, what is counter-intuitive.</p> <p>Is this expected ? How can I detect the tags at all scales ?</p> <p>NB1: Interestingly, if I increase the &quot;quad-decimate&quot; param form default 1.0 to e.g. 16.0 (to reduce the image resolution), I can detect the &quot;close&quot; tag but not the &quot;far&quot; one (seems logical to not detect the small).</p> <p>NB2: I use the VISP C++ lib directly, not the ROS apriltag packages, and images with 640x360 images</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16667740963253386.png" alt="image description" /></p> <hr /> <p><a href="https://answers.ros.org/question/408533/apriltags-not-detected-when-close-to-camera/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/71833/patoinso/" rel="nofollow noreferrer">PatoInso</a> on ROS Answers with karma: 109 on 2022-10-26</p> <p>Post score: 0</p>
AprilTags not detected when close to camera
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>No, you can not. Both ros1 and ros2 use publish/subscribe style for topics.</p> <p>However, you could easily mimic what you are asking for by using the subscribe callback to save the message in a variable (using an appropriate mutex if needed.) Then your code can &quot;read&quot; this variable any time you want to.</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-10-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/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-10-27</strong>:<br /> What about <code>wait_for_message(..)</code>?</p> <p>That exists in both ROS 1 and ROS 2.</p> <p>Technically, it still creates a subscription and just waits for a single msg, so conceptually that's no different from creating your own subscription, but it's essentially what the OP asks for.</p> <p>See #q270298 and #q292582 for previous Q&amp;As about this.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-10-27</strong>:<br /> @gvdhoorn That would be quite inefficient for repeat use; it <em>still</em> uses a standard subscribe callback, and each &quot;read&quot; would take much longer as the ros node now has to communicate with the master plus has to wait for the next message to arrive.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-10-27</strong>:<br /> For everything more than incidental use I would not recommend using it no. But that's also not the intended use-case. It's intended for things like capturing a single message from a topic in a service or action callback, or for initialising a &quot;current state&quot; kind of thing.</p> <p><a href="https://index.ros.org/p/message_filters/" rel="nofollow noreferrer">message_filters/Cache</a> would be something you'd use to implement a proper version of &quot;save the message in a variable [..] and read this [..] any time you want to&quot;.</p>
102622
2022-10-26T09:58:50.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>Currently, if a topic is published, in order to listen to the message, I create a subscriber and a callback function which gets called whenever there is a new message on the topic. Instead of this approach, is it possible to read data from a topic only when I want to? Or to call a function which can read data from topic only when I want it?</p> <p>Thanks, Dev</p> <hr /> <p><a href="https://answers.ros.org/question/408562/read-data-from-ros2-topic-when-i-want-to-instead-of-callback/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/107873/dvy/" rel="nofollow noreferrer">dvy</a> on ROS Answers with karma: 52 on 2022-10-26</p> <p>Post score: 0</p>
Read data from ROS2 topic when I want to instead of callback
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>Is there a way to check for a file with specific name with ros?</p> </blockquote> <p>No, this is standard functionality (of the programming language you are using) and is not part of ROS.</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-10-27</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/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-27</strong>:<br /> Thank you for your answer.</p>
102624
2022-10-27T01:21:06.000
|ros|
<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 node that writes data in file and name of that file is &quot;pose.csv&quot;. I need to make sure that every time I start that node it writes data in new file, so result is should be like then I start node first time it loads data in file &quot;pose_1.csv&quot;, than I started it second time the file should be &quot;pose2.csv&quot;. Is there a way to achieve this using ros. As far as I know there is no way to check, how many times node has been run, but I could be wrong. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/408587/is-there-a-way-to-check-for-a-file-with-specific-name-with-ros?/" 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-10-27</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-10-27</strong>:<br /> I am sorry, but this is unrelated to ROS.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-10-27</strong>:<br /> Thank you for your reply. I understang</p>
Is there a way to check for a file with specific name with ros?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I resolved this issue, I created a python script that will listen to the tf values and publish it to a topic and then subscribe it to move the robot. Example Code</p> <pre><code>listener.waitForTransform(&quot;/turtle2&quot;, &quot;/carrot1&quot;, rospy.Time(), rospy.Duration(4.0)) while not rospy.is_shutdown(): try: now = rospy.Time.now() listener.waitForTransform(&quot;/turtle2&quot;, &quot;/carrot1&quot;, now, rospy.Duration(4.0)) (trans,rot) = listener.lookupTransform(&quot;/turtle2&quot;, &quot;/carrot1&quot;, now) </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> with karma: 61 on 2022-10-28</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102626
2022-10-27T13:36:16.000
|ros|moveit|transform|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want the robot arm to move by detecting the Aruco marker using camera on base. I am using the code below to get translation and rotation between base and the marker, however the condition t.frameExists('marker') is coming false and hence not going into the if loop. Any help would be appreciated. Link to tf graph <a href="https://drive.google.com/file/d/1PRsbMjhfVs6Pw6zeK7N4jQNUpgZB-gm-/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1PRsbMjhfVs6Pw6zeK7N4jQNUpgZB-gm-/view?usp=sharing</a></p> <pre><code> t = TransformListener() a = True if t.frameExists('link_base') and t.frameExists('marker'): # lookupTransform(target_frame, source_frame, time) -&gt; (position, quaternion) (translation,rotation) = t.lookupTransform(&quot;marker&quot;,&quot;link_base&quot;,rospy.Time.now()) </code></pre> <p>below is the frame list</p> <pre><code>The current list of frames is: Frame ground_plane_box exists with parent world. Frame link_eef exists with parent link6. Frame link6 exists with parent link5. Frame link_base exists with parent world. Frame camera_color_optical_frame exists with parent link_base. Frame marker exists with parent camera_color_optical_frame. Frame link1 exists with parent link_base. Frame link2 exists with parent link1. Frame link3 exists with parent link2. Frame link4 exists with parent link3. Frame link5 exists with parent link4. </code></pre> <p>when I am doing</p> <pre><code>rosrun tf tf_echo marker camera_color_optical_frame At time 1666896640.814 - Translation: [-0.145, -0.319, 1.223] - Rotation: in Quaternion [0.979, 0.020, -0.026, -0.203] in RPY (radian) [-2.731, 0.043, 0.050] in RPY (degree) [-156.483, 2.442, 2.850] </code></pre> <p>When I am using the following code to just get into the if loop</p> <pre><code>if t.frameExists('link_base') and t.frameExists('camera_color_optical_frame'): # lookupTransform(target_frame, source_frame, time) -&gt; (position, quaternion) (translation,rotation) = t.lookupTransform(&quot;marker&quot;,&quot;link_base&quot;,rospy.Time.now()) </code></pre> <p>Getting the following error</p> <p>[ERROR] [1666898116.171309]: bad callback: &lt;function callback at 0x7fab3d66e430&gt; Traceback (most recent call last): File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py&quot;, line 750, in _invoke_callback cb(msg) File &quot;/home/akumar/catkin_ws/src/xarm_ros/move_xarm/scripts/subscriber.py&quot;, line 68, in callback (translation,rotation) = t.lookupTransform(&quot;marker&quot;,&quot;link_base&quot;,rospy.Time.now()) File &quot;/opt/ros/noetic/lib/python3/dist-packages/tf/listener.py&quot;, line 104, in lookupTransform msg = self._buffer.lookup_transform(strip_leading_slash(target_frame), strip_leading_slash(source_frame), time) File &quot;/opt/ros/noetic/lib/python3/dist-packages/tf2_ros/buffer.py&quot;, line 86, in lookup_transform return self.lookup_transform_core(target_frame, source_frame, time) tf2.LookupException: &quot;marker&quot; passed to lookupTransform argument target_frame does not exist.</p> <hr /> <p><a href="https://answers.ros.org/question/408634/not-able-to-find-transformlistener.frameexists(%27marker%27)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-10-27</p> <p>Post score: 0</p>
Not able to find TransformListener.frameExists('marker')
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I think you should just be able to do the method you mentioned and produce a new publisher by instantiating it the same way you made the first map publisher,</p> <pre><code> self.new_pcl_publisher = rospy.Publisher('/map2', PointCloud2, latch=True, queue_size=1000) </code></pre> <p>And from there you can publish to this one and subscribe to it</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/121966/wyatt/" rel="nofollow noreferrer">wyatt</a> with karma: 26 on 2022-10-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/110678/hunterlineage1/" rel="nofollow noreferrer">hunterlineage1</a> on 2022-10-28</strong>:<br /> Thank you for your help. Suppose I publish this /map2 topic, will I be able to view it in RViz?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-10-29</strong>:<br /> @hunterlineage1 Yes, you can view messages from the new topic in rviz. In the left panel of rviz, expand the plugin that is displaying the pointcloud (or create one), then assign the ros topic you want that particular plugin to display from the pull-down list.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/110678/hunterlineage1/" rel="nofollow noreferrer">hunterlineage1</a> on 2022-10-29</strong>:<br /> Thank you!</p>
102628
2022-10-27T14:01:22.000
|navigation|mapping|rviz|topic|publisher|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>My goal is to process a PointCloud2 and visualize it in RViz. I have rosbag data collected. This rosbag file includes /map, /tf, /ssl_slam/trajectory topics. The /map topic is in the form of sensor_msgs/PointCloud2 messages. In the single ros node I want to: 1) Read the incoming pointcloud2 messages (from /map topic) and perform point cloud processing, 2) publish back to the same /map topic. Essentially I am trying to modify data on a topic and republish it on the same topic (/map).</p> <p>I looked at several pages explaining how to construct a publisher and subscriber in the same ros node, but I understand that if subscribe and publish to the same topic, you will get an endless loop because the callback function triggers itself by publishing. I also understand that I need to create a different topic for the outgoing data and map this outgoing data to the different topic (i.e. not the same /map topic), but I am clueless on how to go about doing this. I need to be able to visualize the pointcloud2 messages from the different topic (which I have not created yet) in RViz. This will be my 'processed' pointcloud. Please help. Here is what I have currently:</p> <pre><code>import pdb import rospy from roslib import message import math import numpy as np import sensor_msgs.point_cloud2 as pc2 from sensor_msgs.msg import PointCloud2, PointField from std_msgs.msg import Header from ros_numpy.point_cloud2 import pointcloud2_to_array, array_to_pointcloud2, split_rgb_field, merge_rgb_fields class PCLprocessor(object): def __init__(self): self.lastpcl_data = 0 rospy.init_node('pclprocessor') self.pclpublisher = rospy.Publisher('/map', PointCloud2, latch=True, queue_size=1000) rospy.Subscriber('/map', PointCloud2, self.pcl_callback) rospy.spin() def pcl_callback(self, pcl2data): self.pcl_data = pcl2data pdb.set_trace() self.pcl2_array = pointcloud2_to_array(self.pcl_data) self.pcl2_array = split_rgb_field(self.pcl2_array) print('pcl2 array shape BEFORE color separation: ', self.pcl2_array.shape) self.maskint1 = (self.pcl2_array['r'] &lt;= 190) self.maskint2 = (self.pcl2_array['g'] &lt;= 190) self.maskint3 = (self.pcl2_array['b'] &gt;= 140) self.pcl2_array = self.pcl2_array[np.logical_not( np.logical_and(self.maskint1, self.maskint2, self.maskint3))] self.pcl2_array = merge_rgb_fields(self.pcl2_array) print('pcl2 array shape AFTER color separation: ', self.pcl2_array.shape) self.lastpcl_data = array_to_pointcloud2(self.pcl2_array) print('CHECKPOINT ****1') def run(self): print(&quot;CHECKPOINT: def run(self)&quot;) r = rospy.Rate(10) while not rospy.is_shutdown(): self.pclpublisher.publish(self.lastpcl_data) print(&quot;CHECKPOINT: after publishing self.lastpcldata&quot;) r.sleep(0.5) if __name__ == '__main__': PCLprocessor() </code></pre> <hr /> <p><a href="https://answers.ros.org/question/408635/subscribing-and-publishing-to-the-same-topic-(/map)-in-a-single-python-ros-node/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110678/hunterlineage1/" rel="nofollow noreferrer">hunterlineage1</a> on ROS Answers with karma: 24 on 2022-10-27</p> <p>Post score: 0</p>
Subscribing and publishing to the same topic (/map) in a single python ros node
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>you probably need to fill the <code>header</code> field on the <code>lastpcl_data</code> PointCloud2 message. As the <a href="http://docs.ros.org/en/indigo/api/ros_numpy/html/namespaceros__numpy_1_1point__cloud2.html" rel="nofollow noreferrer">array_to_pointcloud docs</a> state you can pass the stamp and frame id to the function, you can use the same data in the messages on the map topic:</p> <pre><code>lastpcl_data = array_to_pointcloud2(pcl2_array, stamp=pcl2data.header.stamp, frame_id=pcl2data.header.frame_id) </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/66603/pepis/" rel="nofollow noreferrer">Pepis</a> with karma: 130 on 2022-10-27</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/110678/hunterlineage1/" rel="nofollow noreferrer">hunterlineage1</a> on 2022-10-28</strong>:<br /> @Pepis Thank you so much for your help -- it worked instantly. Hats off to you!</p>
102630
2022-10-27T15:55:36.000
|navigation|mapping|rviz|topic|publisher|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am trying to process a pointcloud2 being generated by the /map topic, which I play from a rosbag file containing the topics /tf, /map, /ssl_slam/trajectory topics. By process, I mean I want to remove some points in the pointcloud2 which do not satisfy a certain RGB range. I was able to find the points in the pointcloud2 that do not satisfy my RGB range condition and I tried publishing them to a different topic which I named '/map2'.</p> <p>However, when I try to publish the new pointcloud2 to /map2, and try to visualize it in RViz, I get the following error: <strong>Invalid argument passed to canTransform argument source_frame in tf2 frame_ids cannot be empty</strong>. I checked my RViz displays and the original pointcloud2, coming from the /map topic, gets published and visualized correctly, but the /map2 topic's pointcloud2 does not appear in my window and I get the following error when I click on the PointCloud2 Status: <strong>Transform [sender=unknown_publisher] For frame []: Frame [] does not exist</strong></p> <p>My goal: <strong>(1) Subscribe to /map topic to obtain original pointcloud2 data -&gt; (2) 'Process' the pointcloud2, i.e. by removing points which do not satisfy a certain condition; -&gt; (3) publish this pointcloud2 data to another topic /map2 -&gt; (4) be able to visualize the pointcloud2's from /map and /map2 topics in rviz.</strong></p> <p>How do I make my processed pointcloud2, the one that I am publishing to /map2 topic, have the same tf as the original pointcloud2 from the /map topic, so that I can visualize both pointcloud2's in rviz? I looked at <a href="https://answers.ros.org/question/268641/how-to-transform-pointcloud2-with-tf/" rel="nofollow noreferrer">how to Transform Pointcloud2 with tf</a> and <a href="https://answers.ros.org/question/225056/navigation-stack-invalid-argument-passed-to-cantransform-argument-source_frame-in-tf2-frame_ids-cannot-be-empty/" rel="nofollow noreferrer">Invalid argument passed to canTransform argument ... tf2 frame_ids cannot be empty</a> and I am struggling. Please please help, here is my code.</p> <pre><code>import pdb import rospy from roslib import message import math import numpy as np import sensor_msgs.point_cloud2 as pc2 from sensor_msgs.msg import PointCloud2, PointField from std_msgs.msg import Header from ros_numpy.point_cloud2 import pointcloud2_to_array, array_to_pointcloud2, split_rgb_field, merge_rgb_fields lastpcl_data = &quot;&quot; started = False pclpublisher = rospy.Publisher('/map2', PointCloud2, latch=True, queue_size=1000) def pcl_callback(pcl2data): print(&quot;New message received&quot;, &quot;\n&quot;) global started, lastpcl_data pcl_data = pcl2data # &lt;class 'sensor_msgs.msg._PointCloud2.PointCloud2'&gt; pcl2_array = pointcloud2_to_array(pcl_data) pcl2_array = split_rgb_field(pcl2_array) print('pcl2 array shape BEFORE color separation: ', pcl2_array.shape) maskint1 = (pcl2_array['r'] &lt;= 190) maskint2 = (pcl2_array['g'] &lt;= 190) maskint3 = (pcl2_array['b'] &gt;= 140) pcl2_array = pcl2_array[np.logical_not( np.logical_and(maskint1,maskint2,maskint3))] pcl2_array = merge_rgb_fields(pcl2_array) print('pcl2 array shape AFTER color separation: ', pcl2_array.shape) lastpcl_data = array_to_pointcloud2(pcl2_array) # &lt;class 'sensor_msgs.msg._PointCloud2.PointCloud2'&gt; print('CHECKPOINT ****1') if (not started): started = True def timer_callback(event): global started, pclpublisher, lastpcl_data if (started): pclpublisher.publish(lastpcl_data) print(&quot;Last message published&quot;, &quot;\n&quot;) def pcl_processor(): rospy.init_node('pclprocessor') rospy.Subscriber('/map', PointCloud2, pcl_callback) timer = rospy.Timer(rospy.Duration(0.5), timer_callback) rospy.spin() timer.shutdown() if __name__ == '__main__': print(&quot;Running&quot;) pcl_processor() </code></pre> <hr /> <p><a href="https://answers.ros.org/question/408640/processing-pointcloud2-using-ros-node-with-both-publisher-and-subscriber/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110678/hunterlineage1/" rel="nofollow noreferrer">hunterlineage1</a> on ROS Answers with karma: 24 on 2022-10-27</p> <p>Post score: 0</p>
Processing pointcloud2 using ros node with both publisher and subscriber
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Ok, so it was a dumb mistake after all and had nothing to do with the IK solver.... The eef link was wrong: when the two planning groups were joined in the new 'robot' one, moveit took the wrong eef link. By setting the correct one within the code, the issue was solved. Thanks!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/40739/sophvk/" rel="nofollow noreferrer">sophvk</a> with karma: 16 on 2022-11-03</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/8631/fvd/" rel="nofollow noreferrer">fvd</a> on 2022-11-05</strong>:<br /> It might be helpful if you could share your configuration (or the lines that would have helped you) as an example</p> <p><strong>Comment by <a href="https://answers.ros.org/users/40739/sophvk/" rel="nofollow noreferrer">sophvk</a> on 2023-01-25</strong>:<br /> Sure thing. I added a line to set the end effector to the desired link:</p> <pre><code>move_group.setEndEffectorLink(&quot;eef_link&quot;); </code></pre> <p>In this occasion, that was all.</p>
102632
2022-10-28T10:54:35.000
|ros|moveit|universal-robots|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello!</p> <p>I have a universal robot that I want to control with moveit, but I have added a custon actuator near the eef, that also needs a goal in order to make the TCP get to the requested positions.</p> <p>I did the following:</p> <ul> <li><p>Created a Planning group only for the Universal Robots arm, with the 'scaled_pos_joint_traj_controller'</p> </li> <li><p>Created a different planning group for the other actuator (called &quot;reaction arm&quot;), with a custom FollowJointTrajectory controller</p> </li> <li><p>Created a 'robot' planning group, joining both planning groups. This is the one I aim to control using moveit.</p> </li> </ul> <p>If I send a group of joint values (7 values = 6 of the arm + the custom actuator) to the moevit commander server, everything works fine. I get the request to move both arm and reaction arm actuator, and both move without any issues.</p> <p><strong>However</strong>, when sending a position in space (x, y, z, qx, qy, qz, qw) it doesn't move and the following gets printed on the console:</p> <pre><code> [ INFO] [1666971418.092952411]: Ready to take commands for planning group robot. [ INFO] [1666971418.391112115]: Planning request received for MoveGroup action. Forwarding to planning pipeline. [ WARN] [1666971418.392079703]: Cannot find planning configuration for group 'robot' using planner 'RRTConnectkConfigDefault'. Will use defaults instead. [ INFO] [1666971418.400985505]: Planner configuration 'robot' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed. [ INFO] [1666971418.402447013]: robot/robot: Starting planning with 1 states already in datastructure [ INFO] [1666971418.402565255]: robot/robot: Starting planning with 1 states already in datastructure [ INFO] [1666971418.402650253]: robot/robot: Starting planning with 1 states already in datastructure [ INFO] [1666971418.402705428]: robot/robot: Starting planning with 1 states already in datastructure [ERROR] [1666971428.401849115]: robot/robot: Unable to sample any valid states for goal tree [ INFO] [1666971428.402132673]: robot/robot: Created 1 states (1 start + 0 goal) [ERROR] [1666971428.405928852]: robot/robot: Unable to sample any valid states for goal tree [ INFO] [1666971428.406043602]: robot/robot: Created 1 states (1 start + 0 goal) [ERROR] [1666971428.410176418]: robot/robot: Unable to sample any valid states for goal tree [ INFO] [1666971428.410264698]: robot/robot: Created 1 states (1 start + 0 goal) [ERROR] [1666971428.411304502]: robot/robot: Unable to sample any valid states for goal tree [ INFO] [1666971428.411387055]: robot/robot: Created 1 states (1 start + 0 goal) [ WARN] [1666971428.411545666]: ParallelPlan::solve(): Unable to find solution by any of the threads in 10.010131 seconds [ INFO] [1666971428.566960910]: Unable to solve the planning problem [ WARN] [1666971428.567648014]: Fail: ABORTED: No motion plan found. No execution attempted. [ INFO] [1666971428.567749494]: Visualizing plan 2 (Pose Goal) FAILED [ERROR] [1666971428.690040606]: Failed to call srv: Moveit commander </code></pre> <p>I don't know if there's something I can configure differently but it's weird to me that planning with joint values work, while commanding to a certain position doesn't. Shouldn't it be similar? Is it the IK solver the problem here?</p> <p>I hope someone has anything to share with me in order to solve the issue, and if more information is needed, please let me know.</p> <p>Thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/408682/moveit-with-two-planning-groups/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/40739/sophvk/" rel="nofollow noreferrer">sophvk</a> on ROS Answers with karma: 16 on 2022-10-28</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-10-29</strong>:\</p> <blockquote> <p>Is it the IK solver the problem here?</p> </blockquote> <p>likely. You typically see &quot;Unable to sample any valid states for goal tree&quot; if that's the case.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/40739/sophvk/" rel="nofollow noreferrer">sophvk</a> on 2022-11-02</strong>:<br /> Any ideas on what I could try to make it move? I find it weird that when I command the robot to a joint based position it moves. It's only with position based commands that it doesn't.</p>
Moveit with two planning groups
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You can certainly combine maps using Bayes methods if they are transformed into OccupancyGrid maps, here is an example package:</p> <ul> <li><a href="https://github.com/Nightbot1448/TBMMapMerging" rel="nofollow noreferrer">https://github.com/Nightbot1448/TBMMapMerging</a></li> </ul> <p>and a paper &quot;Occupancy Grid Map Merging for Multiple Robot Simultaneous Localization and Mapping&quot;:</p> <ul> <li><a href="https://www.sajad-saeedi.ca/uploads/3/8/5/9/38597021/saeedi_ijra_2015.pdf" rel="nofollow noreferrer">https://www.sajad-saeedi.ca/uploads/3/8/5/9/38597021/saeedi_ijra_2015.pdf</a></li> </ul> <p>Some software helps with working with different sensor maps, e.g.</p> <ul> <li><p><a href="https://github.com/awesomebytes/occupancy_grid_python" rel="nofollow noreferrer">https://github.com/awesomebytes/occupancy_grid_python</a></p> </li> <li><p><a href="https://github.com/ANYbotics/grid_map" rel="nofollow noreferrer">https://github.com/ANYbotics/grid_map</a></p> </li> </ul> <p>Could you please link the paper you read? Then we could maybe help you more.</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-10-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/117137/wugeshenhuaking/" rel="nofollow noreferrer">wugeshenhuaking</a> on 2022-10-30</strong>:<br /> @ljaniec The article I read is here <a href="https://iopscience.iop.org/article/10.1088/1742-6596/2203/1/012029/pdf" rel="nofollow noreferrer">https://iopscience.iop.org/article/10.1088/1742-6596/2203/1/012029/pdf</a> chapter 4.3</p>
102634
2022-10-29T07:41:36.000
|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I saw in the paper that the Bayesian filtering method can be used to fuse the two maps. For example, I used a depth camera and a lidar to build their own maps. I don't quite understand how Bayesian filters fuse maps, because I only know that Bayesian filters can be used to estimate the pose of robots.</p> <hr /> <p><a href="https://answers.ros.org/question/408706/how-to-fuse-maps-constructed-by-two-different-sensors%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-10-29</p> <p>Post score: 0</p>
How to fuse maps constructed by two different sensors?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Its the cost value if you don't know what's in a given occupancy cell. If you have a static map, that could be unexplored regions. If its in a local costmap without a static map, it would be area that haven't been covered by any sensor data yet so you don't know anything about it yet. So this is the cost of unknown space. The value of 255 (or -1) is special so that algorithms know that's unknown space and can act accordingly. But you can override this so that unknown space is always treated as free (if set to 0) or occupied (if set to 254) or anything in-between to your heart's desire.</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-10-31</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102636
2022-10-29T13:05:07.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>So i am trying to set the parameters for costmap but i dont know why this paramter is set to -1 neither what options do i have if i need to change it</p> <p>Also could someone explain to me what this parameter exactly does cause i am not sure ??</p> <p>Thank you in advance ! &lt;3</p> <hr /> <p><a href="https://answers.ros.org/question/408712/(unknown_cost_value)--in-costmap2d/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/108968/kostas-tzias/" rel="nofollow noreferrer">Kostas Tzias</a> on ROS Answers with karma: 9 on 2022-10-29</p> <p>Post score: 0</p>
(unknown_cost_value) in costmap2D
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>The following line of code:</p> <pre><code>RCCHECK(rclc_publisher_init_default(&amp;publisher_range, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(sesnsor_msgs, msg, Range), &quot;micro_ros_platformio_node_publisher_range&quot;)); </code></pre> <p>generates this error when compiling:</p> <pre><code>[..] error: 'rosidl_typesupport_c__get_message_type_support_handle__sesnsor_msgs__msg__Range' was not declared in this scope </code></pre> </blockquote> <p>isn't this just a typo?</p> <p>You have <code>sesnsor_msgs</code> (note the extra <code>s</code>).</p> <p>The correct name of the package would be <code>sensor_msgs</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-10-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/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> on 2022-10-31</strong>:<br /> Of course you're right @gvdhoorn I have been staring at the screen for too long. The number of &quot;speeling&quot; mistakes my acute keyboard dyslexia causes, I should know better to check twice. Apologies for wasting your time :-) I hardly doubt it took you more than 5s, but still..</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2022-10-31</strong>:<br /> You don't need to apologise for anything, and no time was wasted. Happens to all of us.</p>
102638
2022-10-29T15:32:31.000
|ros|ros2|embedded|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all, I'm getting myself into troubles again and would kindly ask for some insight into where I'm messing up.</p> <p>I have been trying to add a simple publisher for the TFMini_Plus sensor data on my teensy 4.1 Using micro-ROS and platformIO on Ubuntu 22.04.1</p> <p>The following line of code:</p> <pre><code>RCCHECK(rclc_publisher_init_default(&amp;publisher_range, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(sesnsor_msgs, msg, Range), &quot;micro_ros_platformio_node_publisher_range&quot;)); </code></pre> <p>generates this error when compiling:</p> <pre><code>src/main.cpp: In function 'void setup()': .pio/libdeps/teensy41/micro_ros_platformio/libmicroros/include/rosidl_runtime_c/message_type_support_struct.h:78:59: error: 'rosidl_typesupport_c__get_message_type_support_handle__sesnsor_msgs__msg__Range' was not declared in this scope rosidl_typesupport_c, PkgName, MsgSubfolder, MsgName)() ^ src/main.cpp:107:43: note: in definition of macro 'RCCHECK' #define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}} ^ src/main.cpp:330:64: note: in expansion of macro 'ROSIDL_GET_MSG_TYPE_SUPPORT' RCCHECK(rclc_publisher_init_default(&amp;publisher_range, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(sesnsor_msgs, msg, Range), &quot;micro_ros_platformio_node_publisher_range&quot;)); </code></pre> <p>upon checking the .pio directory structure, I can clearly identify the appropriate directories and files, just as with all other message types.</p> <p>Here a partial of the directory structure of .pio</p> <pre><code>.pio ├── bin └── libdeps └── teensy41 └── micro_ros_platformio ├── libmicroros │   ├── include │   │   ├── sensor_msgs │   │   │   ├── msg │   │   │   │   ├── battery_state.h │   │   │   │   ├── camera_info.h │   │   │   │   ├── channel_float32.h │   │   │   │   ├── compressed_image.h │   │   │   │   ├── detail │   │   │   │   │   ├── battery_state__functions.c │   │   │   │   │   ├── battery_state__functions.h │   │   │   │   │   ├── ... │   │   │   │   │   ├── range__functions.c │   │   │   │   │   ├── range__functions.h │   │   │   │   │   ├── range__rosidl_typesupport_introspection_c.h │   │   │   │   │   ├── range__rosidl_typesupport_microxrcedds_c.h │   │   │   │   │   ├── range__struct.h │   │   │   │   │   ├── range__type_support.c │   │   │   │   │   ├── range__type_support.h │   │   │   │   │   ├── region_of_interest__functions.c │   │   │   │   │   ├── region_of_interest__functions.h │   │   │   │   │   ├── ... │   │   │   │   ├── fluid_pressure.h │   │   │   │   ├── ... │   │   │   │   ├── range.h │   │   │   │   ├── region_of_interest.h │   │   │   │   ├── ... │   │   │   └── srv │   │   │   ├── detail </code></pre> <p>It is unclear to me why the sensor_msgs/Range fails to properly integrate. Am I forgetting to &quot;register&quot; the sensor messages somehow?</p> <p>I do have the <code>#include &lt;sensor_msgs/msg/range.h&gt;</code> in the top of my source code.</p> <p>Here the entire source code:</p> <pre><code>#include &lt;Arduino.h&gt; #include &lt;Wire.h&gt; #include &lt;micro_ros_platformio.h&gt; #include &lt;example_interfaces/srv/add_two_ints.h&gt; #include &lt;example_interfaces/srv/set_bool.h&gt; #include &lt;teensy_interfaces/srv/neo_pixel_control.h&gt; #include &lt;stdio.h&gt; #include &lt;global.h&gt; #include &lt;config.h&gt; #include &lt;setup.h&gt; #include &lt;rcl/error_handling.h&gt; #include &lt;rcl/rcl.h&gt; #include &lt;rclc/rclc.h&gt; #include &lt;rclc/executor.h&gt; #include &lt;std_msgs/msg/int32.h&gt; #include &lt;std_msgs/msg/int64.h&gt; #include &lt;std_msgs/msg/bool.h&gt; #include &lt;sensor_msgs/msg/range.h&gt; #include &lt;WS2812Serial.h&gt; #if !defined(MICRO_ROS_TRANSPORT_ARDUINO_SERIAL) #error This example is only avaliable for Arduino framework with serial transport. #endif volatile int TFMiniVal = 0; volatile int TFMiniStrength = 0; int TFMini_FloorDistance = 30; int TFMini_FloorDistanceTolerance = 12; // ============================================================================ // INSTANCES, OBJECTS // ============================================================================ // publisher and subscriber common rcl_node_t node; rclc_support_t support; rcl_allocator_t allocator; rclc_executor_t executor; rcl_timer_t timer; unsigned int num_handles = 7; // 1 subscribers, 2 publishers, 4 services // service addTwoInts // rcl_service_t service_addTwoInts; // services rcl_service_t service_FrontLights; rcl_service_t service_RearLights; rcl_service_t service_OdriveFans; rcl_service_t service_NeoPixel; rcl_wait_set_t wait_set; // msg_pub publisher rcl_publisher_t publisher; std_msgs__msg__Int32 msg_pub; // msg_pub_range publisher rcl_publisher_t publisher_range; sensor_msgs__msg__Range msg_pub_range; // subscriber rcl_subscription_t subscriber; std_msgs__msg__Int32 msg_sub; // example_interfaces__srv__AddTwoInts_Response res; // example_interfaces__srv__AddTwoInts_Request req; example_interfaces__srv__SetBool_Request req_FrontLights; example_interfaces__srv__SetBool_Response res_FrontLights; example_interfaces__srv__SetBool_Request req_RearLights; example_interfaces__srv__SetBool_Response res_RearLights; example_interfaces__srv__SetBool_Request req_OdriveFans; example_interfaces__srv__SetBool_Response res_OdriveFans; teensy_interfaces__srv__NeoPixelControl_Request req_NeoPixel; teensy_interfaces__srv__NeoPixelControl_Response res_NeoPixel; // Left NeoPixel byte dwgMem_NeoPixel_L[numNeoPixel_L*3]; // 3 bytes per LED DMAMEM byte dispMem_NeoPixel_L[numNeoPixel_L*12]; // 12 bytes per LED WS2812Serial objNeoPixel_L(numNeoPixel_L, dispMem_NeoPixel_L, dwgMem_NeoPixel_L, pinNeoPixel_L, WS2812_GRB); // Right NeoPixel byte dwgMem_NeoPixel_R[numNeoPixel_R*3]; // 3 bytes per LED DMAMEM byte dispMem_NeoPixel_R[numNeoPixel_R*12]; // 12 bytes per LED WS2812Serial objNeoPixel_R(numNeoPixel_R, dispMem_NeoPixel_R, dwgMem_NeoPixel_R, pinNeoPixel_R, WS2812_GRB); // ============================================================================ // DEFINES // ============================================================================ // I/O - Definitions #define LED_PIN 13 // cleartext substitutions // debug #ifndef DebugMonitor #define DebugMonitor Serial6 #endif #define debug(x) DebugMonitor.print(x) #define debugln(x) DebugMonitor.println(x) // ============================================================================ // FUNCTION PROTOTYPES // ============================================================================ #define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}} #define RCSOFTCHECK(fn) {rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}} // -------------------------------------------------------- // NeoPixel.colorWipe void colorWipe(int, int, WS2812Serial); // TFMini-Plus void readTFMiniPlus(void); // Error handle loop void error_loop() { while(1) { digitalWrite(LED_PIN, !digitalRead(LED_PIN)); delay(500); } } // -------------------------------------------------------- // timer callback (currently just increments msg_pub.data) void timer_callback(rcl_timer_t * timer, int64_t last_call_time) { RCLC_UNUSED(last_call_time); if (timer != NULL) { // increments msg_pub.data and publishes on the topic RCSOFTCHECK(rcl_publish(&amp;publisher, &amp;msg_pub, NULL)); msg_pub.data++; // publishes the latest value from TFMini-Plus msg_pub_range.range = TFMiniVal; msg_pub_range.min_range = 0; msg_pub_range.max_range = 1000; msg_pub_range.radiation_type = sensor_msgs__msg__Range__INFRARED; msg_pub_range.field_of_view = 0.04; msg_pub_range.header.frame_id.data = &quot;TFMini-Plus&quot;; RCSOFTCHECK(rcl_publish(&amp;publisher, &amp;msg_pub_range, NULL)); } } // -------------------------------------------------------- // subscriber callback void subscription_callback(const void * msgin) { const std_msgs__msg__Int32 * msg = (const std_msgs__msg__Int32 *)msgin; digitalWrite(LED_PIN, (msg-&gt;data == 0) ? LOW : HIGH); } // -------------------------------------------------------- // srv.addTwoInts callback // void service_addTwoInts_callback(const void * req, void * res) { // example_interfaces__srv__AddTwoInts_Request * req_in = (example_interfaces__srv__AddTwoInts_Request *) req; // example_interfaces__srv__AddTwoInts_Response * res_in = (example_interfaces__srv__AddTwoInts_Response *) res; // //printf(&quot;Service request value: %d + %d.\n&quot;, (int) req_in-&gt;a, (int) req_in-&gt;b); // res_in-&gt;sum = req_in-&gt;a + req_in-&gt;b; // } // -------------------------------------------------------- // srv.FrontLights callback void service_FrontLights_callback(const void * req_FrontLights, void * res_FrontLights) { bool previousState = digitalRead(FRONT_LIGHT); example_interfaces__srv__SetBool_Request * req_in = (example_interfaces__srv__SetBool_Request *) req_FrontLights; example_interfaces__srv__SetBool_Response * res_in = (example_interfaces__srv__SetBool_Response *) res_FrontLights; digitalWrite(FRONT_LIGHT, (req_in-&gt;data == 0) ? LOW:HIGH); if (previousState != digitalRead(FRONT_LIGHT)) { res_in-&gt;success = true; res_in-&gt;message.data = const_cast&lt;char*&gt;(&quot;Front Lights succeeded to update&quot;); } else { res_in-&gt;success = false; res_in-&gt;message.data = const_cast&lt;char*&gt;(&quot;Front Lights FAILED to update&quot;); } } // -------------------------------------------------------- // srv.RearLights callback void service_RearLights_callback(const void * req_RearLights, void * res_RearLights) { bool previousState = digitalRead(REAR_LIGHT); example_interfaces__srv__SetBool_Request * req_in = (example_interfaces__srv__SetBool_Request *) req_RearLights; example_interfaces__srv__SetBool_Response * res_in = (example_interfaces__srv__SetBool_Response *) res_RearLights; digitalWrite(REAR_LIGHT, (req_in-&gt;data == 0) ? LOW:HIGH); if (previousState != digitalRead(REAR_LIGHT)) { res_in-&gt;success = true; res_in-&gt;message.data = const_cast&lt;char*&gt;(&quot;Rear Lights succeeded to update&quot;); } else { res_in-&gt;success = false; res_in-&gt;message.data = const_cast&lt;char*&gt;(&quot;Rear Lights FAILED to update&quot;); } } // -------------------------------------------------------- // srv.OdriveFans callback void service_OdriveFans_callback(const void * req_OdriveFans, void * res_OdriveFans) { bool previousState = digitalRead(ODRIVE_FAN); example_interfaces__srv__SetBool_Request * req_in = (example_interfaces__srv__SetBool_Request *) req_OdriveFans; example_interfaces__srv__SetBool_Response * res_in = (example_interfaces__srv__SetBool_Response *) res_OdriveFans; digitalWrite(ODRIVE_FAN, (req_in-&gt;data == 0) ? LOW:HIGH); if (previousState != digitalRead(ODRIVE_FAN)) { res_in-&gt;success = true; res_in-&gt;message.data = const_cast&lt;char*&gt;(&quot;Odrive Fans succeeded to update&quot;); } else { res_in-&gt;success = false; res_in-&gt;message.data = const_cast&lt;char*&gt;(&quot;Odrive Fans FAILED to update&quot;); } } // -------------------------------------------------------- // srv.NeoPixel callback void service_NeoPixel_callback(const void * req_NeoPixel, void * res_NeoPixel) { teensy_interfaces__srv__NeoPixelControl_Request * req_in = (teensy_interfaces__srv__NeoPixelControl_Request *) req_NeoPixel; teensy_interfaces__srv__NeoPixelControl_Response * res_in = (teensy_interfaces__srv__NeoPixelControl_Response *) res_NeoPixel; switch(req_in-&gt;status) { case 1: colorWipe(ORANGE, 10, objNeoPixel_L); colorWipe(ORANGE, 10, objNeoPixel_R); break; case 2: colorWipe(RED, 10, objNeoPixel_L); colorWipe(RED, 10, objNeoPixel_R); break; case 3: colorWipe(GREEN, 10, objNeoPixel_L); colorWipe(GREEN, 10, objNeoPixel_R); break; case 4: colorWipe(BLUE, 10, objNeoPixel_L); colorWipe(BLUE, 10, objNeoPixel_R); break; case 5: colorWipe(YELLOW, 10, objNeoPixel_L); colorWipe(YELLOW, 10, objNeoPixel_R); break; case 6: colorWipe(PINK, 10, objNeoPixel_L); colorWipe(PINK, 10, objNeoPixel_R); break; case 7: colorWipe(ORANGE, 10, objNeoPixel_L); colorWipe(ORANGE, 10, objNeoPixel_R); break; case 8: colorWipe(WHT, 10, objNeoPixel_L); colorWipe(WHT, 10, objNeoPixel_R); break; default: colorWipe(BLANK, 10, objNeoPixel_L); colorWipe(BLANK, 10, objNeoPixel_R); break; } res_in-&gt;success = true; res_in-&gt;message.data = const_cast&lt;char*&gt;(&quot;Neopixel changed&quot;); // res_in-&gt;success = true; // res_in-&gt;message.data = const_cast&lt;char*&gt;(&quot;Neopixel blanked&quot;); } // ============================================================================ // SETUP // ============================================================================ void setup() { set_microros_serial_transports(Serial); // Debug DebugMonitor.begin(115200); // I/O setup pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN, HIGH); pinMode(FRONT_LIGHT, OUTPUT); digitalWrite(FRONT_LIGHT, LOW); pinMode(REAR_LIGHT, OUTPUT); digitalWrite(REAR_LIGHT, LOW); pinMode(ODRIVE_FAN, OUTPUT); digitalWrite(ODRIVE_FAN, LOW); // Neopixel objNeoPixel_L.begin(); objNeoPixel_R.begin(); // TFMini Plus TFMiniPlus.begin(115200); // HW Serial for TFmini delay (200); // Give a little time for things to start // Set TFMini Plus to Standard Output mode TFMiniPlus.write(0x42); TFMiniPlus.write(0x57); TFMiniPlus.write(0x02); TFMiniPlus.write(0x00); TFMiniPlus.write(0x00); TFMiniPlus.write(0x00); TFMiniPlus.write(0x01); TFMiniPlus.write(0x06); delay(1000); colorWipe(ORANGE, 10, objNeoPixel_L); colorWipe(ORANGE, 10, objNeoPixel_R); allocator = rcl_get_default_allocator(); // create init_options RCCHECK(rclc_support_init(&amp;support, 0, NULL, &amp;allocator)); // create node RCCHECK(rclc_node_init_default(&amp;node, &quot;uros_platformio_node&quot;, &quot;&quot;, &amp;support)); // create service addTwoInts // RCCHECK(rclc_service_init_default(&amp;service_addTwoInts, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, AddTwoInts), &quot;/addtwoints&quot;)); // create service FrontLights RCCHECK(rclc_service_init_default(&amp;service_FrontLights, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), &quot;/frontlights&quot;)); // create service RearLights RCCHECK(rclc_service_init_default(&amp;service_RearLights, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), &quot;/rearlights&quot;)); // create service OdriveFans RCCHECK(rclc_service_init_default(&amp;service_OdriveFans, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), &quot;/odrivefans&quot;)); // create service NeoPixel RCCHECK(rclc_service_init_default(&amp;service_NeoPixel, &amp;node, ROSIDL_GET_SRV_TYPE_SUPPORT(teensy_interfaces, srv, NeoPixelControl), &quot;/neopixel&quot;)); // create msg_pub publisher RCCHECK(rclc_publisher_init_default(&amp;publisher, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), &quot;micro_ros_platformio_node_publisher&quot;)); // create msg_pub_range publisher // RCCHECK(rclc_publisher_init_default(&amp;publisher_range, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), &quot;micro_ros_platformio_node_publisher_range&quot;)); RCCHECK(rclc_publisher_init_default(&amp;publisher_range, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(sesnsor_msgs, msg, Range), &quot;micro_ros_platformio_node_publisher_range&quot;)); // create subscriber RCCHECK(rclc_subscription_init_default(&amp;subscriber, &amp;node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), &quot;micro_ros_platformio_node_subscriber&quot;)); // create timer, const unsigned int timer_timeout = 1000; RCCHECK(rclc_timer_init_default(&amp;timer, &amp;support, RCL_MS_TO_NS(timer_timeout), timer_callback)); // create executor RCCHECK(rclc_executor_init(&amp;executor, &amp;support.context, num_handles, &amp;allocator)); // RCCHECK(rclc_executor_add_service(&amp;executor, &amp;service_addTwoInts, &amp;req, &amp;res, service_addTwoInts_callback)); RCCHECK(rclc_executor_add_service(&amp;executor, &amp;service_FrontLights, &amp;req_FrontLights, &amp;res_FrontLights, service_FrontLights_callback)); RCCHECK(rclc_executor_add_service(&amp;executor, &amp;service_RearLights, &amp;req_RearLights, &amp;res_RearLights, service_RearLights_callback)); RCCHECK(rclc_executor_add_service(&amp;executor, &amp;service_OdriveFans, &amp;req_OdriveFans, &amp;res_OdriveFans, service_OdriveFans_callback)); RCCHECK(rclc_executor_add_service(&amp;executor, &amp;service_NeoPixel, &amp;req_NeoPixel, &amp;res_NeoPixel, service_NeoPixel_callback)); RCCHECK(rclc_executor_add_subscription(&amp;executor, &amp;subscriber, &amp;msg_sub, &amp;subscription_callback, ON_NEW_DATA)); RCCHECK(rclc_executor_add_timer(&amp;executor, &amp;timer)); msg_pub.data = 0; } // end setup // ============================================================================ // MAIN LOOP // ============================================================================ void loop() { // variable declarations uint32_t t = millis(); if (bFirstScan) { bFirstScan = false; debugln(&quot;First Scan&quot;); } // ------------------------------------------------------ // Service Routine[0]: DEBUG #if SR00_DEBUG_EN == 1 if ((t-tTime[0]) &gt;= (1000 / DEBUG_PULSE)) { debugln(msg_pub.data); tTime[0] = t; } #endif #if SR01_TFMINI_EN == 1 if ((t-tTime[1]) &gt;= (1000 / TFM_PULSE)) { readTFMiniPlus(); debug(&quot;Distance: &quot;); debugln(TFMiniVal); debug(&quot;Strength: &quot;); debugln(TFMiniStrength); debugln(&quot;--------------------&quot;); tTime[1] = t; } #endif // EXECUTOR HANDLE SPIN if ((t-tTime[10]) &gt;= (1000 / SPIN_PULSE)) { RCSOFTCHECK(rclc_executor_spin_some(&amp;executor, RCL_MS_TO_NS(100))); tTime[10] = t; } } // -------------------------------------------------------- // FUNCTIONS // -------------------------------------------------------- // colorWipe void colorWipe(int color, int wait, WS2812Serial refObject) { for (int i=0; i &lt; refObject.numPixels(); i++) { refObject.setPixel(i, color); refObject.show(); delayMicroseconds(wait); } } // ---------------------------------------------------------------------------- void readTFMiniPlus(){ // Data Format for Benewake TFmini // =============================== // 9 bytes total per message: // 1) 0x59 // 2) 0x59 // 3) Dist_L (low 8bit) // 4) Dist_H (high 8bit) // 5) Strength_L (low 8bit) // 6) Strength_H (high 8bit) // 7) Reserved bytes // 8) Original signal quality degree // 9) Checksum parity bit (low 8bit), Checksum = Byte1 + Byte2 +…+Byte8. This is only a low 8bit though while(TFMiniPlus.available()&gt;=9) // When at least 9 bytes of data available (expected number of bytes for 1 signal), then read { // debugln(&quot;Check2&quot;); if((0x59 == TFMiniPlus.read()) &amp;&amp; (0x59 == TFMiniPlus.read())) // byte 1 and byte 2 { unsigned int t1 = TFMiniPlus.read(); // byte 3 = Dist_L unsigned int t2 = TFMiniPlus.read(); // byte 4 = Dist_H t2 &lt;&lt;= 8; t2 += t1; TFMiniVal = t2*10; t1 = TFMiniPlus.read(); // byte 5 = Strength_L t2 = TFMiniPlus.read(); // byte 6 = Strength_H t2 &lt;&lt;= 8; t2 += t1; TFMiniStrength = t2; for(int i=0; i&lt;3; i++)TFMiniPlus.read(); // byte 7, 8, 9 are ignored } } } </code></pre> <hr /> <p><a href="https://answers.ros.org/question/408720/rosidl_runtime_c/message_type_support_struct.h-error/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/73699/pointcloud/" rel="nofollow noreferrer">PointCloud</a> on ROS Answers with karma: 120 on 2022-10-29</p> <p>Post score: 0</p>
rosidl_runtime_c/message_type_support_struct.h error
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I managed to solve this problem. Here is all things that I done in CMakeLists.txt:</p> <ul> <li>add find_package(std_srvs REQUIRED)</li> <li>add ament_target_dependencies(your_node_name rclcpp std_srvs)</li> <li>add ament_export_dependencies(std_srvs) (not sure if that line is necessary but it works now for me)</li> </ul> <p>In package.xml file:</p> <ul> <li>add build_depend std_srvs</li> <li>add exec_depend std_srvs</li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> with karma: 95 on 2022-10-31</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102640
2022-10-30T09:28:58.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 am porting my project from ros1 to ros2 and I have following error:</p> <pre><code>/usr/bin/ld: CMakeFiles/minicar_control_node.dir/src/control_node.cpp.o: in function `main': control_node.cpp:(.text+0x8a4): undefined reference to `minicar::LoopbackRobotHWSim::LoopbackRobotHWSim()' /usr/bin/ld: control_node.cpp:(.text+0xa8a): undefined reference to `minicar::STMRobotHW::STMRobotHW()' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/minicar_control_node.dir/build.make:1039: minicar_control_node] Error 1 make[1]: *** [CMakeFiles/Makefile2:439: CMakeFiles/minicar_control_node.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: CMakeFiles/cmd_vel_limiter.dir/src/cmd_vel_limiter_node.cpp.o: in function `rclcpp::Service&lt;std_srvs::srv::SetBool&gt;::Service(std::shared_ptr&lt;rcl_node_t&gt;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, rclcpp::AnyServiceCallback&lt;std_srvs::srv::SetBool&gt;, rcl_service_options_t&amp;)': cmd_vel_limiter_node.cpp:(.text._ZN6rclcpp7ServiceIN8std_srvs3srv7 SetBoolEEC2ESt10shared_ptrI10rcl_node_tERKNSt7_ _cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_18AnyServiceCallback IS3_EER21rcl_service_options_t[_ZN6rclcpp7 ServiceIN8std_srvs3srv7SetBoolEEC5ESt10shared_ptrI10rcl_node _tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS _18AnyServiceCallbackIS3_EER21rcl_service_options_t]+0xb4): undefined reference to `rosidl_service_type_support_t const* rosidl_typesupport_cpp::get_service_type_support_handle&lt;std_srvs::srv::SetBool&gt;()' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/cmd_vel_limiter.dir/build.make:1039: cmd_vel_limiter] Error 1 make[1]: *** [CMakeFiles/Makefile2:525: CMakeFiles/cmd_vel_limiter.dir/all] Error 2 make: *** [Makefile:141: all] Error 2 --- stderr: minicar_control /usr/bin/ld: CMakeFiles/minicar_control_node.dir/src/control_node.cpp.o: in function `main': control_node.cpp:(.text+0x8a4): undefined reference to `minicar::LoopbackRobotHWSim::LoopbackRobotHWSim()' /usr/bin/ld: control_node.cpp:(.text+0xa8a): undefined reference to `minicar::STMRobotHW::STMRobotHW()' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/minicar_control_node.dir/build.make:1039: minicar_control_node] Error 1 make[1]: *** [CMakeFiles/Makefile2:439: CMakeFiles/minicar_control_node.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: CMakeFiles/cmd_vel_limiter.dir/src/cmd_vel_limiter_node.cpp.o: in function `rclcpp::Service&lt;std_srvs::srv::SetBool&gt;:: Service(std::shared_ptr&lt;rcl_node_t&gt;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, rclcpp::AnyServiceCallback&lt;std_srvs::srv::SetBool&gt;, rcl_service_options_t&amp;)': cmd_vel_limiter_node.cpp:(.text._ZN6rclcpp7ServiceIN8std_srvs3srv7SetBoolEEC2ESt10shared_ptrI10rcl_node_tERKNSt7__ cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_18AnyServiceCallbackIS3_EER21rcl_service_options_t[_ZN6rclcpp7 ServiceIN8std_srvs3srv7SetBoolEEC5ESt10shared_ptrI10rcl_node_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS _18AnyServiceCallbackIS3_EER21rcl_service_options_t]+0xb4): undefined reference to `rosidl_service_type_support_t const* rosidl_typesupport_cpp::get_service_type_support_handle&lt;std_srvs::srv::SetBool&gt;()' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/cmd_vel_limiter.dir/build.make:1039: cmd_vel_limiter] Error 1 make[1]: *** [CMakeFiles/Makefile2:525: CMakeFiles/cmd_vel_limiter.dir/all] Error 2 make: *** [Makefile:141: all] Error 2 </code></pre> <p>This is how looks create_service lines looks like:</p> <pre><code>rclcpp::Service&lt;std_srvs::srv::SetBool&gt;::SharedPtr srv_enableLimiter = pNodeHandle-&gt;create_service&lt;std_srvs::srv::SetBool&gt;(&quot;/minicar/control/enable_limiter&quot;, &amp;EnableLimiterService); </code></pre> <p>EnableLimiterService method constructor:</p> <pre><code>bool EnableLimiterService(const std::shared_ptr&lt;std_srvs::srv::SetBool::Request&gt; request, std::shared_ptr&lt;std_srvs::srv::SetBool::Response&gt; response); </code></pre> <p>This is CMakeLists.txt: cmake_minimum_required(VERSION 3.5) project(minicar_control)</p> <pre><code># Add support for C++14 if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 14) endif() # Load catkin and all dependencies required for this package link_directories(${catkin_LIBRARY_DIRS}) ## Restrict Windows header namespace usage if(WIN32) add_definitions(-DNOGDI) endif() add_library(minicar_hw_interface src/loopback_hw_interface.cpp src/stm_hw_interface.cpp src/base_hw_interface.cpp) add_executable(minicar_control_node src/control_node.cpp) add_executable(cmd_vel_limiter src/cmd_vel_limiter_node.cpp) find_package(ament_cmake REQUIRED) find_package(std_srvs REQUIRED) find_package(angles REQUIRED) find_package(controller_manager REQUIRED) find_package(transmission_interface REQUIRED) find_package(pluginlib REQUIRED) find_package(urdf REQUIRED) find_package(control_toolbox REQUIRED) find_package(rclcpp REQUIRED) find_package(std_msgs REQUIRED) find_package(hardware_interface REQUIRED) find_package(rosidl_default_generators REQUIRED) set(INCLUDE_DIRS <span class="math-container">${ament_cmake_INCLUDE_DIRS} $</span>{angles_INCLUDE_DIRS} <span class="math-container">${controller_manager_INCLUDE_DIRS} $</span>{transmission_interface_INCLUDE_DIRS} <span class="math-container">${pluginlib_INCLUDE_DIRS} $</span>{urdf_INCLUDE_DIRS} <span class="math-container">${control_toolbox_INCLUDE_DIRS} $</span>{rclcpp_INCLUDE_DIRS} <span class="math-container">${std_msgs_INCLUDE_DIRS} $</span>{hardware_interface_INCLUDE_DIRS} <span class="math-container">${rosidl_default_generators_INCLUDE_DIRS}) include_directories($</span>{INCLUDE_DIRS}) set(LIBRARY_DIRS <span class="math-container">${ament_cmake_LIBRARIES} $</span>{angles_LIBRARIES} <span class="math-container">${controller_manager_LIBRARIES} $</span>{transmission_interface_LIBRARIES} <span class="math-container">${pluginlib_LIBRARIES} $</span>{urdf_LIBRARIES} <span class="math-container">${control_toolbox_LIBRARIES} $</span>{rclcpp_LIBRARIES} <span class="math-container">${std_msgs_LIBRARIES} $</span>{hardware_interface_LIBRARIES} <span class="math-container">${rosidl_default_generators_LIBRARIES}) target_link_libraries(minicar_control_node $</span>{LIBRARY_DIRS}) target_link_libraries(cmd_vel_limiter <span class="math-container">${LIBRARY_DIRS}) set(LIBS $</span>{ament_cmake_LIBRARIES} <span class="math-container">${angles_LIBRARIES} $</span>{controller_manager_LIBRARIES} <span class="math-container">${transmission_interface_LIBRARIES} $</span>{pluginlib_LIBRARIES} <span class="math-container">${urdf_LIBRARIES} $</span>{control_toolbox_LIBRARIES} <span class="math-container">${rclcpp_LIBRARIES} $</span>{std_msgs_LIBRARIES} <span class="math-container">${hardware_interface_LIBRARIES} $</span>{rosidl_default_generators_LIBRARIES}) rosidl_generate_interfaces(<span class="math-container">${PROJECT_NAME} "msg/Feedback.msg" "msg/Control.msg" DEPENDENCIES builtin_interfaces std_msgs) #add_dependencies(minicar_hw_interface $</span>{catkin_EXPORTED_TARGETS}) #add_dependencies(minicar_hw_interface ${minicar_control_EXPORTED_TARGETS}) ## Install install(TARGETS minicar_control_node minicar_hw_interface cmd_vel_limiter LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME}) ## Other install(DIRECTORY config DESTINATION share/${PROJECT_NAME}) install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}) install(DIRECTORY msg DESTINATION share/${PROJECT_NAME}) ament_target_dependencies(minicar_control_node rclcpp std_srvs) ament_target_dependencies(minicar_hw_interface rclcpp std_srvs) ament_export_dependencies(std_srvs) ament_export_dependencies(ament_cmake) ament_export_dependencies(angles) ament_export_dependencies(controller_manager) ament_export_dependencies(transmission_interface) ament_export_dependencies(pluginlib) ament_export_dependencies(urdf) ament_export_dependencies(control_toolbox) ament_export_dependencies(rclcpp) ament_export_dependencies(std_msgs) ament_export_dependencies(hardware_interface) ament_export_dependencies(rosidl_default_generators) ament_export_include_directories(<span class="math-container">${INCLUDE_DIRS}) #ament_export_libraries(minicar_hw_interface $</span>{LIBS}) ament_package() </code></pre> <p>And package.xml:</p> <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;package format=&quot;3&quot;&gt; &lt;name&gt;minicar_control&lt;/name&gt; &lt;version&gt;0.1.0&lt;/version&gt; &lt;description&gt;The minicar_control package&lt;/description&gt; &lt;author email=&quot;cirkit.infomation@gmail.com&quot;&gt;CIR-KIT&lt;/author&gt; &lt;maintainer email=&quot;k104009y@mail.kyutech.jp&quot;&gt;Arita Yuta&lt;/maintainer&gt; &lt;maintainer email=&quot;p595201m@mail.kyutech.jp&quot;&gt;Masaru Morita&lt;/maintainer&gt; &lt;maintainer email=&quot;k104073r@mail.kyutech.jp&quot;&gt;Ryodo Tanaka&lt;/maintainer&gt; &lt;license&gt;BSD&lt;/license&gt; &lt;url type=&quot;repository&quot;&gt;https://github.com/CIR-KIT-Unit03/cirkit_unit03_common.git&lt;/url&gt; &lt;url type=&quot;bugtracker&quot;&gt;https://github.com/CIR-KIT-Unit03/cirkit_unit03_common/issues&lt;/url&gt; &lt;buildtool_depend&gt;ament_cmake&lt;/buildtool_depend&gt; &lt;buildtool_depend&gt;rosidl_default_generators&lt;/buildtool_depend&gt; &lt;build_depend&gt;rclcpp&lt;/build_depend&gt; &lt;build_depend&gt;std_msgs&lt;/build_depend&gt; &lt;build_depend&gt;control_toolbox&lt;/build_depend&gt; &lt;build_depend&gt;controller_manager&lt;/build_depend&gt; &lt;build_depend&gt;pluginlib&lt;/build_depend&gt; &lt;build_depend&gt;hardware_interface&lt;/build_depend&gt; &lt;build_depend&gt;transmission_interface&lt;/build_depend&gt; &lt;build_depend&gt;joint_state_controller&lt;/build_depend&gt; &lt;build_depend&gt;urdf&lt;/build_depend&gt; &lt;build_depend&gt;angles&lt;/build_depend&gt; &lt;build_depend&gt;rosserial_server&lt;/build_depend&gt; &lt;build_depend&gt;geometry_msgs&lt;/build_depend&gt; &lt;build_depend&gt;sensor_msgs&lt;/build_depend&gt; &lt;build_depend&gt;twist_mux&lt;/build_depend&gt; &lt;build_depend&gt;teb_local_planner&lt;/build_depend&gt; &lt;build_depend&gt;builtin_interfaces&lt;/build_depend&gt; &lt;build_depend&gt;std_srvs&lt;/build_depend&gt; &lt;exec_depend&gt;rclcpp&lt;/exec_depend&gt; &lt;exec_depend&gt;std_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;control_toolbox&lt;/exec_depend&gt; &lt;exec_depend&gt;controller_manager&lt;/exec_depend&gt; &lt;exec_depend&gt;pluginlib&lt;/exec_depend&gt; &lt;exec_depend&gt;hardware_interface&lt;/exec_depend&gt; &lt;exec_depend&gt;transmission_interface&lt;/exec_depend&gt; &lt;exec_depend&gt;joint_state_controller&lt;/exec_depend&gt; &lt;exec_depend&gt;urdf&lt;/exec_depend&gt; &lt;exec_depend&gt;angles&lt;/exec_depend&gt; &lt;exec_depend&gt;rosserial_server&lt;/exec_depend&gt; &lt;exec_depend&gt;geometry_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;sensor_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;twist_mux&lt;/exec_depend&gt; &lt;exec_depend&gt;teb_local_planner&lt;/exec_depend&gt; &lt;exec_depend&gt;builtin_interfaces&lt;/exec_depend&gt; &lt;exec_depend&gt;rosidl_default_runtime&lt;/exec_depend&gt; &lt;exec_depend&gt;std_srvs&lt;/exec_depend&gt; &lt;member_of_group&gt;rosidl_interface_packages&lt;/member_of_group&gt; &lt;export&gt; &lt;build_type&gt;ament_cmake&lt;/build_type&gt; &lt;/export&gt; &lt;/package&gt; </code></pre> <p>Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/408732/problem-with-service-call./" 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-10-30</p> <p>Post score: 0</p>
Problem with service call
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Finally, I found the issue (and it was much more simple than expected...). ROS Noetic is very sensible to the &quot;/&quot; before a frame_id. So it worked on ROS Kinetic and Melodic, but not on Noetic. And there is no relation with WSL, and the issue was the same on a native Ubuntu.</p> <p>Removing the &quot;/&quot; on <code>frame_id</code>parameter on my launch file solved the issue!</p> <p>Hope this could help someone in the future.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/40527/thibs-sigma/" rel="nofollow noreferrer">thibs-sigma</a> with karma: 18 on 2022-11-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102642
2022-10-31T04:51:50.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>[SOLUTION ON NEXT ANSWER]</p> <p>Hi all,</p> <p>I've successfully set up ROS Noetic on WSL2 (under Windows 10), but I'm currently struggling with PointCloud display on RViz. I'm currently working with the TI IWR6843ISK radar, and set up the ROS example package. Even if tf is configured properly (it works well on a native Ubuntu under ROS Melodic), I can't get it working on WSL2. I have an error in the transform for PointCloud: <code>&quot;Failed to transform for frame /ti_mmwave_pcl_0 to frame ti_mmwave_pcl&quot;</code>, even if the transform exists and is published.</p> <p>I'm using <code>usbip</code> for bridging the serial device from Windows to WSL. Could it be the issue?</p> <p>RViz under WSL2:</p> <p><img src="https://i.ibb.co/mvLFmt4/issue-rviz-wsl2.png" alt="Rviz issue WSL2" /></p> <p>TF monitor :</p> <p><img src="https://i.ibb.co/BLVKKh6/issue-tfmonitor.png" alt="image description" /></p> <p>Rviz under native Ubuntu and ROS Melodic (the PointCloud is displayed correctly): <img src="https://i.ibb.co/wdZ1jJ5/issue-rviz-ubuntu.png" alt="Rviz native Ubuntu" /></p> <p>My launch file:</p> <pre><code>&lt;launch&gt; &lt;!-- Input arguments --&gt; &lt;arg name=&quot;device&quot; value=&quot;6843&quot; doc=&quot;TI mmWave sensor device type [1443, 1642, 6843]&quot;/&gt; &lt;arg name=&quot;config&quot; value=&quot;3d&quot; doc=&quot;TI mmWave sensor device configuration [3d_best_range_res (not supported by 1642 EVM), 2d_best_range_res]&quot;/&gt; &lt;arg name=&quot;max_allowed_elevation_angle_deg&quot; default=&quot;90&quot; doc=&quot;Maximum allowed elevation angle in degrees for detected object data [0 &gt; value &gt;= 90]}&quot;/&gt; &lt;arg name=&quot;max_allowed_azimuth_angle_deg&quot; default=&quot;90&quot; doc=&quot;Maximum allowed azimuth angle in degrees for detected object data [0 &gt; value &gt;= 90]}&quot;/&gt; &lt;arg name=&quot;send_config&quot; default=&quot;true&quot; /&gt; &lt;!-- mmWave_Manager node --&gt; &lt;node pkg=&quot;ti_mmwave_rospkg&quot; type=&quot;ti_mmwave_rospkg&quot; name=&quot;ti_mmwave&quot; ns=&quot;radar_0&quot; output=&quot;screen&quot;&gt; &lt;param name=&quot;command_port&quot; value=&quot;/dev/ttyUSB0&quot; /&gt; &lt;param name=&quot;command_rate&quot; value=&quot;115200&quot; /&gt; &lt;param name=&quot;data_port&quot; value=&quot;/dev/ttyUSB1&quot; /&gt; &lt;param name=&quot;data_rate&quot; value=&quot;921600&quot; /&gt; &lt;param name=&quot;max_allowed_elevation_angle_deg&quot; value=&quot;<span class="math-container">$(arg max_allowed_elevation_angle_deg)" /&gt; &lt;param name="max_allowed_azimuth_angle_deg" value="$</span>(arg max_allowed_azimuth_angle_deg)&quot; /&gt; &lt;param name=&quot;frame_id&quot; value=&quot;/ti_mmwave_0&quot;/&gt; &lt;param name=&quot;mmWaveCLI_name&quot; value=&quot;/mmWaveCLI&quot; /&gt; &lt;remap from=&quot;/ti_mmwave/radar_scan_pcl&quot; to=&quot;/ti_mmwave/radar_scan_pcl_0&quot;/&gt; &lt;/node&gt; &lt;!-- mmWaveQuickConfig node (terminates after configuring mmWave sensor) --&gt; &lt;group if=&quot;<span class="math-container">$(arg send_config)"&gt; &lt;node pkg="ti_mmwave_rospkg" type="mmWaveQuickConfig" name="ti_mmwave_config" ns="radar_0" args="$</span>(find ti_mmwave_rospkg)/cfg/6843ISK_3d.cfg&quot; output=&quot;screen&quot; &gt; &lt;param name=&quot;mmWaveCLI_name&quot; value=&quot;/mmWaveCLI&quot; /&gt; &lt;/node&gt; &lt;/group&gt; &lt;node pkg=&quot;tf2_ros&quot; type=&quot;static_transform_publisher&quot; name=&quot;radar_baselink_0&quot; args=&quot;0 0 0 0 0 0 ti_mmwave_pcl ti_mmwave_0&quot; /&gt; &lt;node pkg=&quot;rviz&quot; type=&quot;rviz&quot; name=&quot;rviz&quot; args=&quot;-d $(find ti_mmwave_rospkg)/launch/rviz/ti_mmwave_multi.rviz&quot;/&gt; &lt;/launch&gt; </code></pre> <p>If someone has any clue about this issue, that would be awesome.</p> <hr /> <p><a href="https://answers.ros.org/question/408761/static-transform-issues-with-pointcloud-under-wsl2-and-ros-noetic/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/40527/thibs-sigma/" rel="nofollow noreferrer">thibs-sigma</a> on ROS Answers with karma: 18 on 2022-10-31</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-11-24</strong>:<br /> In the future, please do not post screenshots of text. Instead, copy/paste the text into your description.</p>
Static transform issues with PointCloud under WSL2 and ROS Noetic
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Eh I solved it, well apparently the order of multiplication makes a difference whether you are rotating it locally or globally, so I simply reversed the imu_rot multiply so it always rotate around the local y-axis not the global imu frame. voila.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/116664/asser19/" rel="nofollow noreferrer">asser19</a> with karma: 26 on 2022-11-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102644
2022-10-31T21:36:17.000
|ros|imu|urdf|quaternion|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello my question might sound a little naive I know. But, you know how tedious and confusing quaternions might be.</p> <p>I have an OAK-D camera with it's model in stl format have a URDF provided with all the links and joints for everything but mainly the base_link of the camera which is been sat arbitrarily around the middle camera center and the offset xyz and orientation rpy of the imu_link relative to the base_link.</p> <p>P.S. I use depthai to bridge the readings with ROS and use magdwick filter for IMU raw data.</p> <p>Now I want the camera model to move (orientation only) as I have the orientation data provided by an IMU filter which is visualized just fine and accurate. I want to publish a transform from the footprint to base_link with the orientation published by the IMU but there's always a misalignment between the rotations axes. I've looked it up but haven't found something specific regarding this issue. Eventually I made a node that uses relative rotations with quaternions and they aligned now they follow one another but in reality the z (blue) axis is forward instead of upwards you can see in the image camera is pointing to the ceiling while the z-axis is forward (body upright). here's an image <a href="https://imgur.com/a/mWwMPh1" rel="nofollow noreferrer">https://imgur.com/a/mWwMPh1</a></p> <p>so in my mind a simple solution was to rotate the quat. around y-axis and I wrote this code</p> <pre><code>orientation_q = msg.orientation q_imu = [orientation_q.x, orientation_q.y, orientation_q.z, orientation_q.w] q_rot = quaternion_from_euler(0, -1.5708, 0) q_imu_rot = quaternion_multiply(q_rot, q_imu) # Origin quat q1_inv = [0, 0, 0, -1] # Relative rot quat from origin to q_imu_rot q_new = quaternion_multiply(q_imu_rot, q1_inv) </code></pre> <p>Then I send this transform. But it leads to other misalignment. I simply want all the resulting orientations to be rotated -90 degrees so my model follows my real camera orientation. Probably there's a smarter solution ik :D Thanks in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/408789/visualize-object-orientation-using-imu/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/116664/asser19/" rel="nofollow noreferrer">asser19</a> on ROS Answers with karma: 26 on 2022-10-31</p> <p>Post score: 0</p>
Visualize object orientation using IMU
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In your ros_package their should be a joint_limits.yaml file, in which the speed limits are set. There you can set the speed limit, or turn of speed limit by setting has_velocity_limits to false. The yaml file should look similar to the following:</p> <pre><code>joint_limits: joint_1: min_position: -2.84 max_position: 2.84 has_velocity_limits: true max_velocity: 3.141592653589793 has_acceleration_limits: false max_acceleration: 0 </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/120024/nils_iseke/" rel="nofollow noreferrer">nils_iseke</a> with karma: 76 on 2022-11-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102646
2022-11-01T11:20:50.000
|ros|moveit|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I would like to know how can I set the maximum speed of the robot manipulator. I am currently using <code>set_max_acceleration_scaling_factor(1)</code>, is there any function that can help to increase it's speed.</p> <hr /> <p><a href="https://answers.ros.org/question/408819/set-the-maximum-speed-of-robot/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-11-01</p> <p>Post score: 0</p>
Set the maximum speed of robot
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You need to change the QoS policies of the scan topic in RViz. <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16673728814435396.png" alt="image description" /></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/120024/nils_iseke/" rel="nofollow noreferrer">nils_iseke</a> with karma: 76 on 2022-11-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/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> on 2022-11-02</strong>:<br /> Ok thank you @nils_iseke, I was actually simulating in gazebo and not rviz and also doing this using The Construct Platform, although while going through the turtlebot3 tutorial files I came across one script where they have imported QoS and assigned value to it as can be seen here - <a href="https://github.com/ROBOTIS-GIT/turtlebot3/blob/ros2/turtlebot3_example/turtlebot3_example/turtlebot3_obstacle_detection/turtlebot3_obstacle_detection.py" rel="nofollow noreferrer">https://github.com/ROBOTIS-GIT/turtlebot3/blob/ros2/turtlebot3_example/turtlebot3_example/turtlebot3_obstacle_detection/turtlebot3_obstacle_detection.py</a> After doing this in my code, it works fine. I guess I had to import QoS in the code and also make the changes told by you in rviz2 to get it working properly, thanks for your answer.</p>
102648
2022-11-01T15:58:18.000
|gazebo|ros2|rviz|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, I am trying to run an obstacle avoidance script and test it in gazebo simulation using turtlebot 3 in ROS2 but I am getting the following error - <code>[WARN] [1667317780.806097773] [obstacle_avoidance]: New publisher discovered on topic '/scan', offering incompatible QoS. No messages will be received from it. Last incompatible policy:RELIABILITY</code> Please help me in solving this issue, thank you.</p> <p>Here is the code I have written -</p> <pre><code>import rclpy from rclpy.node import Node from sensor_msgs.msg import LaserScan from geometry_msgs.msg import Twist distToObstacle = 1 class ObstacleAvoidance(Node): def __init__(self): super().__init__('obstacle_avoidance') self.sub = self.create_subscription(LaserScan, '/scan', self.obstacle_callback, 10) self.pub = self.create_publisher(Twist, '/cmd_vel', 10) def obstacle_callback(self, msg): self.get_logger().info('The distance to obstacle is %s ' % msg.ranges[300]) move = Twist() if msg.ranges[300] &gt; distToObstacle: move.linear.x = 0.5 move.angular.z = 0.0 if msg.ranges[300] &lt;= distToObstacle: move.linear.x = 0.5 move.angular.z = 1.5 self.pub.publish(move) def main(args=None): rclpy.init(args=args) obstacle_avoidance = ObstacleAvoidance() rclpy.spin(obstacle_avoidance) obstacle_avoidance.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <hr /> <p><a href="https://answers.ros.org/question/408837/error-while-running-obstacle-avoidance-script-for-turtlebot3-in-ros2/" 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-11-01</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/103873/davies-ogunsina/" rel="nofollow noreferrer">Davies Ogunsina</a> on 2022-11-01</strong>:<br /> can you please paste your node to debug .</p> <p><strong>Comment by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> on 2022-11-01</strong>:<br /> Hi @Davies Ogunsina, I have updated my question with the code I have written.</p>
Error while running obstacle avoidance script for turtlebot3 in ROS2
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>Will allowing the robot to be &quot;disconnected&quot; from the planned path cause issues elsewhere (namely for the chosen Controller, RPP in our case)?</p> </blockquote> <p>No</p> <blockquote> <p>Should paths always be planned from the origin of the robot without exception (base_link or similar)? Is it bad practice to not use the current position of the bot when planning paths?</p> </blockquote> <p>Not necessarily, its up to the algorithm designer, though that's an atypical use of it (which you may wish to document), there's nothing technically wrong with it.</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-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/92446/hapy-capy/" rel="nofollow noreferrer">hapy-capy</a> on 2022-11-03</strong>:<br /> Thank you for the clarification.</p> <p>In our use case, the path placement is key to proper operation; the paths always needs to be in the same place. These paths (exclusively straight lines) are planned with very tight tolerances in a large outdoor space, relying heavily upon RTK. We're exploring creating static costmaps (without the use of lidar) to be used for keep-out zones lining the paths. We're avoiding traditional obstacle avoidance as we need to drive through what would be considered obstacles by a lidar/depth-sensing system; CV is currently too difficult/time-intensive to implement for our system.</p> <p>We do plan to document, and share with the community portions of our work when developed further. We're grateful for the work that's been done by the community and hope to contribute.</p>
102650
2022-11-01T16:30:10.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>We're working on a modified version of the example &quot;nav2_straightline_planner&quot;. Our goal is to plan a straight path from one waypoint to the next, without regard for the robot's position. This path is only changed after completing the current goal. As it is currently written, our Planner works as expected. We do not use obstacle avoidance of any kind, and do not plan to at the moment. The operating area of the robot is static.</p> <p>My questions are:</p> <ul> <li>Is it bad practice to not use the current position of the bot when planning paths?</li> <li>Should paths always be planned from the origin of the robot without exception (base_link or similar)?</li> <li>Will allowing the robot to be &quot;disconnected&quot; from the planned path cause issues elsewhere (namely for the chosen Controller, RPP in our case)?</li> </ul> <p>We've been running the robot in this current setup for weeks with pretty decent success. RPP does seem to need better tuning on our part to more closely follow the planned path.</p> <p>It seems all of the provided Planners in the Navigation2 stack plan from the robots origin each iteration, unless I'm understanding that incorrectly.</p> <p>Thank you</p> <hr /> <p><a href="https://answers.ros.org/question/408839/navigation2-planner-plugin-best-practices/" 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-11-01</p> <p>Post score: 1</p>
Navigation2 Planner plugin best practices
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Would this not depend on your own requirements / constraints?</p> <p>If you're looking for &quot;the most recently released ROS 2 version on 20.04&quot;, then you have no choice but to install Galactic.</p> <p>If you're looking for stability and LTS support, go with Foxy.</p> <p>If you actually would like to use a newer release, use the Docker images of Humble and you wouldn't be limited by your host OS.</p> <hr /> <p>Edit:</p> <blockquote> <p>Why the Galactic has shorter EOL than Foxy?</p> </blockquote> <p>Because it's a non-LTS release. From <a href="https://www.ros.org/reps/rep-2000.html#support" rel="nofollow noreferrer">here</a>:</p> <blockquote> <h2>Support</h2> <h3>LTS releases</h3> <p>Since Ubuntu LTS releases come with 5 years of standard support we aim to match the same duration. In even years new ROS 2 releases will happen one month after the Ubuntu LTS has been released (which usually means a ROS 2 release in May). The ROS 2 release will be supported until the end of the standard support of the Ubuntu LTS release which is 4 years and 11 months from the ROS 2 release date.</p> <h3>Non-LTS Releases</h3> <p>In order to provide frequent releases to the community, in odd years a non-LTS ROS 2 release will be published. It will always target the same Ubuntu LTS as the previous ROS 2 LTS release but will only be supported for 1.5 years. This duration ensures that the non-LTS will overlap with the next ROS LTS release by 6 months to provide a long enough transition window.</p> <h3>Releases and support duration</h3> <ul> <li>May 2021: G Turtle: non-LTS release, supported for 1.5 years</li> <li>May 2022: H Turtle: LTS release, supported for 5 years</li> <li>May 2023: I Turtle: non-LTS release, supported for 1.5 years</li> <li>May 2024: J Turtle: LTS release, supported for 5 years</li> <li>and so on, alternating annually between LTS and non-LTS releases</li> </ul> </blockquote> <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-03</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/9486/bvbdort/" rel="nofollow noreferrer">bvbdort</a> on 2022-11-03</strong>:<br /> Thanks for the answer. Why the Galactic has shorter EOL than Foxy?</p>
102652
2022-11-03T02:55:54.000
|ros|ros2|installation|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Which version of ROS2 is recommended for Ubuntu 20.04 to install from debian packages. Humble is recommended for 22.04 and Galactic has EOL date November 2022.</p> <p>Is the Foxy best option to install on Ubuntu 20.04 via debian packages?</p> <hr /> <p><a href="https://answers.ros.org/question/408912/which-version-of-ros2-is-recommended-for-ubuntu-20.04/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/9486/bvbdort/" rel="nofollow noreferrer">bvbdort</a> on ROS Answers with karma: 3034 on 2022-11-03</p> <p>Post score: 0</p>
Which version of ROS2 is recommended for Ubuntu 20.04
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, here is my update: I shut off all firewalls of the Windows PC (I switched to a VM). I was able to ping from both directions this way. I still was not able to connect to the virtual controller of RobotStudio. For that I needed to follow this instuction <a href="https://forums.robotstudio.com/discussion/12082/using-robotwebservices-to-access-a-remote-virtual-controller" rel="nofollow noreferrer">here</a>. Afterwards I was able to launch the first example of the bringup. I still have issues with the bringup examples but I'll open another question for that. Thanks for the help!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/99933/joff/" rel="nofollow noreferrer">joff</a> with karma: 40 on 2022-11-09</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102654
2022-11-03T05:22:10.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I installed the abb_robot_driver node from <a href="https://github.com/ros-industrial/abb_robot_driver" rel="nofollow noreferrer">here</a> in my workspace, it worked without any errors while building.</p> <p>I am running:</p> <ul> <li>Ubuntu 20.04, kernel: 5.14.0-1054-oem</li> <li>ROS Noetic</li> </ul> <p>I have now installed Robot studio on a seperate Windows PC, Robot Ware 7 is also installed. I open the robot I want (ABB IRB4600-40/255) and create a controller. It is indicated that the controller is running.</p> <p>When I now try to use the first example of the abb_robot_driver <a href="https://github.com/ros-industrial/abb_robot_driver/tree/master/abb_robot_bringup_examples" rel="nofollow noreferrer">here</a> which is:</p> <pre><code>roslaunch abb_robot_bringup_examples ex1_rws_only.launch robot_ip:=&lt;WindowsPC IP&gt; </code></pre> <p>I get the warning</p> <pre><code>[ WARN] [1667469851.804625427]: Failed to establish RWS connection to the robot controller (attempt 1/5), reason: 'Failed to collect general system info' </code></pre> <p>Until I receive:</p> <pre><code>[FATAL] [1667469856.931221918]: Runtime error: 'Failed to establish RWS connection to the robot controller' </code></pre> <p>I am pretty sure I did not set up everything correctly, but was not able either to find a tutorial how to do so. Can anybody give me a hint? Thank you.</p> <p>Cheers</p> <hr /> <p><a href="https://answers.ros.org/question/408918/connect-ros-with-robotstudio-via-abb_robot_driver/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/99933/joff/" rel="nofollow noreferrer">joff</a> on ROS Answers with karma: 40 on 2022-11-03</p> <p>Post score: 0</p>
Connect ROS with RobotStudio via abb_robot_driver
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I think you have two problems with this code:</p> <ol> <li><p>The third argument to lookup_transform() is a rospy.Time object, as in time-of-day, not a Duration object. Try using rospy.Time(0).</p> </li> <li><p>Your tfBuffer needs some time to actually receive the messages from the /tf topic. You must either 1) explicitly specify timeout=Duration(3.0), or 2) insert a big-enough delay before the call, or 3) loop calling the tfBuffer.can_transform() method until the tfBuffer says it is ready to provide the information.</p> </li> </ol> <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-03</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/121281/robra/" rel="nofollow noreferrer">robra</a> on 2022-11-04</strong>:<br /> Thank you, I actually forgot to update the question, but I had already changed this line: <code>trans = tfBuffer.lookup_transform('base_link', 'tool0', rospy.Duration(3.0))</code> to <code>trans = tfBuffer.lookup_transform('base_link', 'tool0', rospy.Time.now(), rospy.Duration(3.0))</code> as in this <a href="http://wiki.ros.org/tf2/Tutorials/tf2%20and%20time%20%28Python%29" rel="nofollow noreferrer">tutorial</a> but that didn't work either. However, using the <code>rospy.Time(0)</code> instead of <code>rospy.Time.now(),</code> works!</p>
102657
2022-11-03T09:09:06.000
|ros|tf2-ros|transform|tf2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi</p> <p>I have followed the tutorial <a href="http://wiki.ros.org/tf2/Tutorials/tf2%20and%20time%20%28Python%29" rel="nofollow noreferrer">here</a> to find a transformation between 2 frames using Python in ROS Noetic, but I can't get it even though I'm sure the tf exists because I can find it in the terminal.</p> <p>Here is what I get in the terminal:</p> <pre><code>$ rosrun tf tf_echo /base_link /tool0 At time 1667484434.367 - Translation: [-0.197, 0.704, 0.486] - Rotation: in Quaternion [1.000, 0.000, -0.000, -0.000] in RPY (radian) [-3.141, 0.001, 0.000] in RPY (degree) [-179.967, 0.041, 0.028] At time 1667484434.967 - Translation: [-0.197, 0.704, 0.486] - Rotation: in Quaternion [1.000, 0.000, -0.000, -0.000] in RPY (radian) [-3.141, 0.001, 0.000] in RPY (degree) [-179.967, 0.041, 0.028] At time 1667484435.967 - Translation: [-0.197, 0.704, 0.486] - Rotation: in Quaternion [1.000, 0.000, -0.000, -0.000] in RPY (radian) [-3.141, 0.001, 0.000] in RPY (degree) [-179.967, 0.041, 0.028] </code></pre> <p>Here is a minimal code:</p> <pre><code>#!/usr/bin/env python3 import sys import rospy import moveit_commander import tf2_ros class ourbot(object): def __init__(self): super(ourbot, self).__init__() moveit_commander.roscpp_initialize(sys.argv) rospy.init_node(&quot;get_tf&quot;, anonymous=True) def main(): try: demorobot = ourbot() tfBuffer = tf2_ros.Buffer() listener = tf2_ros.TransformListener(tfBuffer) try: trans = tfBuffer.lookup_transform('base_link', 'tool0', rospy.Duration(3.0)) pose_transformed = tf2_geometry_msgs.do_transform_pose(pose_robot, trans) print(pose_transformed) except (tf2_ros.LookupException, tf2_ros.ConnectivityException, tf2_ros.ExtrapolationException): print('not found') except rospy.ROSInterruptException: return except KeyboardInterrupt: return if __name__ == &quot;__main__&quot;: main() </code></pre> <hr /> <p><a href="https://answers.ros.org/question/408932/tf-not-found-using-python-in-ros-noetic/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121281/robra/" rel="nofollow noreferrer">robra</a> on ROS Answers with karma: 3 on 2022-11-03</p> <p>Post score: 0</p>
tf not found using python in ros noetic
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Link that @ravijoshi provided is solved my problem. Thank you very much for your help</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-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102659
2022-11-03T09:31:01.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. So, I created custom .msg and tested it with not_composable.cpp simple publisher and subscriber that was taken from <a href="https://github.com/ros2/examples/tree/foxy/rclcpp/topics" rel="nofollow noreferrer">here</a> in separate package and project has successfully builded. After that I used same CMakeLists.txt and package.xml comands and used them in my original package and I have following error:</p> <pre><code>By not providing &quot;Findminicar_control.cmake&quot; in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by &quot;minicar_control&quot;, but CMake did not find one. Could not find a package configuration file provided by &quot;minicar_control&quot; with any of the following names: minicar_controlConfig.cmake minicar_control-config.cmake Add the installation prefix of &quot;minicar_control&quot; to CMAKE_PREFIX_PATH or set &quot;minicar_control_DIR&quot; to a directory containing one of the above files. If &quot;minicar_control&quot; provides a separate development package or SDK, be sure it has been installed. </code></pre> <p>Where minicar_control is package that contains my .msg files and in this package I create publisher and subscriber. This method works normally with my test package. .msg was created using <a href="https://answers.ros.org/question/408930/undefiend-reference-to-custom-msg-from-publisher-and-subscriber/" rel="nofollow noreferrer">this</a> guide and added to package with commands that are shown in this duide. Appreciate any help and suggestions</p> <hr /> <p><a href="https://answers.ros.org/question/408936/can%27t-connect-custom-msg-to-publisher-and-subscriber./" 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-03</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-11-05</strong>:<br /> I am sorry, but are the publisher and the <code>.msg</code> files in the same package? If yes, then you need a few changes in <code>CMakeLists.txt</code> file as shown in the following question: #q402196</p>
Can't connect custom msg to publisher and subscriber
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>ok, i solved. I forgot to put the</p> <p>&lt;build_type&gt;ament_cmake&lt;/build_type&gt;</p> <p>line in tag of the package.xlm</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/32095/muttidrhummer/" rel="nofollow noreferrer">muttidrhummer</a> with karma: 71 on 2022-11-04</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102661
2022-11-04T04:53:07.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all, I'm on Ros2 rolling, Ubuntu 22.04.</p> <p>I'm building a workspace consisting of 2 packages, one called omron_ros2_msgs and the other one omron_ros2_agv. I start with a clean workspace, then source the /opt setup.bash file, build the workspace with colcon build, and source the install/setup.bash file of the workspace. Unfortunately, after building and sourcing the workspace, ros2 cli cannot see either of the two workspaces. If i source the specific local setup file of the omron_ros2_agv package (&quot;install/omron_ros2_agv/share/omron_ros2_agv/local_setup.bash&quot;), then it works, and i can see the package in the ros2 pkg list. Am i doing something wrong? The cmake and package files of the omron_ros2_agv package are the following :</p> <pre><code>cmake_minimum_required(VERSION 3.8) project(omron_ros2_agv) add_compile_options(-std=c++17) add_compile_options(-Wall) add_compile_options(-Wextra) add_compile_options(-Wno-unused-parameter) set(CMAKE_BUILD_TYPE Release) find_package(ament_cmake REQUIRED) find_package(angles REQUIRED) find_package(nav_msgs REQUIRED) find_package(rclcpp_action REQUIRED) find_package(rclcpp REQUIRED) find_package(std_msgs REQUIRED) find_package(tf2_ros REQUIRED) find_package(tf2_geometry_msgs REQUIRED) find_package(omron_ros2_msgs REQUIRED) find_package(geometry_msgs REQUIRED) find_package(sensor_msgs REQUIRED) find_package(nav_msgs REQUIRED) find_package(Boost REQUIRED COMPONENTS thread) add_executable(omron_ros2_agv_node src/ros2_omron_agv_node.cpp) target_include_directories(omron_ros2_agv_node PUBLIC <span class="math-container">$&lt;BUILD_INTERFACE:$</span>{CMAKE_CURRENT_SOURCE_DIR}/include&gt; $&lt;INSTALL_INTERFACE:include&gt;) target_compile_features(omron_ros2_agv_node PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 target_link_libraries(omron_ros2_agv_node Aria ArNetworking ) ament_target_dependencies(omron_ros2_agv_node <span class="math-container">${$</span>{PROJECT_NAME}_EXPORTED_TARGETS} rclcpp tf2_ros sensor_msgs omron_ros2_msgs geometry_msgs angles nav_msgs tf2_geometry_msgs) install( TARGETS omron_ros2_agv_node DESTINATION lib/${PROJECT_NAME} ) ament_export_dependencies( rclcpp rclcpp_lifecycle <span class="math-container">${$</span>{PROJECT_NAME}_EXPORTED_TARGETS} ) ament_package() </code></pre> <p>package.xml :</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;?xml-model href=&quot;http://download.ros.org/schema/package_format3.xsd&quot; schematypens=&quot;http://www.w3.org/2001/XMLSchema&quot;?&gt; &lt;package format=&quot;3&quot;&gt; &lt;name&gt;omron_ros2_agv&lt;/name&gt; &lt;version&gt;0.1.0&lt;/version&gt; &lt;description&gt;The omron_driver package&lt;/description&gt; &lt;maintainer email=&quot;stiima@todo.todo&quot;&gt;stiima&lt;/maintainer&gt; &lt;license&gt;BSD-3-Clause&lt;/license&gt; &lt;author&gt;Stiima&lt;/author&gt; &lt;buildtool_depend&gt;ament_cmake&lt;/buildtool_depend&gt; &lt;build_depend&gt;omron_ros2_msgs&lt;/build_depend&gt; &lt;depend&gt;angles&lt;/depend&gt; &lt;depend&gt;actionlib&lt;/depend&gt; &lt;depend&gt;actionlib_msgs&lt;/depend&gt; &lt;depend&gt;move_base_msgs&lt;/depend&gt; &lt;depend&gt;nav_msgs&lt;/depend&gt; &lt;depend&gt;roscpp&lt;/depend&gt; &lt;depend&gt;sensor_msgs&lt;/depend&gt; &lt;depend&gt;std_msgs&lt;/depend&gt; &lt;depend&gt;std_srvs&lt;/depend&gt; &lt;depend&gt;tf2_ros&lt;/depend&gt; &lt;!-- The export tag contains other, unspecified, tags --&gt; &lt;export&gt; &lt;!-- Other tools can request additional information be placed here --&gt; &lt;/export&gt; &lt;/package&gt; </code></pre> <p>Thanks</p> <hr /> <p><a href="https://answers.ros.org/question/408985/package-not-fount-when-sourcing-workspace/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/32095/muttidrhummer/" rel="nofollow noreferrer">muttidrhummer</a> on ROS Answers with karma: 71 on 2022-11-04</p> <p>Post score: 0</p>
package not fount when sourcing workspace
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>To me it makes more sense to create another nodelet implementing the filter you propose, and chaining it in between the camera driver and pointcloud-to-laserscan or depthimage-to-laserscan. Using nodelets means that the performance won't get reduced by publishing / subscribing, and the code will be reusable for other use cases.</p> <p>Indeed, I would be surprised if there aren't filters already available as open source. If not, it would make a nice contribution to <a href="https://github.com/ros-perception" rel="nofollow noreferrer">https://github.com/ros-perception</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/1986/jorge/" rel="nofollow noreferrer">jorge</a> with karma: 2284 on 2022-11-06</p> <p>This answer was <strong>NOT 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-11-08</strong>:<br /> @jorge I've been trying to get the laser_filter to work, how do I chain it between a cmaera driver and the other packages?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/1986/jorge/" rel="nofollow noreferrer">jorge</a> on 2022-11-08</strong>:<br /> What I understood is that you have a noisy 3D camera and you want to filter the pointcloud or the depth images. For that, you need to find or write a filter nodelet for each case, and chain with publish-subscribe (represented as ----&gt; here), e.g.</p> <pre><code>cam driver ----&gt; point cloud filter ----&gt; pointcloud-to-laserscan cam driver ----&gt; depth image filter ----&gt; depthimage-to-laserscan </code></pre>
102663
2022-11-04T14:55:19.000
|ros-kinetic|laserscan|pointcloud|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I need to add filters to my <code>pointcloud</code> and<code> depthimage</code> data before converting them to <code>laserscan</code> data due to noise. Seeing as there are weel knwon packages (pointcloud-to-laserscan, depthimage-to-laserscan) that do these conversions, I was thinking to modify the source code of these packages by adding a median filter for instance,in the case of depthimage. Looking at the source code of the <a href="https://github.com/ros-perception/pointcloud_to_laserscan/blob/indigo-devel/src/pointcloud_to_laserscan_nodelet.cpp" rel="nofollow noreferrer">pointcloud-to-laserscan</a> package for instance, it's unclear where in the code I can implement the filter, if that's possible. Does anyone have experience with this? or is there an easier way about this?</p> <hr /> <p><a href="https://answers.ros.org/question/409005/how-to-add-filter-to-pointcloud_to_laserscan-package-and-depthimage_to_laserscan-package/" 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-04</p> <p>Post score: 0</p>
How to add filter to pointcloud_to_laserscan package and depthimage_to_laserscan package
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>As @gvdhoorn has pointed out, it seems that you have not installed dependencies. Please follow the <a href="https://github.com/xArm-Developer/xarm_ros/tree/9d5f61e058e30bcabc965b78587eba4d3759fbc9#43-install-other-dependent-packages" rel="nofollow noreferrer">documentation</a> carefully.</p> <p>For the error mentioned above, the <code>combined-robot-hw</code> package can be installed with the following command:</p> <pre><code>sudo apt install ros-noetic-combined-robot-hw </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-11-05</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102666
2022-11-04T16:04:31.000
|ros|arm-controller|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, I tried cloning the repository following the instruction on the master branch (<a href="https://github.com/xArm-Developer/xarm_ros" rel="nofollow noreferrer">https://github.com/xArm-Developer/xarm_ros</a>), however while doing catkin_make I am getting the following error, please help me through this. I feel like something is wrong with the controller package on their github.</p> <pre><code>``` -- Could NOT find combined_robot_hw (missing: combined_robot_hw_DIR) -- Could not find the required component 'combined_robot_hw'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found. CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by &quot;combined_robot_hw&quot; with any of the following names: combined_robot_hwConfig.cmake combined_robot_hw-config.cmake Add the installation prefix of &quot;combined_robot_hw&quot; to CMAKE_PREFIX_PATH or set &quot;combined_robot_hw_DIR&quot; to a directory containing one of the above files. If &quot;combined_robot_hw&quot; provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): xarm_ros/xarm_controller/CMakeLists.txt:12 (find_package) -- Configuring incomplete, errors occurred! See also &quot;/home/akumar/catkin_ws/build/CMakeFiles/CMakeOutput.log&quot;. See also &quot;/home/akumar/catkin_ws/build/CMakeFiles/CMakeError.log&quot;. ``` </code></pre> <hr /> <p><a href="https://answers.ros.org/question/409007/could-not-find-combined_robot_hw-(missing:-combined_robot_hw_dir)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-11-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 2022-11-05</strong>:\</p> <blockquote> <p>I feel like something is wrong with the controller package on their github.</p> </blockquote> <p>let's not jump to conclusions too quick.</p> <p>Did you follow the steps in the <a href="https://github.com/xArm-Developer/xarm_ros/tree/9d5f61e058e30bcabc965b78587eba4d3759fbc9#43-install-other-dependent-packages" rel="nofollow noreferrer">Install other dependent packages</a> section of the readme?</p>
Could NOT find combined_robot_hw (missing: combined_robot_hw_DIR)
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>One method is to write a script to generate a new bag file using the rosbag API. See these links:</p> <p><a href="http://wiki.ros.org/rosbag/Code%20API" rel="nofollow noreferrer">http://wiki.ros.org/rosbag/Code%20API</a></p> <p><a href="http://wiki.ros.org/rosbag/Cookbook" rel="nofollow noreferrer">http://wiki.ros.org/rosbag/Cookbook</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-11-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
102668
2022-11-05T03:46:06.000
|ros|ros-melodic|rosbag|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I use the MIT dataset to evaluate the gmapping algorithm, but the coordinate transformation maintained in the/tf topic published in the dataset is as follows:</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16676372832907424.png" alt="image description" /></p> <p>I need to use the original odom coordinate system to build /tf instead of odom_ combined. Known as topic/base_ odometry/odom releases the coordinate transformation of odom. Could you please release a new/tf topic, as shown in the figure below:</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1667637957702933.png" alt="image description" /></p> <hr /> <p><a href="https://answers.ros.org/question/409013/how-to-change-the-/tf-topic-message-published-in-the-data%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-05</p> <p>Post score: 0</p>
How to change the /tf topic message published in the data?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Answered here: <a href="http://official-rtab-map-forum.206.s1.nabble.com/Is-this-enough-to-integrate-RTABMap-and-GPS-tp9192p9208.html" rel="nofollow noreferrer">http://official-rtab-map-forum.206.s1.nabble.com/Is-this-enough-to-integrate-RTABMap-and-GPS-tp9192p9208.html</a></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-11-26</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102670
2022-11-07T03:20:29.000
|ros|slam|navigation|3d-slam|rtabmap|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello.</p> <p>I want to integrate RTABMap and GPS.</p> <p>I currently have a T265 and a D455 available for RTABMap.</p> <p>I am using Ubuntu 20.04, ROS Noetic.</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;$(find rtabmap_ros)/launch/config/rgbd_gui.ini&quot; /&gt; &lt;arg name=&quot;rviz_cfg&quot; default=&quot;$(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;arg name=&quot;gps_topic&quot; default=&quot;/ubox/fix&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;!--&lt;arg name=&quot;approx_sync&quot; value=&quot;<span class="math-container">$(arg approx_sync)"/&gt;--&gt; &lt;arg name="gps_topic" value="$</span>(arg gps_topic)&quot; /&gt; &lt;/include&gt; &lt;/launch&gt; </code></pre> <p>I added <code>&lt;arg name=&quot;gps_topic&quot; default=&quot;/ubox/fix&quot; /&gt;</code> and <code>&lt;arg name=&quot;gps_topic&quot; value=&quot;$(arg gps_topic)&quot; /&gt;</code> to use GPS with RTABMap.</p> <p>Question ①.</p> <p>Can I say that I have integrated GPS into RTABMap now?</p> <p>Question ②.</p> <p>In response to the question &quot;I want to compare before and after adding GPS?&quot; in the following post, matlabbe replied &quot;There is a /gps/fix input topic to rtabmap node. To use GPS in graph You may check this post and this post that show how GPS and SLAM trajectories can be You may check this post and this post that show how GPS and SLAM trajectories can be visualized in rtabmap-databaseViewer. But I could not find &quot;Optimizer/PriorsIgnored&quot; anywhere about RTABMap. Where can I add or change this setting?</p> <p><a href="http://official-rtab-map-forum.206.s1.nabble.com/how-to-identify-that-GPS-has-affected-rtabmap-localization-td8383.html" rel="nofollow noreferrer">http://official-rtab-map-forum.206.s1.nabble.com/how-to-identify-that-GPS-has-affected-rtabmap-localization-td8383.html </a></p> <p>rqt_graph when the RTABMap launch file is run <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16678090773363263.png" alt="rqt_graph" /></p> <hr /> <p><a href="https://answers.ros.org/question/409058/%5Bnoetic,-rtabmap,-gps%5Di-want-to-use-gps-with-rtabmap./" 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-11-07</p> <p>Post score: 0</p>
[Noetic, RTABMap, GPS]I want to use GPS with RTABMap
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>Will installing MotoPlus [..]</p> </blockquote> <p>First: on a YRC1000, you would not be &quot;<em>installing MotoPlus</em>&quot;. MotoPlus (the SDK at least) is a development environment you'd install on a Windows PC. The runtime environment is already present on the YRC1000. The only thing you would do is install <em>MotoROS</em>. That's a MotoPlus <em>application</em>, and the part which runs on the YRC1000.</p> <blockquote> <p>Will installing MotoPlus have any effect on the &quot;standard&quot; functioning of the pendant?</p> </blockquote> <p>No.</p> <blockquote> <p>Will the installation impact the behavior of other control methods?</p> </blockquote> <p>No.</p> <p>MotoROS1 uses a regular INFORM job to control when the ROS node would have control over the robot. If that job isn't active, no external control is possible.</p> <p>MotoROS1 will attempt to start the job though if the ROS node asks it to. But it can only do that if the controller is in remote mode (ie: the Programming Pendant is not the single point of control).</p> <p>All other INFORM programs can still run as normal and the robot would not start moving &quot;suddenly&quot; just because a ROS node wants it to. You have to actively allow MotoROS1 to take control.</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-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102672
2022-11-07T07:26:46.000
|ros|moveit|motoman-driver|motoman|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone,</p> <p>I want to control a Yaskawa motoman gp7 robot arm with ROS. For that I am following <a href="http://wiki.ros.org/motoman_driver/Tutorials/indigo/InstallServer" rel="nofollow noreferrer">this tutorial</a> on how to install the necessary software on the arm's controller. In my case the GP7 has a YRC1000 with a Standard Pendant.</p> <p>The thing is, I am not the only user of the arm, it is setup there for different users to experiment and such using other control methods such as programming with the <em>teach pendant</em>.</p> <p>Will installing MotoPlus have any effect on the &quot;standard&quot; functioning of the pendant? Will the installation impact the behavior of other control methods?</p> <hr /> <p><a href="https://answers.ros.org/question/409064/implications-of-installing-motoplus-on-controller-for-non-ros-users/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/123049/gas_patxo/" rel="nofollow noreferrer">gas_patxo</a> on ROS Answers with karma: 3 on 2022-11-07</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-07</strong>:<br /> Btw: this question would <em>probably</em> have been better asked on the <a href="https://github.com/ros-industrial/motoman/discussions" rel="nofollow noreferrer">Discussion board</a> of <code>ros-industrial/motoman</code> on Github.</p> <p>It's technically not a ROS question, as it's about MotoPlus and Yaskawa Motoman robots.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/123049/gas_patxo/" rel="nofollow noreferrer">gas_patxo</a> on 2022-11-08</strong>:<br /> Got it, thank you. I decided to post it here because in the <a href="http://wiki.ros.org/motoman_driver/Tutorials/indigo/InstallServer" rel="nofollow noreferrer">mentioned tutorial</a> it is written:</p> <blockquote> <p>Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS &amp; ROS, and also add appropriate tags.</p> </blockquote>
Implications of installing MotoPlus on controller for non-ROS users
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I figure out that It is essential to run rosbridge on the computer where you want to send data to. After installing rosbridge using the following command <code>sudo apt-get install ros-&lt;rosdistro&gt;-rosbridge-server</code> and launching using the command <code>roslaunch rosbridge_server rosbridge_websocket.launch</code> it was working perfectly. I would like to suggest to take care of the port number as rosbridge usually use 9090 and any different port number in the code could lead to error.</p> <p>I am closing this issue as it has been solved. If the problem persists, please comment and the issue will be reopened if appropriate.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> with karma: 61 on 2022-11-08</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102674
2022-11-07T16:12:07.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, how can I publish data from rust to ROS running on two different computers. I am trying to use the following library but it does not contain any example for my use case where I want to transfer my data to another computer where ROS will be running.</p> <p><a href="https://github.com/adnanademovic/rosrust" rel="nofollow noreferrer">https://github.com/adnanademovic/rosrust</a></p> <hr /> <p><a href="https://answers.ros.org/question/409083/publishing-data-from-rust-to-ros/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-11-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-11-07</strong>:<br /> I think you wanted to copy &amp; paste a link to this library/write its name, but it is not here. Please update your question.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on 2022-11-07</strong>:<br /> I updated the question.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-11-07</strong>:<br /> This question may be related to #q409094</p>
Publishing data from Rust to Ros
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I figure out that It is essential to run rosbridge on the computer where you want to send data to. After installing rosbridge using the following command <code>sudo apt-get install ros-&lt;rosdistro&gt;-rosbridge-server</code> and launching using the command <code>roslaunch rosbridge_server rosbridge_websocket.launch</code> it was working perfectly. I would like to suggest to take care of the port number as rosbridge usually use 9090 and any different port number in the code could lead to error.</p> <p>I am closing this issue as it has been solved. If the problem persists, please comment and the issue will be reopened if appropriate.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> with karma: 61 on 2022-11-08</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102676
2022-11-07T21:08:15.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I would like to know how I can send data to different computer, I initiated with sending data into the same machine using the code. However, getting the following error message, is there a specific way on entering the IP address or any other requirement that needs to be taken care of before starting sending the message. Like do I need to install rosbridge and run it before sending the message.</p> <p><strong>Error</strong></p> <pre><code>[roslibrust::rosbridge::client] Failed to reconnect: CommFailure(Io(Os { code: 111, kind: ConnectionRefused, message: &quot;Connection refused&quot; })) </code></pre> <p><strong>CODE</strong></p> <pre><code>use log::*; use roslibrust::ClientHandle; roslibrust_codegen_macro::find_and_generate_ros_messages!(&quot;assets/ros1_common_interfaces/std_msgs&quot;); /// This example creates a client, and publishes a message to the topic &quot;talker&quot; /// Running this example at the same time as subscribe_and_log will have the two examples /// pass messages between each other. /// To run this example a rosbridge websocket server should be running at the deafult port (9090). #[tokio::main(flavor = &quot;multi_thread&quot;)] async fn main() -&gt; Result&lt;(), Box&lt;dyn std::error::Error + Send + Sync&gt;&gt; { simple_logger::SimpleLogger::new() .with_level(log::LevelFilter::Debug) .without_timestamps() // required for running wsl2 .init() .unwrap(); let client = ClientHandle::new(&quot;ws://localhost:9080&quot;).await?; let publisher = client.advertise::&lt;std_msgs::Header&gt;(&quot;talker&quot;).await?; loop { let msg = std_msgs::Header::default(); info!(&quot;About to publish&quot;); publisher.publish(msg).await.unwrap(); info!(&quot;Published msg...&quot;); tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; } } </code></pre> <hr /> <p><a href="https://answers.ros.org/question/409094/publishing-to-ros-node-running-on-different-computer/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-11-07</p> <p>Post score: 0</p>
Publishing to ROS node running on different Computer
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>I observe a shift/drift between /map and /odom frames and I have my odometry track which is getting disturbed.</p> </blockquote> <p>Any other issues notwithstanding, you absolutely will see the <code>/map</code> and <code>/odom</code> frames drift from one another. This is expected and correct. See <a href="https://www.ros.org/reps/rep-0105.html" rel="nofollow noreferrer">REP-105</a> for details.</p> <p>You should really include a sample message from each sensor input, but I can see some things in your config that I would address:</p> <ol> <li>In your <code>ekf_local</code> instance, instead of fusing the robot's wheel encoder pose data, I'd recommend fusing the wheel encoder velocity data, if the sensor produces it. You only have one source here, so you can also leave this as-is if you like. However, I question the need for the first EKF instance then: you might as well see if your wheel encoder odometry node supports publishing the <code>odom</code>-&gt;<code>base_link</code> transform itself. If it does, you can drop <code>ekf_local</code>.</li> <li>Your biggest issue in the <code>ekf_global</code> instance is that you are fusing two different sources of absolute X and Y position data, one from your wheel encoders and one from your GPS data. Those sources will not agree with one another at all over time, and will diverge. Your state estimate will start to jump back and forth as it receives each measurement. You need to instead fuse the velocity data from the wheel encoders if it produces it (get rid of the <code>XY</code> position data). If your wheel encoders don't produce that data, then fuse X, Y, <strong>and yaw</strong>, but turn on <code>differential</code> mode.</li> <li>Does your <code>gps_heading</code> topic have the same coordinate frame as the <code>XY</code> position data? In other words, if your <code>odometry/gps</code> data moved the robot from <code>(0, 0)</code> to <code>(1, 1)</code>, would the <code>gps_heading</code> topic read <code>pi / 4</code>? I am guessing not. Those have to be in agreement (or the relevant transform must exist to make sure they do). If they disagree, the prediction step will project the robot forward in the direction of the heading, but then get corrected to the <code>odometry/gps</code> data's <code>XY</code> coordinate, which will give the estimate a weird saw-tooth look.</li> </ol> <p>I could comment more with sample sensor messages, but those are definitely issues that should be addressed.</p> <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-04-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/4040/cyril-jourdan/" rel="nofollow noreferrer">Cyril Jourdan</a> on 2023-04-26</strong>:<br /> Hi Tom, thanks a lot for your comment. Your suggestions are exactly the kind of issues we have encounter. First, the gps_heading which was generated from 2 GPS had an inverted direction, so it worked already much better after putting a value of Pi for the navsat_transform yaw_offset. We also moved its TF above the middle of the wheels to avoid the saw-tooth effect. We recently tried without ekf_local and will check this idea of fusing the wheel velocity or differential position.</p>
102678
2022-11-08T08:48:19.000
|navigation|ros2|odometry|mapping|robot-localization|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello everyone,</p> <p>I use ROS2 Foxy along with robot_localization. I have a differential wheeled robot with odometry and 2 GPS rtk for position and heading.</p> <p>The sensors work properly independently. I have a clean odometry track and the heading is working fine. The problem occurs when I merge them using robot_localization, with two ekf_localisation_node (local and global) and one navsat_transform_node. I observe a shift/drift between /map and /odom frames and I have my odometry track which is getting disturbed.</p> <p>Under mapviz, using /map as fixed and target frame :</p> <ul> <li>red and orange tracks are similar (/odom and /odometry/filtered/local)</li> <li>yellow track is /odometry/gps</li> <li>blue track is tf_frame with /odom frame (which has /map as a direct parent)</li> <li>black track is /odometry/filtered/global</li> </ul> <p>The blue track can become completely crazy : <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1667914644885035.png" alt="image description" /></p> <p>Here are the parameters used in localization.yaml</p> <pre><code>navsat_transform: ros__parameters: magnetic_declination_radians: 0.0387 yaw_offset: 0.0 zero_altitude: true # True if operating in 2D publish_filtered_gps: true use_odometry_yaw: true wait_for_datum: false use_local_cartesian: false frequency: 30.0 # Hz delay: 0.0 # Seconds transform_timeout: 0.0 broadcast_utm_transform: false broadcast_utm_transform_as_parent_frame: false ekf_local: ros__parameters: frequency: 30.0 # Hz sensor_timeout: 0.1 # Seconds two_d_mode: true # No 3D information will be used (zero_altitude already set to true) publish_acceleration: false publish_tf: true reset_on_time_jump: false map_frame: map # Defaults to &quot;map&quot; if unspecified odom_frame: odom # Defaults to &quot;odom&quot; if unspecified base_link_frame: base_footprint # Defaults to &quot;base_link&quot; if unspecified world_frame: odom # Defaults to the value of odom_frame if unspecified odom0: odom # Wheel odometry odom0_config: [true, true, false, # [x, y, z] false, false, true, # [roll, pitch, yaw] false, false, false, # [x_vel, y_vel, z_vel] false, false, false, # [roll_vel, pitch_vel, yaw_vel] false, false, false] # [x_accel, y_accel, z_accel] odom0_nodelay: true odom0_differential: false odom0_relative: false odom0_queue_size: 30 ekf_global: ros__parameters: frequency: 30.0 # Hz sensor_timeout: 0.1 # Seconds two_d_mode: true # No 3D information will be used (zero_altitude already set to true) publish_acceleration: false publish_tf: true reset_on_time_jump: false map_frame: map # Defaults to &quot;map&quot; if unspecified odom_frame: odom # Defaults to &quot;odom&quot; if unspecified base_link_frame: base_footprint # Defaults to &quot;base_link&quot; if unspecified world_frame: map # Defaults to the value of odom_frame if unspecified odom0: odometry/gps # navsat_transform_node output odom0_config: [true, true, false, # [x, y, z] false, false, false, # [roll, pitch, yaw] false, false, false, # [x_vel, y_vel, z_vel] false, false, false, # [roll_vel, pitch_vel, yaw_vel] false, false, false] # [x_accel, y_accel, z_accel] odom0_nodelay: true odom0_differential: false odom0_relative: false odom0_queue_size: 30 odom1: odom # Wheel odometry odom1_config: [true, true, false, # [x, y, z] false, false, false, # [roll, pitch, yaw] false, false, false, # [x_vel, y_vel, z_vel] false, false, false, # [roll_vel, pitch_vel, yaw_vel] false, false, false] # [x_accel, y_accel, z_accel] odom1_nodelay: true odom1_differential: false odom1_relative: false odom1_queue_size: 30 imu0: gps_heading imu0_config: [false, false, false, # [x, y, z] false, false, true, # [roll, pitch, yaw] false, false, false, # [x_vel, y_vel, z_vel] false, false, false, # [roll_vel, pitch_vel, yaw_vel] false, false, false] # [x_accel, y_accel, z_accel] imu0_nodelay: false imu0_differential: false imu0_relative: false imu0_queue_size: 30 </code></pre> <p>Do you have any idea what is causing this behavior ?</p> <p>Many thanks</p> <hr /> <p><a href="https://answers.ros.org/question/409127/robot_localization-/map-/odom-drift/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/4040/cyril-jourdan/" rel="nofollow noreferrer">Cyril Jourdan</a> on ROS Answers with karma: 157 on 2022-11-08</p> <p>Post score: 0</p>
robot_localization /map /odom drift
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You may look in this code</p> <p><a href="http://docs.ros.org/en/melodic/api/cartographer_ros/html/pbstream__to__ros__map__main_8cc_source.html" rel="nofollow noreferrer">http://docs.ros.org/en/melodic/api/cartographer_ros/html/pbstream__to__ros__map__main_8cc_source.html</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> with karma: 1999 on 2022-11-08</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/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-11-09</strong>:<br /> Thank you for your help. You already answered my question, but have you any thoughts, how to solve this 'ModuleNotFoundError: No module named &quot;cartographer.mapping&quot; ' problem?</p>
102680
2022-11-08T09:22:56.000
|ros|
<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 need to read .pbstream file. I need to achieve result like <a href="https://github.com/meyerjo/cartographer-read-pbstream" rel="nofollow noreferrer">this</a>. I already tried to use script from this repository and I have this error and steel couldn't resolved it:</p> <pre><code>Traceback (most recent call last): File &quot;main.py&quot;, line 5, in &lt;module&gt; from pbstream.reader import PBstream_Reader File &quot;&lt;frozen zipimport&gt;&quot;, line 259, in load_module File &quot;/usr/local/lib/python3.8/dist-packages/pbstream-0.0.1-py3.8.egg/pbstream/reader.py&quot;, line 9, in &lt;module&gt; ModuleNotFoundError: No module named 'cartographer.mapping' </code></pre> <p>Is there any package that solves this task or maybe is there any suggestion how to solve this No module named 'cartographer.mapping' problem. Appreciate any help</p> <hr /> <p><a href="https://answers.ros.org/question/409130/is-there-a-way-to-read-.pbstream-file?/" 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-08</p> <p>Post score: 0</p>
Is there a way to read .pbstream file?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It's from <code>tf2_ros::MessageFilter</code>, not <code>message_filters</code> itself (that's a different package, different class).</p> <p>Specifically, <a href="https://github.com/ros2/geometry2/blob/53b782b5e873966369d6b70083fdc3e353a0ad51/tf2_ros/include/tf2_ros/message_filter.h#L700-L710" rel="nofollow noreferrer">here</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-11-09</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102682
2022-11-08T10:16:39.000
|ros2|message-filters|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm trying to debug find the root cause that generate this kind of error messages:</p> <pre><code>[planner_server-17] [INFO] [1667918874.743278206] [global_costmap.global_costmap]: Message Filter dropping message: frame 'laser_merged' at time 1667918874.441 for reason 'the timestamp on the message is earlier than all the data in the transform cache' </code></pre> <p>But I could not find in the code for Humble of the whole <a href="https://github.com/ros-planning/navigation2/tree/humble" rel="nofollow noreferrer">nav2 repo</a> nor the <a href="https://github.com/ros2/message_filters/tree/humble" rel="nofollow noreferrer">message_filters</a> any code printing this message, by CTRL+F its keywords like &quot;earlier&quot;, &quot;for reason&quot;, &quot;Message Filter dropping message&quot;...</p> <p>Where does this message comes from ?</p> <hr /> <p><a href="https://answers.ros.org/question/409132/where-does-message-%22message-filter-dropping-message%22-comes-from/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/71833/patoinso/" rel="nofollow noreferrer">PatoInso</a> on ROS Answers with karma: 109 on 2022-11-08</p> <p>Post score: 0</p>
Where does message "Message Filter dropping message" comes from
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Edit:</p> <blockquote> <p><strong>What I've already tried</strong></p> <p>Building with</p> <pre><code><span class="math-container">$ MAKEFLAGS="-j1 -l1" &gt; $</span> colcon build --executor sequential </code></pre> </blockquote> <p>apologies, as I only now noticed you'd already configured Colcon to reduce/disable build parallelism.</p> <p>I'm a bit uncertain whether <code>MAKEFLAGS=&quot;-j1 -l1&quot;</code> on its own line like that would work though. I would at least expect you to have to run <code>export MAKEFLAGS=&quot;-j1 -l1&quot;</code>, or otherwise <code>MAKEFLAGS=&quot;-j1 -l1&quot; colcon build --executor sequential</code>.</p> <p>If you're still running into this problem, it's likely there isn't anything at the Colcon/CMake level you can do about this.</p> <p>Note that an A53 has about 1/100th of the performance of a typical desktop processor. So things taking a little longer would not be unexpected I believe.</p> <hr /> <p>Original answer:</p> <p>It's very likely this is caused by C++ template instantiation.</p> <p><code>rclcpp</code> is template heavy, and the type support code is as well.</p> <p>By default, Colcon will ask CMake to use all CPU cores available for a build. On embedded systems, especially without any swap, this will typically lead to memory becoming the bottleneck (ie: there is not enough memory to let the compiler 'comfortably' use all the cores).</p> <p>You have various ways to reduce parallelism (and thereby most likely also work around the limited available memory) with Colcon. See #q368249 and #q304300 for previous discussions.</p> <p>Adding some swap also typically helps, but you may not have that possibility.</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-09</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/64636/holunder/" rel="nofollow noreferrer">holunder</a> on 2022-11-22</strong>:<br /> I've added 4 GB of swap to the machine and found that build eventually completes now. Thanks a lot for guiding me in this direction.</p> <p>Unfortunately, it still needs quite long (30 minutes) to complete.</p>
102684
2022-11-08T11:20:55.000
|ros|ros2|colcon|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><strong>Problem</strong></p> <p>I try to build a ros2 package and run out of memory so that the system gets unresponsive or the process is terminated.</p> <p>I'm using ros2 foxy on ubuntu 20.04</p> <p><strong>Hardware</strong></p> <ul> <li>CPU: 4 x ARM A53</li> <li>RAM: 4 GB</li> <li>Swap: 0 Byte</li> </ul> <p><strong>Package</strong></p> <p>It's a single node without any functionality. I've created about 65 custom ros messages as <em>idl</em> files.</p> <p>As soon as I create subscriber for each message with empty callback functions, the build process ends up in consuming whole memory.</p> <p>Example Code:</p> <pre><code>// Subscriber cust1_gen_Sub = this-&gt;create_subscription&lt;my_pkg::msg::Cust1&gt;(&quot;cust1_gen&quot;, 10, std::bind(&amp;Nd::topic_callback_Cust1_gen, this, _1)); // Callback void Nd::topic_callback_Cust1_gen(const my_pkg::msg::Cust1::SharedPtr msg) const { // empty } </code></pre> <p>My <code>CMakeLists.txt</code> is this</p> <pre><code>cmake_minimum_required(VERSION 3.5) project(my_pkg) # Default to C99 if(NOT CMAKE_C_STANDARD) set(CMAKE_C_STANDARD 99) endif() # 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 dependencies find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(std_msgs REQUIRED) find_package(builtin_interfaces REQUIRED) find_package(rosidl_default_generators REQUIRED) rosidl_generate_interfaces(${PROJECT_NAME} &quot;msg/Cust1.idl&quot; ... &quot;msg/Cust65.idl&quot; DEPENDENCIES builtin_interfaces ) ament_export_dependencies(rosidl_default_runtime) include_directories(include/${PROJECT_NAME}) add_executable(Nd xs/nd.cpp) ament_target_dependencies(Nd rclcpp std_msgs) rosidl_target_interfaces(Nd ${PROJECT_NAME} &quot;rosidl_typesupport_cpp&quot;) ament_package() </code></pre> <p><strong>Observation</strong></p> <p>Observed memory consumption during build by means of <em>htop</em>. While building the message file objects, it's up to 800 MB Mem usage</p> <p>Sometimes it simply stucks for hours, sometimes the process gets aborted after 10 minuts.</p> <p>Process which consumes whole memory as shown by <code>ps aux</code></p> <pre><code>/usr/lib/gcc/aarch64-linux-gnu/9/cc1plus -quiet -I .../my_pkg -I build/my_pkg/rosidl_generator_cpp -imultiarch aarch64-linux-gnu -D_GNU_SOURCE -D DEFAULT_RMW_IMPLEMENTATION=rmw_fastrtps_cpp -D RCUTILS_ENABLE_FAULT_INJECTION -D ROS_PACKAGE_NAME=&quot;my_pkg&quot; -D SPDLOG_COMPILED_LIB -isystem /opt/ros/foxy/include my_pkg/Nd.cpp -quiet -dumpbase Nd.cpp -mlittle-endian -mabi=lp64 -auxbase-strip CMakeFiles/Nd.dir/os/Nd/Nd.cpp.o -Wall -Wextra -Wpedantic -std=gnu++14 -fasynchronous-unwind-tables -fstack-protector-strong -Wformat-security -fstack-clash-protection -o /tmp/ccd6zsmm.s </code></pre> <p><strong>What I've already tried</strong></p> <p>Building with</p> <pre><code><span class="math-container">$ MAKEFLAGS="-j1 -l1" $</span> colcon build --executor sequential </code></pre> <p><strong>Questions</strong></p> <p>Is there anything I could try to solve the issue and speed up the build on my device? I was used to build my project on target in ROS1. Is this not suitable for devices of this performance?</p> <hr /> <p><a href="https://answers.ros.org/question/409136/build-of-ros2-package:-out-of-memory/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/64636/holunder/" rel="nofollow noreferrer">holunder</a> on ROS Answers with karma: 20 on 2022-11-08</p> <p>Post score: 0</p>
Build of ROS2 package: Out of memory
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Perhaps QML could suit you:</p> <ul> <li><p><a href="https://discourse.ros.org/t/create-stunning-uis-for-ros2-using-the-newly-released-qml-ros2-plugin/25906" rel="nofollow noreferrer">https://discourse.ros.org/t/create-stunning-uis-for-ros2-using-the-newly-released-qml-ros2-plugin/25906</a></p> </li> <li><p><a href="https://github.com/StefanFabian/qml_ros2_plugin" rel="nofollow noreferrer">https://github.com/StefanFabian/qml_ros2_plugin</a></p> </li> </ul> <blockquote> <p>Connects QML and ROS2 enabling the simple creation of great looking Graphical User Interfaces for robotics applications.</p> </blockquote> <p>I would also like to see other answers with pure RViz and ROS2 launch files</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-11-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/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-11-09</strong>:<br /> Thank you for your help. As far as I understand this is not what I looking for. I already have rqt interface to work with my robot, the problem is I don't have necessary package which allows me to launch specific list of launch files for different requirements. Still, I appreciate that you are trying to help.</p>
102686
2022-11-09T06:55:56.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. In my ROS1 project I have a python script that can launch specific list of launch files depending on clicked button in rqt. This script have following lines of code:</p> <pre><code>import roslaunch ... class RosService(roslaunch.pmon.ProcessListener): ... self.uuid = roslaunch.rlutil.get_or_generate_uuid(None, False) ... self.launch_path = roslaunch.rlutil.resolve_launch_arguments(args)[0] ... self.parent = roslaunch.parent.ROSLaunchParent(self.uuid, [(self.launch_path,self.launch_args)], process_listeners = [self], force_screen = self.force_screen, force_log = self.force_log) </code></pre> <p>Is there a way to use something similar in ROS2? I know that there are ros2launch package, but, maybe I miss something, as far as I understand this package is very much different from roslaunch from ROS1. Appreciate any help. If there is an example of implementation similar functionality in any other project, I would be very grateful for chance to look on it.</p> <hr /> <p><a href="https://answers.ros.org/question/409181/is-there-roslaunch-python-package-in-ros2?/" 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-09</p> <p>Post score: 1</p>
Is there roslaunch python package in ros2?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have not tried it, but I see that this features was added to rclpy Rolling just 2 days ago:</p> <p><a href="https://github.com/ros2/rclpy/issues/953" rel="nofollow noreferrer">https://github.com/ros2/rclpy/issues/953</a></p> <p><a href="https://github.com/ros2/rclpy/pull/960" rel="nofollow noreferrer">https://github.com/ros2/rclpy/pull/960</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-11-17</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-18</strong>:<br /> Thank you for your help. I'm working with Foxy for now, but it still a huge help. I'll check it.</p>
102688
2022-11-10T03:20:38.000
|ros|ros2|rclpy|
<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 following line of code in my ROS1 project:</p> <pre><code>trajectory = rospy.wait_for_message('/trajectory_node_list', MarkerArray, 1.0) </code></pre> <p>How this line should look in ros2? I have find <a href="https://answers.ros.org/question/378693/waitformessage-ros2-equivalent/" rel="nofollow noreferrer">this</a> and <a href="https://answers.ros.org/question/307370/ros2-whats-the-best-way-to-wait-for-a-new-message/" rel="nofollow noreferrer">this</a> links with similar question but those two was about C++ and newest one was asked more than year ago, so maybe something changed from those time. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/409214/is-there-an-equivalent-of-rospy.wait_for_message-in-ros2?/" 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-10</p> <p>Post score: 0</p>
Is there an equivalent of rospy.wait_for_message in ros2?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The echo command outputs the transform from the source frame to the target frame.</p> <p>The lookupTransform API provides the transform to take data from the <code>source_frame</code> to the <code>target_frame</code></p> <p>There's been a lot of threads about it one of the original is here: <a href="https://github.com/ros/geometry/issues/108" rel="nofollow noreferrer">https://github.com/ros/geometry/issues/108</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-11-11</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/95995/mrocw/" rel="nofollow noreferrer">MrOCW</a> on 2022-11-11</strong>:<br /> OK got it so to get coordinate of B with reference to coordinate of A, i have to use: tf_buffer_-&gt;lookupTransform(A Frame, B Frame_, tf2::TimePointZero);</p>
102690
2022-11-10T23:53:07.000
|ros|ros2|transforms|eigen|tf2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, I am writing code for transformations using apriltag.</p> <pre><code>tf_buffer_-&gt;lookupTransform(tag_frame_, camera_frame_, tf2::TimePointZero); </code></pre> <p>gives different transformation matrix values compared to</p> <pre><code>ros2 run tf2_ros tf2_echo camera_frame_ tag_frame_ </code></pre> <p>tf2_echo:</p> <pre><code>- Matrix: 0.984 0.162 -0.068 -0.405 0.123 -0.912 -0.391 -0.223 -0.125 0.376 -0.918 0.937 0.000 0.000 0.000 1.000 - Matrix: 0.962 0.256 -0.097 -0.311 0.199 -0.896 -0.396 -0.186 -0.189 0.362 -0.913 0.929 0.000 0.000 0.000 1.000 - Matrix: 0.972 0.234 -0.024 -0.437 0.215 -0.924 -0.316 -0.181 -0.097 0.302 -0.948 0.988 0.000 0.000 0.000 1.000 - Matrix: 0.957 0.289 0.033 -0.388 0.278 -0.876 -0.393 -0.157 -0.085 0.385 -0.919 0.986 0.000 0.000 0.000 1.000 - Matrix: 0.943 0.325 0.074 -0.327 0.332 -0.893 -0.305 -0.168 -0.033 0.313 -0.949 1.008 0.000 0.000 0.000 1.000 - Matrix: 0.952 0.299 -0.071 -0.174 0.266 -0.918 -0.295 -0.229 -0.153 0.262 -0.953 0.934 0.000 0.000 0.000 1.000 - Matrix: 0.934 0.323 -0.149 -0.099 0.264 -0.910 -0.320 -0.241 -0.239 0.260 -0.935 0.931 0.000 0.000 0.000 1.000 - Matrix: 0.911 0.301 -0.282 0.075 0.234 -0.941 -0.246 -0.252 -0.339 0.158 -0.928 0.982 0.000 0.000 0.000 1.000 - Matrix: 0.904 0.310 -0.295 0.175 0.253 -0.943 -0.215 -0.213 -0.345 0.120 -0.931 0.991 0.000 0.000 0.000 1.000 - Matrix: 0.853 0.311 -0.419 0.175 0.240 -0.947 -0.213 -0.211 -0.463 0.081 -0.883 0.865 0.000 0.000 0.000 1.000 </code></pre> <p>lookupTransform:</p> <pre><code>cam -&gt; tag: 0.993005 0.115175 -0.0259908 0.480949 0.115586 -0.903337 0.413064 -0.542837 0.0240963 -0.413179 -0.910331 0.743633 0 0 0 1 cam -&gt; tag: 0.961699 0.198847 -0.188665 0.511308 0.256293 -0.896393 0.361654 -0.422628 -0.097204 -0.396155 -0.913024 0.743996 6.91763e-310 7.29112e-304 0 1 cam -&gt; tag: 0.961699 0.198847 -0.188665 0.511308 0.256293 -0.896393 0.361654 -0.422628 -0.097204 -0.396155 -0.913024 0.743996 6.91763e-310 7.29112e-304 0 1 cam -&gt; tag: 0.956792 0.27811 -0.0848747 0.498498 0.28892 -0.876387 0.38532 -0.405495 0.0327782 -0.393193 -0.918872 0.856553 6.91763e-310 7.29112e-304 0 1 cam -&gt; tag: 0.939404 0.342707 -0.00846977 0.407591 0.326405 -0.886622 0.327659 -0.352925 0.104781 -0.310569 -0.944758 0.968488 6.91763e-310 7.29112e-304 0 1 cam -&gt; tag: 0.951675 0.266108 -0.153299 0.369307 0.29877 -0.917761 0.261632 -0.40231 -0.071069 -0.29479 -0.952916 0.809793 6.91763e-310 7.29112e-304 0 1 cam -&gt; tag: 0.934415 0.263749 -0.239384 0.379393 0.323434 -0.909803 0.260095 -0.429692 -0.149192 -0.320462 -0.935439 0.778602 6.91763e-310 7.29112e-304 0 1 cam -&gt; tag: 0.91128 0.234292 -0.338638 0.323273 0.300529 -0.940601 0.15796 -0.414841 -0.281515 -0.245716 -0.927563 0.869551 6.91763e-310 7.29112e-304 0 1 cam -&gt; tag: 0.916233 0.259035 -0.305643 0.234101 0.310183 -0.941478 0.131931 -0.384305 -0.253581 -0.215685 -0.942962 0.939625 6.91763e-310 7.29112e-304 0 1 cam -&gt; tag: 0.853249 0.240313 -0.462834 0.301601 0.310555 -0.947119 0.0807536 -0.32455 -0.418953 -0.212638 -0.882759 0.791917 6.91763e-310 7.29112e-304 0 1 </code></pre> <hr /> <p><a href="https://answers.ros.org/question/409243/lookuptransform-and-tf2_echo-shows-different-results/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/95995/mrocw/" rel="nofollow noreferrer">MrOCW</a> on ROS Answers with karma: 58 on 2022-11-10</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-11-11</strong>:<br /> Shouldn't the last row be <code>[0, 0, 0, 1]</code> in the output of lookupTransform of the right side?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> on 2022-11-11</strong>:<br /> Please copy and paste the console info into questions instead of screenshotting. It's not easily debugged without being able to copy and paste.</p>
lookupTransform and tf2_echo shows different results
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello @jenamax,</p> <p>I think You need to install the latest docker. In my case, installing version 20.10.14 helped. It did not work with 20.10.8</p> <p>Follow the below link's issues that were raised in GitHub.</p> <p><a href="https://github.com/osrf/docker_images/issues/623" rel="nofollow noreferrer">https://github.com/osrf/docker_images/issues/623</a></p> <p><a href="https://stackoverflow.com/questions/71941032/why-i-cannot-run-apt-update-inside-a-fresh-ubuntu22-04">https://stackoverflow.com/questions/71941032/why-i-cannot-run-apt-update-inside-a-fresh-ubuntu22-04</a></p> <p><a href="https://github.com/osrf/docker_images/issues/621" rel="nofollow noreferrer">https://github.com/osrf/docker_images/issues/621</a></p> <p>I think that will solve your problem,</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-11-11</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/123431/jenamax/" rel="nofollow noreferrer">jenamax</a> on 2022-11-12</strong>:<br /> Yes, after Docker update this problem was solved. Thank you!</p>
102692
2022-11-11T04:54:30.000
|ros2|docker|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello! I have the following issue when try to build a docker image based on ROS2 Humble. When I am running apt update for further installation of other packages I get the following error:</p> <pre><code>W: http://packages.ros.org/ros2/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true' E: Sub-process returned an error code </code></pre> <p>The same thing happens when I just pull the original image (osrf/ros:humble-desktop) and run apt update inside it</p> <hr /> <p><a href="https://answers.ros.org/question/409252/apt-update-fails-in-ros2-humble-docker-container/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/123431/jenamax/" rel="nofollow noreferrer">jenamax</a> on ROS Answers with karma: 1 on 2022-11-11</p> <p>Post score: 0</p>
apt update fails in ROS2 Humble docker container
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>follow #q325486 and <a href="https://answers.gazebosim.org//question/3172/timing-synchronisation-between-gazebo-and-ros/" rel="nofollow noreferrer">https://answers.gazebosim.org//question/3172/timing-synchronisation-between-gazebo-and-ros/</a></p> <p>and if you will this solved your problem, then close this question no need to duplicate it,</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-11-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102694
2022-11-11T07:37:21.000
|gazebo|ros2|octomap|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I have the following problem. I try to publish a pointcloud from a camera in gazebo onto my move_groups octomap configuration. The camera shows the correct image and I get a pointcloud on my /camera/points topic but as soon as I start my workspace I get the following error:</p> <pre><code>[move_group-13] [ERROR] [1668170556.088628285] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Transform error: Lookup would require extrapolation into the past. Requested time 136.418000 but the earliest data is at time 1668170546.080549, when looking up transform from frame [upper_arm_link] to frame [camera_link] [move_group-13] [ERROR] [1668170556.088732748] [moveit.ros.occupancy_map_updater]: Transform cache was not updated. Self-filtering may fail. If transforms were not available yet, consider setting robot_description_planning/shape_transform_cache_lookup_wait_time to wait longer for transforms </code></pre> <p>I develop on ROS2 Foxy in a docker container with the UR ROS2 Driver.</p> <p>my camera is defined, with the prefix being empty, in the urdf as:</p> <pre><code>&lt;!-- Define gazebo sensor --&gt; &lt;gazebo reference=&quot;<span class="math-container">${prefix}camera_link"&gt; &lt;sensor type="depth" name="$</span>{prefix}camera&quot;&gt; &lt;always_on&gt;false&lt;/always_on&gt; &lt;update_rate&gt;10.0&lt;/update_rate&gt; &lt;camera name=&quot;camera&quot;&gt; &lt;horizontal_fov&gt;1.047198&lt;/horizontal_fov&gt; &lt;image&gt; &lt;width&gt;640&lt;/width&gt; &lt;height&gt;480&lt;/height&gt; &lt;format&gt;R8G8B8&lt;/format&gt; &lt;/image&gt; &lt;clip&gt; &lt;near&gt;0.05&lt;/near&gt; &lt;far&gt;3.0&lt;/far&gt; &lt;/clip&gt; &lt;distortion&gt; &lt;k1&gt;0.0&lt;/k1&gt; &lt;k2&gt;0.0&lt;/k2&gt; &lt;k3&gt;0.0&lt;/k3&gt; &lt;p1&gt;0.0&lt;/p1&gt; &lt;p2&gt;0.0&lt;/p2&gt; &lt;center&gt;0.5 0.5&lt;/center&gt; &lt;/distortion&gt; &lt;/camera&gt; &lt;plugin name=&quot;<span class="math-container">${prefix}camera_controller" filename="libgazebo_ros_camera.so"&gt; &lt;ros&gt; &lt;imageTopicName&gt;$</span>{prefix}/camera/color/image_raw&lt;/imageTopicName&gt; &lt;cameraInfoTopicName&gt;<span class="math-container">${prefix}/camera/color/camera_info&lt;/cameraInfoTopicName&gt; &lt;depthImageTopicName&gt;$</span>{prefix}/camera/depth/image_raw&lt;/depthImageTopicName&gt; &lt;depthImageCameraInfoTopicName&gt;<span class="math-container">${prefix}/camera/depth/camera_info&lt;/depthImageCameraInfoTopicName&gt; &lt;pointCloudTopicName&gt;$</span>{prefix}/camera/points&lt;/pointCloudTopicName&gt; &lt;/ros&gt; &lt;camera_name&gt;<span class="math-container">${prefix}camera&lt;/camera_name&gt; &lt;frame_name&gt;$</span>{prefix}camera_link&lt;/frame_name&gt; &lt;hack_baseline&gt;0.07&lt;/hack_baseline&gt; &lt;min_depth&gt;0.001&lt;/min_depth&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; &lt;!-- Links --&gt; &lt;link name=&quot;${prefix}camera_link&quot;&gt; &lt;visual&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&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;/visual&gt; &lt;collision&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&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;inertial&gt; &lt;mass value=&quot;0.001&quot;/&gt; &lt;origin xyz=&quot;0 0 0&quot;/&gt; &lt;inertia ixx=&quot;0.0001&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.0001&quot; iyz=&quot;0.0&quot; izz=&quot;0.0001&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;!-- Joints --&gt; &lt;joint type=&quot;fixed&quot; name=&quot;<span class="math-container">${prefix}tool_camera_joint"&gt; &lt;origin xyz="0 0 0.1" rpy="0 $</span>{-pi/2.0} 0&quot;/&gt; &lt;child link=&quot;<span class="math-container">${prefix}camera_link"/&gt; &lt;parent link="$</span>{prefix}wrist_3_link&quot;/&gt; &lt;axis xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;/joint&gt; </code></pre> <p>octomaps configuration:</p> <pre><code>octomap_config = {&quot;octomap_frame&quot;: &quot;camera_link&quot;, &quot;octomap_resolution&quot;: 0.05, &quot;max_range&quot;: 5.0} octomap_updater_config = load_yaml(&quot;modproft_ur_bringup&quot;, &quot;config/sensors_3d.yaml&quot;) </code></pre> <p>move_group node:</p> <pre><code>move_group_node = Node( package=&quot;moveit_ros_move_group&quot;, executable=&quot;move_group&quot;, output=&quot;screen&quot;, parameters=[ robot_description, robot_description_semantic, robot_description_kinematics, ompl_planning_pipeline_config, trajectory_execution, moveit_controllers, planning_scene_monitor_parameters, octomap_config, octomap_updater_config, ], ) </code></pre> <p>sensors config:</p> <pre><code>sensors: [&quot;sensor1&quot;] sensor1: sensor_plugin: occupancy_map_monitor/PointCloudOctomapUpdater point_cloud_topic: /camera/points max_range: 5.0 point_subsample: 1 padding_offset: 0.1 padding_scale: 1.0 shape_padding: 0.01 shape_scale: 1.0 max_update_rate: 1.0 filtered_cloud_topic: filtered_cloud </code></pre> <p>Many thanks for the help in advance!</p> <hr /> <p><a href="https://answers.ros.org/question/409258/ros2-octomap-transform-cache-was-not-updated.-self-filtering-may-fail/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/108850/sergej/" rel="nofollow noreferrer">sergej</a> on ROS Answers with karma: 1 on 2022-11-11</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/103088/angcorcue2/" rel="nofollow noreferrer">angcorcue2</a> on 2023-07-04</strong>:<br /> Did you solve it?</p>
ROS2 OctoMap Transform cache was not updated. Self-filtering may fail
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Nav2 has no problem using any localizer you choose. If it provides the map to odom transformation, the rest of the system doesn't care which is used.</p> <p>From <code>[basic_navigator]</code>, that look to me like you're using the Simple Commander API. We wait for the pose to be received in the <code>waitUntilNav2Active</code> function: <a href="https://github.com/ros-planning/navigation2/blob/987fe905ec58a97ec85c485a1733ead585a5bc7f/nav2_simple_commander/nav2_simple_commander/robot_navigator.py#L311-L318" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/blob/987fe905ec58a97ec85c485a1733ead585a5bc7f/nav2_simple_commander/nav2_simple_commander/robot_navigator.py#L311-L318</a></p> <p>As you can see from the signature, you can specify the localizer node's name being used. Only when this is set to AMCL will this wait for that topic to receive a pose. Otherwise, it does not.</p> <pre><code>def waitUntilNav2Active(self, navigator='bt_navigator', localizer='amcl'): &quot;&quot;&quot;Block until the full navigation system is up and running.&quot;&quot;&quot; self._waitForNodeToActivate(localizer) if localizer == 'amcl': self._waitForInitialPose() self._waitForNodeToActivate(navigator) self.info('Nav2 is ready for use!') return </code></pre> <p>It just looks to me like you need to specify your localization node to wait for activation correctly. This is also specified in the Nav2 documentation on the API <a href="https://navigation.ros.org/commander_api/index.html" rel="nofollow noreferrer">https://navigation.ros.org/commander_api/index.html</a></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-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/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2022-11-13</strong>:<br /> @mamado if you are running your own external global localization, you shouldn't be using AMCL at the same time. Having two ros nodes publishing the <code>map-&gt;odom</code> TF is going to lead to unstable localization.</p>
102696
2022-11-11T09:23:17.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I would like to use Nav2 to navigate my robot from its current location to a waypoint or set of waypoints. I have an external localization computer that computes the exact location and provides the tf of map-&gt;odom-&gt;base_link to ros2. I launched the nav2_bringup with amcl and I can see my robot in RViz with no issues. I then tried to run the navigate_to_waypoint example from the nav2_simple_commander navigation package but I always get the following error:</p> <pre><code>[INFO] [1668174934.714896959] [basic_navigator]: Setting initial pose [INFO] [1668174934.715584247] [basic_navigator]: Publishing Initial Pose [INFO] [1668174934.716242568] [basic_navigator]: Waiting for amcl_pose to be received. </code></pre> <p>I also get the following in the nav2_bringup window:</p> <pre><code>[component_container_isolated-3] [INFO] [1668174656.886551258] [amcl]: Setting pose (1668174656.886551): 3.450 2.150 3.142 </code></pre> <p>Is there anything I am missing. How can I use Nav2 to for navigation without using its internal localization.</p> <p>I am using ROS2 Humble</p> <hr /> <p><a href="https://answers.ros.org/question/409260/using-nav2-with-external-localization-source/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/65803/mamado/" rel="nofollow noreferrer">mamado</a> on ROS Answers with karma: 61 on 2022-11-11</p> <p>Post score: 0</p>
Using Nav2 with external localization source
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>Can robot_localization be used with Noetic?</p> </blockquote> <p>Yes.</p> <p>Below are the two ways to install <a href="http://wiki.ros.org/robot_localization" rel="nofollow noreferrer">robot_localization</a> in ROS Noetic:</p> <ol> <li><p><strong>Install from Pre-built Binaries (Preferred):</strong> Please use the following command:</p> <pre><code> $ sudo apt install ros-noetic-robot-localization </code></pre> </li> <li><p><strong>Install from Source:</strong> To answer you completely, I tried this approach as well. Please see below:</p> <pre><code> <span class="math-container">$ cd ros_ws/src $</span> git clone https://github.com/cra-ros-pkg/robot_localization.git --branch noetic-devel <span class="math-container">$ cd ros_ws/ $</span> rosdep install --from-paths src --ignore-src -r -y $ catkin_make -DCMAKE_BUILD_TYPE=Release </code></pre> </li> </ol> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-11-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/113638/donguri/" rel="nofollow noreferrer">donguri</a> on 2022-11-14</strong>:<br /> Thank you for your prompt reply.</p> <p>I can't try it right away, but I will certainly try it soon.</p> <p>Thank you very much.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-11-17</strong>:\</p> <blockquote> <p>I can't try it right away, but I will certainly try it soon.</p> </blockquote> <p>Does it work?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/113638/donguri/" rel="nofollow noreferrer">donguri</a> on 2022-11-18</strong>:<br /> Dear ravijoshi.</p> <p>Thank you for your patience. And thank you for your advice.</p> <p>Thanks to you, everything went well.</p> <p>The only thing I did was change <code>$ catkin_make -DCMAKE_BUILD_TYPE=Release</code> part to <code>$ catkin build</code>.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-11-19</strong>:<br /> I am glad you made it work!</p>
102698
2022-11-13T22:33:23.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Is robot_localization not available for ROS Noeic?</p> <p>I git clone the &quot;robot_localization&quot; Package and tried to do a &quot;catkin build&quot;, but it skips as follows.</p> <pre><code>[build] Warning: Skipping package `robot_localization` because it has an unsupported package build type: `ament_cmake` [build] Note: Available build types: [build] - `catkin` [build] - `cmake` </code></pre> <p>From my research, it seems that &quot;ament_cmake&quot; is a ROS2 specific build tool and cannot be used with Noetic. Please let me know if I am wrong.</p> <p>Is there any way to use robot_localization with ROS Noetic?</p> <p>Thank you.</p> <hr /> <p><a href="https://answers.ros.org/question/409325/can-robot_localization-be-used-with-noetic?/" 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-11-13</p> <p>Post score: 0</p>
Can robot_localization be used with Noetic?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have the same issue with my 2 turtlebot4 on Ubuntu 20 Galactic . I implemented a fix here: <a href="https://github.com/ros-controls/ros2_control/pull/852" rel="nofollow noreferrer">https://github.com/ros-controls/ros2_control/pull/852</a>. Might be helpful</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/123783/hugob/" rel="nofollow noreferrer">hugob</a> with karma: 26 on 2022-11-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/66668/osal22/" rel="nofollow noreferrer">Osal22</a> on 2022-11-16</strong>:<br /> Thank you will surely look into detail</p>
102700
2022-11-14T00:46:31.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>UBUNTU 22.04 ROS2 HUMBLE</p> <p>I have two ur3e universal robots. I am using prefixes and namespaces for this prefixes to separate tf links name of both robots and namespaces for launching controller nodes for both robots</p> <p>I have made changes to ur_controllers.yaml according to joint names</p> <p>I simply want to launch 2 instances of controller_manager node in ros2 humble when I do it with namespaces controllers do not work</p> <p>Here is my launch file ur_control.launch.py that I have added namespaces in</p> <pre><code>from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch.actions import OpaqueFunction from launch.conditions import IfCondition, UnlessCondition from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare def launch_setup(context, *args, **kwargs): # Initialize Arguments ur_type = LaunchConfiguration(&quot;ur_type&quot;) robot_ip = LaunchConfiguration(&quot;robot_ip&quot;) safety_limits = LaunchConfiguration(&quot;safety_limits&quot;) safety_pos_margin = LaunchConfiguration(&quot;safety_pos_margin&quot;) safety_k_position = LaunchConfiguration(&quot;safety_k_position&quot;) # General arguments runtime_config_package = LaunchConfiguration(&quot;runtime_config_package&quot;) controllers_file = LaunchConfiguration(&quot;controllers_file&quot;) description_package = LaunchConfiguration(&quot;description_package&quot;) description_file = LaunchConfiguration(&quot;description_file&quot;) prefix = LaunchConfiguration(&quot;prefix&quot;) use_fake_hardware = LaunchConfiguration(&quot;use_fake_hardware&quot;) fake_sensor_commands = LaunchConfiguration(&quot;fake_sensor_commands&quot;) initial_joint_controller = LaunchConfiguration(&quot;initial_joint_controller&quot;) activate_joint_controller = LaunchConfiguration(&quot;activate_joint_controller&quot;) launch_rviz = LaunchConfiguration(&quot;launch_rviz&quot;) headless_mode = LaunchConfiguration(&quot;headless_mode&quot;) launch_dashboard_client = LaunchConfiguration(&quot;launch_dashboard_client&quot;) use_tool_communication = LaunchConfiguration(&quot;use_tool_communication&quot;) tool_parity = LaunchConfiguration(&quot;tool_parity&quot;) tool_baud_rate = LaunchConfiguration(&quot;tool_baud_rate&quot;) tool_stop_bits = LaunchConfiguration(&quot;tool_stop_bits&quot;) tool_rx_idle_chars = LaunchConfiguration(&quot;tool_rx_idle_chars&quot;) tool_tx_idle_chars = LaunchConfiguration(&quot;tool_tx_idle_chars&quot;) tool_device_name = LaunchConfiguration(&quot;tool_device_name&quot;) tool_tcp_port = LaunchConfiguration(&quot;tool_tcp_port&quot;) tool_voltage = LaunchConfiguration(&quot;tool_voltage&quot;) joint_limit_params = PathJoinSubstitution( [FindPackageShare(description_package), &quot;config&quot;, ur_type, &quot;joint_limits.yaml&quot;] ) kinematics_params = PathJoinSubstitution( [FindPackageShare(description_package), &quot;config&quot;, ur_type, &quot;default_kinematics.yaml&quot;] ) physical_params = PathJoinSubstitution( [FindPackageShare(description_package), &quot;config&quot;, ur_type, &quot;physical_parameters.yaml&quot;] ) visual_params = PathJoinSubstitution( [FindPackageShare(description_package), &quot;config&quot;, ur_type, &quot;visual_parameters.yaml&quot;] ) script_filename = PathJoinSubstitution( [FindPackageShare(&quot;ur_robot_driver&quot;), &quot;resources&quot;, &quot;ros_control.urscript&quot;] ) input_recipe_filename = PathJoinSubstitution( [FindPackageShare(&quot;ur_robot_driver&quot;), &quot;resources&quot;, &quot;rtde_input_recipe.txt&quot;] ) output_recipe_filename = PathJoinSubstitution( [FindPackageShare(&quot;ur_robot_driver&quot;), &quot;resources&quot;, &quot;rtde_output_recipe.txt&quot;] ) robot_description_content = Command( [ PathJoinSubstitution([FindExecutable(name=&quot;xacro&quot;)]), &quot; &quot;, PathJoinSubstitution([FindPackageShare(description_package), &quot;urdf&quot;, description_file]), &quot; &quot;, &quot;robot_ip:=&quot;, robot_ip, &quot; &quot;, &quot;joint_limit_params:=&quot;, joint_limit_params, &quot; &quot;, &quot;kinematics_params:=&quot;, kinematics_params, &quot; &quot;, &quot;physical_params:=&quot;, physical_params, &quot; &quot;, &quot;visual_params:=&quot;, visual_params, &quot; &quot;, &quot;safety_limits:=&quot;, safety_limits, &quot; &quot;, &quot;safety_pos_margin:=&quot;, safety_pos_margin, &quot; &quot;, &quot;safety_k_position:=&quot;, safety_k_position, &quot; &quot;, &quot;name:=&quot;, ur_type, &quot; &quot;, &quot;script_filename:=&quot;, script_filename, &quot; &quot;, &quot;input_recipe_filename:=&quot;, input_recipe_filename, &quot; &quot;, &quot;output_recipe_filename:=&quot;, output_recipe_filename, &quot; &quot;, &quot;prefix:=&quot;, prefix, &quot; &quot;, &quot;use_fake_hardware:=&quot;, use_fake_hardware, &quot; &quot;, &quot;fake_sensor_commands:=&quot;, fake_sensor_commands, &quot; &quot;, &quot;headless_mode:=&quot;, headless_mode, &quot; &quot;, &quot;use_tool_communication:=&quot;, use_tool_communication, &quot; &quot;, &quot;tool_parity:=&quot;, tool_parity, &quot; &quot;, &quot;tool_baud_rate:=&quot;, tool_baud_rate, &quot; &quot;, &quot;tool_stop_bits:=&quot;, tool_stop_bits, &quot; &quot;, &quot;tool_rx_idle_chars:=&quot;, tool_rx_idle_chars, &quot; &quot;, &quot;tool_tx_idle_chars:=&quot;, tool_tx_idle_chars, &quot; &quot;, &quot;tool_device_name:=&quot;, tool_device_name, &quot; &quot;, &quot;tool_tcp_port:=&quot;, tool_tcp_port, &quot; &quot;, &quot;tool_voltage:=&quot;, tool_voltage, &quot; &quot;, ] ) robot_description = {&quot;robot_description&quot;: robot_description_content} initial_joint_controllers = PathJoinSubstitution( [FindPackageShare(runtime_config_package), &quot;config&quot;, controllers_file] ) rviz_config_file = PathJoinSubstitution( [FindPackageShare(description_package), &quot;rviz&quot;, &quot;view_robot.rviz&quot;] ) # define update rate update_rate_config_file = PathJoinSubstitution( [ FindPackageShare(runtime_config_package), &quot;config&quot;, ur_type.perform(context) + &quot;_update_rate.yaml&quot;, ] ) control_node = Node( namespace=&quot;/ur1/&quot;, package=&quot;controller_manager&quot;, executable=&quot;ros2_control_node&quot;, parameters=[robot_description, update_rate_config_file, initial_joint_controllers], output=&quot;screen&quot;, condition=IfCondition(use_fake_hardware), ) ur_control_node = Node( namespace=&quot;/ur1/&quot;, package=&quot;ur_robot_driver&quot;, executable=&quot;ur_ros2_control_node&quot;, parameters=[robot_description, update_rate_config_file, initial_joint_controllers], output=&quot;screen&quot;, condition=UnlessCondition(use_fake_hardware), ) dashboard_client_node = Node( namespace=&quot;/ur1/&quot;, package=&quot;ur_robot_driver&quot;, condition=IfCondition(launch_dashboard_client) and UnlessCondition(use_fake_hardware), executable=&quot;dashboard_client&quot;, name=&quot;dashboard_client&quot;, output=&quot;screen&quot;, emulate_tty=True, parameters=[{&quot;robot_ip&quot;: robot_ip}], ) tool_communication_node = Node( namespace=&quot;/ur1/&quot;, package=&quot;ur_robot_driver&quot;, condition=IfCondition(use_tool_communication), executable=&quot;tool_communication.py&quot;, name=&quot;ur_tool_comm&quot;, output=&quot;screen&quot;, parameters=[ { &quot;robot_ip&quot;: robot_ip, &quot;tcp_port&quot;: tool_tcp_port, &quot;device_name&quot;: tool_device_name, } ], ) controller_stopper_node = Node( namespace=&quot;/ur1/&quot;, package=&quot;ur_robot_driver&quot;, executable=&quot;controller_stopper_node&quot;, name=&quot;controller_stopper&quot;, output=&quot;screen&quot;, emulate_tty=True, condition=UnlessCondition(use_fake_hardware), parameters=[ {&quot;headless_mode&quot;: headless_mode}, {&quot;joint_controller_active&quot;: activate_joint_controller}, { &quot;consistent_controllers&quot;: [ &quot;io_and_status_controller&quot;, &quot;force_torque_sensor_broadcaster&quot;, &quot;joint_state_broadcaster&quot;, &quot;speed_scaling_state_broadcaster&quot;, ] }, ], ) robot_state_publisher_node = Node( namespace=&quot;/ur1/&quot;, package=&quot;robot_state_publisher&quot;, executable=&quot;robot_state_publisher&quot;, output=&quot;both&quot;, parameters=[robot_description], ) rviz_node = Node( package=&quot;rviz2&quot;, condition=IfCondition(launch_rviz), executable=&quot;rviz2&quot;, name=&quot;rviz2&quot;, output=&quot;log&quot;, arguments=[&quot;-d&quot;, rviz_config_file], ) joint_state_broadcaster_spawner = Node( namespace=&quot;/ur1/&quot;, package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[&quot;joint_state_broadcaster&quot;, &quot;--controller-manager&quot;, &quot;controller_manager&quot;], ) io_and_status_controller_spawner = Node( namespace=&quot;/ur1/&quot;, package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[&quot;io_and_status_controller&quot;, &quot;-c&quot;, &quot;ur1/controller_manager&quot;], ) speed_scaling_state_broadcaster_spawner = Node( namespace=&quot;/ur1/&quot;, package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[ &quot;speed_scaling_state_broadcaster&quot;, &quot;--controller-manager&quot;, &quot;ur1/controller_manager&quot;, ], ) force_torque_sensor_broadcaster_spawner = Node( namespace=&quot;/ur1/&quot;, package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[ &quot;force_torque_sensor_broadcaster&quot;, &quot;--controller-manager&quot;, &quot;ur1/controller_manager&quot;, ], ) forward_position_controller_spawner_stopped = Node( namespace=&quot;/ur1/&quot;, package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[&quot;forward_position_controller&quot;, &quot;-c&quot;, &quot;ur1/controller_manager&quot;, &quot;--inactive&quot;], ) # There may be other controllers of the joints, but this is the initially-started one initial_joint_controller_spawner_started = Node( namespace=&quot;/ur1/&quot;, package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[initial_joint_controller, &quot;-c&quot;, &quot;ur1/controller_manager&quot;], condition=IfCondition(activate_joint_controller), ) initial_joint_controller_spawner_stopped = Node( namespace=&quot;/ur1/&quot;, package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[initial_joint_controller, &quot;-c&quot;, &quot;ur1/controller_manager&quot;, &quot;--inactive&quot;], condition=UnlessCondition(activate_joint_controller), ) nodes_to_start = [ control_node, ur_control_node, dashboard_client_node, tool_communication_node, controller_stopper_node, robot_state_publisher_node, rviz_node, joint_state_broadcaster_spawner, io_and_status_controller_spawner, speed_scaling_state_broadcaster_spawner, force_torque_sensor_broadcaster_spawner, forward_position_controller_spawner_stopped, initial_joint_controller_spawner_stopped, initial_joint_controller_spawner_started, ] return nodes_to_start </code></pre> <p>The output from the terminal</p> <pre><code> c[INFO] [launch]: All log files can be found below /home/goalbytes/.ros/log/2022-11-14-09-57-09-231667-goalbytes-39691 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [ros2_control_node-1]: process started with pid [39695] [INFO] [robot_state_publisher-2]: process started with pid [39697] [INFO] [rviz2-3]: process started with pid [39699] [INFO] [spawner-4]: process started with pid [39701] [INFO] [spawner-5]: process started with pid [39703] [INFO] [spawner-6]: process started with pid [39705] [INFO] [spawner-7]: process started with pid [39707] [INFO] [spawner-8]: process started with pid [39709] [INFO] [spawner-9]: process started with pid [39711] [ros2_control_node-1] free(): invalid pointer [robot_state_publisher-2] Link ur1/base_link had 2 children [robot_state_publisher-2] Link ur1/base had 0 children [robot_state_publisher-2] Link ur1/base_link_inertia had 1 children [robot_state_publisher-2] Link ur1/shoulder_link had 1 children [robot_state_publisher-2] Link ur1/upper_arm_link had 1 children [robot_state_publisher-2] Link ur1/forearm_link had 1 children [robot_state_publisher-2] Link ur1/wrist_1_link had 1 children [robot_state_publisher-2] Link ur1/wrist_2_link had 1 children [robot_state_publisher-2] Link ur1/wrist_3_link had 2 children [robot_state_publisher-2] Link ur1/flange had 1 children [robot_state_publisher-2] Link ur1/tool0 had 0 children [robot_state_publisher-2] Link ur1/ft_frame had 0 children [robot_state_publisher-2] [INFO] [1668401830.001683495] [ur1.robot_state_publisher]: got segment ur1/base [robot_state_publisher-2] [INFO] [1668401830.002288509] [ur1.robot_state_publisher]: got segment ur1/base_link [robot_state_publisher-2] [INFO] [1668401830.002681026] [ur1.robot_state_publisher]: got segment ur1/base_link_inertia [robot_state_publisher-2] [INFO] [1668401830.003042989] [ur1.robot_state_publisher]: got segment ur1/flange [robot_state_publisher-2] [INFO] [1668401830.003395492] [ur1.robot_state_publisher]: got segment ur1/forearm_link [robot_state_publisher-2] [INFO] [1668401830.003773250] [ur1.robot_state_publisher]: got segment ur1/ft_frame [robot_state_publisher-2] [INFO] [1668401830.004181386] [ur1.robot_state_publisher]: got segment ur1/shoulder_link [robot_state_publisher-2] [INFO] [1668401830.004550257] [ur1.robot_state_publisher]: got segment ur1/tool0 [robot_state_publisher-2] [INFO] [1668401830.004900711] [ur1.robot_state_publisher]: got segment ur1/upper_arm_link [robot_state_publisher-2] [INFO] [1668401830.005253082] [ur1.robot_state_publisher]: got segment ur1/wrist_1_link [robot_state_publisher-2] [INFO] [1668401830.005594472] [ur1.robot_state_publisher]: got segment ur1/wrist_2_link [robot_state_publisher-2] [INFO] [1668401830.005925523] [ur1.robot_state_publisher]: got segment ur1/wrist_3_link [robot_state_publisher-2] [INFO] [1668401830.006249560] [ur1.robot_state_publisher]: got segment world [spawner-8] [INFO] [1668401830.268979412] [ur1.spawner_forward_position_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-9] [INFO] [1668401830.347034376] [ur1.spawner_joint_trajectory_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-7] [INFO] [1668401830.347620215] [ur1.spawner_force_torque_sensor_broadcaster]: Waiting for '/ur1/controller_manager' node to exist [spawner-6] [INFO] [1668401830.353431446] [ur1.spawner_speed_scaling_state_broadcaster]: Waiting for '/ur1/controller_manager' node to exist [rviz2-3] [INFO] [1668401830.363403777] [rviz2]: Stereo is NOT SUPPORTED [rviz2-3] [INFO] [1668401830.363782400] [rviz2]: OpenGl version: 4.6 (GLSL 4.6) [spawner-5] [INFO] [1668401830.368414209] [ur1.spawner_io_and_status_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-4] [INFO] [1668401830.381896433] [ur1.spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [rviz2-3] [INFO] [1668401830.384755565] [rviz2]: Stereo is NOT SUPPORTED [ERROR] [ros2_control_node-1]: process has died [pid 39695, exit code -6, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args -r __ns:=/ur1 --params-file /tmp/launch_params_7ltk2lr6 --params-file /home/goalbytes/workspace/ros_ur_driver/install/ur_robot_driver/share/ur_robot_driver/config/ur5e_update_rate.yaml --params-file /home/goalbytes/workspace/ros_ur_driver/install/ur_robot_driver/share/ur_robot_driver/config/ur_controllers_ur1.yaml']. [spawner-8] [INFO] [1668401832.281162641] [ur1.spawner_forward_position_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-9] [INFO] [1668401832.359148652] [ur1.spawner_joint_trajectory_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-7] [INFO] [1668401832.359180740] [ur1.spawner_force_torque_sensor_broadcaster]: Waiting for '/ur1/controller_manager' node to exist [spawner-6] [INFO] [1668401832.365116711] [ur1.spawner_speed_scaling_state_broadcaster]: Waiting for '/ur1/controller_manager' node to exist [spawner-5] [INFO] [1668401832.380461178] [ur1.spawner_io_and_status_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-4] [INFO] [1668401832.395388596] [ur1.spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-8] [INFO] [1668401834.291457977] [ur1.spawner_forward_position_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-7] [INFO] [1668401834.368092322] [ur1.spawner_force_torque_sensor_broadcaster]: Waiting for '/ur1/controller_manager' node to exist [spawner-9] [INFO] [1668401834.368258719] [ur1.spawner_joint_trajectory_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-6] [INFO] [1668401834.373476386] [ur1.spawner_speed_scaling_state_broadcaster]: Waiting for '/ur1/controller_manager' node to exist [spawner-5] [INFO] [1668401834.389638229] [ur1.spawner_io_and_status_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-4] [INFO] [1668401834.403900314] [ur1.spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-8] [INFO] [1668401836.302992523] [ur1.spawner_forward_position_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-7] [INFO] [1668401836.377558136] [ur1.spawner_force_torque_sensor_broadcaster]: Waiting for '/ur1/controller_manager' node to exist [spawner-9] [INFO] [1668401836.377899347] [ur1.spawner_joint_trajectory_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-6] [INFO] [1668401836.383552682] [ur1.spawner_speed_scaling_state_broadcaster]: Waiting for '/ur1/controller_manager' node to exist [spawner-5] [INFO] [1668401836.400557142] [ur1.spawner_io_and_status_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-4] [INFO] [1668401836.413084852] [ur1.spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-8] [INFO] [1668401838.314095380] [ur1.spawner_forward_position_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-9] [INFO] [1668401838.387859975] [ur1.spawner_joint_trajectory_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-7] [INFO] [1668401838.388085991] [ur1.spawner_force_torque_sensor_broadcaster]: Waiting for '/ur1/controller_manager' node to exist [spawner-6] [INFO] [1668401838.392326844] [ur1.spawner_speed_scaling_state_broadcaster]: Waiting for '/ur1/controller_manager' node to exist [spawner-5] [INFO] [1668401838.410726052] [ur1.spawner_io_and_status_controller]: Waiting for '/ur1/controller_manager' node to exist [spawner-4] [INFO] [1668401838.422346946] [ur1.spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-8] [ERROR] [1668401840.323617974] [ur1.spawner_forward_position_controller]: Controller manager not available [spawner-9] [ERROR] [1668401840.396285023] [ur1.spawner_joint_trajectory_controller]: Controller manager not available [spawner-7] [ERROR] [1668401840.400496365] [ur1.spawner_force_torque_sensor_broadcaster]: Controller manager not available [spawner-6] [ERROR] [1668401840.401350561] [ur1.spawner_speed_scaling_state_broadcaster]: Controller manager not available [spawner-5] [ERROR] [1668401840.420010735] [ur1.spawner_io_and_status_controller]: Controller manager not available [spawner-4] [ERROR] [1668401840.431361903] [ur1.spawner_joint_state_broadcaster]: Controller manager not available [ERROR] [spawner-8]: process has died [pid 39709, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner forward_position_controller -c ur1/controller_manager --inactive --ros-args -r __ns:=/ur1']. [ERROR] [spawner-9]: process has died [pid 39711, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_trajectory_controller -c ur1/controller_manager --ros-args -r __ns:=/ur1']. [ERROR] [spawner-6]: process has died [pid 39705, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner speed_scaling_state_broadcaster --controller-manager ur1/controller_manager --ros-args -r __ns:=/ur1']. [ERROR] [spawner-4]: process has died [pid 39701, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --controller-manager controller_manager --ros-args -r __ns:=/ur1']. [ERROR] [spawner-5]: process has died [pid 39703, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner io_and_status_controller -c ur1/controller_manager --ros-args -r __ns:=/ur1']. [ERROR] [spawner-7]: process has died [pid 39707, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner force_torque_sensor_broadcaster --controller-manager ur1/controller_manager --ros-args -r __ns:=/ur1']. </code></pre> <p>any help how i should launch controllers in namespaces or is there any other way to do it please guide</p> <hr /> <p><a href="https://answers.ros.org/question/409328/multiple-controller-controller_manager-instances-with-namespaces/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/66668/osal22/" rel="nofollow noreferrer">Osal22</a> on ROS Answers with karma: 15 on 2022-11-14</p> <p>Post score: 1</p>
Multiple Controller controller_manager instances with namespaces
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>There could be following two issues. Please check:</p> <ol> <li><p>Please install <code>controller-manager</code> as shown below:</p> <pre><code> sudo apt install ros-foxy-controller-manager </code></pre> </li> <li><p>The executable name seems <code>spawner.py</code> based on the <a href="https://control.ros.org/foxy/doc/ros2_control/controller_manager/doc/userdoc.html#helper-scripts" rel="nofollow noreferrer">documentation</a>.</p> <pre><code> ros2 run controller_manager spawner.py -h </code></pre> </li> </ol> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-11-15</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-15</strong>:<br /> It works. Thank you very much!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-11-15</strong>:<br /> I am glad you made it work!</p>
102702
2022-11-14T06:48:25.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 almost successfully migrated my project from Noetic to Foxy and now I'm to launch my packages. I have the following problem:</p> <pre><code>[INFO] [launch]: All log files can be found below /home/mikita/.ros/log/2022-11-14-03-39-50-208073-ubuntu-11543 [INFO] [launch]: Default logging verbosity is set to INFO Task exception was never retrieved future: &lt;Task finished name='Task-2' coro=&lt;LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226&gt; exception=SubstitutionFailure(&quot;executable 'spawner' not found on the libexec directory '/opt/ros/foxy/lib/controller_manager' &quot;)&gt; Traceback (most recent call last): File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py&quot;, line 228, in _process_one_event await self.__process_event(next_event) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py&quot;, line 248, in __process_event visit_all_entities_and_collect_futures(entity, self.__context)) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) [Previous line repeated 1 more time] File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 38, in visit_all_entities_and_collect_futures sub_entities = entity.visit(context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py&quot;, line 108, in visit return self.execute(context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py&quot;, line 453, in execute ret = super().execute(context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py&quot;, line 823, in execute self.__expand_substitutions(context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py&quot;, line 668, in __expand_substitutions cmd = [perform_substitutions(context, x) for x in self.__cmd] File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py&quot;, line 668, in &lt;listcomp&gt; cmd = [perform_substitutions(context, x) for x in self.__cmd] File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py&quot;, line 26, in perform_substitutions return ''.join([context.perform_substitution(sub) for sub in subs]) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py&quot;, line 26, in &lt;listcomp&gt; return ''.join([context.perform_substitution(sub) for sub in subs]) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py&quot;, line 232, in perform_substitution return substitution.perform(self) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/substitutions/executable_in_package.py&quot;, line 84, in perform raise SubstitutionFailure( launch.substitutions.substitution_failure.SubstitutionFailure: executable 'spawner' not found on the libexec directory '/opt/ros/foxy/lib/controller_manager' </code></pre> <p>This is how my launch file looks like:</p> <pre><code>import os import sys import launch import launch_ros.actions from ament_index_python.packages import get_package_share_directory def generate_launch_description(): ld = launch.LaunchDescription([ launch_ros.actions.Node( package='controller_manager', executable='spawner', name='controller_spawner', output='screen', parameters=[ { '/minicar/controller/enable_odom_tf': 'true' }, { 'robot_description': &quot;minicar.gazebo.xacro&quot; } ] ), launch_ros.actions.Node( package='robot_state_publisher', executable='robot_state_publisher', name='robot_state_publisher', parameters=[ { '/minicar/controller/enable_odom_tf': 'true' }, { 'robot_description': &quot;minicar.gazebo.xacro&quot; } ] ), launch.actions.IncludeLaunchDescription( launch.launch_description_sources.PythonLaunchDescriptionSource( os.path.join(get_package_share_directory( 'minicar_control'), 'launch/mux.launch.py') ) ) ]) return ld if __name__ == '__main__': generate_launch_description() </code></pre> <p>I've tried solution that suggested <a href="https://github.com/cyberbotics/webots_ros2/issues/350" rel="nofollow noreferrer">here</a>, still not working. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/409350/executable-%27spawner%27-not-found-on-the-libexec-directory-%27/opt/ros/foxy/lib/controller_manager%27-problem/" 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-14</p> <p>Post score: 0</p>
executable 'spawner' not found on the libexec directory '/opt/ros/foxy/lib/controller_manager' problem
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>There's a tutorial for that: <a href="https://moveit.picknik.ai/main/doc/examples/dual_arms/dual_arms_tutorial.html" rel="nofollow noreferrer">https://moveit.picknik.ai/main/doc/examples/dual_arms/dual_arms_tutorial.html</a></p> <p>One of the limitations of the tutorial setup is that motion planning &amp; execution for the 2 arms will be synchronous. Basically, that's because the MoveGroupInterface is single-threaded.</p> <p>They do share a planning scene so collision avoidance should work as you expect.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/21281/andyze/" rel="nofollow noreferrer">AndyZe</a> with karma: 2331 on 2022-11-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/66668/osal22/" rel="nofollow noreferrer">Osal22</a> on 2022-11-14</strong>:<br /> Thank you it is helpful. but if I want to control both arm simultaneously with different goals and with collision avoidance</p> <p><strong>Comment by <a href="https://answers.ros.org/users/21281/andyze/" rel="nofollow noreferrer">AndyZe</a> on 2022-11-14</strong>:<br /> You can do this, no problem:</p> <pre><code>I want to control both arm simultaneously with different goals and with collision avoidance </code></pre> <p>But not something like this:</p> <pre><code>Plan a motion for Arm 1 Begin executing for Arm 1 Plan a motion for Arm 2 Begin executing for Arm 2 Arm 1 motion completes Arm 2 motion completes </code></pre>
102704
2022-11-14T09:18:15.000
|ros|ros2|moveit|hardware-interface|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am just wondering what is the best approach to control multiple universal robotics arms from moveit and ros2. both robotic arms share their workspace so with collision avoidance.</p> <p>If anyone had previous experience please share</p> <p>Thank you</p> <hr /> <p><a href="https://answers.ros.org/question/409355/control-multiple-universal-robotic-arm-in-ros2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/66668/osal22/" rel="nofollow noreferrer">Osal22</a> on ROS Answers with karma: 15 on 2022-11-14</p> <p>Post score: 0</p>
Control Multiple Universal Robotic arm in ros2
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>ROS 1, does not officially support Ubuntu 22.10. However, you can build ROS Noetic from source. Please read #q399664 for further details. It is related to Ubuntu 22.04 though but should work with 22.10</p> <p>Please share errors if found during the compilation process.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-11-15</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102706
2022-11-14T10:13:34.000
|ros|ros-kinetic|ubuntu|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I would like to know which version and how can I install ROS 1 in Ubuntu 22.10?</p> <p>Thank you</p> <hr /> <p><a href="https://answers.ros.org/question/409357/how-to-install-ros-1-in-ubuntu-22.10?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110426/akumar3.1428/" rel="nofollow noreferrer">akumar3.1428</a> on ROS Answers with karma: 61 on 2022-11-14</p> <p>Post score: 1</p>
How to install ROS 1 in Ubuntu 22.10?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I believe the error is coming due to an incorrect installation of <a href="https://bitbucket.org/traclabs/trac_ik/src/master/" rel="nofollow noreferrer">trac_ik</a>. To answer you completely, I tested it in ROS Noetic and found it working. Please see below:</p> <ol> <li><p><strong>Install trac_ik:</strong> Please install from pre-built binaries as shown below:</p> <pre><code> $ sudo apt install ros-noetic-trac-ik </code></pre> </li> <li><p><strong>Install dependency to run an example:</strong> We do not need this package. But here, I want to run an example to confirm trac_ik.</p> <pre><code> $ sudo apt install ros-noetic-pr2-description </code></pre> </li> <li><p><strong>Run example:</strong> The <a href="https://bitbucket.org/traclabs/trac_ik/src/9d22477e70d64df75720ec99066cb03ee813ec3d/trac_ik_examples/launch/pr2_arm.launch#lines-11" rel="nofollow noreferrer">pr2_arm.launch</a> uses <a href="https://bitbucket.org/traclabs/trac_ik/src/9d22477e70d64df75720ec99066cb03ee813ec3d/trac_ik_examples/src/ik_tests.cpp#lines-51" rel="nofollow noreferrer"><code>TRAC_IK::TRAC_IK tracik_solver(chain_start, chain_end, urdf_param, timeout, eps)</code></a></p> <pre><code> ravi@dell:~$ roslaunch trac_ik_examples pr2_arm.launch ... logging to /home/ravi/.ros/log/a428d09e-64be-11ek-b98a-bhc0cd415369/roslaunch-dell-13219.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is &lt;1GB. started roslaunch server http://dell:36633/ SUMMARY ======== PARAMETERS * /robot_description: &lt;?xml version=&quot;1.... * /rosdistro: noetic * /rosversion: 1.15.14 * /trac_ik_tests/chain_end: r_wrist_roll_link * /trac_ik_tests/chain_start: torso_lift_link * /trac_ik_tests/num_samples: 1000 * /trac_ik_tests/timeout: 0.005 * /trac_ik_tests/urdf_param: /robot_description NODES / trac_ik_tests (trac_ik_examples/ik_tests) auto-starting new master process[master]: started with pid [13259] ROS_MASTER_URI=http://localhost:11311 setting /run_id to a428d09e-64be-11ek-b98a-bhc0cd415369 process[rosout-1]: started with pid [13284] started core service [/rosout] process[trac_ik_tests-2]: started with pid [13287] [ INFO] [1668500629.439007277]: Using 7 joints [ INFO] [1668500629.440011185]: *** Testing KDL with 1000 random samples [ INFO] [1668500629.440163447]: 0% done [ INFO] [1668500630.509473437]: 90% done [ INFO] [1668500630.632576062]: KDL found 859 solutions (85.9%) with an average of 0.0011914 secs per sample [ INFO] [1668500630.632594903]: *** Testing TRAC-IK with 1000 random samples [ INFO] [1668500630.632938700]: 0% done [ INFO] [1668500631.733434004]: TRAC-IK found 955 solutions (95.5%) with an average of 0.0010914 secs per sample [trac_ik_tests-2] process has finished cleanly log file: /home/ravi/.ros/log/a428d09e-64be-11ek-b98a-bhc0cd415369/trac_ik_tests-2*.log ^C[rosout-1] killing on exit [master] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done </code></pre> </li> </ol> <h2>Note</h2> <p>Please read below if you get the following error with <code>pr2_arm.launch</code> file</p> <pre><code>RLException: Invalid &lt;param&gt; tag: Cannot load command parameter [robot_description]: no such command [['/opt/ros/noetic/share/xacro/xacro.py', '/opt/ros/noetic/share/pr2_description/robots/pr2.urdf.xacro']]. Param xml is &lt;param name=&quot;robot_description&quot; command=&quot;<span class="math-container">$(find xacro)/xacro.py '$</span>(find pr2_description)/robots/pr2.urdf.xacro'&quot;/&gt; The traceback for the exception was written to the log file </code></pre> <p>Please change <code>xacro.py</code> to <code>xacro</code> at line#8 of <code>/opt/ros/noetic/share/trac_ik_examples/launch/pr2_arm.launch</code> file as suggested <a href="https://answers.ros.org/question/366957/problem-with-xacro-invalid-param/?answer=366979#post-id-366979" rel="nofollow noreferrer">here</a>.</p> <h2>Update</h2> <p>With &quot;chain_start&quot;, &quot;chain_end&quot;, as &quot;base_link&quot;, and &quot;tool0&quot; respectively, the IK test of <a href="https://github.com/ros-industrial/kuka_experimental/tree/melodic-devel/kuka_lbr_iiwa_support/urdf" rel="nofollow noreferrer">kuka lbr iiwa</a> robot using trac_ik works smoothly. Below is the <code>kuka_lbr_iiwa.launch</code> file:</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;launch&gt; &lt;arg name=&quot;num_samples&quot; default=&quot;1000&quot; /&gt; &lt;arg name=&quot;chain_start&quot; default=&quot;base_link&quot; /&gt; &lt;arg name=&quot;chain_end&quot; default=&quot;tool0&quot; /&gt; &lt;arg name=&quot;timeout&quot; default=&quot;0.005&quot; /&gt; &lt;param name=&quot;robot_description&quot; command=&quot;<span class="math-container">$(find xacro)/xacro --inorder '$</span>(find kuka_lbr_iiwa_support)/urdf/lbr_iiwa_14_r820.xacro'&quot; /&gt; &lt;node name=&quot;trac_ik_tests&quot; pkg=&quot;trac_ik_examples&quot; type=&quot;ik_tests&quot; output=&quot;screen&quot;&gt; &lt;param name=&quot;num_samples&quot; value=&quot;<span class="math-container">$(arg num_samples)" /&gt; &lt;param name="chain_start" value="$</span>(arg chain_start)&quot; /&gt; &lt;param name=&quot;chain_end&quot; value=&quot;<span class="math-container">$(arg chain_end)" /&gt; &lt;param name="timeout" value="$</span>(arg timeout)&quot; /&gt; &lt;param name=&quot;urdf_param&quot; value=&quot;/robot_description&quot; /&gt; &lt;/node&gt; &lt;/launch&gt; </code></pre> <p>This is how, I executed it:</p> <pre><code>$ roslaunch trac_ik_examples kuka_lbr_iiwa.launch ... logging to /home/ravi/.ros/log/648856b2-655b-11ed-b98a-bfc0cd455360/roslaunch-dell-115393.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is &lt;1GB. xacro: in-order processing became default in ROS Melodic. You can drop the option. started roslaunch server http://dell:44651/ SUMMARY ======== PARAMETERS * /robot_description: &lt;?xml version=&quot;1.... * /rosdistro: noetic * /rosversion: 1.15.14 * /trac_ik_tests/chain_end: tool0 * /trac_ik_tests/chain_start: base_link * /trac_ik_tests/num_samples: 1000 * /trac_ik_tests/timeout: 0.005 * /trac_ik_tests/urdf_param: /robot_description NODES / trac_ik_tests (trac_ik_examples/ik_tests) auto-starting new master process[master]: started with pid [115433] ROS_MASTER_URI=http://localhost:11311 setting /run_id to 648856b2-655b-11ed-b98a-bfc0cd455360 process[rosout-1]: started with pid [115460] started core service [/rosout] process[trac_ik_tests-2]: started with pid [115467] [ INFO] [1668567873.100935324]: Using 7 joints [ INFO] [1668567873.102060585]: *** Testing KDL with 1000 random samples [ INFO] [1668567873.107102190]: 0% done [ INFO] [1668567874.109234688]: 30% done [ INFO] [1668567875.367298698]: 70% done [ INFO] [1668567876.307079837]: KDL found 400 solutions (40%) with an average of 0.00320388 secs per sample [ INFO] [1668567876.307104300]: *** Testing TRAC-IK with 1000 random samples [ INFO] [1668567876.307449347]: 0% done [ INFO] [1668567876.837260447]: TRAC-IK found 996 solutions (99.6%) with an average of 0.000525585 secs per sample [trac_ik_tests-2] process has finished cleanly log file: /home/ravi/.ros/log/648856b2-655b-11ed-b98a-bfc0cd455360/trac_ik_tests-2*.log ^C[rosout-1] killing on exit [master] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> with karma: 1744 on 2022-11-15</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/92256/johndoe/" rel="nofollow noreferrer">JohnDoe</a> on 2022-11-15</strong>:<br /> Thank you for your reply and detailed explanation. I followed your instructions and was able to see the same verification results.</p> <p>However, this is not what I want.</p> <p>When I run <a href="https://bitbucket.org/traclabs/trac_ik/src/master/trac_ik_examples/src/" rel="nofollow noreferrer">test.cpp</a> via C++ in IDE and launch the robot description in another terminal, I get the error mentioned above, which does not happen with the <code>ROS Melodic</code>.</p> <p>I am using the <a href="https://github.com/ros-industrial/kuka_experimental/tree/melodic-devel/kuka_lbr_iiwa_support/urdf" rel="nofollow noreferrer">kuka lbr iiwa robot</a>. For the main function of my test.cpp, I just changed the following parameters based on the sample.</p> <pre><code>nh.param(&quot;chain_start&quot;, chain_start, std::string(&quot;base_link&quot;)); nh.param(&quot;chain_end&quot;, chain_end, std::string(&quot;tool0&quot;)); nh.param(&quot;urdf_param&quot;, urdf_param, std::string(&quot;/robot_description&quot;)); </code></pre> <p>Besides, the rest is exactly the same as the original test.cpp.</p> <p>Would you please try to call <code>trac-ik</code> in this way?</p> <p>Thanks!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-11-15</strong>:<br /> Please see the &quot;Update&quot; section in my answer above. Basically, it works fine with your parameters as well. However, in your computer, most probably the <code>trac_ik</code> is broken. Please install it as mentioned in the answer above.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/92256/johndoe/" rel="nofollow noreferrer">JohnDoe</a> on 2022-11-15</strong>:<br /> Thank you for your patient response, which I greatly appreciate.</p> <p>I have tried all your instructions and everything goes well. However, I found the problem when I was trying to share a minimally reproducible example for you.</p> <p>For my original project, there are many components in the <code>find_package</code> of <code>CMakeList</code>, e.g. <code>kdl_parser</code>, <code>trac_ik_lib</code>, <code>nlopt</code>, <code>visualization_msgs</code>, and so on.</p> <p>For the minimal reproducible example project, I just included <code>kdl_parser</code> and <code>trac_ik_lib</code>, and I found that the error encountered above disappeared.</p> <p>Through repeated testing, I found that in <code>ROS Noetic</code>, the <code>nlopt lib</code> and <code>trac_ik_lib</code> conflict with each other, which causes the error I raised in the question and does not occur with <code>ROS Melodic</code>.</p> <p>Anyway, thanks for the guidance and I was able to find this problem in my attempt.</p> <p>PS: I installed <code>nlopt</code> and <code>trac_ik_lib</code> by <code>sudo apt-get install ros-noetic-****</code>.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25207/ravijoshi/" rel="nofollow noreferrer">ravijoshi</a> on 2022-11-15</strong>:<br /> I am glad that you made it work. Sometime, creating a &quot; minimally reproducible example&quot; helps to filter the issue, as you did. BTW, the <code>nlopt</code> is automatically installed when using <code>sudo apt install ros-noetic-trac-ik</code>. So, you don't need to worry about it. Otherwise, you have to install <code>libnlopt-dev</code> and <code>libnlopt-cxx0</code>. I have tested both approaches in Noetic (Ubuntu 20.04 LTS) and found working.</p> <p>Finally, if this answer helped you to found the issue and the problem is resolved, may I request you to (1) upvote, and (2) mark this answer as accepted? Please look at the top left corner of this above above.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/92256/johndoe/" rel="nofollow noreferrer">JohnDoe</a> on 2022-11-16</strong>:<br /> No problem, I've marked this as the answer.</p> <p>Thanks again for your kindness!</p>
102708
2022-11-15T02:19:19.000
|ros|ros-melodic|kdl|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi!</p> <p>I have used TRAC-IK on ROS Melodic and Kinetic and everything works fine.</p> <p>However, when I ported the same code to ROS Noetic, I found that TRAC-IK could not be initialized, i.e., I got this error</p> <pre><code> Signal: SIGSEGV (Segmentation fault) </code></pre> <p>when running to</p> <pre><code> TRAC_IK::TRAC_IK tracik_solver(chain_start, chain_end, urdf_param, timeout, eps); </code></pre> <p>To make sure it wasn't an error in my code, I ran <a href="https://bitbucket.org/traclabs/trac_ik/src/master/trac_ik_examples/src/" rel="nofollow noreferrer">test.cpp </a> separately and ran into the same problem.</p> <p>I'm not sure what is causing this error, or if I'm missing the installation of other libraries. But for now, my code builds fine.</p> <p>Looking forward any reply!</p> <p>Thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/409387/error-when-initializing-trac_ik-on-noetic/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/92256/johndoe/" rel="nofollow noreferrer">JohnDoe</a> on ROS Answers with karma: 3 on 2022-11-15</p> <p>Post score: 0</p>
Error when initializing trac_ik on Noetic
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It seems you are missing a:</p> <pre><code>&lt;remap from=&quot;map&quot; to=&quot;/rtabmap/grid_map&quot;/&gt; </code></pre> <p>before <code>move_base</code> node. Verify in RVIZ that you can see the global costmap.</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-11-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/113638/donguri/" rel="nofollow noreferrer">donguri</a> on 2022-11-17</strong>:<br /> Dear matlabbe.</p> <p>Thank you for the reply!</p> <pre><code>&lt;node pkg=&quot;move_base&quot; type=&quot;move_base&quot; respawn=&quot;false&quot; name=&quot;move_base&quot; output=&quot;screen&quot;&gt; </code></pre> <p>I tried adding <code>&lt;remap from=&quot;map&quot; to=&quot;/rtabmap/grid_map&quot;/&gt;</code> before the above code in move_base.launch and running it, but it still did not work.</p> <p>The changes I have made may have differed from your intentions, so I will add the changes I have made in editing to the body of the question. Please check it.</p> <p>I would like to publish any other files that might be relevant to solving this problem. Thank you in advance.</p> <p>Thank you.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/113638/donguri/" rel="nofollow noreferrer">donguri</a> on 2022-11-17</strong>:<br /> In the Rviz I added to the question, I see that &quot;robot/center&quot; and &quot;map&quot; are misaligned.</p> <p>Is this misalignment the cause of this problem?</p> <p>By the way, the center of the robot is &quot;robot/center&quot; and various sensors are installed in front of the robot.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> on 2022-11-19</strong>:<br /> Use <code>rosnode info</code> on <code>move_base</code>and <code>rtabmap</code>nodes to know exactly what is the map topic name you should remap. <code>rqt_graph</code>can be handy to debug topic remapping issues. I don't see how rtabmap is started, but if it is started in global namespace, the topic would be <code>/grid_map</code>, unless you did remap the output topic name somewhere.</p>
102710
2022-11-16T03:01:16.000
|ros|slam|navigation|rtabmap|move-base|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have set the robot's target point and orientation in &quot;2D Nav Goal&quot; in RViz and am trying to run the robot to the target point, but I get the following error message.</p> <pre><code>The robot's start position is off the global costmap. Planning will always fail, are you sure the robot has been properly localized? </code></pre> <p>I am asking this question because I have researched the error I am getting and have tried everything and it does not solve the problem.</p> <p>The current situation looks like this.</p> <ul> <li>Activate sensors (fisheye camera, depth camera, etc.).</li> <li>Activate RTABMap.</li> <li>Activate move_base.</li> <li>Launch navigation.</li> <li>Specify the target in &quot;2D Nav Goal&quot; of RViz.</li> <li><strong>Output the above error.</strong></li> </ul> <p>The robot makes a left turn and stops while the error is being output.</p> <p>I see from the questions of others who have the same error as mine that it seems to be solved by changing the contents of &quot;global_costmap_param.yaml&quot;. However, in my case, I am using RTABMap, so I wonder if the solution is a little different?</p> <p>move_base.launch</p> <pre><code>&lt;!-- ROS navigation stack with velocity smoother and safety (reactive) controller --&gt; &lt;launch&gt; &lt;arg name=&quot;odom_frame_id&quot; default=&quot;t265_odom_frame&quot;/&gt; &lt;arg name=&quot;base_frame_id&quot; default=&quot;robot_center&quot;/&gt; &lt;arg name=&quot;global_frame_id&quot; default=&quot;map&quot;/&gt; &lt;arg name=&quot;odom_topic&quot; default=&quot;t265/odom/sample&quot; /&gt; &lt;arg name=&quot;laser_topic&quot; default=&quot;scan&quot; /&gt; &lt;node pkg=&quot;move_base&quot; type=&quot;move_base&quot; respawn=&quot;false&quot; name=&quot;move_base&quot; output=&quot;screen&quot;&gt; &lt;rosparam file=&quot;<span class="math-container">$(find realsense_controls)/config/costmap_common_params.yaml" command="load" ns="global_costmap" /&gt; &lt;rosparam file="$</span>(find realsense_controls)/config/costmap_common_params.yaml&quot; command=&quot;load&quot; ns=&quot;local_costmap&quot; /&gt; &lt;rosparam file=&quot;<span class="math-container">$(find realsense_controls)/config/local_costmap_params_3d.yaml" command="load" /&gt; &lt;rosparam file="$</span>(find realsense_controls)/config/global_costmap_params.yaml&quot; command=&quot;load&quot; /&gt; &lt;rosparam file=&quot;$(find realsense_controls)/config/base_local_planner_params.yaml&quot; command=&quot;load&quot; /&gt; &lt;!-- reset frame_id parameters using user input data --&gt; &lt;param name=&quot;global_costmap/global_frame&quot; value=&quot;<span class="math-container">$(arg global_frame_id)"/&gt; &lt;param name="global_costmap/robot_base_frame" value="$</span>(arg base_frame_id)&quot;/&gt; &lt;param name=&quot;local_costmap/global_frame&quot; value=&quot;<span class="math-container">$(arg odom_frame_id)"/&gt; &lt;param name="local_costmap/robot_base_frame" value="$</span>(arg base_frame_id)&quot;/&gt; &lt;param name=&quot;DWAPlannerROS/global_frame_id&quot; value=&quot;$(arg odom_frame_id)&quot;/&gt; &lt;remap from=&quot;odom&quot; to=&quot;<span class="math-container">$(arg odom_topic)"/&gt; &lt;remap from="scan" to="$</span>(arg laser_topic)&quot;/&gt; &lt;/node&gt; &lt;/launch&gt; </code></pre> <p>global_costmap_param.yaml</p> <pre><code>#global_costmap global_frame: /map robot_base_frame: /robot_center update_frequency: 1 publish_frequency: 1 always_send_full_costmap: false #static_map: false #rolling_window: true plugins: - {name: static_layer, type: &quot;rtabmap_ros::StaticLayer&quot;} - {name: obstacle_layer, type: &quot;costmap_2d::ObstacleLayer&quot;} - {name: inflation_layer, type: &quot;costmap_2d::InflationLayer&quot;} </code></pre> <p>----------------------Editing ①.--------------------------------</p> <p>After the change &quot;move_base.launch&quot; </p> <pre><code> &lt;arg name=&quot;odom_frame_id&quot; default=&quot;t265_odom_frame&quot;/&gt; &lt;arg name=&quot;base_frame_id&quot; default=&quot;robot_center&quot;/&gt; &lt;arg name=&quot;global_frame_id&quot; default=&quot;map&quot;/&gt; &lt;arg name=&quot;odom_topic&quot; default=&quot;t265/odom/sample&quot; /&gt; &lt;arg name=&quot;laser_topic&quot; default=&quot;scan&quot; /&gt; &lt;!--Added statement--&gt; &lt;remap from=&quot;map&quot; to=&quot;/rtabmap/grid_map&quot;/&gt; &lt;node pkg=&quot;move_base&quot; type=&quot;move_base&quot; respawn=&quot;false&quot; name=&quot;move_base&quot; output=&quot;screen&quot;&gt; &lt;rosparam file=&quot;<span class="math-container">$(find realsense_controls)/config/costmap_common_params.yaml" command="load" ns="global_costmap" /&gt; &lt;rosparam file="$</span>(find realsense_controls)/config/costmap_common_params.yaml&quot; command=&quot;load&quot; ns=&quot;local_costmap&quot; /&gt; &lt;rosparam file=&quot;<span class="math-container">$(find realsense_controls)/config/local_costmap_params_3d.yaml" command="load" /&gt; &lt;rosparam file="$</span>(find realsense_controls)/config/global_costmap_params.yaml&quot; command=&quot;load&quot; /&gt; &lt;rosparam file=&quot;$(find realsense_controls)/config/base_local_planner_params.yaml&quot; command=&quot;load&quot; /&gt; &lt;!-- reset frame_id parameters using user input data --&gt; &lt;param name=&quot;global_costmap/global_frame&quot; value=&quot;<span class="math-container">$(arg global_frame_id)"/&gt; &lt;param name="global_costmap/robot_base_frame" value="$</span>(arg base_frame_id)&quot;/&gt; &lt;param name=&quot;local_costmap/global_frame&quot; value=&quot;<span class="math-container">$(arg odom_frame_id)"/&gt; &lt;param name="local_costmap/robot_base_frame" value="$</span>(arg base_frame_id)&quot;/&gt; &lt;param name=&quot;DWAPlannerROS/global_frame_id&quot; value=&quot;$(arg odom_frame_id)&quot;/&gt; &lt;remap from=&quot;odom&quot; to=&quot;<span class="math-container">$(arg odom_topic)"/&gt; &lt;remap from="scan" to="$</span>(arg laser_topic)&quot;/&gt; &lt;/node&gt; &lt;/launch&gt; </code></pre> <p>You can also see that a global costmap has been generated.:The robot/center is in the front and the map is in the back. <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16686770958282824.png" alt="Rviz" /></p> <hr /> <p><a href="https://answers.ros.org/question/409435/%5Bnoetic,-rtabmap,-move_base%5Di-cannot-resolve-the-error-%22the-robot%27s-start-position-is-off-the-global-costmap.%22/" 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-11-16</p> <p>Post score: 0</p>
[Noetic, Rtabmap, move_base]I cannot resolve the error "The robot's start position is off the global costmap."
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You are interested in these tutorials:</p> <ul> <li><a href="https://docs.ros.org/en/foxy/Tutorials/Intermediate/Launch/Launch-Main.html" rel="nofollow noreferrer">https://docs.ros.org/en/foxy/Tutorials/Intermediate/Launch/Launch-Main.html</a></li> </ul> <p>Especially usage of <code>from launch.conditions import IfCondition</code> from <a href="https://docs.ros.org/en/foxy/Tutorials/Intermediate/Launch/Using-Substitutions.html#substitutions-example-launch-file" rel="nofollow noreferrer">https://docs.ros.org/en/foxy/Tutorials/Intermediate/Launch/Using-Substitutions.html#substitutions-example-launch-file</a></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-11-17</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-17</strong>:<br /> Thank you for your help.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2022-11-17</strong>:<br /> Please accept it as an answer, so it will have a chance to be moved to the StackExchange later :)</p>
102712
2022-11-17T02:44:05.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 migrating my project to ROS2 Foxy. In my old launch file I have following lines of code:</p> <pre><code> &lt;arg name=&quot;config&quot; default=&quot;<span class="math-container">$(eval 'cartographer_jetson.lua' if (target == 'jetson') else 'cartographer_host.lua')"/&gt; &lt;arg name="odom" default="$</span>(eval '/rs_t265/odom/sample' if (target == 'jetson') else '/minicar/controller/odom')&quot;/&gt; </code></pre> <p>How those lines should look like in python launch file? I actually couldn't find documentation with examples that cover that situation, so if there are some documentation with detailed explanation of python launch file creation process I'll be would be very grateful for a link. Appreciate any help</p> <hr /> <p><a href="https://answers.ros.org/question/409490/how-to-use-if-else-in-python-launch-file?/" 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-17</p> <p>Post score: 0</p>
How to use if else in python launch file?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I figured it out. This message's origin is ~/.bashrc file. You should type:</p> <pre><code>nano ~/.bashrc </code></pre> <p>After that go to the bottom and you will see</p> <pre><code>source /opt/ros/noetic/setup.bash </code></pre> <p>Delete this line of code. Then the message won't appear anymore.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/124054/whxper/" rel="nofollow noreferrer">whxper</a> with karma: 16 on 2022-11-17</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102714
2022-11-17T05:03:45.000
|ros|source|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi. I had ROS 1(noetic) on my Ubuntu. Then i removed it and installed ROS 2. But whenever i open the terminal, i see this message and i don't know how to remove it. Could you help me with that? Thanks</p> <pre><code>bash: /opt/ros/noetic/setup.bash: No such file or directory </code></pre> <hr /> <p><a href="https://answers.ros.org/question/409496/how-can-i-remove-this-message-from-my-terminal?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/124054/whxper/" rel="nofollow noreferrer">whxper</a> on ROS Answers with karma: 16 on 2022-11-17</p> <p>Post score: 0</p>
How can i remove this message from my terminal?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Can you add a <code>' '</code> around <code> jetson</code> here and try again?</p> <p><code>default_value=PythonExpression([&quot;'/rs_t265/odom/sample' if &quot;,target, &quot;=='jetson' else '/minicar/controller/odom'&quot;])</code></p> <p>You are comparing strings, without <code>' '</code> around it Python treats it like a variable name</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-11-17</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-18</strong>:<br /> Thank you for your help. I followed your suggestion and also changed LaunchConfiguration for target like this:</p> <pre><code>target = LaunchConfiguration(&quot;target&quot;, default=&quot;'jetson'&quot;) </code></pre> <p>and problem solved.</p>
102716
2022-11-17T07:56:56.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've come from ROS1 and very familiar with ROS2 python launch system so, maybe, for anybody this problem will be obvious, but, unfortunately, not for me. I have the following launch file:</p> <pre><code>import os import sys import xacro import launch import launch_ros.actions from launch.substitutions import LaunchConfiguration from ament_index_python.packages import get_package_share_directory from launch.substitutions import PythonExpression xacro_path = os.path.join(get_package_share_directory('minicar_description'), 'urdf', 'minicar.xacro') xacro_doc = xacro.parse(open(xacro_path, 'r')) xacro.process_doc(xacro_doc) robot_description = xacro_doc.toxml() def generate_launch_description(): target = LaunchConfiguration(&quot;target&quot;, default='jetson') use_sim_time = LaunchConfiguration('use_sim_time', default='true') minicar_cartographer_prefix = get_package_share_directory('minicar_slam') cartographer_config_dir = LaunchConfiguration('cartographer_config_dir', default=os.path.join( minicar_cartographer_prefix, 'config')) configuration_basename = PythonExpression([&quot;'cartographer_jetson.lua' if &quot;, target, &quot;==jetson else 'cartographer_host.lua'&quot;]) LaunchConfiguration('configuration_basename',default=configuration_basename) resolution = LaunchConfiguration('resolution', default='0.05') ##publish_period_sec = LaunchConfiguration('publish_period_sec', default='1.0') ##rviz_config_dir = os.path.join(get_package_share_directory('turtlebot3_cartographer'), 'rviz', 'tb3_cartographer.rviz') ld = launch.LaunchDescription([ launch.actions.DeclareLaunchArgument( 'cartographer_config_dir', default_value=cartographer_config_dir ), launch.actions.DeclareLaunchArgument( 'configuration_basename', default_value=configuration_basename ), launch.actions.DeclareLaunchArgument( 'use_sim_time', default_value=use_sim_time ), launch.actions.DeclareLaunchArgument( 'target', default_value=target ), launch.actions.DeclareLaunchArgument( name='config', default_value=PythonExpression([&quot;'cartographer_jetson.lua' if &quot;, target, &quot;==jetson else 'cartographer_host.lua'&quot;]) ), launch.actions.DeclareLaunchArgument( name='odom', #default_value=&quot;<span class="math-container">$(var '/rs_t265/odom/sample' if (target == 'jetson') else '/minicar/controller/odom')" default_value=PythonExpression(["'/rs_t265/odom/sample' if ",target, "==jetson else '/minicar/controller/odom'"]) ), launch.actions.DeclareLaunchArgument( name='scan', default_value='/minicar/rplidar/scan' ), launch.actions.DeclareLaunchArgument( name='map', default_value='none' ), launch.actions.DeclareLaunchArgument( name='bag', default_value='none' ), launch_ros.actions.Node( package='cartographer_ros', executable='cartographer_node', name='cartographer_node', output='screen', parameters=[ { 'robot_description': robot_description } ], condition=launch.conditions.IfCondition("$</span>(var map == 'none')&quot;) ), launch_ros.actions.Node( package='cartographer_ros', executable='cartographer_node', name='cartographer_node', output='screen', parameters=[ { 'robot_description': robot_description } ], arguments=[ '-configuration_directory', cartographer_config_dir, '-configuration_basename', configuration_basename ], condition=launch.conditions.IfCondition(&quot;<span class="math-container">$(var map != 'none')") ), launch_ros.actions.Node( package='robot_state_publisher', executable='robot_state_publisher', name='robot_state_publisher', parameters=[ { 'use_sim_time': use_sim_time, 'robot_description': robot_description } ], arguments=[ '-configuration_directory', cartographer_config_dir, '-configuration_basename', configuration_basename ], condition=launch.conditions.IfCondition(PythonExpression(["$</span>(var bag != 'none')&quot;])) ), launch_ros.actions.Node( package='rosbag2', executable='play', name='playbag', parameters=[ { 'robot_description': robot_description } ], condition=launch.conditions.IfCondition(PythonExpression([&quot;$(var bag != 'none')&quot;])) ), launch_ros.actions.Node( package='cartographer_ros', executable='occupancy_grid_node', name='cartographer_occupancy_grid_node', arguments=[ 'resolution', resolution ], parameters=[ { 'robot_description': robot_description } ] ) ]) return ld if __name__ == '__main__': generate_launch_description() </code></pre> <p>That generate this error:</p> <pre><code>[INFO] [launch]: All log files can be found below /home/mikita/.ros/log/2022-11-17-04-43-30-782618-ubuntu-104998 [INFO] [launch]: Default logging verbosity is set to INFO Task exception was never retrieved future: &lt;Task finished name='Task-2' coro=&lt;LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226&gt; exception=NameError(&quot;name 'jetson' is not defined&quot;)&gt; Traceback (most recent call last): File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py&quot;, line 228, in _process_one_event await self.__process_event(next_event) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py&quot;, line 248, in __process_event visit_all_entities_and_collect_futures(entity, self.__context)) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) [Previous line repeated 1 more time] File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 38, in visit_all_entities_and_collect_futures sub_entities = entity.visit(context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py&quot;, line 108, in visit return self.execute(context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/declare_launch_argument.py&quot;, line 184, in execute perform_substitutions(context, self.default_value) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py&quot;, line 26, in perform_substitutions return ''.join([context.perform_substitution(sub) for sub in subs]) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py&quot;, line 26, in &lt;listcomp&gt; return ''.join([context.perform_substitution(sub) for sub in subs]) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py&quot;, line 219, in perform_substitution return substitution.perform(self) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/substitutions/python_expression.py&quot;, line 72, in perform return str(eval(perform_substitutions(context, self.expression), {}, math.__dict__)) File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt; NameError: name 'jetson' is not defined </code></pre> <p>I'm trying to follow <a href="https://github.com/chargerKong/learning_ros2_launch_by_example/blob/main/docs/How%20to%20use%20pythonexpression.md" rel="nofollow noreferrer">this</a> and <a href="https://docs.ros.org/en/foxy/Tutorials/Intermediate/Launch/Using-Substitutions.html#substitutions-example-launch-file" rel="nofollow noreferrer">this</a> examples of IfCondition and PythonExpression usage, but, apparently, I'm missing something. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/409512/name-is-not-defined-in-ros2-python-launch-file/" 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-17</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-11-17</strong>:<br /> It would be appreciated if you can minimize the code to review to <a href="https://en.wikipedia.org/wiki/Minimal_reproducible_example" rel="nofollow noreferrer">MRE</a> - if possible, with one argument and one node only</p>
name is not defined in ROS2 python launch file
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>FYI: there's a beta release for Create 3 with ROS 2 Humble: <a href="https://iroboteducation.github.io/create3_docs/releases/h_0_0/" rel="nofollow noreferrer">https://iroboteducation.github.io/create3_docs/releases/h_0_0/</a></p> <p>However, as you said, most features work across Galactic-Humble.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/30341/alsora/" rel="nofollow noreferrer">alsora</a> with karma: 1322 on 2022-11-17</p> <p>This answer was <strong>NOT ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
102718
2022-11-17T12:23:04.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Is it possible to run the Irobot Create 3 with Ros 2 Humble or is it fixed to Galactic?</p> <hr /> <p><a href="https://answers.ros.org/question/409525/irobot-create-3-ros2-humble/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/22870/duck-development/" rel="nofollow noreferrer">duck-development</a> on ROS Answers with karma: 1999 on 2022-11-17</p> <p>Post score: 0</p>
irobot create 3 ros2 humble
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Whoops, I looked at the <a href="https://github.com/ros2/demos/tree/humble/action_tutorials/action_tutorials_py" rel="nofollow noreferrer">rclpy demos</a>, but forgot about the <a href="https://github.com/ros2/examples/tree/master/rclpy/actions" rel="nofollow noreferrer">rclpy examples</a>.</p> <p>There are several server examples showing how to build long-running action servers that handle cancellation. They work well w/ the client examples, as well as <code>ros2 action send_goal</code>.</p> <p>In looking at the server code, I see a few patterns:</p> <ul> <li>execute_callback contains a call to time.sleep() to simulate a long-running action</li> <li>execute_callback blocks until the goal has been reached, or a cancellation request has been received</li> <li>the trick is to use a MultiThreadedExecutor and a ReentrantCallbackGroup: these allow the server to receive and process cancellation requests while the goal is executing</li> <li>in some cases the execute_callback is marked async, but this doesn't matter, since it never yields (never awaits)</li> </ul> <p>Thanks.</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-11-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
102721
2022-11-17T18:27:11.000
|ros|ros2|action|rclpy|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The <a href="https://github.com/ros2/demos/blob/humble/action_tutorials/action_tutorials_py/action_tutorials_py/fibonacci_action_server.py" rel="nofollow noreferrer">Fibonacci action demo</a> is nice, but it doesn't support cancellation.</p> <p>I added a custom <code>cancel_callback</code>, called it from <code>ros2 action send_goal</code>, and tried to cancel by hitting ctrl-C, but it doesn't seem to work. I suspect that's because <code>execute_callback</code> is blocking.</p> <p>What is a preferred pattern for handling long-running actions in rclpy with cancellation? Any examples / demos / tutorials?</p> <p>Thanks.</p> <hr /> <p><a href="https://answers.ros.org/question/409537/handling-long-actions-in-rclpy-(with-cancellation)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/28405/clyde/" rel="nofollow noreferrer">clyde</a> on ROS Answers with karma: 1247 on 2022-11-17</p> <p>Post score: 1</p>
Handling long actions in rclpy (with cancellation)
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I was facing the same problem as both the robot_localization and the diff_drive_controller were publishing the tf's. So I disabled the tf's comming from diff_drive_controller by adding this param: enable_odom_tf: false This solved my problem.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/124888/kunal-mod/" rel="nofollow noreferrer">Kunal Mod</a> with karma: 26 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/124177/pavan_c/" rel="nofollow noreferrer">pavan_c</a> on 2022-11-30</strong>:<br /> Thank You for the answer Kunal, it is working. I even got it working with RosAria by creating a duplicate topic with different names of frame_id's so that TF's won't get clashed. Also, can you please let me know how to configure the process noise covariance matrix in the EKF node?</p>
102723
2022-11-17T22:16:32.000
|navigation|ekf|pioneer-3dx|rosaria|robot-localization|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am using ROS NOETIC and Pioneer3DX as the mobile robot which publishes Odometry info into /RosAria/pose topic as nav_msgs/Odometry message. Phidgets Spatial IMU is being used which published the IMU data to /imu/data_raw and /imu/data (this uses imu_madgwick filter to get the orientation data) topics as sensor_msgs/imu.</p> <p>This is my launch file:</p> <pre><code>&lt;node pkg=&quot;robot_localization&quot; type=&quot;ekf_localization_node&quot; name=&quot;ekf_odom_node&quot; output=&quot;screen&quot; &gt; &lt;param name=&quot;frequency&quot; value=&quot;10&quot;/&gt; &lt;param name=&quot;sensor_timeout&quot; value=&quot;0.1&quot;/&gt; &lt;param name=&quot;publish_tf&quot; value=&quot;true&quot;/&gt; &lt;param name=&quot;two_d_mode&quot; value=&quot;true&quot;/&gt; &lt;remap from=&quot;odometry/filtered&quot; to=&quot;odom/ekf/enc_imu&quot;/&gt; &lt;!-- &lt;param name=&quot;map_frame&quot; value=&quot;map&quot;/&gt; --&gt; &lt;param name=&quot;odom_frame&quot; value=&quot;odom&quot;/&gt; &lt;param name=&quot;base_link_frame&quot; value=&quot;base_link&quot;/&gt; &lt;param name=&quot;world_frame&quot; value=&quot;odom&quot;/&gt; &lt;param name=&quot;transform_time_offset&quot; value=&quot;0.0&quot;/&gt; &lt;param name=&quot;odom0&quot; value=&quot;/RosAria/pose&quot;/&gt; &lt;param name=&quot;odom0_differential&quot; value=&quot;true&quot; /&gt; &lt;param name=&quot;odom0_relative&quot; value=&quot;false&quot; /&gt; &lt;param name=&quot;odom0_queue_size&quot; value=&quot;10&quot; /&gt; &lt;rosparam param=&quot;odom0_config&quot;&gt;[false, false, false, false, false, false, true, true, false, false, false, true, false, false, false]&lt;/rosparam&gt; &lt;param name=&quot;imu0&quot; value=&quot;/imu/data&quot;/&gt; &lt;param name=&quot;imu0_differential&quot; value=&quot;false&quot; /&gt; &lt;param name=&quot;imu0_relative&quot; value=&quot;true&quot; /&gt; &lt;param name=&quot;imu0_queue_size&quot; value=&quot;10&quot; /&gt; &lt;param name=&quot;imu0_remove_gravitational_acceleration&quot; value=&quot;true&quot; /&gt; &lt;rosparam param=&quot;imu0_config&quot;&gt;[false, false, false, false, false, true, false, false, false, false, false, true, true, false, false]&lt;/rosparam&gt; &lt;param name=&quot;print_diagnostics&quot; value=&quot;true&quot; /&gt; &lt;param name=&quot;debug&quot; value=&quot;false&quot; /&gt; &lt;param name=&quot;debug_out_file&quot; value=&quot;debug_odom_ekf.txt&quot; /&gt; &lt;rosparam param=&quot;process_noise_covariance&quot;&gt;[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.7491722135750453e-06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.7491722135750453e-06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.7491722135750453e-06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7.53975837175367e-06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7.53975837175367e-06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7.53975837175367e-06]&lt;/rosparam&gt; </code></pre> <p>My Odometry data doesn't have any Covariance and my IMU data has covariance for angular velocity and linear acceleration, which I have specified in the process noise covariance.</p> <p>When I launch robot_localization, tf tree starts jiggling, I assume it is due to the clash between my Mobile robot controller and the robot_localization node publishing the tf in base_link. Please let me know how can I fix this.</p> <p>Also, my filtered odometry topic seems to have covariance and it is constantly changing even when stationary (which I think is due to the IMU, the IMU frame is constantly quivering even when there is no movement). I would like to know the reason/fix for this. A single instance of echoed filtered odometry topic looks like this:</p> <hr /> <pre><code>header: seq: 109 stamp: secs: 1668740288 nsecs: 491907835 frame_id: &quot;odom&quot; child_frame_id: &quot;base_link&quot; pose: pose: position: x: -0.0027767606103315393 y: -0.001673958087734123 z: -6.744843784137596e-19 orientation: x: -2.346676768845103e-21 y: 3.727956144832735e-21 z: -3.8869887649939077e-05 w: 0.999999999244566 covariance: [2.5936842164529874e-09, -8.262592806627886e-10, -6.622168163121949e-29, -6.51261107995881e-29, -2.1762563577312287e-27, 2.8450281461501656e-09, -8.26259280662786e-10, 3.466544928206097e-09, -3.531843233858175e-29, 2.240228932317681e-27, 7.406142294336661e-29, -4.720515954616235e-09, -6.237768220090504e-29, -3.652695440579897e-29, 1.6966118537294256e-09, -2.2507145702543902e-11, 3.7374557772980976e-11, -4.854850589794123e-30, -6.187178545053845e-29, 2.234850450568973e-27, -2.250714570254387e-11, 1.9517088713200696e-09, 2.3360351043958477e-13, -2.9994289813041105e-27, -2.1745832537608525e-27, 7.123303943513571e-29, 3.7374557772980866e-11, 2.336035104395824e-13, 1.9514617135004515e-09, -1.749658505742235e-27, 2.8450281461501797e-09, -4.7205159546162296e-09, -5.483666760685148e-30, -3.647455422328822e-27, -2.1815083512975117e-27, 2.1702338813096678e-08] twist: twist: linear: x: -0.05010471062555465 y: -0.030309224849492545 z: -1.1370249616301676e-18 angular: x: 1.3814492723897156e-21 y: 6.076604847095885e-22 z: 0.00013337306265425098 covariance: [2.24411163849706e-09, 2.9660498804899114e-27, -7.266418360758023e-27, -3.3104205459984865e-32, 5.495001420972768e-32, 7.74031030451591e-50, 9.289639803192707e-28, 2.2441116384970603e-09, -8.745147397450586e-28, -5.4401329579754266e-33, 9.029772770157075e-33, 1.271448515629526e-50, -4.21542365055365e-27, -2.0919414991473807e-27, 1.6905828785801147e-09, -1.3851442826998742e-13, 2.300067240234748e-13, 3.2514696938862866e-31, -1.808953450357923e-32, -1.0703286354554449e-32, -1.3851442826998752e-13, 6.881328598779493e-08, 1.3119186332455095e-16, -1.4224270414867518e-25, 3.00261465895899e-32, 1.776637994317112e-32, 2.3000672402347464e-13, 1.3119186343091536e-16, 6.881328584902495e-08, -8.276459357269306e-27, 4.1654287691771453e-50, 2.478040890632391e-50, 3.3591904764586926e-31, -2.6523856600289845e-25, -2.1058221482951057e-26, 1.3872113963674785e-07] </code></pre> <hr /> <p><a href="https://answers.ros.org/question/409543/i-have-used-robot_localization-node-to-fuse-my-odometry-data-with-imu.-after-running-it-and-visualizing-in-rviz-the-tf-tree-is-jiggling-a-lot-(maybe-due-to-multiple-sources-publishing-the-info-at-the-same-time).-how-do-i-solve-this?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/124177/pavan_c/" rel="nofollow noreferrer">pavan_c</a> on ROS Answers with karma: 3 on 2022-11-17</p> <p>Post score: 0</p>
Jiggling tf Tree After fusing Odometry with IMU
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>You can write a proper node for recoding a bag file.</p> <p>You can follow a tutorial for recording a bag file using the python ros2 node.</p> <p><a href="https://docs.ros.org/en/galactic/Tutorials/Advanced/Recording-A-Bag-From-Your-Own-Node-Py.html" rel="nofollow noreferrer">https://docs.ros.org/en/galactic/Tutorials/Advanced/Recording-A-Bag-From-Your-Own-Node-Py.html</a></p> <blockquote> <p>I kill the process</p> </blockquote> <p>Instead, you can unsubscribe to that by using the following line.</p> <p><code>self.Node.destroy_subscription(self,self.subscriber)</code></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-11-18</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/122096/ima/" rel="nofollow noreferrer">Ima</a> on 2022-11-18</strong>:<br /> Thanks for the reply! I, however, tried writing a ros2 node for recording a rosbag but Ros2 foxy doesn't provide the package rosbag2_py.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2022-11-18</strong>:<br /> Have a look in the future branch you will be able to get rosbag2_py</p> <p><a href="https://github.com/ros2/rosbag2/tree/foxy-future" rel="nofollow noreferrer">https://github.com/ros2/rosbag2/tree/foxy-future</a></p> <p><a href="https://github.com/ros2/rosbag2/issues/983" rel="nofollow noreferrer">https://github.com/ros2/rosbag2/issues/983</a></p> <p>If you got your answer then accept the answer by pressing tick button.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/122096/ima/" rel="nofollow noreferrer">Ima</a> on 2022-11-21</strong>:<br /> I can't change the whole branch to a new one, and what I'm looking for is removing the remaining active topics from the topic list</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2022-11-21</strong>:<br /> Clone the git repo, then after change the branch to foxy, build it. I think you will be ready to go.</p>
102725
2022-11-18T04:52:46.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, I wanted to use a python script to record a bag instead of using the command line in terminal. My script is based on <a href="https://answers.ros.org/question/286871/how-record-rosbag-with-python/" rel="nofollow noreferrer">how record rosbag with python</a>. However, the recorded topic stay active in the topic list even after I kill the process with Ctrl+C.</p> <p>The code snippet is as follows:</p> <pre><code>import subprocess, shlex, psutil command = &quot;ros2 bag record -o subset /sensor/position&quot; command = shlex.split(command) rosbag_proc = subprocess.Popen(command) </code></pre> <p>How can I fix this?</p> <p>Any help is appreciated</p> <hr /> <p><a href="https://answers.ros.org/question/409553/how-can-i-remove-active-topic?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/122096/ima/" rel="nofollow noreferrer">Ima</a> on ROS Answers with karma: 1 on 2022-11-18</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-18</strong>:<br /> Follow the answer..</p>
How can I remove active topic?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>You can have a look at question #q374976, You can do so by using below code.</p> <pre><code>import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.actions import ExecuteProcess def generate_launch_description(): package_dir =get_package_share_directory('&lt;package_path&gt;') # add package path world_files = os.path.join(package_dir,'worlds','&lt;world_path&gt;') # add world file path for *.world file ld = LaunchDescription() gazeboworld = ExecuteProcess( cmd=['gazebo','--verbose',world_files,'-s','libgazebo_ros_factory.so'] ) ld.add_action(gazeboworld) return ld </code></pre> <p>And Let's say you have URDF file and you want to add in Gazebo,</p> <pre><code>def generate_launch_description(): urdf = os.path.join(get_package_share_directory( robot_name), 'urdf', '&lt;File&gt;.urdf') xml = open(urdf, 'r').read() xml = xml.replace('&quot;', '\\&quot;') swpan_args = '{name: \&quot;my_robot\&quot;, xml: \&quot;' + xml + '\&quot; }' return LaunchDescription([ ExecuteProcess( cmd=['gazebo', '--verbose', world, '-s', 'libgazebo_ros_factory.so'], output='screen'), ExecuteProcess( cmd=['ros2', 'service', 'call', '/spawn_entity', 'gazebo_msgs/SpawnEntity', swpan_args], output='screen'), ]) </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-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/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2022-11-18</strong>:<br /> Thank you very much for your help.</p>
102727
2022-11-18T05:59:22.000
|gazebo|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 am migrating my project to ROS2 Foxy and for now I have a problem with understanding, how to launch gazebo from python launch file. Is there any detailed documentation or example for that case? All that I have found so far is launch file for turtlebot3, and it just don't work for some reason. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/409556/is-there-a-documentetion-or-example-of-how-to-launch-gazebo-with-python-launch-file?/" 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-18</p> <p>Post score: 0</p>
Is there a documentetion or example of how to launch gazebo with python launch file?