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>Your <code>rs_camera.launch</code> file is opening a <strong>hardware device</strong>, and the Intel-supplied code allows only one linux process at a time <strong>on the machine</strong> to open a particular camera device.</p> <p>Running the Intel code inside a docker does not let you to escape this limitation.</p>
105293
2023-11-08T21:22:59.760
|ros|topic|ros-noetic|docker|realsense-camera|
<p>steps to reproduce the problem</p> <ol> <li>In the first terminal type: <code>sudo docker run -it --privileged -v /dev:/dev -v /home/mona:/workspace -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY --device /dev/bus/usb ros_noetic</code></li> <li>Now, type <code>hostname -I</code> to get the IP of master node. <code>IP</code></li> <li>Now, in the same terminal start the master <code>roslaunch realsense2_camera rs_camera.launch align_depth:=true</code></li> <li>In a new terminal type: <code>sudo docker run -it --privileged -v /dev:/dev -v /home/mona:/workspace -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY --device /dev/bus/usb ros_noetic</code></li> <li>Also, in the newly opened terminal, now type: <code>root@046bedc1feb3:/workspace# ROS_MASTER_URI=http://IP:11311</code></li> <li>In the newly opened terminal, you should be able to see list of topics via <code>rostopic list</code></li> <li>Now, pick one of the topics and make sure it has content: <code>root@046bedc1feb3:/workspace# rostopic echo /camera/aligned_depth_to_color/image_raw</code></li> <li>Run this command in the second terminal, and make sure it works. You should see some content posted.</li> </ol> <pre><code> root@046bedc1feb3:/workspace# rosrun roscpp_tutorials babbler [ INFO] [1699477519.602225115]: hello world 0 [ INFO] [1699477519.702355346]: hello world 1 [ INFO] [1699477519.802340629]: hello world 2 [ INFO] [1699477519.902507063]: hello world 3 [ INFO] [1699477520.002284399]: hello world 4 [ INFO] [1699477520.102295005]: hello world 5 [ INFO] [1699477520.202313266]: hello world 6 [ INFO] [1699477520.302315862]: hello world 7 [ INFO] [1699477520.402323428]: hello world 8 [ INFO] [1699477520.502385264]: hello world 9 [ INFO] [1699477520.602336241]: hello world 10 [ INFO] [1699477520.702384903]: hello world 11 [ INFO] [1699477520.802342050]: hello world 12 [ INFO] [1699477520.902314431]: hello world 13 [ INFO] [1699477521.002317829]: hello world 14 </code></pre> <p>also, I see this for the docker ps:</p> <pre><code>(base) mona@ada:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 046bedc1feb3 ros_noetic &quot;/ros_entrypoint.sh …&quot; 11 minutes ago Up 11 minutes frosty_vaughan 93aebfa79986 ros_noetic &quot;/ros_entrypoint.sh …&quot; 11 minutes ago Up 11 minutes amazing_chandrasekhar </code></pre> <p>Problems:</p> <ol> <li>No content seen after echo:</li> </ol> <p><code>root@046bedc1feb3:/workspace# rostopic echo /camera/aligned_depth_to_color/image_raw</code></p> <ol start="2"> <li><p>No image shown in <code>rviz</code>: <a href="https://i.stack.imgur.com/vtXnR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vtXnR.png" alt="enter image description here" /></a> <a href="https://i.stack.imgur.com/BKAMb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BKAMb.png" alt="enter image description here" /></a> <a href="https://i.stack.imgur.com/mklLr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mklLr.png" alt="enter image description here" /></a></p> </li> <li><p><code>no new messages</code> in <code>rostopic hz topic_name</code>:</p> </li> </ol> <pre><code> root@046bedc1feb3:/workspace# rostopic hz /camera/aligned_depth_to_color/image_raw subscribed to [/camera/aligned_depth_to_color/image_raw] no new messages no new messages no new messages no new messages </code></pre>
no new messages for rostopic hz /camera/aligned_depth_to_color/image_raw in ros noetic inside docker
<p>If you are on Gazebo Classic (e.g. Gazebo 11), you can try to use <code>collide_without_contact</code>:</p> <ul> <li>See <a href="http://sdformat.org/spec?ver=1.10&amp;elem=collision#surface_contact" rel="nofollow noreferrer">here</a> for the spec,</li> <li>See <a href="https://github.com/arpg/Gazebo/blob/619218c0bb3dc8878b6c4dc2fddf3f7ec1d85497/test/worlds/collide_without_contact.world#L48-L52" rel="nofollow noreferrer">here</a> for an example.</li> </ul> <p>Unfortunately, this seems not implemented yet for 'new Gazebo' (i.e. 'Gazebo Sim', e.g. Gazebo Fortress or Garden or Harmonic).</p> <p>A possible alternative (both for Gazebo Classic as well as Gazebo Sim) is to use a collision bitmask:</p> <ul> <li><p>See <a href="https://classic.gazebosim.org/tutorials?tut=collide_bitmask&amp;cat=physics" rel="nofollow noreferrer">here</a> for documentation</p> <p>(It is a Gazebo Classic documentation page, but I think the usage is identical in Gazebo Sim),</p> </li> <li><p>See the <code>gz-sim</code> <a href="https://github.com/gazebosim/gz-sim/blob/gz-sim7/examples/worlds/shapes_bitmask.sdf" rel="nofollow noreferrer">GitHub repository</a> for an example demo world.</p> </li> </ul>
105296
2023-11-08T22:20:09.323
|navigation|gazebo|collision|
<p>Right now I have added this code to the collision element of the Object model sdf file, which allows the robot could go through the object very very slowly. Is there a way to make the robot have no collision with the object while I could still use Lidar to detect the objects in the Gazebo? 0 0 &lt;collide_without_contact&gt;true&lt;/collide_without_contact&gt; </p>
Hope to disable collision between Robot model and object model While the Lidar could still detect the Object in Gazebo
<p>It depends on what you need to do. I assume you want to do path planning.</p> <p>If you just need a kinematic model, and you want to build your own path planning algorithm for that model, you can choose any URDF robot you can find. <a href="https://github.com/robot-descriptions/awesome-robot-descriptions" rel="nofollow noreferrer">Here</a> you have an exhaustive list of URDF robots.</p> <p>If you need a complete simulated environment to run and compare existing path planning algorithms and view and run trajectories, I would follow <a href="https://moveit.picknik.ai/humble/doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial.html" rel="nofollow noreferrer">MoveIt's documentation</a> for a setup with the Panda robot.</p>
105312
2023-11-09T11:51:12.073
|robotic-arm|ros-humble|path-planning|
<p>Can you guys suggest me a Robot with 6 or 7 degree of Freedom which works well with Ros Humble for my Thesis. It will be only on a simulated environment.</p>
Best Robot for Simulation
<p>The documentation on the different time sources is <a href="https://design.ros2.org/articles/clock_and_time.html" rel="nofollow noreferrer">here</a>:</p> <blockquote> <p>There will be at least three versions of these abstractions with the following types, <code>SystemTime</code>, <code>SteadyTime</code> and <code>ROSTime</code>. These choices are designed to parallel the <code>std::chrono</code> <code>system_clock</code> and <code>steady_clock</code>.</p> <p>[...]</p> <p>The <code>ROSTime</code> will report the same as <code>SystemTime</code> when a ROS Time Source is not active. When the ROS time source is active <code>ROSTime</code> will return the latest value reported by the Time Source. <code>ROSTime</code> is considered active when the parameter <code>use_sim_time</code> is set on the node.</p> </blockquote> <p>For the difference between <code>std::chrono::system_clock</code> and <code>std::chrono::steady_clock</code>, see <a href="https://stackoverflow.com/a/31553641/20622761">this stackverflow answer</a>:</p> <blockquote> <p>If you're holding a <code>system_clock</code> in your hand, you would call it a watch, and it would tell you what time it is.</p> <p>If you're holding a <code>steady_clock</code> in your hand, you would call it a stopwatch, and it would tell you how fast someone ran a lap, but it would not tell you what time it is.</p> <p>If you had to, you could time someone running a lap with your watch. But if your watch (like mine) periodically talked to another machine (such as the atomic clock in Boulder CO) to correct itself to the current time, it might make minor mistakes in timing that lap. The stopwatch won't make that mistake, but it also can't tell you what the correct current time is.</p> </blockquote> <p>Re. your second question:</p> <blockquote> <p>Actual question is, How do I get steady time from node-&gt;now()? Because that is the answer I am looking for.</p> </blockquote> <p>~~I think ROS node clocks always use <code>RCL_ROS_TIME</code> which either is <code>SystemTime</code> or the time that is published to topic <code>/clock</code> in case of <code>use_sim_time</code> true.~~</p> <p><strong>EDIT:</strong> Seems above is wrong, see <a href="https://github.com/ros2/rclcpp/blob/9c098e544ecf191b7c61f63f7f4fac6f6449cedd/rclcpp/src/rclcpp/node.cpp#L197" rel="nofollow noreferrer">the source code</a>: the Node constructor takes the clock type from the NodeOptions. So it seems it is possible to choose the clock type by instantiatin a NodeOptions, set its clock type and pass it to your node constructor. See <a href="https://github.com/ros2/rclcpp/blob/9c098e544ecf191b7c61f63f7f4fac6f6449cedd/rclcpp/include/rclcpp/node_options.hpp#L38-L61" rel="nofollow noreferrer">here</a> for the options in the NodeOptions. <strong>/EDIT</strong></p> <p>What is your exact use case to want to set the node clock to steady time?</p> <p>If you actually want a steady timer:</p> <p>You can create use <code>Node::create_wall_timer()</code> instead of <code>Node::create_timer()</code>, e.g.:</p> <pre class="lang-cpp prettyprint-override"><code>timer_ = this-&gt;create_wall_timer( 500ms, std::bind(&amp;MinimalPublisher::timer_callback, this)); </code></pre> <p>A wall timer uses RCL_STEADY_TIME:</p> <p><a href="https://github.com/ros2/rclcpp/blob/0f331f90a99da40f7b7a69b4f55b30b7245d294f/rclcpp/include/rclcpp/timer.hpp#L347" rel="nofollow noreferrer">https://github.com/ros2/rclcpp/blob/0f331f90a99da40f7b7a69b4f55b30b7245d294f/rclcpp/include/rclcpp/timer.hpp#L347</a></p> <p>Do realize that if you use a wall_timer in a node that is also used with <code>use_sim_time == true</code>, its timer will run and the timer callback will be triggered irrespective of the simulation time (e.g. also when the simulation is paused).</p>
105321
2023-11-09T15:23:58.260
|ros2|ros-humble|rclcpp|ros-foxy|
<p>I wrote the following code to check the difference myself, but I could not find any considerable difference.</p> <pre><code>#include &lt;rclcpp/rclcpp.hpp&gt; auto main(int argc, char **argv) -&gt; int { rclcpp::init(argc, argv); auto node = std::make_shared&lt;rclcpp::Node&gt;(&quot;time_converter&quot;); rclcpp::Time steady_time(node-&gt;now(),RCL_STEADY_TIME); RCLCPP_INFO(node-&gt;get_logger(), &quot;RCL_STEADY_TIME = %f&quot;,steady_time.seconds()); rclcpp::Time sys_time(node-&gt;now(),RCL_SYSTEM_TIME); RCLCPP_INFO(node-&gt;get_logger(), &quot;RCL_SYSTEM_TIME = %f&quot;,sys_time.seconds()); rclcpp::Time ros_time(node-&gt;now(),RCL_ROS_TIME); RCLCPP_INFO(node-&gt;get_logger(), &quot;RCL_ROS_TIME = %f&quot;,ros_time.seconds()); return EXIT_SUCCESS; } </code></pre> <p><strong>Output:</strong></p> <pre><code>[INFO] [1699543136.456027415] [time_converter]: steady node time = 1699543136.456026 [INFO] [1699543136.456121797] [time_converter]: sys node time = 1699543136.456121 [INFO] [1699543136.456138399] [time_converter]: sys node time = 1699543136.456138 </code></pre> <p>Actual question is, How do I get steady time from <code>node-&gt;now()</code>? Because that is the answer I am looking for.</p>
What is the difference between RCL_STEADY_TIME, RCL_SYSTEM_TIME and RCL_ROS_TIME?
<p>Couldn't figure out to use something from <code>tf2/convert.h</code> I solved it now this way:</p> <pre><code> geometry_msgs::msg::TransformStamped t; t.header.stamp = g_node-&gt;get_clock()-&gt;now(); t.header.frame_id = frame_id; t.child_frame_id = child_frame_no; t.transform.translation.x = transform.getOrigin().getX(); t.transform.translation.y = transform.getOrigin().getY(); t.transform.translation.z = transform.getOrigin().getZ(); t.transform.rotation.w = transform.getRotation().getW(); t.transform.rotation.x = transform.getRotation().getAxis().getX(); t.transform.rotation.y = transform.getRotation().getAxis().getY(); t.transform.rotation.z = transform.getRotation().getAxis().getZ(); br-&gt;sendTransform(t); </code></pre>
105331
2023-11-10T01:59:45.833
|ros2|transform|tf2|
<p>I'm trying to convert <code>tf2::Transform</code> to <code>geometry_msgs::msg::Transform</code> with help of <code>tf2/convert.h</code> but I get compiler errors. I'm using ROS2 Humble with Ubuntu 22.04. What I'm doing wrong?</p> <pre><code> tf2::Transform transform; // make something with transform ... // Build a TransformStamped message geometry_msgs::msg::TransformStamped t; t.header.stamp = node-&gt;get_clock()-&gt;now(); t.header.frame_id = frame_id; t.child_frame_id = child_frame_id; // Now try to assign the tf2::Transform to the transform in the message t.transform = tf2::toMsg&lt;tf2::Transform, geometry_msgs::msg::Transform&gt;(transform); </code></pre> <p>Error undefined reference to geometry_msgs::msg::Transform_std::allocator&lt;void &gt; tf2::toMsg&lt;tf2::Transform, geometry_msgs::msg::Transform_std::allocator&lt;void &gt; &gt;(tf2::Transform const&amp;)'</p> <pre><code> // Another try with another function, this fails too tf2::convert(transform, t.transform) </code></pre> <p>Error /opt/ros/humble/include/tf2/tf2/impl/convert.h:67:12: error: no matching function for call to ‘toMsg(const tf2::Transform&amp;)’ 67 | b = toMsg(a);</p>
Problems on converting tf2::Transform to geometry_msgs::msg::Transform
<p>Welcome to Robotics Stack Exchange!</p> <p>I could successfully install <a href="https://github.com/ros-drivers/microstrain_mips" rel="nofollow noreferrer">microstrain_mips</a> package on ROS Noetic in Ubuntu 20.04.6 LTS. Below are the steps, I followed:</p> <pre><code><span class="math-container">$ mkdir -p ~/microstrain_ws/src/ $</span> cd ~/microstrain_ws/src/ <span class="math-container">$ git clone https://github.com/ros-drivers/microstrain_mips.git $</span> rosdep install --from-paths . --ignore-src -r -y <span class="math-container">$ cd cd ~/microstrain_ws/ $</span> source /opt/ros/noetic/setup.bash $ catkin_make </code></pre> <p>Next, I was able to run the node. It showed some obvious error as I don't have the device connected. However, until here, it seems to be working well.</p> <pre><code><span class="math-container">$ source /opt/ros/noetic/setup.bash $</span> source devel/setup.bash <span class="math-container">$ roscore $</span> rosrun microstrain_mips microstrain_mips_node [ INFO] [1699613921.567464487]: Attempting to open serial port &lt;/dev/ttyACM1&gt; at &lt;115200&gt; Unable to open com Port /dev/ttyACM1 Errno = 2 [FATAL] [1699613921.568017008]: Couldn't open serial port! Is it plugged in? Segmentation fault (core dumped) </code></pre> <p>I can also run <code>microstrain.launch</code> as shown below:</p> <pre><code>$ roslaunch microstrain_mips microstrain.launch ... logging to /home/user/.ros/log/893a16fc-7fb9-11ee-a910-db79fbf4f264/roslaunch-dell-5876.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:35581/ SUMMARY ======== PARAMETERS * /gx5/microstrain_mips_node/auto_init: True * /gx5/microstrain_mips_node/baudrate: 115200 * /gx5/microstrain_mips_node/declination: 0.23 * /gx5/microstrain_mips_node/declination_source: 2 * /gx5/microstrain_mips_node/device_setup: True * /gx5/microstrain_mips_node/dynamics_mode: 1 * /gx5/microstrain_mips_node/frame_based_enu: False * /gx5/microstrain_mips_node/gps_frame_id: navsat_link * /gx5/microstrain_mips_node/gps_rate: 4 * /gx5/microstrain_mips_node/imu_angular_cov: [0.01, 0, 0, 0, 0... * /gx5/microstrain_mips_node/imu_frame_id: gx5_link * /gx5/microstrain_mips_node/imu_linear_cov: [0.01, 0, 0, 0, 0... * /gx5/microstrain_mips_node/imu_orientation_cov: [0.01, 0, 0, 0, 0... * /gx5/microstrain_mips_node/imu_rate: 100 * /gx5/microstrain_mips_node/nav_rate: 10 * /gx5/microstrain_mips_node/odom_child_frame_id: base_link * /gx5/microstrain_mips_node/odom_frame_id: wgs84_odom_link * /gx5/microstrain_mips_node/port: /dev/microstrain * /gx5/microstrain_mips_node/publish_filtered_imu: False * /gx5/microstrain_mips_node/publish_imu: True * /gx5/microstrain_mips_node/readback_settings: True * /gx5/microstrain_mips_node/remove_imu_gravity: True * /gx5/microstrain_mips_node/save_settings: True * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/expected: ['microstrain_mip... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/imu/expected: ['microstrain_mip... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/imu/path: imu * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/imu/remove_prefix: microstrain_mips_... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/imu/timeout: 5.0 * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/imu/type: diagnostic_aggreg... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/packet/expected: ['microstrain_mip... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/packet/path: packet * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/packet/remove_prefix: microstrain_mips_... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/packet/timeout: 5.0 * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/packet/type: diagnostic_aggreg... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/path: general * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/port/expected: ['microstrain_mip... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/port/path: port * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/port/remove_prefix: microstrain_mips_... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/port/timeout: 5.0 * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/port/type: diagnostic_aggreg... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/remove_prefix: microstrain_mips_... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/timeout: 5.0 * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/type: diagnostic_aggreg... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/path: microstrain_mips_... * /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/type: diagnostic_aggreg... * /rosdistro: noetic * /rosversion: 1.16.0 NODES / imu_diagnostic_aggregator (diagnostic_aggregator/aggregator_node) /gx5/ microstrain_mips_node (microstrain_mips/microstrain_mips_node) auto-starting new master process[master]: started with pid [5884] ROS_MASTER_URI=http://localhost:11311 setting /run_id to 893a16fc-7fb9-11ee-a910-db79fbf4f264 process[rosout-1]: started with pid [5894] started core service [/rosout] process[gx5/microstrain_mips_node-2]: started with pid [5901] process[imu_diagnostic_aggregator-3]: started with pid [5902] [ INFO] [1699614534.743373413]: Attempting to open serial port &lt;/dev/microstrain&gt; at &lt;115200&gt; Unable to open com Port /dev/microstrain Errno = 2 [FATAL] [1699614534.743634974]: Couldn't open serial port! Is it plugged in? [gx5/microstrain_mips_node-2] process has died [pid 5901, exit code -11, cmd /home/user/microstrain_ws/devel/lib/microstrain_mips/microstrain_mips_node __name:=microstrain_mips_node __log:=/home/user/.ros/log/893a16fc-7fb9-11ee-a910-db79fbf4f264/gx5-microstrain_mips_node-2.log]. log file: /home/user/.ros/log/893a16fc-7fb9-11ee-a910-db79fbf4f264/gx5-microstrain_mips_node-2*.log ^C[imu_diagnostic_aggregator-3] killing on exit [rosout-1] killing on exit [master] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done </code></pre> <p>Hope it helps!</p>
105334
2023-11-10T05:02:32.040
|ros|c++|gps|
<p>I installed ROS <code>microstrain_mips</code> using <code>git clone</code> in my workspace. <a href="http://wiki.ros.org/microstrain_3dm_gx5_45" rel="nofollow noreferrer">Here</a> is the Wiki page of the package. However, my current ROS version is Noetic, and the package supports Indigo. When I try to execute the launch file after installation, I encounter an error saying, <code>Couldn't find executable named microstrain_mips_node.</code></p> <ol> <li>I'm curious if ROS <code>microstrain_mips</code> is compatible with Noetic.</li> <li>If <code>microstrain_mips_node</code> isn't running as it should, I'm wondering how to resolve this issue.</li> </ol> <p>I've already executed <code>catkin_make</code> and <code>source ./devel/setup.bash</code> before running <code>roslaunch</code>.</p> <p>My OS is Ubuntu 20.04.6 LTS. When I clone the package into the existed WS, the package is not installed in ./devel/lib folder, so I did't get any output of: find . -name microstrain_mips_node. However, when i clone the package into a new workspace, it worked in it. In the existed WS, there are a couple of python ROS packages. Do you think it is the problem?</p>
Couldn't find executable named microstrain_mips_node
<p>Okay so something similar was happening to me. I see that you resolved your problem (fantastic) by fixing an error in one of your .yaml files, but I think it is worth putting my solution here just in case it can help anyone.</p> <p>I found that there were multiple &quot;zombie&quot; nodes running in the background which were not allowing my <i>controller_manger</i> to execute. You can check for these by running the command:</p> <p><i> ros2 node list </i></p> <p>If you see any nodes that are duplicates or should not be running, you will have to kill them. For ROS2 the best method I found was to just restart your machine.</p> <p>Hope this helps someone.</p> <p>Cheers</p>
105341
2023-11-10T11:54:29.570
|ros2|ros-humble|controller-manager|ros2-controllers|gazebo-ros2-control|
<p>I'm facing an issue with controlling a robot in Gazebo using ROS 2 and ros2_control. I'm running ROS 2 with the Humble distribution on Ubuntu 22.04. I have installed the necessary packages including ros2_control, gazebo_ros2_control, and others.</p> <p>I am trying to test using a default package just to show my errors. The errors I encounter are</p> <pre><code>robotics$ ros2 run controller_manager spawner test_controller </code></pre> <blockquote> <p>[INFO] [1699614834.933186665] [spawner_test_controller]: Waiting for '/controller_manager' node to exist [INFO] [1699614836.952766939] [spawner_test_controller]: Waiting for '/controller_manager' node to exist [INFO] [1699614838.971527756] [spawner_test_controller]: Waiting for '/controller_manager' node to exist [INFO] [1699614840.991855230] [spawner_test_controller]: Waiting for '/controller_manager' node to exist [ERROR] [1699614843.012806033] [spawner_test_controller]: Controller manager not available [ros2run]: Process exited with failure 1</p> </blockquote> <pre><code>robotics$ ros2 run controller_manager controller_manager </code></pre> <blockquote> <p>No executable found</p> </blockquote> <pre><code>robotics$ ros2 run controller_manager ros2_control_node </code></pre> <blockquote> <p><a href="https://i.stack.imgur.com/TmoyK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TmoyK.png" alt="enter image description here" /></a></p> </blockquote> <p>and here to list the packages i have</p> <pre><code>robotics$ ros2 pkg list | grep ros2_control gazebo_ros2_control ros2_control ros2_control_test_assets ros2_controllers robotics$ ros2 pkg list | grep controller_manager controller_manager controller_manager_msgs moveit_simple_controller_manager robotics$ ros2 pkg executables controller_manager controller_manager ros2_control_node controller_manager spawner controller_manager unspawner </code></pre> <p>I tried solutions suggested in the <a href="https://answers.ros.org/question/413240/ros2-controller-manager-migration-from-foxy-to-humble-controller-manager-not-available/" rel="nofollow noreferrer">link</a>, but still no use.</p>
Controller Manager not available
<p>No.</p> <p>Looking at the binary data for a <code>visualization_msgs/msg/Marker</code> message saved with <code>ros2 bag</code>, the values of the constants don't appear in the message data. If you inspect the generated code for an interface, you may also notice that only fields are part of the message structure, constants are only defined in the api/header files.</p>
105345
2023-11-10T14:00:09.307
|ros2|ros-humble|performance|
<p>If I define a ROS2 field as <a href="https://docs.ros.org/en/foxy/Concepts/About-ROS-Interfaces.html#constants" rel="nofollow noreferrer">constant</a>, does the on-the-wire size of a serialized message change? In other words, do constant fields affect the serialized representation of ROS2 messages?</p> <p>PS I am using the default middleware.</p>
Do constant fields in ROS2 topics affect serialized message size?
<p>the reply to your question is implicitly contained in the detected object message. As you can see in the code, the objects message is in camera coordinates: <a href="https://github.com/stereolabs/zed-ros2-wrapper/blob/master/zed_components/src/zed_camera/src/zed_camera_component.cpp#L7141" rel="nofollow noreferrer">https://github.com/stereolabs/zed-ros2-wrapper/blob/master/zed_components/src/zed_camera/src/zed_camera_component.cpp#L7141</a></p> <p>The ZED SDK allows you to change this behavior by setting the value of the parameter <a href="https://www.stereolabs.com/docs/api/structsl_1_1RuntimeParameters.html" rel="nofollow noreferrer">RuntimeParameters::measure3D_reference_frame</a> to <a href="https://www.stereolabs.com/docs/api/group__PositionalTracking__group.html#ga7160d24146fdddd5a7e8f67fde1c4487" rel="nofollow noreferrer">sl::REFERENCE_FRAME::WORLD</a> instead of <a href="https://www.stereolabs.com/docs/api/group__PositionalTracking__group.html#ga7160d24146fdddd5a7e8f67fde1c4487" rel="nofollow noreferrer">sl::REFERENCE_FRAME::CAMERA</a>, but the ROS 2 Wrapper does not allow to select this option.</p>
105346
2023-11-10T16:18:42.450
|ros2|velocity|object-detection|
<p>Hello Robot Stack Exchange community,</p> <p>I am currently working with the Stereolabs Zed 2i camera and its ROS wrapper for object detection. I have been exploring the codebase on GitHub and reviewing the documentation on the official website, but I haven't been able to find information on configuring the velocity parameters for object detection.</p> <p>Specifically, I am interested in understanding which parameter(s) in the Zed 2i ROS wrapper are responsible for providing the velocity of detected objects. I would like to know if there is a way to configure whether the velocity is reported relative to the camera coordinate system or in the above-ground frame. If there is none I also would like to know if I receive the speed relative to the camera or above ground.</p> <p>I appreciate any insights or guidance on this matter. Thank you!</p>
Inquiry about Zed 2i ROS Wrapper: Velocity Parameters for Object Detection
<p>About your build error: if you look at image_transport.h, you'll see that the advertise() and subscribe() are defined only for ImageConstPtr objects. That's why it won't build if you pass a CompressedImageConstPtr object.</p> <p>Not sure if you are aware of it, but the image_transport::ImageTransport class has a feature to automatically decompress a CompressedImage msg, then pass an ImageConstPtr object to your subscribe() callback. Take a look at this page:</p> <p><a href="http://wiki.ros.org/image_transport/Tutorials/ExaminingImagePublisherSubscriber" rel="nofollow noreferrer">http://wiki.ros.org/image_transport/Tutorials/ExaminingImagePublisherSubscriber</a></p>
105349
2023-11-10T17:34:48.903
|callback|ros-noetic|nodelet|image-transport|compressed-image-transport|
<p>I'm working in ROS noetic on ubuntu 20.04</p> <p>I'm pretty new to the concepts of nodelets but I felt I needed them to more efficiently go through a process of taking uncompressed images and then decompressing them with the <a href="http://docs.ros.org/en/noetic/api/image_transport/html/classimage__transport_1_1ImageTransport.html" rel="nofollow noreferrer">image_transport</a> package without it having to go through TCP. I went through the <a href="https://wiki.ros.org/pluginlib/Tutorials/Writing%20and%20Using%20a%20Simple%20Plugin" rel="nofollow noreferrer">pluginlib tutorial</a> and then <a href="https://automaticaddison.com/working-with-ros-nodelets-in-ros-noetic/" rel="nofollow noreferrer">this tutorial for nodelets</a>, which I based my code off of.</p> <p>I slightly altered it to first take normal images, which worked, but once I started working with the image_transport package, I've been encountering an error related to the callback signature.</p> <p>Here is my main code where the commented out lines are the lines for the normal publisher/subscriber that worked with sensor_msgs/Image types.</p> <pre><code>#include &lt;ros/ros.h&gt; #include &lt;std_msgs/String.h&gt; #include &lt;sensor_msgs/CompressedImage.h&gt; #include &lt;sensor_msgs/Image.h&gt; #include &lt;nodelet/nodelet.h&gt; #include &lt;opencv2/core.hpp&gt; #include &lt;opencv2/imgcodecs.hpp&gt; #include &lt;cv_bridge/cv_bridge.h&gt; #include &lt;image_transport/image_transport.h&gt; #include &lt;pluginlib/class_list_macros.h&gt; #include &lt;stdio.h&gt; #include &lt;boost/bind.hpp&gt; namespace image_nodelet { class Transport_Nodelet: public nodelet::Nodelet { public: Transport_Nodelet() { } private: virtual void onInit() { ros::NodeHandle nh = getPrivateNodeHandle(); ros::NodeHandle im_nh = getNodeHandle(); NODELET_DEBUG(&quot;Initializing nodelet...&quot;); image_transport::ImageTransport it(im_nh); sub_ = it.subscribe(&quot;/acl_jackal/forward/color/image_raw/compressed&quot;, 1, boost::bind(&amp;Transport_Nodelet::callback, this, _1)); pub_ = it.advertise(&quot;img_out&quot;, 1); //image_transport::Subscriber sub = it.subscribe(&quot;/acl_jackal/forward/color/image_raw/compressed&quot;, 1, &amp;Transport_Nodelet::callback, this); //image_transport::Publisher pub = it.advertise(&quot;img_out&quot;, 1); // Create a publisher topic //pub = nh.advertise&lt;sensor_msgs::Image&gt;(&quot;img_out&quot;,10); // Create a subscriber topic //sub = nh.subscribe(&quot;/acl_jackal/forward/color/image_raw/compressed&quot;,10, &amp;Transport_Nodelet::callback, this); } // ros::Publisher pub; // ros::Subscriber sub; image_transport::Publisher pub_; image_transport::Subscriber sub_; void callback(const sensor_msgs::CompressedImageConstPtr&amp; input) { try { // Convert the compressed image ROS message to a cv::Mat using cv_bridge cv_bridge::CvImagePtr cv_ptr = cv_bridge::toCvCopy(input, sensor_msgs::image_encodings::BGR8); // Here cv_ptr-&gt;image contains the uncompressed image as cv::Mat // You can now publish the uncompressed image if needed pub_.publish(cv_ptr-&gt;toImageMsg()); } catch (cv_bridge::Exception&amp; e) { ROS_ERROR(&quot;Could not convert from '%s' to 'bgr8'.&quot;, input-&gt;format.c_str()); } // sensor_msgs::Image output; // output.data = input-&gt;data; // NODELET_DEBUG(&quot;msg data = %d&quot;,output.data); // ROS_INFO(&quot;msg data = %d&quot;,output.data); // pub.publish(output); } }; // Export the Hello_World class as a plugin using the // PLUGINLIB_EXPORT_CLASS macro. PLUGINLIB_EXPORT_CLASS(image_nodelet::Transport_Nodelet, nodelet::Nodelet); } </code></pre> <p>However, I get an error when I <code>catkin_make</code>:</p> <pre><code>/home/glenn/catkin_make_ws/src/my_workspace/src/my_nodelet.cpp:31:141: required from here /usr/include/boost/bind/bind.hpp:319:35: error: no match for call to ‘(boost::_mfi::mf1&lt;void, image_nodelet::Transport_Nodelet, const boost::shared_ptr&lt;const sensor_msgs::CompressedImage_&lt;std::allocator&lt;void&gt; &gt; &gt;&amp;&gt;) (image_nodelet::Transport_Nodelet*&amp;, const boost::shared_ptr&lt;const sensor_msgs::Image_&lt;std::allocator&lt;void&gt; &gt; &gt;&amp;)’ 319 | unwrapper&lt;F&gt;::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); </code></pre> <p>This is referring to line 31 of my code which is:</p> <pre><code>sub_ = it.subscribe(&quot;/acl_jackal/forward/color/image_raw/compressed&quot;, 1, boost::bind(&amp;Transport_Nodelet::callback, this, _1)); </code></pre> <p>I followed the image_transport API documentation for the <a href="http://docs.ros.org/en/noetic/api/image_transport/html/classimage__transport_1_1ImageTransport.html#a1c847a2c719c874f84a78a6a60b98c7f" rel="nofollow noreferrer">callback signature</a>, where the only difference is I used <code>sensor_msgs::CompressedImageConstPtr&amp;</code> instead of <code>sensor_msgs::ImageConstPtr&amp;</code> which you can see in my callback function.</p> <p>Any help would be appreciated. I've tried looking at all the documentation and forums but found no hints at a solution to my problem.</p> <p><strong>Update</strong>: I tried the obvious and just followed exactly as the document says for the callback, so I changed the argument type in the callback from</p> <pre><code>void callback(const sensor_msgs::CompressedImageConstPtr&amp; input) </code></pre> <p>to</p> <pre><code>void callback(const sensor_msgs::ImageConstPtr&amp; input) </code></pre> <p>With everything else the same, and it compiled. Does this mean I can't use the compressed image type with image_transport? I managed to already read uncompressed images so would I better off manually uncompressing without the image_transport package?</p>
Trouble with creating an image_transport nodelet
<p>Its hard to help answer any of these types of questions without reproducable examples. There's no hard limit at 1.8947... in the code, so there's clearly something not configured properly that's blocking you. I can't precisely give you an easy answer without sitting down with it myself and working through it.</p> <p>Looking at your config, nothing immediately jumps out to me as obviously wrong except perhaps:</p> <pre><code> sim_time: 2.0 </code></pre> <p>which might need to be increased for 3m/s?</p>
105351
2023-11-10T17:46:59.947
|navigation|ros-humble|nav2|
<p>I'm working with Gazebo and run into an issue with Nav 2. I would like to increase the max speed but I'm not able to do so. It seems the speed is stuck to a maximum of 2m/s while my configuration is as follow :</p> <pre><code>bt_navigator: ros__parameters: global_frame: map robot_base_frame: base_link odom_topic: /odometry/filtered_map default_nav_to_pose_bt_xml: $(find-pkg-share otto_navigation)/behavior_tree/follow_point.xml bt_loop_duration: 10 default_server_timeout: 20 plugin_lib_names: - nav2_compute_path_to_pose_action_bt_node - nav2_compute_path_through_poses_action_bt_node - nav2_follow_path_action_bt_node - nav2_back_up_action_bt_node - nav2_spin_action_bt_node - nav2_wait_action_bt_node - nav2_clear_costmap_service_bt_node - nav2_drive_on_heading_bt_node - nav2_is_stuck_condition_bt_node - nav2_goal_reached_condition_bt_node - nav2_goal_updated_condition_bt_node - nav2_initial_pose_received_condition_bt_node - nav2_reinitialize_global_localization_service_bt_node - nav2_rate_controller_bt_node - nav2_distance_controller_bt_node - nav2_speed_controller_bt_node - nav2_truncate_path_action_bt_node - nav2_goal_updater_node_bt_node - nav2_recovery_node_bt_node - nav2_pipeline_sequence_bt_node - nav2_round_robin_node_bt_node - nav2_transform_available_condition_bt_node - nav2_time_expired_condition_bt_node - nav2_distance_traveled_condition_bt_node - nav2_single_trigger_bt_node - nav2_is_battery_low_condition_bt_node - nav2_navigate_through_poses_action_bt_node - nav2_navigate_to_pose_action_bt_node - nav2_remove_passed_goals_action_bt_node - nav2_planner_selector_bt_node - nav2_controller_selector_bt_node - nav2_goal_checker_selector_bt_node controller_server: ros__parameters: controller_frequency: 10.0 min_x_velocity_threshold: 0.001 min_y_velocity_threshold: 0.5 min_theta_velocity_threshold: 0.001 failure_tolerance: 0.3 progress_checker_plugin: &quot;progress_checker&quot; goal_checker_plugins: [&quot;goal_checker&quot;] controller_plugins: [&quot;FollowPath&quot;] progress_checker: plugin: &quot;nav2_controller::SimpleProgressChecker&quot; required_movement_radius: 0.5 movement_time_allowance: 10.0 goal_checker: plugin: &quot;nav2_controller::SimpleGoalChecker&quot; xy_goal_tolerance: 0.25 yaw_goal_tolerance: 0.25 stateful: True FollowPath: # DWB Controller : https://navigation.ros.org/configuration/packages/dwb-params/controller.html plugin: &quot;dwb_core::DWBLocalPlanner&quot; critics: [&quot;RotateToGoal&quot;, &quot;Oscillation&quot;, &quot;BaseObstacle&quot;, &quot;GoalAlign&quot;, &quot;PathAlign&quot;, &quot;PathDist&quot;, &quot;GoalDist&quot;] BaseObstacle.scale: 0.02 PathAlign.scale: 32.0 PathAlign.forward_point_distance: 0.1 GoalAlign.scale: 24.0 GoalAlign.forward_point_distance: 0.1 PathDist.scale: 32.0 GoalDist.scale: 24.0 RotateToGoal.scale: 32.0 RotateToGoal.slowing_factor: 5.0 RotateToGoal.lookahead_time: -1.0 transform_tolerance: 0.2 stateful: True short_circuit_trajectory_evaluation: true # Kinematic : https://navigation.ros.org/configuration/packages/dwb-params/kinematic.html max_vel_theta: 3.14 min_speed_xy: 0.0 max_speed_xy: 3.0 min_speed_theta: 0.0 min_vel_x: 0.0 min_vel_y: 0.0 max_vel_x: 3.0 max_vel_y: 0.0 acc_lim_x: 1.0 acc_lim_y: 0.0 acc_lim_theta: 2.0 decel_lim_x: -10.0 decel_lim_y: 0.0 decel_lim_theta: -2.0 # XYTheta Iterator : https://navigation.ros.org/configuration/packages/dwb-params/iterator.html vx_samples: 20 vy_samples: 0 vtheta_samples: 40 # LimitedAccelGenerator : https://navigation.ros.org/configuration/packages/dwb-plugins/limited_accel_generator.html sim_time: 2.0 # StandardTrajectoryGenerator : https://navigation.ros.org/configuration/packages/dwb-plugins/standard_traj_generator.html linear_granularity: 0.05 angular_granularity: 0.025 local_costmap: local_costmap: ros__parameters: always_send_full_costmap: True update_frequency: 5.0 publish_frequency: 2.0 height: 100 width: 100 resolution: 0.05 robot_base_frame: base_link robot_radius: 0.22 rolling_window: true plugins: [&quot;inflation_layer&quot;] inflation_layer: plugin: &quot;nav2_costmap_2d::InflationLayer&quot; cost_scaling_factor: 3.0 inflation_radius: 0.55 # GPS WPF CHANGE: Set rolling global costmap with 50x50 size. See note below global_costmap: global_costmap: ros__parameters: always_send_full_costmap: True update_frequency: 1.0 publish_frequency: 1.0 height: 500 width: 500 resolution: 0.1 global_frame: map robot_base_frame: base_link robot_radius: 0.22 # When using GPS navigation you will potentially traverse huge environments which are not practical to # fit on a big static costmap. Thus it is recommended to use a rolling global costmap large enough to # contain each pair of successive waypoints. See: https://github.com/ros-planning/navigation2/issues/2174 rolling_window: True track_unknown_space: True # no static map plugins: [&quot;inflation_layer&quot;] inflation_layer: plugin: &quot;nav2_costmap_2d::InflationLayer&quot; cost_scaling_factor: 3.0 inflation_radius: 0.55 planner_server: ros__parameters: expected_planner_frequency: 20.0 planner_plugins: ['GridBased'] GridBased: plugin: 'nav2_navfn_planner/NavfnPlanner' waypoint_follower: ros__parameters: loop_rate: 200 stop_on_failure: false waypoint_task_executor_plugin: &quot;wait_at_waypoint&quot; wait_at_waypoint: plugin: &quot;nav2_waypoint_follower::WaitAtWaypoint&quot; enabled: True waypoint_pause_duration: 200 velocity_smoother: ros__parameters: smoothing_frequency: 20.0 scale_velocities: false feedback: &quot;OPEN_LOOP&quot; max_velocity: [3.0, 0.0, 2.5] min_velocity: [-0.5, 0.0, -2.5] deadband_velocity: [0.0, 0.0, 0.0] velocity_timeout: 1.0 max_accel: [2.5, 0.0, 3.2] max_decel: [-2.5, 0.0, -3.2] odom_topic: &quot;odom&quot; odom_duration: 0.1``` </code></pre> <p>Here is what I see in rviz when I send a goal : <a href="https://i.stack.imgur.com/BM0ah.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BM0ah.png" alt="What we see in rviz" /></a></p> <p>Here is what I see on <code>cmd_vel_nav</code> and <code>cmd_vel</code> (output of velocity smoother) <a href="https://i.stack.imgur.com/OTtMy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OTtMy.png" alt="cmd_vel_nav and cmd_vel" /></a></p> <p>However, I expect my robot to be able to reach 3m/s because of the 'max_vel_x: 3.0' parameter I set BUT it never happens, even when it has to follow a straight line. Can you help me on this one please ?</p> <p>Here is the <code>ros2 node list</code> output (I removed irrelevant nodes) :</p> <pre><code>/behavior_server /bt_navigator /bt_navigator_navigate_through_poses_rclcpp_node /bt_navigator_navigate_to_pose_rclcpp_node /controller_server /global_costmap/global_costmap /lifecycle_manager_navigation /nav2_container /planner_server /smoother_server /velocity_smoother /waypoint_follower /local_costmap/local_costmap [...] </code></pre>
Nav 2 - Max speed blocked way under the max vel specified
<p>Based on @Steve's suggestion, the following is what worked for me</p> <pre><code>def generate_launch_description(): ld = LaunchDescription() arg_use_rgbd_odom = LaunchConfiguration(&quot;use_rgbd_odom&quot;) arg_use_stereo_odom = LaunchConfiguration(&quot;use_stereo_odom&quot;) ld.add_action(DeclareLaunchArgument('use_rgbd_odom', default_value='false')) ld.add_action(DeclareLaunchArgument('use_stereo_odom', default_value='false')) include_container = Node( name='odom_container', package='rclcpp_components', executable='component_container', output='both', ) ld.add_action(include_container) load_rgbd_odom = LoadComposableNodes( target_container='odom_container', condition=IfCondition(arg_use_rgbd_odom), composable_node_descriptions=[ ComposableNode( package='rtabmap_odom', plugin='rtabmap_odom::RGBDOdometry', name='rgbd_odom', ) ] ) ld.add_action(load_rgbd_odom) load_stereo_odom = LoadComposableNodes( target_container='odom_container', condition=IfCondition(arg_use_stereo_odom), composable_node_descriptions=[ ComposableNode( package='rtabmap_odom', plugin='rtabmap_odom::StereoOdometry', name='stereo_odom', ), ] ) ld.add_action(load_stereo_odom) return ld </code></pre>
105396
2023-11-13T16:18:07.050
|ros2|ros-humble|ros2-launch|
<p>I am on ROS2 Humble. My launch file looks the following</p> <pre><code>from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch_ros.descriptions import ComposableNode from launch.substitutions import LaunchConfiguration from launch_ros.actions import ComposableNodeContainer from launch.conditions import IfCondition, UnlessCondition def generate_launch_description(): ld = LaunchDescription() arg_frame_id = LaunchConfiguration(&quot;frame_id&quot;) arg_use_rgbd_odom = LaunchConfiguration(&quot;use_rgbd_odom&quot;) arg_use_stereo_odom = LaunchConfiguration(&quot;use_stereo_odom&quot;) ld.add_action(DeclareLaunchArgument('frame_id', default_value='camera_link')) ld.add_action(DeclareLaunchArgument('use_rgbd_odom', default_value='true')) ld.add_action(DeclareLaunchArgument('use_stereo_odom', default_value='false')) include_rtabmap_icp_odom = ComposableNodeContainer( name='odom_node_container', namespace='', package='rclcpp_components', executable='component_container', composable_node_descriptions=[ ComposableNode( condition=IfCondition(arg_use_rgbd_odom), ##### Unexpected argument error package='rtabmap_odom', plugin='rtabmap_odom::RGBDOdometry', name='rgbd_odom', ), ComposableNode( condition=IfCondition(arg_use_stereo_odom), ##### Unexpected argument error package='rtabmap_odom', plugin='rtabmap_odom::StereoOdometry', name='stereo_odom', ), ], output='screen', ) ld.add_action(include_rtabmap_icp_odom) return ld </code></pre> <p>I would like to switch between these conditions(whether to use stereo or rgbd odometry) but I dont seem to find a way around with ComposableNodes.</p> <p>Thanks in advance</p>
How to load a ComposableNode based on a condition?
<p>Solved this issue but I'm not sure how I messed it up to begin with. After running &quot;printenv | grep -i ROS&quot; on each machine, I noticed that ROS_LOCALHOST_ONLY was set to 1 on the Dev computer and 0 on the Raspberry Pi. I changed the value of this variable to be 0 on the Computer as well and now my communications are working properly.</p>
105400
2023-11-13T21:03:47.523
|communication|network-setup|msg-subscriber|
<p>When running demo_nodes_cpp talker on the Dev computer and demo_nodes_cpp listener on my Raspberry Pi, the listener does not pick up the the message as it does when both nodes are running on the same device. &quot;ros2 node list&quot; only outputs the node that is running on that machine and does not show the node running on the other.</p> <p>I have ROS2 Humble installed on both the dev computer and the Raspberry Pi. Both machines are running on the same network. I followed the Articulated Robotics tutorial on setting up the netplan configuration files(although my Raspberry Pi does not stick to the static IP address I entered on the &quot;addresses&quot; line for some reason). The machines can ping one another. I can access the Pi from the Dev computer using SSH. I have set both of the ROS_DOMAIN_ID's to 101. Talker and Listener work when they are both running on the same device. I did see some other questions asking about Multicast being enabled; I believe multicast is enabled on both devices based on ipaddr resulting in:</p> <p>On dev computer: 3: wlo1: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UP group default qlen 1000</p> <p>On the pi: 3: wlan0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000</p> <p>netplan config files:</p> <p>Dev Computer: network: version: 2 renderer: NetworkManager</p> <p>wifis: wlo1:<br /> dhcp4: false dhcp6: false addresses: [192.168.86.249/24] routes: - to: default via: 192.168.86.1<br /> nameservers: addresses: [192.168.86.1]</p> <pre><code> access-points: &quot;------&quot;: # password: &quot;-------&quot; </code></pre> <p>Raspberry Pi:</p> <p>network: version: 2 renderer: NetworkManager</p> <p>wifis: wlan0: dhcp4: false dhcp6: false addresses: [192.168.86.250/24] routes: - to: default via: 192.168.86.1 nameservers: addresses: [192.168.86.1]</p> <pre><code> access-points: &quot;------&quot;: password: &quot;-------&quot; </code></pre> <p>Any advice appreciated! Happy to provide more information upon request!</p>
Raspberry Pi failing to subscribe to topic being published to by dev computer?
<p>Using</p> <p><code>rosbag record -O mona_noetic.bag -a -x &quot;(.*)theora(.*)|(.*)compressed(.*)&quot;</code></p> <p>instead of</p> <p><code>rosbag record -a -O mona_noetic</code></p> <p>fixed the problem.</p> <p>Also, if you exactly know what you want to capture, you can use a command like the following:</p> <pre><code>root@77c9b6999e4b:/workspace# rosbag record -O mona_noetic.bag /camera/aligned_depth_to_color/image_raw /camera/color/image_raw /camera/depth/camera_info /camera/color/camera_info /camera/extrinsics/depth_to_color [ INFO] [1700147750.161300211]: Subscribing to /camera/aligned_depth_to_color/image_raw [ INFO] [1700147750.164502682]: Subscribing to /camera/color/camera_info [ INFO] [1700147750.166064340]: Subscribing to /camera/color/image_raw [ INFO] [1700147750.166996966]: Subscribing to /camera/depth/camera_info [ INFO] [1700147750.167893184]: Subscribing to /camera/extrinsics/depth_to_color [ INFO] [1700147750.170980936]: Recording to 'mona_noetic.bag'. </code></pre> <p>Please note, despite having depth aligned captures, it happens that we have 1-3 more depth images than color. And you can find and omit them by using <code>ls *.png | sort &gt; ../depth.txt</code> and <code>ls *.png | sort &gt; ../rgb.txt</code> and then <code>vimdiff depth.txt rgb.txt</code>.</p> <pre><code>(base) mona@ada:~/mona_noetic<span class="math-container">$ ls rgb/*.png | wc -l 538 (base) mona@ada:~/mona_noetic$</span> ls depth/*.png | wc -l 539 </code></pre> <p>Reference <a href="https://github.com/IntelRealSense/realsense-ros/issues/315#issuecomment-699030884" rel="nofollow noreferrer">https://github.com/IntelRealSense/realsense-ros/issues/315#issuecomment-699030884</a></p>
105438
2023-11-15T16:32:39.237
|ros|python|rosbag|ros-noetic|depth|
<p>Steps for reproducing the problem with an Intel RealSense D435 camera using ROS Noetic inside a docker.</p> <p>In the first terminal:</p> <ol> <li><p><code>(base) mona@ada:~$ sudo docker run -it --privileged -v /dev:/dev -v /home/mona:/workspace -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY --device /dev/bus/usb ros_noetic</code></p> </li> <li><p><code>root@7a805700666e:/workspace# cd catkin_ws</code></p> </li> <li><p>(base) mona@ada:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7a805700666e ros_noetic &quot;/ros_entrypoint.sh …&quot; 4 seconds ago Up 3 seconds clever_feynman</p> </li> <li><p><code>roslaunch realsense2_camera rs_camera.launch align_depth:=true</code></p> </li> </ol> <p>After capture is done,</p> <p>5.</p> <pre><code>root@7a805700666e:/workspace/catkin_ws# catkin_make Base path: /workspace/catkin_ws Source space: /workspace/catkin_ws/src Build space: /workspace/catkin_ws/build Devel space: /workspace/catkin_ws/devel Install space: /workspace/catkin_ws/install #### #### Running command: &quot;make cmake_check_build_system&quot; in &quot;/workspace/catkin_ws/build&quot; #### #### #### Running command: &quot;make -j32 -l32&quot; in &quot;/workspace/catkin_ws/build&quot; #### </code></pre> <ol start="6"> <li></li> </ol> <pre><code> root@ce71bcbb2d89:/workspace/catkin_ws# source devel/setup.bash </code></pre> <ol start="7"> <li></li> </ol> <pre><code> root@ce71bcbb2d89:/workspace/catkin_ws# rosrun bag_converter convert.py </code></pre> <p>other terminal</p> <ol> <li><p><code>$ xhost +local:docker</code></p> </li> <li><p><code>docker exec -it -e DISPLAY=$DISPLAY clever_feynman bash</code> run step 3 in this terminal after starting step 4 in the first terminal.</p> </li> <li><p><code>root@7a805700666e:/workspace# rosbag record -a -O mona_noetic</code></p> </li> </ol> <p>Here's the conversion script:</p> <pre><code>(base) mona@ada:~$ cat catkin_ws/src/bag_converter/scripts/convert.py #!/usr/bin/python3 import os import sys import yaml from rosbag.bag import Bag import cv2 import roslib; #roslib.load_manifest(PKG) import rosbag import rospy import cv2 import numpy as np import argparse import os from sensor_msgs.msg import Image from cv_bridge import CvBridge from cv_bridge import CvBridgeError class ImageCreator(): def __init__(self, bagfile, rgbpath, depthpath, rgbstamp, depthstamp): self.bridge = CvBridge() with rosbag.Bag(bagfile, 'r') as bag: for topic,msg,t in bag.read_messages(): print(topic) if topic == &quot;/camera/color/image_raw&quot;: cv_image = self.bridge.imgmsg_to_cv2(msg,&quot;bgr8&quot;) timestr = &quot;%.6f&quot; % msg.header.stamp.to_sec() image_name = timestr+ &quot;.png&quot; cv2.waitKey(1); cv2.imwrite(rgbpath + image_name, cv_image) elif topic == &quot;/camera/aligned_depth_to_color/image_raw&quot;: cv_image = self.bridge.imgmsg_to_cv2(msg,&quot;16UC1&quot;) timestr = &quot;%.6f&quot; % msg.header.stamp.to_sec() image_name = timestr+ &quot;.png&quot; cv2.imwrite(depthpath + image_name, (cv_image).astype(np.uint16)) if __name__ == '__main__': ImageCreator('/workspace/mona_noetic.bag', '/workspace/mona_noetic/rgb/', '/workspace/mona_noetic/depth/', 1, 1) </code></pre> <p>However, from the capture, we see this unaligned number of depth aligned frames for rgb and depth:</p> <pre><code>root@7a805700666e:/workspace# rosbag info mona_noetic.bag path: mona_noetic.bag version: 2.0 duration: 18.2s start: Nov 15 2023 16:04:52.73 (1700064292.73) end: Nov 15 2023 16:05:10.93 (1700064310.93) size: 30.5 MB messages: 462 compression: none [41/41 chunks] types: bond/Status [eacc84bf5d65b6777d4c50f463dfb9c8] diagnostic_msgs/DiagnosticArray [60810da900de1dd6ddd437c3503511da] dynamic_reconfigure/Config [958f16a05573709014982821e6822580] dynamic_reconfigure/ConfigDescription [757ce9d44ba8ddd801bb30bc456f946f] realsense2_camera/Extrinsics [3627b43073f4cd5dd6dc179a49eda2ad] realsense2_camera/Metadata [4966ca002be16ee67fe4dbfb2f354787] rosgraph_msgs/Log [acffd30cd6b6de30f120938c17c593fb] sensor_msgs/CameraInfo [c9a58c1b0b154e0e6da7578cb991d214] sensor_msgs/CompressedImage [8f7a12909da2c9d3332d540a0977563f] sensor_msgs/Image [060021388200f6f0f447d0fcd9c64743] tf2_msgs/TFMessage [94810edda583a504dfda3829e70d7eec] theora_image_transport/Packet [33ac4e14a7cff32e7e0d65f18bb410f3] topics: /camera/align_to_color/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/align_to_color/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/aligned_depth_to_color/image_raw 2 msgs : sensor_msgs/Image /camera/aligned_depth_to_color/image_raw/compressed/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/aligned_depth_to_color/image_raw/compressed/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/aligned_depth_to_color/image_raw/compressedDepth/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/aligned_depth_to_color/image_raw/compressedDepth/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/aligned_depth_to_color/image_raw/theora/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/aligned_depth_to_color/image_raw/theora/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/color/camera_info 2 msgs : sensor_msgs/CameraInfo /camera/color/image_raw/compressed 2 msgs : sensor_msgs/CompressedImage /camera/color/image_raw/compressed/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/color/image_raw/compressed/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/color/image_raw/compressedDepth/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/color/image_raw/compressedDepth/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/color/image_raw/theora/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/color/image_raw/theora/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/depth/camera_info 39 msgs : sensor_msgs/CameraInfo /camera/depth/image_rect_raw 38 msgs : sensor_msgs/Image /camera/depth/image_rect_raw/compressed 38 msgs : sensor_msgs/CompressedImage /camera/depth/image_rect_raw/compressed/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/depth/image_rect_raw/compressed/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/depth/image_rect_raw/compressedDepth 40 msgs : sensor_msgs/CompressedImage /camera/depth/image_rect_raw/compressedDepth/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/depth/image_rect_raw/compressedDepth/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/depth/image_rect_raw/theora 3 msgs : theora_image_transport/Packet /camera/depth/image_rect_raw/theora/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/depth/image_rect_raw/theora/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/depth/metadata 37 msgs : realsense2_camera/Metadata /camera/extrinsics/depth_to_color 1 msg : realsense2_camera/Extrinsics /camera/realsense2_camera_manager/bond 37 msgs : bond/Status (2 connections) /camera/rgb_camera/auto_exposure_roi/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/rgb_camera/auto_exposure_roi/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/rgb_camera/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/rgb_camera/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/stereo_module/auto_exposure_roi/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/stereo_module/auto_exposure_roi/parameter_updates 1 msg : dynamic_reconfigure/Config /camera/stereo_module/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /camera/stereo_module/parameter_updates 1 msg : dynamic_reconfigure/Config /diagnostics 68 msgs : diagnostic_msgs/DiagnosticArray /rosout 88 msgs : rosgraph_msgs/Log (2 connections) /rosout_agg 38 msgs : rosgraph_msgs/Log /tf_static 1 msg : tf2_msgs/TFMessage </code></pre> <p>Further, I see this error when starting the depth align capture:</p> <pre><code>[ INFO] [1700064224.344956163]: SELECTED BASE:Depth, 0 [ INFO] [1700064224.355172954]: RealSense Node Is Up! 15/11 16:03:44,482 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 300, error: Resource temporarily unavailable, number: b [ WARN] [1700064224.531686247]: 15/11 16:03:44,873 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:44,924 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:45,179 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:45,230 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:45,381 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:45,432 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:45,584 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:45,635 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:45,786 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:45,837 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:45,988 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:46,039 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:46,191 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 15/11 16:03:46,243 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 [ERROR] [1700064294.457665710]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' 15/11 16:04:54,800 ERROR [140200416114432] (uvc-streamer.cpp:106) uvc streamer watchdog triggered on endpoint: 132 [ERROR] [1700064294.983499621]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064295.496846075]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064296.010771429]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064296.478652416]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064296.895753832]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064297.321010419]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064297.747054477]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064298.173193296]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064298.601070803]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064299.022315621]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064299.448716345]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064299.868316530]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064300.287427109]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064300.702281242]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064301.118212082]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064301.540673572]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064301.961749822]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064302.381357661]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064302.799640022]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064303.226624059]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064303.655973210]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064304.081943511]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064304.509441908]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064304.939367902]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064305.369842480]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064305.800837626]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064306.233901531]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064306.662224030]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064307.088729246]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064307.503594745]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064307.920114882]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064308.346923624]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064308.779323394]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064309.224245296]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064309.664677204]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064310.094353804]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064310.524822175]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' [ERROR] [1700064310.940728063]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense' ^C[camera/realsense2_camera-3] killing on exit [camera/realsense2_camera_manager-2] killing on exit [rosout-1] killing on exit [master] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done </code></pre>
depth aligned capture doesn't yield same number of rgb and depth frames -- cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is
<p><code>gazebo_ros</code> is still used in ROS2. The source code is available here : <a href="https://github.com/ros-simulation/gazebo_ros_pkgs/tree/ros2" rel="nofollow noreferrer">gazebo_ros ros2 branch</a></p> <p><code>sudo apt-get install ros-humble-gazebo-ros</code> should do the job</p>
105439
2023-11-15T16:36:11.053
|ros-humble|tutorial|nav2|
<p>I'm trying to discover Nav2 stack.<br /> I'd like to do a mission/follow-waypoint thing in my own simulation.<br /> I started with the &quot;<em>Getting Started</em>&quot; -&gt; &quot;<em>Running the Example</em>&quot; after installation of nav2 Ubuntu package for ros2-humble.<br /> I got the error : <em>&quot;package 'gazebo_ros' not found ...&quot;</em><br /> But if I'm not mistaken, this is a ROS1 package. It is used to spawn entity. I did not find a package with the executable, (in my simulation I use <code>ros_gz_sim</code> to spawn element).<br /> I probably miss something, could you tell me what it is ?</p>
ROS1 dependency in nav2 tutorial?
<p>Use the <code>ns</code> tag in the <code>xacro:include</code>.</p> <p>Resources</p> <ul> <li>ROS Wiki: <a href="http://wiki.ros.org/xacro#Including_other_xacro_files" rel="nofollow noreferrer">http://wiki.ros.org/xacro#Including_other_xacro_files</a></li> <li>Xacro Repo: <a href="https://github.com/ros/xacro/wiki#xacroinclude" rel="nofollow noreferrer">https://github.com/ros/xacro/wiki#xacroinclude</a></li> </ul>
105450
2023-11-15T21:35:49.330
|ros2|ros-humble|xacro|include|namespace|
<p>How do you use <code>xacro:macro</code> and <code>arg</code> to include 2 of the same robot in your URDF? I'm using args for each Xacro file to read the suffix. Because it's in the global namespace, I can't reassign the suffix arg. This results in a conflicting namespace. &quot;Error: link 'slide_1/base_link' is not unique.&quot;</p> <p>Also, the urdf.xacro file I'm including has a macro as well, with material tags inside to keep it local. However, running this macro 2 times, the materials get declared multiple times. &quot;Error: material 'aluminum' is not unique.&quot; <em>I have an inconvenient way of solving this by passing a global arg and wrapping each material declaration around an if statement so the materials are only declared once at the top level xacro. Not pretty.</em></p> <pre><code>&lt;xacro:macro name=&quot;full_assembly&quot; params=&quot;suffix&quot;&gt; &lt;xacro:arg name=&quot;suffix&quot; default=&quot;<span class="math-container">${suffix}" /&gt; &lt;xacro:include filename="$</span>(find pkg)/urdf/single_assembly.urdf.xacro&quot; /&gt; &lt;/xacro:macro&gt; &lt;xacro:property name=&quot;suffix_1&quot; value=&quot;_1&quot; /&gt; &lt;xacro:property name=&quot;suffix_2&quot; value=&quot;_2&quot; /&gt; &lt;xacro:full_assembly suffix=&quot;<span class="math-container">${suffix_1}" /&gt; &lt;xacro:full_assembly suffix="$</span>{suffix_2}&quot;/&gt; </code></pre>
How do you pass params into another Xacro file via xacro:include? How does the other Xacro file receive that input?
<p>Communication between different ROS 2 releases is not guaranteed to work, see <a href="https://answers.ros.org/question/341372/can-nodes-from-different-ros-2-distributions-communicate-compatibly/" rel="nofollow noreferrer">this previous answer</a>.</p>
105457
2023-11-16T09:48:12.413
|ros2|ros-humble|dds|ros-foxy|
<p>I am trying to explore the usage of DDS in ROS2. My set up is 2 computers connected to the same network. Slave computer runs ROS2 Foxy and host Computer runs ROS2 Humble.</p> <p>I couldn't get them to communicate .</p> <p>I am grateful if someone can help me with my problem or correct what i've done. Please advise.</p> <p>Steps I've done so far: On Slave Computer:</p> <pre><code>On slave computer i modified my bashrc to add these lines : export ROS_DOMAIN_ID=1 In a terminal i ran fastdds discovery --server-id 0 In another terminal. I ran my talker node. /chatter is being published checked using ros2 topic list. </code></pre> <p>On Host Computer:</p> <pre><code>On Host computer i modified my bashrc to add these lines : export ROS_DOMAIN_ID=1 export ROS_DISCOVERY_SERVER=Slave'sIP:11811 I checked ros2 topic list. /chatter is missing. I tried running my listener node. Nothing was heard. </code></pre> <p>After this, i tried to kill and re-start the ros2 daemon and just repeated the process.</p> <p>I'm expecting that after the proper setup. host machine can at least view slave machine's topic and can run the listener while subscribing to the topic from host machine.</p>
using fastDDS on 2 computers with ROS Foxy and ROS Humble (Cannot receive topic on host computer)
<p>Partial answer already. I was experimenting running the script from a regular terminal.</p> <p>Running:</p> <pre><code>C:\dev\ros2_humble\.venv\Scripts\python.exe C:\Users\name\project\node.py </code></pre> <p>Gives the error: (which is not unexpected)</p> <blockquote> <p>ModuleNotFoundError: No module named 'rclpy'</p> </blockquote> <p>I can avoid this by setting <code>PYTHONPATH</code>:</p> <pre><code>$Env:PYTHONPATH=&quot;C:\dev\ros2_humble\Lib\site-packages&quot;; C:\dev\ros2_humble\.venv\Scripts\python.exe C:\Users\name\project\node.py </code></pre> <p>Now I get the same error as with PyCharm:</p> <blockquote> <p>ImportError: DLL load failed while importing _rclpy_pybind11: The specified module could not be found.</p> </blockquote> <p>And I found I can fix this by expanding <code>PATH</code> with the <code>bin/</code> directory of ROS2:</p> <pre><code>$Env:PYTHONPATH=&quot;C:\dev\ros2_humble\Lib\site-packages&quot;; $Env:PATH = &quot;C:\dev\ros2_humble\bin;&quot; + $Env:PATH; C:\dev\ros2_humble\.venv\Scripts\python.exe C:\Users\name\project\node.py </code></pre> <p>Now my node runs!</p> <p>It seems you can apply the same with PyCharm, edit the run configuration and under &quot;Environment&quot; change &quot;Environment Variables:&quot; to override the <code>PATH</code> variable. However, when doing this, the error is <em>not</em> fixed...<br /> A quick test with <code>import os; os.environ[&quot;Path&quot;]</code> at the start of my script shows that <code>PATH</code> is not modified at all.</p> <p>I'm not sure how to continue here.</p> <p>EDIT: I got it, I need to type &quot;path&quot; under environment variables (no capitals) and I need to specify it in full (i.e. I cannot extend it), but now it works!</p>
105462
2023-11-16T13:11:32.197
|ros2|python|ide|
<p>I am trying to run (and debug) a ROS2 node made in Python with the PyCharm IDE.</p> <p>The results won't be exactly the same as <code>ros2 run ...</code>, but it seems directly running the relevant script is at least close: <code>python src/my_project/my_node/node.py</code></p> <p>So in PyCharm I add the Python 3.8 interpreter I use for ROS2 and open the project. So far so good, by adding <code>C:\dev\ros2_humble\Lib\site-packages</code> to the <a href="https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-reloading-interpreter-paths.html" rel="nofollow noreferrer">interpreter path</a> I get correct code completion etc.</p> <p>However, when I try to run my file I am prompted with this error:</p> <pre><code>Traceback (most recent call last): File &quot;C:\Users\name\project\node.py&quot;, line 12, in &lt;module&gt; import rclpy File &quot;C:\dev\ros2_humble\Lib\site-packages\rclpy\__init__.py&quot;, line 49, in &lt;module&gt; from rclpy.signals import install_signal_handlers File &quot;C:\dev\ros2_humble\Lib\site-packages\rclpy\signals.py&quot;, line 15, in &lt;module&gt; from rclpy.exceptions import InvalidHandle File &quot;C:\dev\ros2_humble\Lib\site-packages\rclpy\exceptions.py&quot;, line 15, in &lt;module&gt; from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy File &quot;C:\dev\ros2_humble\Lib\site-packages\rclpy\impl\implementation_singleton.py&quot;, line 32, in &lt;module&gt; rclpy_implementation = import_c_library('._rclpy_pybind11', package) File &quot;C:\dev\ros2_humble\Lib\site-packages\rpyutils\import_c_library.py&quot;, line 39, in import_c_library return importlib.import_module(name, package=package) File &quot;C:\Program Files\Python38\lib\importlib\__init__.py&quot;, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: DLL load failed while importing _rclpy_pybind11: The specified module could not be found. The C extension 'C:\dev\ros2_humble\Lib\site-packages\rclpy\_rclpy_pybind11.cp38-win_amd64.pyd' failed to be imported while being present on the system. Please refer to 'https://docs.ros.org/en/{distro}/Guides/Installation-Troubleshooting.html#import-failing-even-with-library-present-on-the-system' for possible solutions </code></pre> <p>I noticed I get the exact same error when running the script from a fresh (unsourced) terminal:</p> <pre><code>C:\dev\ros2_humble\.venv\Scripts\python.exe C:\Users\name\project\node.py </code></pre> <p>How could I circumvent this in PyCharm?</p>
Running / debugging ROS2 Python node with PyCharm on Windows
<p>The <code>rospy.Timer</code> object is designed to operate asynchronously. When you create a Timer inside a while loop, it attempts to create a new timer on each iteration of the loop. This will lead to unexpected behavior, as these timers are not being properly managed or canceled.</p> <p>The callback <code>publish</code> in the Timer is designed to be called at regular intervals specified by the duration.</p> <p>Revised publisher code (with minimal changes):</p> <pre class="lang-py prettyprint-override"><code>#!/usr/bin/env python import rospy from std_msgs.msg import Int16, String pub_1 = rospy.Publisher('file_update', Int16, queue_size=30) shutdown_signal = False def publish(event): if not shutdown_signal: num_msg = 23 pub_1.publish(num_msg) def shutdown(data): global shutdown_signal shutdown_signal = True if __name__ == '__main__': rate = 10 rospy.init_node('file_update_publisher', anonymous=True) rospy.Subscriber('shutdown_publisher', String, shutdown) timer = rospy.Timer(rospy.Duration(1/rate), publish) rospy.spin() timer.shutdown() </code></pre> <p>Feel free to build on this code, specifically the <code>update_file</code> function. If you are starting ROS development, I would recommend switching to <a href="https://docs.ros.org/en/humble/" rel="nofollow noreferrer">ROS 2</a>.</p>
105481
2023-11-17T00:28:30.530
|ros|python|
<p>I am trying to be able to control when do I publish so I tried to put the rospy.Timer in a while loop. I did not use rospy.Rate or rate.sleep because I found out that it somehow interferes with the signal of another node(if someone could help on this would be nice too). However when I put the rospy.Timer in a loop it does not seem working as intended</p> <p>This is my publisher code</p> <pre><code> #!/usr/bin/env python import rospy from std_msgs.msg import Int16 from std_msgs.msg import String pub_1=rospy.Publisher('file_update',Int16,queue_size=30) shutdown_signal = False # Flag to indicate whether to shut down the publisher rate=10 def update_file(): global shutdown_signal while not shutdown_signal: rospy.Timer(rospy.Duration(1/rate),publish) def publish(event): num_msg=23 pub_1.publish(num_msg) def shutdown(data): global shutdown_signal shutdown_signal = True #rospy.loginfo(&quot;Received shutdown signal&quot;) if __name__ == '__main__': rospy.init_node('file_update_publisher', anonymous=True) rospy.Subscriber('shutdown_publisher', String, shutdown) try: update_file() except rospy.ROSInterruptException: print(&quot;An exception occured&quot;) </code></pre> <p>And this is my subscriber code</p> <pre><code> #!/usr/bin/env python3 import rospy from std_msgs.msg import String from std_msgs.msg import Int16 def file_update_callback(data): number=data.data print(number) shutdown_pub = rospy.Publisher('shutdown_publisher', String, queue_size=1) shutdown_pub.publish(&quot;Shutdown&quot;) def listen_file_update(): rospy.init_node('file_update_listener', anonymous=True) rospy.Subscriber('file_update', Int16, file_update_callback) rospy.spin() if __name__ == '__main__': listen_file_update() </code></pre>
Why can't I put a rospy.Timer in a while loop?
<blockquote> <p>I would like to generate a &quot;smooth&quot; trajectory in space, and plan it using Moveit2 (along with ROS2 humble) in order to make a UR5e robot drive these points.</p> </blockquote> <p>Usually, you would make use of the <a href="https://moveit.picknik.ai/humble/doc/examples/move_group_interface/move_group_interface_tutorial.html" rel="nofollow noreferrer"><code>MoveGroupInterface</code></a>, which provides a C++ API to interface with your robot. If you take a look at the file <a href="https://github.com/ros-planning/moveit2/blob/main/moveit_ros/planning_interface/move_group_interface/include/moveit/move_group_interface/move_group_interface.h" rel="nofollow noreferrer">move_group_interface.h</a>, you will find a couple of functions that will help you setup and plan for poses with your robot.</p> <p>The general order of usage is as follows:</p> <ul> <li>setup MoveGroupInterface to accept the robot description and the SRDF <em>(look at the tutorial for a clearer explanation)</em></li> <li>Set the planning parameters using the <a href="https://github.com/ros-planning/moveit2/blob/0807cb254d01abdc4f60247d2c322e1aead71d35/moveit_ros/planning_interface/move_group_interface/include/moveit/move_group_interface/move_group_interface.h#L205" rel="nofollow noreferrer"><code>setPlannerParams</code></a> function</li> <li>Set a target for the robot. You can either use <a href="https://github.com/ros-planning/moveit2/blob/0807cb254d01abdc4f60247d2c322e1aead71d35/moveit_ros/planning_interface/move_group_interface/include/moveit/move_group_interface/move_group_interface.h#L412C3-L412C71" rel="nofollow noreferrer"><code>setJointValueTarget</code></a>, or <a href="https://github.com/ros-planning/moveit2/blob/0807cb254d01abdc4f60247d2c322e1aead71d35/moveit_ros/planning_interface/move_group_interface/include/moveit/move_group_interface/move_group_interface.h#L562" rel="nofollow noreferrer"><code>setPoseTarget</code></a> depending on your use-case.</li> <li>Generate a <a href="https://github.com/ros-planning/moveit2/blob/0807cb254d01abdc4f60247d2c322e1aead71d35/moveit_ros/planning_interface/move_group_interface/include/moveit/move_group_interface/move_group_interface.h#L712C50-L712C50" rel="nofollow noreferrer"><code>plan</code></a> for the robot.</li> <li>Once happy with the generated plan, you want to <a href="https://github.com/ros-planning/moveit2/blob/0807cb254d01abdc4f60247d2c322e1aead71d35/moveit_ros/planning_interface/move_group_interface/include/moveit/move_group_interface/move_group_interface.h#L747" rel="nofollow noreferrer"><code>execute</code></a> it.</li> </ul> <p><strong>NOTE:</strong> In the general context of MoveIt2, &quot;plan&quot; just constructs a trajectory, that the robot needs to follow. When you want the robot to follow the generated trajectory, you want to call the &quot;execute&quot; function.</p> <blockquote> <p>My question is: how should I provide these points (which would be in Cartesian coordinates) so that they would be used to create the respective joint coordinates and be sent to ros_control?</p> </blockquote> <p>You should ideally not be putting in a trajectory by hand, as it leads to augmentation of human error. What you should do instead, is use <code>setPoseTargets</code>, or in your case, I think you would like to use <code>setJointValueTargets</code>, plan for these joint values, store the plan, do some post-processing if necessary, and then send it off to execute.</p> <p>Normally, the UR5 should have some moveit_config file pertaining to ros2_control, this YAML should take care of passing the output of the MoveIt-generated trajectory over to the ros2_control side of things. IIRC, for the simplest operation, there is a <a href="https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/blob/fcc9d3602e12d5e73835f42275ba8c1a753a9d7b/ur_moveit_config/config/controllers.yaml#L3" rel="nofollow noreferrer">JointTrajectoryController</a> used, which takes in the generated plan and sends it over to the dedicated robot controller.</p> <p>Hope this helps to make things clearer !</p>
105491
2023-11-17T12:58:21.580
|ros2|moveit|universal-robots|joint-trajectory-controller|ros2-control|
<p>I would like to generate a &quot;smooth&quot; trajectory in space, and plan it using Moveit2 (along with ROS2 humble) in order to make a UR5e robot drive these points.</p> <p>I am aware that I need to discretize this trajectory into several points.</p> <p>My guess is that I would need the MoveIt2 path planner to compute the joint positions, and I would send these to the joint trajectory controller of ros_control.</p> <p>I tried to google around but could not find a similar implementation.</p> <p>I would appreciate any help, or any road map that I should follow.</p>
Using MoveIt2 to plan a smooth path consisted of several discretized points to control a UR5e robot
<p>I wouldn't overcomplicate it with what you're trying to do. Its extremely lightweight :-)</p> <blockquote> <p>this isn't ideal especially if the code took a while to run it could cause sensor messages to be missed</p> </blockquote> <p>You're not going to miss a callback on a laser scan checking an operation that trivial unless your sensor is publishing at KHz-level speeds or you're running on an STM32 (and even then?). In the callback is fine for the basic thing you're trying to accomplish.</p> <blockquote> <p>I wanted to only check for obstacles every 2secs</p> </blockquote> <p>I'd have the class contain a member of the last time it was checked. As laser scans come in, check what time it is either using <code>node-&gt;now()</code> or from the message's header <code>msg.header.stamp</code> and don't check it unless the duration between checks is high enough.</p>
105499
2023-11-17T23:31:36.263
|ros2|callback|laserscan|obstacle-avoidance|logic-control|
<p>I am working on a turtlebot simulation with ROS2, and I would like the robot to stop when it hits a wall.</p> <p>Where is the proper place to implement simple logic (for example, if distance &lt; 10 then stop)? Right now, I have code in the callback, but this isn't ideal especially if the code took a while to run it could cause sensor messages to be missed. Also, if I wanted to only check for obstacles every 2secs, putting a delay in the callback is also not a good idea.</p> <p>What is the preferred method/where is the preferred place to add this logic, and also how can I delay it so the logic only checks the laser scan every 2 seconds?</p> <pre><code>#include &quot;rclcpp/rclcpp.hpp&quot; #include &quot;sensor_msgs/msg/laser_scan.hpp&quot; #include &quot;geometry_msgs/msg/twist.hpp&quot; class LaserScanReader : public rclcpp::Node { public: LaserScanReader() : Node(&quot;laser_scan_reader&quot;) { subscription_ = this-&gt;create_subscription&lt;sensor_msgs::msg::LaserScan&gt;( &quot;scan&quot;, 10, std::bind(&amp;LaserScanReader::topic_callback, this, std::placeholders::_1)); cmd_vel_publisher_ = this-&gt;create_publisher&lt;geometry_msgs::msg::Twist&gt;(&quot;/cmd_vel&quot;, 10); } void publish_cmd_vel(geometry_msgs::msg::Twist cmd_vel) { cmd_vel_publisher_-&gt;publish(cmd_vel); } private: void topic_callback(const sensor_msgs::msg::LaserScan::SharedPtr msg) const { int center_index = msg-&gt;ranges.size() / 2; RCLCPP_INFO(this-&gt;get_logger(), &quot;Center reading: '%f'&quot;, msg-&gt;ranges[center_index]); if (msg-&gt;ranges[center_index] &lt; 10) { // stop robot here/publish 0 to cmd_vel (is there a better place to do this) // how can I cehck every 2secs (insted of everytime callback runs) } } rclcpp::Subscription&lt;sensor_msgs::msg::LaserScan&gt;::SharedPtr subscription_; }; int main(int argc, char *argv[]) { rclcpp::init(argc, argv); rclcpp::spin(std::make_shared&lt;LaserScanReader&gt;()); rclcpp::shutdown(); return 0; } <span class="math-container">```</span> </code></pre>
Where is the preffered position to put a simple control loop in a ROS2 Node (C++) for obstacle avoidance
<p>If you build everything from source after the new version of python was setup everything should reference the new version of python.</p> <p>You will need to make sure that you didn't build anything or have any cache files or things already partially built against the older python version in your workspace. And aren't using any system packages that rely on the system version of python.</p> <p>A good link for past discussions of nuances: <a href="https://robotics.stackexchange.com/questions/94176/how-do-i-specify-the-version-of-python3-for-ros2">How do I specify the version of Python3 for ROS2?</a></p>
105502
2023-11-18T03:29:03.200
|python|python3|build-from-source|
<p>I am on a Jetson nano, and I need to run ROS humble under a version of Python more recent than the 3.8 version in Ubuntu 20.04's APT repo. As such, I installed python 3.11.6 through pyenv, and built ROS2 humble from source. When I run my ros package (built with ament_python), however, my python scripts execute with the system's native python 3.8, even though pyenv still shows 3.11.6 as active, and if I run &quot;python3&quot; in the terminal, I get a 3.11.6 cli.</p> <p>What is the best way of rectifying this? Is there a way to specify that a particular Python interpreter should be used?</p> <p>I assume I will have to re-build from source, because ros2 seems to have built with python 3.8 for some packages, and 3.11 for others- when I do so, should I completely remove the native python3.8? Is that even safe to do on a Jetson nano?</p> <p>Thanks!</p>
Running ros (built from source) with specific Python version
<p>ROS 2 uses multicast packets for discovery unless you set it up differently. The multicast packets may not be routed across your subnet, which is something you can check in your router configuration.</p> <p>You can also use the <code>ros2 multicast receive</code> and <code>ros2 multicast send</code> utilities to assist in debugging the network.</p> <p>If you cannot make changes to the router, you may be able to get the nodes to communicate through a discovery server: <a href="https://docs.ros.org/en/humble/Tutorials/Advanced/Discovery-Server/Discovery-Server.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Tutorials/Advanced/Discovery-Server/Discovery-Server.html</a></p>
105511
2023-11-18T16:40:06.580
|ros2|raspberry-pi|network|
<p>I want to use WSL2 on my development PC to send control signals to nodes running on a Raspberry Pi.</p> <p>To get there I have a three step plan:</p> <ol> <li>get connectivity</li> <li>get ros2 humble communications to work</li> <li>get it to work with my software</li> </ol> <p><strong>Step 1)</strong></p> <p>Seems to work:</p> <p>I've setup a subnet <code>192.168.177.0/24</code> for the WSL2 with Wireguard. WSL2 has the address <code>192.168.177.133</code>. On the other end is the <code>server.wg0</code> adapter with address <code>192.168.177.132</code>. The Raspberry Pi is in the <code>192.168.178.0/24</code> subnet provided by my fritzbox with address <code>192.168.178.21</code>. I've set up routing on the fritzbox to use my development machine <code>192.168.178.51</code> as the gateway to the <code>192.168.177.0/24</code> subnet. Pinging between all of the participants works, so I guess the basic network architecture is ok. An example traceroute:</p> <pre><code>traceroute to 192.168.177.133 (192.168.177.133), 30 hops max, 60 byte packets 1 DESKTOP-XXXXXX.fritz.box (192.168.178.51) 2.225 ms * * 2 192.168.177.133 (192.168.177.133) 3.682 ms 3.902 ms 3.985 ms </code></pre> <p><strong>Step 2)</strong></p> <p>To test if I can get ros2 humble / FastDDS right, I am using <code>ros2 run demo_nodes_cpp talker</code> on the WSL2 Ubuntu 22.04 and <code>ros2 run demo_nodes_cpp listener</code> on the Raspberry Pi Ubuntu 22.04.</p> <p>I am currently not getting them to talk to each other. I've read a bit in the documentation and ended up with the following configurations for FastDDS: on WSL2:</p> <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt; &lt;dds&gt; &lt;log&gt; &lt;use_default&gt;false&lt;/use_default&gt; &lt;consumer&gt; &lt;class&gt;StdoutErrConsumer&lt;/class&gt; &lt;property&gt; &lt;name&gt;stderr_threshold&lt;/name&gt; &lt;value&gt;Log::Kind::Info&lt;/value&gt; &lt;/property&gt; &lt;/consumer&gt; &lt;/log&gt; &lt;profiles xmlns=&quot;http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles&quot;&gt; &lt;!-- Configuration for the control computer --&gt; &lt;participant profile_name=&quot;control_computer_profile&quot;&gt; &lt;domainId&gt;0&lt;/domainId&gt; &lt;rtps&gt; &lt;participantID&gt;0&lt;/participantID&gt; &lt;builtin&gt; &lt;!-- initial peer list --&gt; &lt;initialPeersList&gt; &lt;locator&gt; &lt;udpv4&gt; &lt;address&gt;192.168.178.21&lt;/address&gt; &lt;port&gt;7412&lt;/port&gt; &lt;/udpv4&gt; &lt;/locator&gt; &lt;/initialPeersList&gt; &lt;!-- discovery config --&gt; &lt;discovery_config&gt; &lt;initialAnnouncements&gt; &lt;count&gt;500&lt;/count&gt; &lt;period&gt; &lt;nanosec&gt;100000000&lt;/nanosec&gt; &lt;/period&gt; &lt;/initialAnnouncements&gt; &lt;/discovery_config&gt; &lt;/builtin&gt; &lt;/rtps&gt; &lt;/participant&gt; &lt;/profiles&gt; &lt;/dds&gt; </code></pre> <p>On the RasPi the differences are the IP address and port number</p> <pre><code>&lt;address&gt;192.168.177.133&lt;/address&gt; &lt;port&gt;7410&lt;/port&gt; </code></pre> <p>as well as the <code>&lt;participantID&gt;1&lt;/participantID&gt;</code>.</p> <p>I have confirmed that the <code>config.xml</code>s get read, since when using an invalid value for the log level I get errors. However, even with log level <code>Log::Kind::Info</code> I get no output on my CLI which I would assume is the <code>StdoutErrConsumer</code>.</p> <p>I have also opened the firewalls on both Ubuntu systems with</p> <pre><code>sudo iptables -A INPUT -p udp --dport 7410 -j ACCEPT sudo iptables -A INPUT -p udp --dport 7411 -j ACCEPT </code></pre> <p>on WSL2 and</p> <pre><code>sudo iptables -A INPUT -p udp --dport 7412 -j ACCEPT sudo iptables -A INPUT -p udp --dport 7413 -j ACCEPT </code></pre> <p>on the RasPi.</p> <p>My Questions:</p> <ol> <li>How do I get the talker / listener example to work?</li> <li>How can I get more information of what is happening on startup? I.e. if FastDDS tries to connect to the peers on the initial peer list.</li> <li>Are there similar questions on this site or tutorials online around this issue?</li> <li>Can you give me an explanation of the PDP for dummies especially what the parameters do and if and when discovery ends? What happens say if another ros2 system wants to join five minutes after start up?</li> <li>Any other troubleshooting ideas? As in what to do and how to make it easier to spot mistakes?</li> </ol> <p><strong>Step 3)</strong></p> <p>Not there yet.</p>
FastDDS: demo_nodes_cpp between WSL2 and Raspberry Pi
<blockquote> <p>after i replace 1000 from 10000 everything was fine</p> </blockquote> <p>Glad you figured it out, but you'd be better off using the <code>static_transform_publisher</code> from the <code>tf2_ros</code> package instead. With this newer improved node, you don't specify a period_in_millisec at all:</p> <pre><code>&lt;node pkg=&quot;tf2_ros&quot; type=&quot;static_transform_publisher&quot; name=&quot;myname&quot; args=&quot;x y z yaw pitch roll parent_frame child_frame&quot; /&gt; </code></pre>
105515
2023-11-19T03:30:42.953
|hector-slam|ros-noetic|hector-mapping|depthimage-to-laserscan|
<p>I'm currently converting depth image to laserscan, further i want to do mapping using hector slam . When i try running my code it say.</p> <blockquote> <p>lookupTransform base_link to camera_depth_frame timed out. Could not transform laser scan into base_frame.</p> </blockquote> <p>Can anyone please help me with this . thanks in advance. please find my launch file script below</p> <pre><code>&lt;launch&gt; &lt;node pkg=&quot;hector_mapping&quot; type=&quot;hector_mapping&quot; name=&quot;hector_mapping&quot; output=&quot;screen&quot;&gt; &lt;param name=&quot;pub_map_odom_transform&quot; value=&quot;true&quot;/&gt; &lt;param name=&quot;map_frame&quot; value=&quot;map&quot; /&gt; &lt;param name=&quot;base_frame&quot; value=&quot;base_link&quot; /&gt; &lt;param name=&quot;odom_frame&quot; value=&quot;base_link&quot; /&gt; &lt;remap from=&quot;scan&quot; to=&quot;/scan&quot;/&gt; &lt;/node&gt; &lt;node pkg=&quot;tf&quot; type=&quot;static_transform_publisher&quot; name=&quot;map_odom&quot; args=&quot;1 0.0 0.0 0.0 0.0 1 map odom 10000&quot; /&gt; &lt;node pkg=&quot;tf&quot; type=&quot;static_transform_publisher&quot; name=&quot;odom_bf&quot; args=&quot;1 0.0 0.0 0.0 0.0 1 odom base_footprint 10000&quot; /&gt; &lt;node pkg=&quot;tf&quot; type=&quot;static_transform_publisher&quot; name=&quot;bf_bl&quot; args=&quot;1 0.0 0.0 0.0 0.0 1 base_footprint base_link 10000&quot; /&gt; &lt;node pkg=&quot;tf&quot; type=&quot;static_transform_publisher&quot; name=&quot;bl_scan&quot; args=&quot;1 0.0 0.0 0.0 0.0 1 base_link scan 10000 &quot;/&gt; &lt;node pkg=&quot;tf&quot; type=&quot;static_transform_publisher&quot; name=&quot;bl_cdf&quot; args=&quot;1 0.0 0.0 0.0 0.0 1 base_link camera_depth_frame 10000&quot; /&gt; &lt;/launch&gt; </code></pre>
Hector slam mapping
<p>The issue was with inertia. The inertia was too small and some values were negative. I increased inertia of all the links and it started behaving normally.</p>
105522
2023-11-19T17:16:52.037
|ros2|urdf|ros-humble|gazebo-ros2-control|
<p>I am developing heaped project. I am using ROS2 humble with JointTrajectoryController.</p> <p>When I spawn model in gazebo it moves uncontrollably, it shoot itself out of sight. When it lands on its back it stays put. Whenever one of its legs touches ground it is all over. When I spawn model without controller model behaves as expected (just folds itself due to gravity). Here is a <a href="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExbHE0ZHBubmcxdHl5M3FocHZicTdlNW40NTBuMDRjZXQxMHYyNmp6dSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/fMpN2N6s5LQmiwoLmI/source.gif" rel="nofollow noreferrer">gif</a> (its shaky, because i am following the model, because it throws itself out of reach of standard view).</p> <p>I tried changing damping, friction, PID, nothing works. Here is part of my urdf and controllers.yaml:</p> <pre><code>&lt;robot xmlns:xacro=&quot;http://www.ros.org/wiki/xacro&quot;&gt; &lt;link name=&quot;base_link&quot;&gt; &lt;/link&gt; &lt;link name=&quot;body_link&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.160055124 0.267586317 0.39836396&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.64954282&quot; /&gt; &lt;inertia ixx=&quot;0.000794907&quot; ixy=&quot;4.01E-09&quot; ixz=&quot;-4.37E-08&quot; iyy=&quot;0.001704166&quot; iyz=&quot;4.77E-07&quot; izz=&quot;0.001070923&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;.../body_link.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;1 1 1 1&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;mesh filename=&quot;file:.../body_link.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;body_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;-0.102475952 0.159586753 -0.131089911&quot; rpy=&quot;1.570796327 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;body_link&quot; /&gt; &lt;axis xyz=&quot;0 0 0&quot; /&gt; &lt;dynamics damping=&quot;0.0&quot; friction=&quot;0.0&quot; /&gt; &lt;/joint&gt; &lt;link name=&quot;coxa_fl_link&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.031263 -0.04285 -0.0031807&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.060087&quot; /&gt; &lt;inertia ixx=&quot;1.33E-05&quot; ixy=&quot;-7.73E-08&quot; ixz=&quot;3.75E-08&quot; iyy=&quot;2.61E-05&quot; iyz=&quot;-4.96E-07&quot; izz=&quot;2.23E-05&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;.../coxa_fl_link.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;1 1 1 1&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;mesh filename=&quot;.../coxa_fl_link.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;coxa_fl_joint&quot; type=&quot;revolute&quot;&gt; &lt;origin xyz=&quot;0.25338 0.24361 0.50425&quot; rpy=&quot;-2.618 0 -1.5708&quot; /&gt; &lt;parent link=&quot;body_link&quot; /&gt; &lt;child link=&quot;coxa_fl_link&quot; /&gt; &lt;axis xyz=&quot;1 0 0&quot; /&gt; &lt;limit lower=&quot;-1.5&quot; upper=&quot;1.5&quot; effort=&quot;0.1&quot; velocity=&quot;0.1&quot; /&gt; &lt;dynamics damping=&quot;0.0&quot; friction=&quot;0.0&quot; /&gt; &lt;/joint&gt; &lt;link name=&quot;femur_fl_link&quot;&gt; ... </code></pre> <pre><code>controller_manager: ros__parameters: update_rate: 30 # use_sim_time: true joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster joint_trajectory_position_controller: type: joint_trajectory_controller/JointTrajectoryController # joint_state_broadcaster: # ros__parameters: joint_trajectory_position_controller: ros__parameters: joints: - coxa_fl_joint - femur_fl_joint - tibia_fl_joint - coxa_ml_joint - femur_ml_joint - tibia_ml_joint - coxa_rl_joint - femur_rl_joint - tibia_rl_joint - coxa_fr_joint - femur_fr_joint - tibia_fr_joint - coxa_mr_joint - femur_mr_joint - tibia_mr_joint - coxa_rr_joint - femur_rr_joint - tibia_rr_joint gains: coxa_fl_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} femur_fl_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} tibia_fl_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} coxa_ml_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} femur_ml_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} tibia_ml_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} coxa_rl_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} femur_rl_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} tibia_rl_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} coxa_fr_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} femur_fr_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} tibia_fr_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} coxa_mr_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} femur_mr_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} tibia_mr_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} coxa_rr_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} femur_rr_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} tibia_rr_joint: {p: 0.0, i: 0.0, d: 0.0, i_clamp: 0.0, ff_velocity_scale: 0.00} command_interfaces: - position state_interfaces: - position # - velocity action_monitor_rate: 20.0 # Defaults to 20 allow_partial_joints_goal: false # Defaults to false open_loop_control: true allow_integration_in_goal_trajectories: false constraints: stopped_velocity_tolerance: 0.01 # Defaults to 0.01 goal_time: 0.0 # Defaults to 0.0 (start immediately) </code></pre>
Model in gazebo moves violently, with JointTrajectoryController
<p>The very large difference in timestamps looks like some of your system is running on simulated time and some is running on system time(Aka wall clock time). It's likely that you are running some of your nodes without sim time selected by the parameter.</p>
105528
2023-11-19T21:18:55.153
|ros2|
<p>I am using <a href="https://github.com/robo-friends/m-explore-ros2" rel="nofollow noreferrer">https://github.com/robo-friends/m-explore-ros2</a> this repo to implement explore_lite package to ros2 foxy. When I try this package with turtlebot, it works great. But when i use my own project and my own world. There is requested and data time error which can be seen below. There is a huge difference between times and i dont know why. When i check the ros2 topic echo /tf i can see the publishing data very clearly. The data value(119.801) always matched with the echo tf lists and it's unit in second</p> <p>Extrapolation Error looking up robot pose: Lookup would require extrapolation into the future. Requested time 1700418376.067588 but the latest data is at time 119.801000, when looking up transform from frame [base_link] to frame [map]</p> <p>The command that i use:</p> <ol> <li><p>ros2 launch my_bot launch_sim.launch.py (this is launch my robot in gazebo)</p> </li> <li><p>rviz2</p> </li> <li><p>ros2 launch nav2_bringup slam_launch.py use_sim_time:=true</p> </li> <li><p>ros2 launch nav2_bringup navigation_launch.py use_sim_time:=true</p> </li> <li><p>ros2 run explore_lite explore --ros-args --params-file &lt;path_to_ros_ws&gt;/m-explore-ros2/explore/config/params.yaml(this starts explore_lite.)</p> </li> </ol>
Ros2 foxy explore_lite package requested and data time error
<p>Gazebo computes physics updates in the same thread as the <code>worldUpdateBegin</code> event, which is why it worked properly when your code was in that callback. Gazebo also uses 3 separate threads for its sensor updates (Cameras/Rendering sensors, CPU-based Ray sensors, and all other sensors: IMU, Force-torque, etc), so there will be thread synchronization issues if you want to access the physics-based collision data from those threads. I don't think there's an easy answer to this.</p>
105564
2023-11-21T08:56:18.323
|gazebo-plugin|gazebo-9|
<p>Recently, I've been working on a lidar sensor plugin in Gazebo. I'm attempting to initiate a thread within the sensor plugin to continuously execute 'dSpaceCollide2,' but for some reason, it crashes. The following is what I did:</p> <pre><code>void Load(sensors::SensorPtr _parent, sdf::ElementPtr sdf) { // launch a thread to save point cloud distortpc_thd = std::make_unique&lt;std::thread&gt;(&amp;DistortPC::DistortPCHandler, this); } void DistortPC::DistortPCHandler() { //... // here is the operation invoke GetPhysicsUpdateMutex() and dSpaceCollide2() laserShape-&gt;GetIntersection(dist, entity); // ... } </code></pre> <p>when i launch gazebo, at random time it crashed. I suspect it's due to multiple threads accessing shared resources. However, when I place this operation in the 'worldUpdateBegin' callback, it works fine.</p> <pre><code>void Load(sensors::SensorPtr _parent, sdf::ElementPtr sdf) { // move thread unsafe ops to event handler, and it works normal! update_connection_ = event::Events::ConnectWorldUpdateBegin( boost::bind(&amp;DistortPC::DistortPCHandler, this)); </code></pre> <p>Yet, I aim to have this operation run continuously rather than waiting for the callback to execute. Could you kindly advise on how to resolve this issue? Or I just want the collison detection like dSpaceCollide2() works instead of the whole physics simulation stuff, how should i disable that? I think only put ray casting on work rather than simulation lower computing load maybe??</p>
implement ray-casting in gazebo9, bumped into multithreading issue
<p>Right now you're giving open loop commands but expecting precise positioning in your stop condition. This may succeed in the simplest of simulators, but it's a recipe for disaster with any real system or realistic simulation.</p> <p>You need to introduce some amount of feedback, and adjust your commanded velocity twist amount to be dependent on how far along your desired path your robot is. It's a very large change to your algorithm, but it will allow you to drive circles (or any path) while dealing with real world disturbances like different floor types, carpets, and humans.</p> <p>If you're really trying to hack together a simple circle, you'll want to change your twist values (<code>msg.linear</code> and <code>msg.angular</code>) so the robot completes 1 circle with an integer number of messages and then just send that number of messages. This code will be useless outside of this particular setup though.</p>
105568
2023-11-21T12:09:31.823
|publisher|turtlesim|subscribers|
<p>I am interested in drawing one circle with the <em>turtlesim</em>. However the subscriber is retrieving the pose way faster than the publishers moves the turtle. This is the code that I came up with:</p> <pre><code>#!/usr/bin/env python3 import rospy from geometry_msgs.msg import Twist from turtlesim.msg import Pose locations = [] def pose_callback(pose:Pose): global locations msg = Twist() msg.linear.x = 2.0 msg.angular.z = 1.0 pub.publish(msg) rospy.sleep(0.5) # delay on subscribing locations.append((pose.x,pose.y)) rospy.loginfo(locations) if (pose.x, pose.y) in locations: rospy.loginfo(f'Circle completed!') rospy.signal_shutdown('Completed circle') if __name__ == &quot;__main__&quot;: rospy.init_node('draw_one_circle', disable_signals=True) pub = rospy.Publisher(&quot;/turtle1/cmd_vel&quot;, Twist, queue_size=10) sub = rospy.Subscriber(&quot;/turtle1/pose&quot;, Pose, callback=pose_callback) rospy.loginfo(&quot;Node has been started.&quot;) rospy.spin() </code></pre> <p>Any tip on what should I do?</p>
Turtlesim: Stop after one turn. Subscriber way faster than the Publisher
<p>It looks like you didn't get the <a href="https://github.com/ClemensElflein/open_mower_ros/blob/main/.gitmodules" rel="nofollow noreferrer">openmower submodules</a> (the <a href="https://github.com/ClemensElflein/open_mower_ros/blob/main/README.md" rel="nofollow noreferrer">readme</a> should be changed to mention those prominently)</p> <pre><code>cd open_mower_ros git submodule update --init --recursive </code></pre> <p>There may be some other packages to git clone manually that aren't in the submodules and can't be installed through rosdep (like the above comment suggests).</p>
105574
2023-11-21T15:23:12.287
|ros|ros-noetic|dependencies|git|
<p>I have cloned this repo:<a href="https://github.com/ClemensElflein/open_mower_ros" rel="nofollow noreferrer">https://github.com/ClemensElflein/open_mower_ros</a></p> <p>however when fetching the dependencies with:</p> <pre><code>rosdep install --from-paths src --ignore-src --default-yes </code></pre> <p>I get the following error:</p> <pre><code>ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies: mower_utils: Cannot locate rosdep definition for [xbot_msgs] mower_msgs: Cannot locate rosdep definition for [xesc_msgs] mower_simulation: Cannot locate rosdep definition for [xbot_positioning] mower_comms: Cannot locate rosdep definition for [xesc_msgs] mower_map: Cannot locate rosdep definition for [xbot_msgs] open_mower: Cannot locate rosdep definition for [ftc_local_planner] mower_logic: Cannot locate rosdep definition for [xbot_positioning] </code></pre> <p>I have tried many things, but nothing works. I am working on ros-noetic. Any tip?</p>
Error fetching dependencies from Git repo
<p>The issue was only fixed after I edited the file: [ros_install]/share/ament_cmake_core/cmake/core/python.cmake Thanks to Roberto My arguments were ignored when i used the command: colcon build --cmake-args -DPython3_FIND_VIRTUALENV=&quot;ONLY&quot;</p>
105587
2023-11-22T10:14:47.397
|ros2|python|colcon|
<p>When building my workspace with <code>colcon build</code>, it fails because of missing Python packages:</p> <blockquote> <p>ModuleNotFoundError: No module named 'em'</p> </blockquote> <p>'em' is just an example, different project give different errors. When trying to fix this, I see the packages <em>are</em> already installed:</p> <pre><code>&gt; python -m pip install empy Requirement already satisfied: empy in c:\dev\ros2_humble\.venv\lib\site-packages (3.3.4) </code></pre> <p>After a little investigation I read the following in the logs:</p> <blockquote> <p>--- stderr: geographic_msgs CMake Error at C:/dev/ros2_humble/share/rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake:59 (message): execute_process(C:/Program Files/Python310/python.exe -m rosidl_adapter</p> </blockquote> <p><code>colcon</code> is using the wrong version of Python... But I am running all the above after sourcing ROS2, from inside the ROS2 virtual environment.</p> <p>How can I get <code>colcon</code> to stick with the right Python version?</p>
ROS2 on Windows 10 - `colcon build` uses wrong Python version: "No module named *"
<p>In <code>cmake</code>, <code>add_library()</code> is used to build a library. It does not link it into the project executable. <code>target_link_libraries()</code> does that.</p> <p><a href="https://cmake.org/cmake/help/latest/command/add_library.html" rel="nofollow noreferrer">https://cmake.org/cmake/help/latest/command/add_library.html</a></p> <p>If the compiler can see both a shared library and a static library with the same library name, I don't recall what the compiler does. You may need to explicitly provide the .a suffix to tell the compiler to use the static version.</p>
105590
2023-11-22T12:06:31.963
|ros2|cmake|colcon|linking|gdb|
<p>I am trying to understand custom memory allocators for ROS2. To understand the functioning of <code>tlsf</code> I am using <code>tlsf_example</code> wrapper project present in <code>src/ros2/realtime_support</code>. I have added dummy print statements to <code>src/ros2/tlsf/tlsf/src/tlsf.c</code>, to just verify if my changes are being applied. The colcon command I ran to build is <code>colcon build --cmake-args -DCMAKE_BUILD_TYPE=Debug --packages-select tlsf tlsf_cpp</code>. I am running the binary present in <code>src/install/tlsf_cpp/lib/tlsf_cpp</code>. But I don't see any of my changes being outputed to terminal. I also tried using <code>gdb</code> but I am not getting any source line info for <code>tlsf_malloc</code> function defined in <code>tlsf.c</code> file.</p> <p><code>CMakeLists.txt</code> file for <code>tlsf.c</code></p> <pre class="lang-cpp prettyprint-override"><code>cmake_minimum_required(VERSION 3.5) project(tlsf) if(WIN32 OR APPLE OR ANDROID) message(STATUS &quot;tlsf allocator does not target Windows, OSX or Android, skipping...&quot;) return() endif() # Default to C11 if(NOT CMAKE_C_STANDARD) set(CMAKE_C_STANDARD 11) endif() if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES &quot;Clang&quot;) add_compile_options(-Wall -Wextra -Wpedantic -g -O0) endif() find_package(ament_cmake REQUIRED) add_library(<span class="math-container">${PROJECT_NAME} STATIC src/tlsf.c src/target.h include/tlsf/tlsf.h) target_include_directories($</span>{PROJECT_NAME} PUBLIC &quot;<span class="math-container">$&lt;BUILD_INTERFACE:$</span>{CMAKE_SOURCE_DIR}/include/tlsf&gt;&quot; &quot;<span class="math-container">$&lt;INSTALL_INTERFACE:include/$</span>{PROJECT_NAME}&gt;&quot;) set_target_properties(${PROJECT_NAME} PROPERTIES C_VISIBILITY_PRESET hidden) ament_export_targets(export_${PROJECT_NAME}) # Disable linting for now. #if(BUILD_TESTING) # find_package(ament_lint_auto REQUIRED) # ament_lint_auto_find_test_dependencies() #endif() ament_package() install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME} ) install( TARGETS <span class="math-container">${PROJECT_NAME} EXPORT export_$</span>{PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) </code></pre> <p>I am sure that the build command touches <code>tlsf.c</code> file after changes but I am unable to observe any changes in the output. I want to know whether the application I am running actually links to the changed file, is there any way to achieve this? What changes should I do to the <code>CMakeLists.txt</code> file for <code>tlsf</code>? Is the binary I ran the correct binary to expect changes? Also how can I debug <code>tlsf_malloc</code> function in ROS2? I have very little idea about ROS build system, any resources to learn more about it are welcome.</p>
Debugging ros2 libraries
<p>You need to source your Humble overlay before running <code>rosdep</code>. When you build the image without that last line and then run it, you can see that the sourcing happens during the entrypoint.</p> <p>Also remember that the default shell in docker is not bash. You can switch to bash by putting the following line in your dockerfile <code>SHELL [&quot;/bin/bash&quot;, &quot;-c&quot;]</code>, but this will run all commands after this line with bash.</p> <p>So the last line of your dockerfile can become 3 lines:</p> <pre><code>SHELL [&quot;/bin/bash&quot;, &quot;-c&quot;] RUN source /opt/ros/humble/install/setup.bash \ &amp;&amp; rosdep install &lt;rest of your options&gt; </code></pre>
105592
2023-11-22T13:13:18.293
|ros2|docker|
<p>I'm trying to make a Dockerfile with nav2 build process, but I'm facing a problem:</p> <pre><code>FROM dustynv/ros:humble-ros-base-l4t-r32.7.1 RUN mkdir -p /root/nav2_ws/src WORKDIR /root/nav2_ws ENV ROS_PACKAGE_PATH=/opt/ros/humble/install # ROS fundamentals RUN apt-mark hold '*opencv*' \ &amp;&amp; apt-get update \ &amp;&amp; apt autoremove -y \ &amp;&amp; rosinstall_generator --deps --exclude RPP --rosdistro humble navigation2 &gt; ros2.humble.nav2.rosinstall \ &amp;&amp; vcs import src/ &lt; ros2.humble.nav2.rosinstall \ # &amp;&amp; sudo rosdep fix-permissions \ &amp;&amp; rosdep update RUN rosdep install -y --ignore-src --from-paths src --rosdistro humble --skip-keys &quot;xsimd&quot; --skip-keys &quot;ignition-cmake2&quot; --skip-keys &quot;ignition-math6&quot; </code></pre> <p>The last RUN command returns several errors:</p> <pre><code>ERROR: the following packages/stacks could not have their rosdep keys resolved </code></pre> <p>in the image build process.</p> <p>But, if I comment out that RUN command, build the image and run it, then inside the container I can run that command without errors (all dependencies are solved and installed.)</p> <p>What am I missing?</p> <pre><code>docker build -t nav2_docker -f Dockerfile . </code></pre> <p>and</p> <pre><code>docker run -it --rm --network bridge nav2_docker:latest </code></pre>
Nav2 building from source in docker
<p>The BNO055 contains a magnetometer, while the BMI088 does not. However, the magnetometer is of limited value in most on-robot IMU applications because the motors cause enough magnetic disturbance to mess with any calibration you perform.</p> <p>Although the BNO055 has on-board sensor fusion and a simple interface, I'd recommend you pick the BMI088 or newer:</p> <ol> <li>The integrated sensor fusion on the BNO055 is aimed at IoT and mobile phone applications, and at one point it required motion in all 9 DoF to calibrate. If you have a ground-based mobile robot, this calibration routine is cumbersome.</li> <li>The BNO055 is no longer supported, so the integrated sensor fusion is of limited value and won't be receiving updates.</li> <li>You have a lidar and other sensors to compensate for any drift that might accumulate.</li> </ol> <p>As for dead reckoning, your robot kinematics have a lot to say about what sort of library you need there. I gather from your question that your robot is legged and not wheeled, so dead reckoning is a bit more challenging. SLAM in a long, narrow (featureless) passageway is difficult. However, if the goal is not to create metric maps but to safely traverse the length of the tube, then dead reckoning matters a lot less.</p> <p>Disclosure: I used to work at Bosch in the robotics area, but I had frequent contact with some of the Sensortec team.</p>
105599
2023-11-22T15:07:50.307
|imu|localization|sensors|
<p>I am working on a robot for navigating confined spaces that are GPS denied, I have to navigate a 300mm square concrete tube. This is a prototype/proof of concept work and I don't have a ton of sensor experience so I am trying to balance ease of use vs accuracy. We will also be working with some form of LIDAR slam and kinematics approximations to corroborate position.</p> <p>I have been recommended the BNO055 IMU because it has integrated sensor fusion and a simple interface. However, I have also heard that the proprietary software is quite inaccurate.</p> <p>Bosch has discontinued the BNO055 and their recommended sensor for robotics is the BMI088. Could anyone with more experience feedback on what sensor would be best for me?</p> <p>Also, could anyone recommend an open source software for dead reckoning?</p>
Localisation without GPS: BNO055 vs BMI088 / other IMU
<p>I'm aware of two different ways to implement this:</p> <ol> <li><p>add the obstacle(s) to your PlanningScene. The path planner should create a path that avoids collision with the object(s).</p> </li> <li><p>define Path Planner Constraints. There are various types of Constraints, but I would first look at the <code>PositionConstraint</code> to see if it fits your need. The message type associated with this feature is <code>moveit_msgs/Constraints</code>.</p> </li> </ol> <p>The only online example I have that uses Constraints is old and in c++, but I suppose it's better than nothing:</p> <p><a href="https://docs.ros.org/en/kinetic/api/moveit_tutorials/html/doc/move_group_interface/move_group_interface_tutorial.html#planning-with-path-constraints" rel="nofollow noreferrer">https://docs.ros.org/en/kinetic/api/moveit_tutorials/html/doc/move_group_interface/move_group_interface_tutorial.html#planning-with-path-constraints</a></p>
105615
2023-11-23T08:47:05.727
|moveit|ros-noetic|
<p>guys. Is there any way to set appropriate workspace.</p> <p>For example: This is my moveit_config loaded in rviz:</p> <p><a href="https://i.stack.imgur.com/YFpiV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YFpiV.png" alt="enter image description here" /></a></p> <p>and the red area has a box(in real robot) which did not show in the rviz.</p> <p>well, the blue areas are the arm workspace, but, actually, in real world, the arm just need to work at the front part of the car.</p> <p>So, it there any way to set workspace and let the planner only planning in the restrict space.</p> <p>Thanks</p>
How to set workspace in MoveIt
<p>Your firewall changes are not sufficient to allow ros1 to work. ros1 requires that you allow incoming tcp connections to all port numbers &gt;= 1024 from the other host.</p>
105617
2023-11-23T09:23:13.337
|ros-melodic|communication|multiple|
<p>I am communicating with my desktop PC as master and my Raspberry pi as slave. When I start a node on the Raspberry pi and publish a topic (<code>/scan</code>), the desktop PC shows the topic (<code>/scan</code>) in the <code>rostopic list</code> but <code>no new messages</code> in the <code>rostopic hz /scan</code>.</p> <p>The conditions are as follows</p> <p><code>&lt;Desktop PC: ubuntu 18.04 / melodic</code></p> <p>Contents of <code>~/.bashrc</code>:</p> <pre><code>export ROS_MASTER_URI=http://192.168.30.109:11311 export ROS_HOSTNAME=192.168.30.109 export ROS_IP=192.168.30.109 </code></pre> <p><code>&lt;Raspberry pi: ubuntu18.04 / melodic&gt;</code></p> <p>Contents of ~/.bashrc</p> <pre><code>export ROS_MASTER_URI=http://192.168.30.109:11311 export ROS_HOSTNAME=192.168.30.110 export ROS_IP=192.168.30.110 </code></pre> <p>Note that I tried deleting ROS_HOSTNAME, but it did not work.</p> <p>Also, I don't know if this information is necessary, but when I do <code>rqt_graph</code>, <code>Nodes/Topics(all)</code> shows both /scan and the node that is publishing, but <code>Nodes/Topics(active)</code> shows only <code>/rostopic</code></p> <p>****************** only appears.</p> <p>Please let me know if there is anything else I should check.</p> <p>I am a Japanese speaker, so there may be some things I am not doing well. Thank you in advance for your answer.</p> <p>11/23 23:40(@UTC) added</p> <p>I typed the following commands on both my desktop PC and Raspberry pi.</p> <pre><code>sudo ufw allow 11311 sudo ufw allow 22 sudo ufw reload </code></pre> <p>I am aware that 11311 is the port used for ROS communication and 22 is the port used for ssh.</p> <p>11/24 2:20(@UTC) added</p> <p><strong>I solved the problem by typing the following command on both my desktop PC and Raspberry pi!</strong></p> <pre><code>sudo ufw allow 1024:65535/tcp sudo ufw reload </code></pre> <p>Thank you so much to ignacio and Mike973 for your comments and answers.</p> <p>I may come back to ask again, so please help me again if you like.</p>
Problem communicating with multiple ROS units: rostopic list is visible but not rostopic echo. ($ROS_IP is already set)
<p>I'm not exactly sure of the solution to my problem, but I resolved it. The following is my current source code, CMakeList.txt and package.xml.</p> <p>octomap_publisher_node.cpp</p> <pre><code>#include &lt;rclcpp/rclcpp.hpp&gt; #include &lt;octomap/octomap.h&gt; #include &lt;octomap_msgs/conversions.h&gt; #include &lt;octomap_msgs/msg/octomap.hpp&gt; #include &lt;iostream&gt; class OctomapPublisher : public rclcpp::Node { public: OctomapPublisher(const std::string&amp; octree_file) : Node(&quot;octomap_publisher&quot;), octree_file_(octree_file) { publisher_ = this-&gt;create_publisher&lt;octomap_msgs::msg::Octomap&gt;(&quot;octomap&quot;, 10); timer_ = this-&gt;create_wall_timer( std::chrono::milliseconds(500), std::bind(&amp;OctomapPublisher::publishOctomap, this)); } private: void publishOctomap() { octomap::OcTree* tree = nullptr; // Load the octree from the OT file tree = dynamic_cast&lt;octomap::OcTree*&gt;(octomap::AbstractOcTree::read(octree_file_)); if (!tree) { RCLCPP_ERROR(this-&gt;get_logger(), &quot;Failed to read octree from file&quot;); return; } // Convert the octree to a message octomap_msgs::msg::Octomap msg; octomap_msgs::binaryMapToMsg(*tree, msg); msg.header.frame_id = &quot;map&quot;; msg.header.stamp = this-&gt;now(); // Publish the message publisher_-&gt;publish(msg); delete tree; // Clean up } std::string octree_file_; rclcpp::Publisher&lt;octomap_msgs::msg::Octomap&gt;::SharedPtr publisher_; rclcpp::TimerBase::SharedPtr timer_; }; int main(int argc, char **argv) { rclcpp::init(argc, argv); if (argc &lt; 2) { std::cerr &lt;&lt; &quot;Usage: octomap_publisher &lt;octree_file.ot&gt;&quot; &lt;&lt; std::endl; return 1; } auto octomap_publisher = std::make_shared&lt;OctomapPublisher&gt;(argv[1]); rclcpp::spin(octomap_publisher); rclcpp::shutdown(); return 0; } </code></pre> <p>CMakeList.txt</p> <pre><code>cmake_minimum_required(VERSION 3.5) project(octomap_publisher) # 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(octomap REQUIRED) find_package(octomap_msgs REQUIRED) find_package(octomap_server REQUIRED) # Include C++ libraries include_directories( include ) # Declare a C++ executable add_executable(octomap_publisher_node src/octomap_publisher_node.cpp) ament_target_dependencies(octomap_publisher_node rclcpp octomap octomap_msgs octomap_server ) # Specify libraries to link a library or executable target against target_link_libraries(octomap_publisher_node ${OCTOMAP_LIBRARIES} ) # Specify libraries to link a # Install targets install(TARGETS octomap_publisher_node DESTINATION lib/${PROJECT_NAME} ) 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;octomap_publisher&lt;/name&gt; &lt;version&gt;0.0.0&lt;/version&gt; &lt;description&gt;TODO: Package description&lt;/description&gt; &lt;maintainer email=&quot;ajifoster3@gmail.com&quot;&gt;ajifoster3&lt;/maintainer&gt; &lt;license&gt;TODO: License declaration&lt;/license&gt; &lt;buildtool_depend&gt;ament_cmake_auto&lt;/buildtool_depend&gt; &lt;depend&gt;octomap_msgs&lt;/depend&gt; &lt;depend&gt;octomap&lt;/depend&gt; &lt;depend&gt;rclcpp&lt;/depend&gt; &lt;depend&gt;octomap_server&lt;/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>
105644
2023-11-24T15:24:57.557
|ros|octomap|ros-humble|colcon|
<p>Using 64-bit Ubuntu 22.04.3 LTS On &quot;colcon build&quot; I'm recieving the following error:</p> <pre><code>/home/ajifoster3/dev_ws/src/octomap_publisher/src/octomap_publisher_node.cpp:2:10: fatal error: octomap_msgs/conversions.h: No such file or directory 2 | #include &lt;octomap_msgs/conversions.h&gt; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. gmake[2]: *** [CMakeFiles/octomap_publisher_node.dir/build.make:76: CMakeFiles/octomap_publisher_node.dir/src/octomap_publisher_node.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/octomap_publisher_node.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2 --- Failed &lt;&lt;&lt; octomap_publisher [0.17s, exited with code 2] </code></pre> <hr /> <p>opt/ros/humble/include/octomap_msgs has a file called conversions.h</p> <p>My ros node:</p> <pre><code>#include &lt;octomap/OcTree.h&gt; #include &lt;octomap_msgs/conversions.h&gt; #include &lt;rclcpp/rclcpp.hpp&gt; class OctomapPublisher : public rclcpp::Node { public: OctomapPublisher() : Node(&quot;octomap_publisher&quot;) { this-&gt;declare_parameter&lt;std::string&gt;(&quot;octomap_file&quot;, &quot;/home/ajifoster3/occupancy_map_full.txt&quot;); std::string octomap_file; this-&gt;get_parameter(&quot;octomap_file&quot;, octomap_file); auto tree = std::make_shared&lt;octomap::OcTree&gt;(octomap_file); octomap_msgs::msg::Octomap octomap_msg; octomap_msgs::binaryMapToMsg(*tree, octomap_msg); publisher_ = this-&gt;create_publisher&lt;octomap_msgs::msg::Octomap&gt;(&quot;octomap&quot;, 1); timer_ = this-&gt;create_wall_timer( std::chrono::milliseconds(1000), [this, octomap_msg]() { publisher_-&gt;publish(octomap_msg); }); } private: rclcpp::Publisher&lt;octomap_msgs::msg::Octomap&gt;::SharedPtr publisher_; rclcpp::TimerBase::SharedPtr timer_; }; int main(int argc, char** argv) { rclcpp::init(argc, argv); rclcpp::spin(std::make_shared&lt;OctomapPublisher&gt;()); rclcpp::shutdown(); return 0; } </code></pre> <p>my CMakeLists.txt is the following</p> <pre><code>cmake_minimum_required(VERSION 3.8) project(octomap_publisher) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES &quot;Clang&quot;) add_compile_options(-Wall -Wextra -Wpedantic) endif() find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(octomap_msgs REQUIRED) add_executable(octomap_publisher_node src/octomap_publisher_node.cpp) ament_target_dependencies(octomap_publisher_node rclcpp octomap_msgs) install(TARGETS octomap_publisher_node DESTINATION lib/${PROJECT_NAME} ) if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) ament_lint_auto_find_test_dependencies() endif() 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;octomap_publisher&lt;/name&gt; &lt;version&gt;0.0.0&lt;/version&gt; &lt;description&gt;TODO: Package description&lt;/description&gt; &lt;maintainer email=&quot;ajifoster3@gmail.com&quot;&gt;ajifoster3&lt;/maintainer&gt; &lt;license&gt;TODO: License declaration&lt;/license&gt; &lt;buildtool_depend&gt;ament_cmake&lt;/buildtool_depend&gt; &lt;depend&gt;rclcpp&lt;/depend&gt; &lt;depend&gt;octomap_msgs&lt;/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>
octomap_msgs/conversions.h: No such file or directory
<p>The solution was that I had to install all the dependencies with rosdep. I forgot this step. Thank you @ChristophFroehlich</p> <p>Follow the <a href="https://control.ros.org/master/doc/ros2_control_demos/doc/index.html#build-from-debian-packages" rel="nofollow noreferrer">tutorial</a> on how to build the ros2 control demos:</p>
105669
2023-11-26T14:17:32.240
|ros2|ros-humble|path|ros2-control|
<p>I am trying to launch the first example from the ros2 control demo package: <a href="https://github.com/ros-controls/ros2_control_demos/tree/humble" rel="nofollow noreferrer">https://github.com/ros-controls/ros2_control_demos/tree/humble</a>. I am using ROS2 humble on ubuntu 22.04. First I built every package successfully, then sourced the install/setup.bash and started the launchfile with:</p> <pre><code>ros2 launch ros2_control_demo_example_1 view_robot.launch.py </code></pre> <p>But I received the following Error.</p> <pre><code>[ERROR] [launch]: Caught exception in launch (see debug for traceback): executable '[&lt;launch.substitutions.text_substitution.TextSubstitution object at 0x7f6a81793cd0&gt;]' not found on the PATH </code></pre> <p>I did not change any code from the example. It would be nice if somebody could help me or tell me what the problem is?</p> <p>Here is my Traceback:</p> <pre><code>[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription' [INFO] [launch]: All log files can be found below /home/user/.ros/log/date [INFO] [launch]: Default logging verbosity is set to DEBUG [DEBUG] [launch]: processing event: '&lt;launch.events.include_launch_description.IncludeLaunchDescription object at 0x7f6a8632e3e0&gt;' [DEBUG] [launch]: processing event: '&lt;launch.events.include_launch_description.IncludeLaunchDescription object at 0x7f6a8232e3e0&gt;' ✓ '&lt;launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x7f6a8236d8a0&gt;' Executing &lt;Task finished name='Task-2' coro=&lt;LaunchService._process_one_event() done, defined at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:228&gt; exception=SubstitutionFailure(&quot;executable '[&lt;launch.substitutions.text_substitution.TextSubstitution object at 0x7f6a81793cd0&gt;]' not found on the PATH&quot;) created at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:318&gt; took 0.133 seconds [DEBUG] [launch]: An exception was raised in an async action/event [DEBUG] [launch]: Traceback (most recent call last): File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py&quot;, line 336, in run_async raise completed_tasks_exceptions[0] File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py&quot;, line 230, in _process_one_event await self.__process_event(next_event) File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py&quot;, line 250, in __process_event visit_all_entities_and_collect_futures(entity, self.__context)) File &quot;/opt/ros/humble/lib/python3.10/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/humble/lib/python3.10/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/humble/lib/python3.10/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/humble/lib/python3.10/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/humble/lib/python3.10/site-packages/launch/action.py&quot;, line 108, in visit return self.execute(context) File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch_ros/actions/node.py&quot;, line 490, in execute self._perform_substitutions(context) File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch_ros/actions/node.py&quot;, line 445, in _perform_substitutions evaluated_parameters = evaluate_parameters(context, self.__parameters) File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch_ros/utilities/evaluate_parameters.py&quot;, line 164, in evaluate_parameters output_params.append(evaluate_parameter_dict(context, param)) File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch_ros/utilities/evaluate_parameters.py&quot;, line 72, in evaluate_parameter_dict evaluated_value = perform_substitutions(context, list(value)) File &quot;/opt/ros/humble/lib/python3.10/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/humble/lib/python3.10/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/humble/lib/python3.10/site-packages/launch/launch_context.py&quot;, line 240, in perform_substitution return substitution.perform(self) File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch/substitutions/command.py&quot;, line 94, in perform command_str = perform_substitutions(context, self.command) File &quot;/opt/ros/humble/lib/python3.10/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/humble/lib/python3.10/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/humble/lib/python3.10/site-packages/launch/launch_context.py&quot;, line 240, in perform_substitution return substitution.perform(self) File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch/substitutions/path_join_substitution.py&quot;, line 45, in perform performed_substitutions = [sub.perform(context) for sub in self.__substitutions] File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch/substitutions/path_join_substitution.py&quot;, line 45, in &lt;listcomp&gt; performed_substitutions = [sub.perform(context) for sub in self.__substitutions] File &quot;/opt/ros/humble/lib/python3.10/site-packages/launch/substitutions/find_executable.py&quot;, line 66, in perform raise SubstitutionFailure(&quot;executable '{}' not found on the PATH&quot;.format(self.name)) launch.substitutions.substitution_failure.SubstitutionFailure: executable '[&lt;launch.substitutions.text_substitution.TextSubstitution object at 0x7f6a81793cd0&gt;]' not found on the PATH [ERROR] [launch]: Caught exception in launch (see debug for traceback): executable '[&lt;launch.substitutions.text_substitution.TextSubstitution object at 0x7f6a81793cd0&gt;]' not found on the PATH [DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown' [DEBUG] [launch]: processing event: '&lt;launch.events.shutdown.Shutdown object at 0x7f6a8232e140&gt;' [DEBUG] [launch]: processing event: '&lt;launch.events.shutdown.Shutdown object at 0x7f6a8232e140&gt;' ✓ '&lt;launch.event_handlers.on_shutdown.OnShutdown object at 0x7f6a8171cbb0&gt;' [DEBUG] [launch]: processing event: '&lt;launch.events.shutdown.Shutdown object at 0x7f6a8232e140&gt;' ✓ '&lt;launch.event_handlers.on_shutdown.OnShutdown object at 0x7f6a8232c9a0&gt;' </code></pre>
executable '[<launch.substitutions.text_substitution.TextSubstitution>]' not found on the PATH
<p>As given in this answer <a href="https://robotics.stackexchange.com/questions/102973/rqt-plot-in-ros-2">rqt_plot in ROS 2?</a>, you can use <code>rqt_plot</code> in ROS1 or PlotJuggler <a href="https://plotjuggler.io" rel="nofollow noreferrer">https://plotjuggler.io</a> in ROS2 to plot your vector components. You can also show the TFs in RViz.</p>
105685
2023-11-27T05:02:22.650
|ros2|imu|ros-humble|
<p>I recently added an MPU9250 9dof IMU to my robot and configured <a href="https://github.com/hiwad-aziz/ros2_mpu9250_driver" rel="nofollow noreferrer">ros2_mpu9250_driver</a></p> <p>How can I confirm the IMU and ROS2 node are working correctly, and the orientation output is configured correctly.</p> <p>I see /imu topics:</p> <pre><code>$ ros2 topic echo --once --flow-style /imu header: stamp: sec: 1701139672 nanosec: 166159626 frame_id: base_link orientation: x: -0.00013199338433265485 y: -0.003050688240073104 z: -0.7370080372140175 w: 0.6758770812514282 orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] angular_velocity: x: 0.6774427480915985 y: 3.1466335877862592 z: -1.001618320610687 angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] linear_acceleration: x: 0.28355115234375006 y: 0.042684038085936626 z: 9.88417614990236 linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] --- </code></pre> <p>but how can I visualize the orientation the IMU thinks versus the orientation from the wheel encoders /odom topic?</p> <p>ps. the IMU QoS is set to sensor_data (best effort)</p>
Confirm ROS2 (Humble) IMU node working correctly?
<p>Your robot slides backward because you did not specify damping and friction coefficients of wheel joints. Try this:</p> <pre><code>&lt;joint name=&quot;wheel_joint_<span class="math-container">${name}" type="continuous"&gt; &lt;origin xyz="$</span>{x} <span class="math-container">${y} -0.100250" rpy="1.57 0.0 0.0"/&gt; &lt;parent link="base_link"/&gt; &lt;child link="wheel_link_$</span>{name}&quot;/&gt; &lt;axis xyz=&quot;0.0 0.0 1.0&quot;/&gt; &lt;dynamics damping=&quot;0.7&quot; friction=&quot;0.1&quot; /&gt; &lt;/joint&gt; </code></pre>
105688
2023-11-27T10:41:24.927
|gazebo|urdf|
<p>As the title mentioned, I built a robot using urdf. However when I spawned it into gazebo it start slowly sliding backward. I tried adding friction into the code but it seems to do nothing. Also I've noticed my inertia is slightly tilting forward and the wheel part being square (I've calculated using the <a href="https://en.wikipedia.org/wiki/List_of_moments_of_inertia#List_of_3D_inertia_tensors" rel="nofollow noreferrer">formula</a>). Maybe that's the reason it's sliding? Down below is my urdf file and inertia showed in gazebo. <a href="https://i.stack.imgur.com/M8YnN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M8YnN.png" alt="gazebo inertia" /></a> forklift.urdf.xacro:</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;robot xmlns:xacro=&quot;http://www.ros.org/wiki/xacro&quot; name=&quot;forklift&quot;&gt; &lt;link name=&quot;base_footprint&quot;/&gt; &lt;link name=&quot;base_link&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.0 0.0 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;mass value=&quot;50.0&quot;/&gt; &lt;!-- &lt;inertia ixx=&quot;0.05&quot; ixy=&quot;0.05&quot; ixz=&quot;0.05&quot; iyy=&quot;1.3419385416666667&quot; iyz=&quot;1.3419385416666667&quot; izz=&quot;2.296875&quot;/&gt; --&gt; &lt;inertia ixx=&quot;1.3419385416666667&quot; iyy=&quot;1.3419385416666667&quot; izz=&quot;2.296875&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyz=&quot;0.0&quot;/&gt; &lt;/inertial&gt; &lt;visual name=&quot;&quot;&gt; &lt;origin xyz=&quot;0.0 0.0 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;geometry&gt; &lt;box size=&quot;0.525 0.525 0.2155&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;blue&quot;&gt; &lt;color rgba=&quot;0.0 0.0 1.0 1.0&quot;/&gt; &lt;texture filename=&quot;&quot;/&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0.0 0.0 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;geometry&gt; &lt;box size=&quot;0.525 0.525 0.2155&quot;/&gt; &lt;/geometry&gt; &lt;!-- &lt;surface&gt; &lt;friction&gt; &lt;ode&gt; &lt;mu&gt;100&lt;/mu&gt; &lt;mu2&gt;100&lt;/mu2&gt; &lt;/ode&gt; &lt;/friction&gt; &lt;/surface&gt; --&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference=&quot;base_link&quot;&gt; &lt;material&gt;Gazebo/Blue&lt;/material&gt; &lt;/gazebo&gt; &lt;joint name=&quot;base_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;0.0 0.0 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;parent link=&quot;base_footprint&quot;/&gt; &lt;child link=&quot;base_link&quot;/&gt; &lt;/joint&gt; &lt;!-- *** wheels *** --&gt; &lt;xacro:macro name=&quot;wheel&quot; params=&quot;name x y&quot;&gt; &lt;link name=&quot;wheel_link_<span class="math-container">${name}"&gt; &lt;inertial&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;mass value="1.0"/&gt; &lt;!-- &lt;inertia ixx="0.05" ixy="0.05" ixz="0.05" iyy="0.0009333333333333333" iyz="0.0009333333333333333" izz="0.0018"/&gt; --&gt; &lt;inertia ixx="0.0009333333333333333" iyy="0.0009333333333333333" izz="0.0018" ixy="0.0" ixz="0.0" iyz="0.0"/&gt; &lt;/inertial&gt; &lt;visual name=""&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;geometry&gt; &lt;cylinder radius="0.06" length="0.02"/&gt; &lt;/geometry&gt; &lt;material name="black"&gt; &lt;color rgba="0.0 0.0 0.0 1.0"/&gt; &lt;texture filename=""/&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;geometry&gt; &lt;cylinder radius="0.06" length="0.02"/&gt; &lt;/geometry&gt; &lt;!-- &lt;surface&gt; &lt;friction&gt; &lt;ode&gt; &lt;mu&gt;100&lt;/mu&gt; &lt;mu2&gt;100&lt;/mu2&gt; &lt;/ode&gt; &lt;/friction&gt; &lt;/surface&gt; --&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference="wheel_link_$</span>{name}&quot;&gt; &lt;material&gt;Gazebo/Black&lt;/material&gt; &lt;/gazebo&gt; &lt;joint name=&quot;wheel_joint_<span class="math-container">${name}" type="continuous"&gt; &lt;origin xyz="$</span>{x} <span class="math-container">${y} -0.100250" rpy="1.57 0.0 0.0"/&gt; &lt;parent link="base_link"/&gt; &lt;child link="wheel_link_$</span>{name}&quot;/&gt; &lt;axis xyz=&quot;0.0 0.0 1.0&quot;/&gt; &lt;/joint&gt; &lt;/xacro:macro&gt; &lt;!-- *** fork base *** --&gt; &lt;xacro:macro name=&quot;fork_base&quot; params=&quot;name y&quot;&gt; &lt;link name=&quot;forkbase_link_<span class="math-container">${name}"&gt; &lt;inertial&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;mass value="0.5"/&gt; &lt;!-- &lt;inertia ixx="0.05" ixy="0.05" ixz="0.05" iyy="0.0005208333333333334" iyz="0.0004208333333333334" izz="0.00010833333333333334"/&gt; --&gt; &lt;inertia ixx="0.0005208333333333334" iyy="0.0004208333333333334" izz="0.00010833333333333334" ixy="0.0" ixz="0.0" iyz="0.0"/&gt; &lt;/inertial&gt; &lt;visual name=""&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;geometry&gt; &lt;box size="0.01 0.05 0.1"/&gt; &lt;/geometry&gt; &lt;material name="green"&gt; &lt;color rgba="0.0 1.0 0.0 1.0"/&gt; &lt;texture filename=""/&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;geometry&gt; &lt;box size="0.01 0.05 0.1"/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference="forkbase_link_$</span>{name}&quot;&gt; &lt;material&gt;Gazebo/Green&lt;/material&gt; &lt;/gazebo&gt; &lt;joint name=&quot;forkbase_link_<span class="math-container">${name}" type="fixed"&gt; &lt;origin xyz="0.2675 $</span>{y} -0.10025&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;forkbase_link_${name}&quot;/&gt; &lt;/joint&gt; &lt;/xacro:macro&gt; &lt;!-- *** fork *** --&gt; &lt;xacro:macro name=&quot;fork_link&quot; params=&quot;name&quot;&gt; &lt;link name=&quot;fork_link_<span class="math-container">${name}"&gt; &lt;inertial&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;mass value="0.5"/&gt; &lt;!-- &lt;inertia ixx="0.05" ixy="0.05" ixz="0.05" iyy="0.00010833333333333334" iyz="0.0026083333333333336" izz="0.0027083333333333334"/&gt; --&gt; &lt;inertia ixx="0.00010833333333333334" iyy="0.0026083333333333336" izz="0.0027083333333333334" ixy="0.0" ixz="0.0" iyz="0.0"/&gt; &lt;/inertial&gt; &lt;visual name=""&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;geometry&gt; &lt;box size="0.25 0.05 0.01"/&gt; &lt;/geometry&gt; &lt;material name="green"&gt; &lt;color rgba="0.0 1.0 0.0 1.0"/&gt; &lt;texture filename=""/&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;geometry&gt; &lt;box size="0.25 0.05 0.01"/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference="fork_link_$</span>{name}&quot;&gt; &lt;material&gt;Gazebo/Green&lt;/material&gt; &lt;/gazebo&gt; &lt;joint name=&quot;fork_link_<span class="math-container">${name}" type="fixed"&gt; &lt;origin xyz="0.13 0 -0.045" rpy="0.0 0.0 0.0"/&gt; &lt;parent link="forkbase_link_$</span>{name}&quot;/&gt; &lt;child link=&quot;fork_link_${name}&quot;/&gt; &lt;/joint&gt; &lt;/xacro:macro&gt; &lt;!-- *** combine component *** --&gt; &lt;!-- &lt;xacro:wheel name=&quot;back_right&quot; x=&quot;-0.150000&quot; y =&quot;-0.272513&quot;/&gt; &lt;xacro:wheel name=&quot;back_left&quot; x=&quot;-0.150000&quot; y =&quot;0.272513&quot;/&gt; &lt;xacro:wheel name=&quot;front_right&quot; x=&quot;0.150000&quot; y =&quot;-0.272513&quot;/&gt; &lt;xacro:wheel name=&quot;front_left&quot; x=&quot;0.150000&quot; y =&quot;0.272513&quot;/&gt; --&gt; &lt;xacro:wheel name=&quot;back_right&quot; x=&quot;-0.150000&quot; y =&quot;-0.272513&quot;/&gt; &lt;xacro:wheel name=&quot;back_left&quot; x=&quot;-0.150000&quot; y =&quot;0.272513&quot;/&gt; &lt;xacro:wheel name=&quot;front_right&quot; x=&quot;0.150000&quot; y =&quot;-0.272513&quot;/&gt; &lt;xacro:wheel name=&quot;front_left&quot; x=&quot;0.150000&quot; y =&quot;0.272513&quot;/&gt; &lt;xacro:fork_base name=&quot;right&quot; y =&quot;-0.055&quot;/&gt; &lt;xacro:fork_base name=&quot;left&quot; y =&quot;0.055&quot;/&gt; &lt;xacro:fork_link name=&quot;right&quot;/&gt; &lt;xacro:fork_link name=&quot;left&quot;/&gt; &lt;/robot&gt; </code></pre>
Robot sliding in idle state when spawning in gazebo
<p>This is not possible. Only fully defined message types can be published, as the ROS middleware requires each topic to have a fixed message type. Once a type is established for a topic, attempts to use a different type will fail (something like <code>Could not process inbound connection: topic types do not match</code>). You have 2 options:</p> <ol> <li><p>Use a fully defined message type if possible.</p> </li> <li><p>If your data is truly dynamic, i.e. if the data schema is not fixed, then you can do something like using <code>std_msgs/String</code> with the <code>data</code> field being arbitrary JSON data. You would have to convert your message into JSON first though.</p> </li> </ol> <pre class="lang-py prettyprint-override"><code>import rospy from rospy_message_converter import json_message_converter from std_msgs.msg import String pub = rospy.Publisher( 'jason_topic', String, queue_size=10 ) pub.publish( data=json_message_converter.convert_ros_message_to_json(msg) ) </code></pre> <p>I would strongly recommend option (1) because most ROS tooling cannot handle things like option (2). I would only use option (2) if you're sending arbitrary unstructured blobs over messages.</p>
105691
2023-11-27T16:42:42.937
|ros|python|python3|
<p>I am trying to publish a rospy.msg.AnyMsg by doing the following:</p> <pre><code>import rospy . . . publisher = rospy.Publisher('jason_topic', rospy.msg.AnyMsg, queue_size=10) publisher.publish(ros_message) </code></pre> <p>I get the following stack trace:</p> <pre><code>Traceback (most recent call last): File &quot;subscriber_any.py&quot;, line 26, in &lt;module&gt; publisher.publish(ros_message) File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py&quot;, line 879, in publish data = args_kwds_to_message(self.data_class, args, kwds) File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/msg.py&quot;, line 118, in args_kwds_to_message if len(data_class._slot_types) == 0: AttributeError: type object 'AnyMsg' has no attribute '_slot_types' </code></pre> <p>I did a <code>print(dir(rospy.msg.AnyMsg()))</code> and verified that there was no attribute _slot_types. Is what I am trying to do possible and if so how?</p>
Is there a way to publish a ROS AnyMsg in Python?
<p>I solved this problem by uninstalling &quot;Python 3.12, 64-bit version&quot; which had been installed on my system because I found the CMake error refers to a Python 3.12 on my system and I didn't know why it should have existed on my system (During ROS2 installation I had installed python 3.8, not 3.12). So, I called the following command in the command prompt, and I was assured an extra Python version was installed on my system:</p> <pre><code>&gt; py -0 </code></pre> <p>which returned:</p> <pre><code>Installed Pythons found by py Launcher for Windows -3.8-64 * -3.12-64 </code></pre> <p>I decided to uninstall version 3.12 so that ROS2 just uses Python 3.8. Fortunately, it fixed my issue.</p>
105698
2023-11-27T23:07:05.830
|ros|ros2|ros-humble|colcon|windows|
<p>I am using ROS2 humble on Windows 10 and it is installed successfully. Now I am going through this tutorial for creating a workspace: <a href="https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html</a></p> <p>But while I am using the “colcon build --merge install” command I face the following error message:</p> <pre><code>Failed &lt;&lt;&lt; turtlesim [9.41s, exited with code 1] Summary: 0 packages finished [9.75s] 1 package failed: turtlesim 1 package had stderr output: turtlesim WNDPROC return value cannot be converted to LRESULT TypeError: WPARAM is simple, so must be an int object (got NoneType) </code></pre> <p>You can see the full error message here:</p> <p><a href="https://i.stack.imgur.com/V802p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V802p.png" alt="enter image description here" /></a></p> <p>however, it creates the “build, install and log folder” on my workspace, and also “ros2 run turtlesim turtlesim_node” opens the turtlesim.</p> <p>It seems that the turtlesim package comes pre-built along with the ros2 installation and it is not calling the turtlesim package on my ros2_ws at all. So, when I modify the overlay like this:</p> <p><a href="https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html#modify-the-overlay" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html#modify-the-overlay</a></p> <p>Nothing has happened; this is about 1 week I am stuck in this step, could anyone help me in this regard? I should mention that I installed “em”, “empty” and none of them fixed the problem.</p>
Colcon build error : 0 packages finished
<p>You create a dockerfile to build your own docker image starting from the ROS 2 Humble container. Such a dockerfile could look something like this:</p> <pre><code>from osrf/ros:humble-desktop # Install Nav2 packages RUN apt-get update &amp;&amp; apt-get install -y \ ros-<span class="math-container">$ROS_DISTRO-navigation2 \ ros-$</span>ROS_DISTRO-nav2-bringup \ ros-<span class="math-container">$ROS_DISTRO-robot-localization \ ros-$</span>ROS_DISTRO-slam-toolbox </code></pre> <p>Build the container using the <code>docker build</code> command, though you'll need to look up all the extra options you may want.</p>
105726
2023-11-29T03:04:23.307
|navigation|ros-humble|raspberry-pi|docker|cv-bridge|
<p>I have a working ROS 2 Humble robot (Raspberry Pi4 based GoPiGo3 robot running Ubuntu 22.04) that runs nav2 async mapping, localization, and navigation at close to 100% load.</p> <p>I just acquired a Raspberry Pi5 and the robot power supply cannot support swapping the Pi5 in for the Pi4, so I would like to try offloading nav2 nodes to the Pi5 running Humble in Docker.</p> <p>I followed the ROS 2 Docker setup guide, but the ROS 2 Humble Desktop Docker container does not appear to have tf-transformations or Nav2 in the container.</p> <p>Eventually, I will need the ros-perception/vision_opencv cv_bridge package also.</p> <p>How can I create a ROS 2 Humble environment with all the packages I need installed?</p>
Got Pi5 w PiOS Bookworm, Want ROS 2 Humble Desktop Docker with Nav2 and more
<p>This question is not specific enough to get accurate answers.</p> <p>Wifi has no guaranteed latency, e.g. <a href="https://www.quora.com/What-is-the-average-latency-of-a-WiFi-network" rel="nofollow noreferrer">this post</a> mentions as a typical wifi latency a 50 percentile less than 4,5 ms, but worst case up to 1 second. It depends on your application whether that is acceptable or not.</p> <p>There exist solutions for deterministic wireless communication, e.g. <a href="https://www.drivesweb.com/people-and-markets/wireless-into-the-world-of-servo-motors" rel="nofollow noreferrer">IO-Link wireless solution offers low latency of 5ms and synchronization rates of 10 microseconds</a>, for up to <a href="https://www.google.com/url?sa=t&amp;source=web&amp;rct=j&amp;opi=89978449&amp;url=https://io-link.com/share/Downloads/At-a-glance/IO-Link_Wireless_Expos%25C3%25A9_eng_2018.pdf&amp;ved=2ahUKEwiO3ZTsleqCAxU73QIHHVUICUgQFnoECA0QBg&amp;usg=AOvVaw0p4iKeeev92s9RL7g3YEit" rel="nofollow noreferrer">40 nodes (sensors or actuators)</a>. But this obviously comes at a higher cost than a wifi router.</p>
105727
2023-11-29T03:38:12.170
|wifi|bluetooth|servo|
<p>My goal is to have a servo that can be controlled by a mouse &quot;instantaneously&quot;, aka as fast as a racing video game cursor or limited by the speed of the servo itself.</p> <p>So far, I have tried Bluetooth Low Energe (BLE), and I can get about 150ms &quot;in practice&quot; because I can't set the connection interval with the library I am using (&quot;<a href="https://inthehand.com/category/bluetooth/" rel="nofollow noreferrer">In the Hand BLE</a>&quot; for .NET). However the theoretical limit seems to be 7.5ms (according to <a href="https://docs.silabs.com/bluetooth/4.0/general/system-and-performance/throughput-with-bluetooth-low-energy-technology#connection-interval" rel="nofollow noreferrer">this article</a>).</p> <p>With that said my questions are these:</p> <ol> <li>Is the theoretical 7.5ms speed for BLE &quot;realistic&quot; or am I better off using legacy Bluetooth or Wifi?</li> <li>If neither, is there something else I should be using for quickly sending wireless signals to the microcontroller controlling the servo? I.e. is this &quot;solved&quot; with some standard solution? I am using a <a href="https://developer.wildernesslabs.co/Meadow/Meadow_Basics/Hardware/F7v2/" rel="nofollow noreferrer">Meadow F7</a> to receive the signal and a .NET core app to send it, but I can easily switch to Arduino / Pi / Python / whatever.</li> </ol>
Best Protocol for Wireless "Instantaneous" Servo Control?
<p>Per the <a href="https://iroboteducation.github.io/create3_docs/setup/network-config/" rel="nofollow noreferrer">Network Reccommendations</a>, Bridged Network is required:</p> <blockquote> <p>While many virtualization applications default to a &quot;shared&quot; or &quot;NAT&quot; network connection, this type of connection will not allow ROS 2 to communicate with the Create® 3 robot. Instead, a bridged network connection should be used for the virtual machine.</p> </blockquote> <p>Creating a multipass instance with <code>--bridged</code> fixes:</p> <pre><code>multipass launch --name=create3-bridged --bridged --cpus=2 --disk=20GiB </code></pre> <p>VM Infor <code>multipass info create3-bridged</code>:</p> <pre><code>Name: create3-bridged State: Running IPv4: 10.211.67.5 192.168.0.153 Release: Ubuntu 22.04.3 LTS Image hash: 054db2d88c45 (Ubuntu 22.04 LTS) CPU(s): 2 Load: 1.38 0.90 0.47 Disk usage: 2.5GiB out of 19.3GiB Memory usage: 204.5MiB out of 951.1MiB </code></pre> <p>Notice previously, the IP was <code>172.17.0.1</code> but now is <code>192.168.0.153</code> which matches my home network.</p> <p><code>ros2 topic list</code> now produces:</p> <pre><code>/battery_state /cliff_intensity /cmd_audio /cmd_lightring /cmd_vel /dock /hazard_detection /imu /interface_buttons /ir_intensity /ir_opcode /kidnap_status /mobility_monitor/transition_event /mouse /odom /parameter_events /robot_state/transition_event /rosout /slip_status /static_transform/transition_event /stop_status /tf /tf_static /wheel_status /wheel_ticks /wheel_vels </code></pre>
105732
2023-11-29T08:47:42.127
|ros-humble|macos|create3|irobot|multipass|
<p>I have a Mac OS <code>14.1</code> and I'm seting up irobot Create3 for the first time. I've confirmed the robot works using the <a href="https://edu.irobot.com/learning-library/create-3-web-playground-for-python" rel="nofollow noreferrer">python web playground</a>.</p> <p>I've installed Multipass <code>1.12.2+mac</code> and created an Ubuntu 22.04 instance and installed ROS2 per <a href="https://iroboteducation.github.io/create3_docs/setup/ubuntu2204/" rel="nofollow noreferrer">the robot humble setup guide</a>. I created the multipass instance with this command:</p> <pre><code>multipass launch --name=create3 --cpus=2 --disk=20GiB </code></pre> <p>When listing the topics, I don't see any of the expected irobot topics</p> <pre><code>ros2 topic list </code></pre> <p>Actual:</p> <pre><code>/parameter_events /rosout </code></pre> <p>Expected:</p> <pre><code>/battery_state /cliff_intensity /cmd_audio ... </code></pre> <p>The VM info <code>multipass info create3</code>:</p> <pre><code>Name: create3 State: Running IPv4: 10.211.67.3 172.17.0.1 Release: Ubuntu 22.04.3 LTS Image hash: 054db2d88c45 (Ubuntu 22.04 LTS) CPU(s): 2 Load: 0.00 0.14 0.12 Disk usage: 8.8GiB out of 19.3GiB Memory usage: 248.8MiB out of 3.8GiB Mounts: -- </code></pre>
irobot create3 topics not found after setup in macos multipass vm
<p>To do this with your existing functions you can modify the position function to take a yaw value. quaternion_from_euler(ai, aj, ak, axes='sxyz') takes a yaw value in radians for the ak parameter. You can find this in the <a href="http://docs.ros.org/en/jade/api/tf/html/python/transformations.html" rel="nofollow noreferrer">tf.transformations docs</a>.</p> <pre class="lang-py prettyprint-override"><code>def position(self,x,y,z,yaw): pub_posisi = rospy.Publisher(&quot;/mavros/setpoint_position/local&quot;,PoseStamped,queue_size=10) posisi = PoseStamped() posisi.pose.position.x = x posisi.pose.position.y = y posisi.pose.position.z = z q = quaternion_from_euler(0.0,0.0,yaw) posisi.pose.orientation.x = q[0] posisi.pose.orientation.y = q[1] posisi.pose.orientation.z = q[2] posisi.pose.orientation.w = q[3] pub_posisi.publish(posisi) rospy.loginfo(f&quot;go to point {x,y,z} with yaw {yaw}&quot;) time.sleep(15) </code></pre> <p>Hope this helps! :)</p>
105740
2023-11-29T12:52:56.717
|ros-noetic|rotation|yaw|
<p>Arming and takeoff work fine but i don't know how to do yaw rotation:</p> <pre class="lang-py prettyprint-override"><code>class controller: def __init__(self): rospy.Subscriber('mavros/state', State, self.state_cb) self.state = State() def state_cb(self, msg): self.state = msg def move(self,x,y,z): pub_posisi = rospy.Publisher(&quot;/mavros/setpoint_velocity/cmd_vel&quot;,TwistStamped,queue_size=1) pub_data = TwistStamped() pub_data.twist.linear.x = x pub_data.twist.linear.y = y pub_data.twist.linear.z = z pub_posisi.publish(pub_data) time.sleep(5) def position(self,x,y,z): pub_posisi = rospy.Publisher(&quot;/mavros/setpoint_position/local&quot;,PoseStamped,queue_size=10) posisi = PoseStamped() posisi.pose.position.x = x posisi.pose.position.y = y posisi.pose.position.z = z q = quaternion_from_euler(0.0,0.0,3.0) posisi.pose.orientation.x = q[0] posisi.pose.orientation.y = q[1] posisi.pose.orientation.z = q[2] posisi.pose.orientation.w = q[3] pub_posisi.publish(posisi) rospy.loginfo(f&quot;go to point {x,y,z}&quot;) time.sleep(15) </code></pre>
Simple takeoff then do yaw rotation
<p>Put the <code>wiringPiSetup()</code> inside <code>main</code> and before spinning the node (<code>rclcpp::spin(node)</code>). It should look like this.</p> <pre><code>int main(int argc, char** argv) { rclcpp::init(argc, argv); wiringPiSetupGpio(); if (wiringPiSetupGpio() == -1) { return -1; } auto node = std::make_shared&lt;MyNode&gt;(); RCLCPP_INFO(node-&gt;get_logger(), &quot;Starting node&quot;); rclcpp::spin(node); rclcpp::shutdown(); return 0; } </code></pre> <p>Although putting <code>wiringPiSetup()</code> in the constructor doesn't throw any errors, it looks like you want the initialization to be separate from the rest of the ROS Node. I have no references for this solution.</p>
105747
2023-11-29T17:01:40.803
|ros2|c++|ros-humble|raspberry-pi|
<p>What I've tried and works to know the WiringPi library is working on my Raspberry Pi 4.</p> <ul> <li><code>g++</code> compiling a test <code>cpp</code> script using <code>WiringPi</code>.</li> <li>Terminal <code>gpio</code> commands (<code>gpio -g mode 18 output</code> sets pin 18 to be an output)</li> <li>Physically wiring an output to an input. Writing to the output changed the input correctly</li> <li>All results of changing <code>pinMode</code> and <code>digialWrite</code> were correct on the <code>gpio readall</code></li> </ul> <p>Properly linking the external WiringPi library into my ROS 2 package, <code>wiringPi.h</code> file in my <code>cpp</code> node, and using the same code as the test <code>cpp</code> script, it doesn't work. Is there something special I need to account for? Is there a ROS 2 background thread preventing WiringPi from functioning?</p> <h3>Code</h3> <pre><code> class MyNode : public rclcpp::Node { public: MyNode() : Node(&quot;my-node&quot;) { wiringPiSetupGpio(); if (wiringPiSetupGpio() == -1) { throw std::runtime_error(&quot;Failed to initialize WiringPiSetup&quot;); } pinMode(18, OUTPUT); pinMode(17, INPUT); // Jumper wire connecting pin 18 to 17 digitalWrite(18, HIGH); RCLCPP_INFO(get_logger(), &quot;%d&quot;, digitalRead(17); } } int main(int argc, char **argv) { rclcpp::init(argc, argv); try { auto node = std::make_shared&lt;MyNode&gt;(); RCLCPP_INFO(node-&gt;get_logger(), &quot;Starting node&quot;); rclcpp::spin(node); } catch (const std::exception &amp;ex) { RCLCPP_ERROR_STREAM(rclcpp::get_logger(&quot;main&quot;), &quot;Exception during node initialization: &quot; &lt;&lt; ex.what()); } rclcpp::shutdown(); return 0; } </code></pre> <p>18 does not change to OUTPUT nor is it set to HIGH. 17 is by default an INPUT.</p> <h3>Reference</h3> <ul> <li>GPIO terminal comamnds I was testing: <a href="https://learn.sparkfun.com/tutorials/raspberry-gpio/c-wiringpi-setup" rel="nofollow noreferrer">https://learn.sparkfun.com/tutorials/raspberry-gpio/c-wiringpi-setup</a></li> <li>Example I used in my <code>cpp</code> file: <a href="https://learn.sparkfun.com/tutorials/raspberry-gpio/c-wiringpi-example" rel="nofollow noreferrer">https://learn.sparkfun.com/tutorials/raspberry-gpio/c-wiringpi-example</a></li> </ul>
Who has gotten WiringPi working in a ROS 2 C++ node? Want to control GPIO on Raspberry Pi 4 running Ubuntu 22
<p>For anyone who wants the same thing as me I ended up using <a href="https://github.com/MoffKalast/vizanti" rel="nofollow noreferrer">https://github.com/MoffKalast/vizanti</a> and it works like a charm!</p>
105770
2023-11-30T12:50:08.170
|ros2|rviz|ros-humble|rosbridge|webots|
<p>Im on ROS2-Humble and i want to see my robot's location and movement on the map, the way i see it on Rviz, on my browser. <a href="https://i.stack.imgur.com/Ps2i6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ps2i6.png" alt="enter image description here" /></a> Like the picture above, I want from Rviz to get the Grid, RobotModel, TF, and Map, send it on my browser and show it there, kinda like streaming it or rendering it via a .js file and .html. Im new with ROS2 and i cant seem to find any sources to help me. Most of the things i find are for ROS1 and Chat GPT doesnt help at all. Basically something like this: <a href="https://answers.ros.org/question/319626/real-time-map-generate-on-web-like-a-rviz/" rel="nofollow noreferrer">https://answers.ros.org/question/319626/real-time-map-generate-on-web-like-a-rviz/</a></p> <p>Any tips/help would be greatly appreciated, thanks in advance!</p>
How can i show on my browser what i see on Rviz?
<p>Humble can be a better choice as it has LTS, there will be more stable package releases and more support on he core. Also you can discuss this type of topics at <a href="https://discourse.ros.org/" rel="nofollow noreferrer">discourse.ros.org</a></p>
105772
2023-11-30T13:31:01.710
|ros2|ros-humble|rosdistro|ros-iron|
<p>I have some experience on ROS and now planning to switch to ROS2.</p> <p>Just installed a fresh Ubuntu 22.04. Which ROS2 distro should I use? <strong>Iron or Humble?</strong></p> <p>I am assuming Humble has more stable packages and options for a newcomer. But, if the Humble packages work on Iron too, that might change things.</p> <p>On the other hand, Iron's EOL is pretty close (2024) compared to Humble's (2027). Would appreciate some help.</p>
Which ROS2 Distro? Iron or Humble?
<p>You can use <code>AnyMsg</code> to subscribe to the topic, then use this to acquire information about the topic which can be used to construct a publisher and a new message which can be published. For an example, see below.</p> <pre><code>import rospy import genpy from rospy.msg import AnyMsg rospy.init_node(&quot;test_node&quot;) publisher = None msg_class = None # callback that we'll use to setup the publisher once we've gotten a message def setup_publisher(msg): global msg_class global publisher topic_type = msg._connection_header[&quot;type&quot;] msg_class = genpy.message.get_message_class(topic_type) publisher = rospy.Publisher(&quot;test_topic&quot;, msg_class, queue_size=10) # subscribe and wait for a message to come in check_rate = rospy.Rate(10) sub = rospy.Subscriber(&quot;test_topic&quot;, AnyMsg, setup_publisher) while publisher is None and not rospy.is_shutdown(): check_rate.sleep() sub.unregister() # all done with the subscriber now assert publisher is not None while not rospy.is_shutdown(): # now that we have a valid publisher we can create a new message. # we could use genpy like in the callback, or we can just use the # publisher: new_msg = publisher.data_class() # even if we don't know what type it is beforehand, # we can find out what information can be populated # thanks to the 'slots' attribute provided by messages if &quot;data&quot; in new_msg.__slots__: if type(new_msg.data) == int: new_msg.data = 42 elif type(new_msg.data) == str: new_msg.data = &quot;Hello World!&quot; elif type(new_msg.data) == float: new_msg.data = 3.14159 # we can also make use of the setattr/gettattr # functions in a slightly more traditionally-python way for slot in dir(new_msg): if slot.startswith(&quot;_&quot;): # ignore private attributes continue if type(getattr(new_msg, slot)) == int: # set any integer to 42 setattr(new_msg, slot, 42) # now we can publish the message publisher.publish(new_msg) </code></pre> <p>But, notice that we need to do some introspection on the message to find/set fields if we don't know them beforehand, and this can be a bit messy. For that reason, whenever you can, it's recommended to just use the message.</p>
105784
2023-11-30T19:16:20.040
|ros|python|python3|
<p>I am trying to publish a ROS message in Python but I do not know the message type. I tried using AnyMsg and it did not work. If this is possible would someone be able to provide a Python code snippet?</p>
How do you publish on a ROS topic when the message type is not known?
<p>I think your idea to send the map to openCV sounds reasonable. Of course the mapping algo won't see a square against the wall. It will see the wall with square shapes areas sticking out and will see that only after you've steered the robot around the sqaure so it can get line-of-site on all three exposed sides.</p> <p>With gmapping running, the developing map is updated/published once or twice a minute and you could use that published data.</p> <p>The code below works on ros-kinetic (ubuntu 16) to receive the /map topic, convert to an appropriate 8bit unsigned with pixel values manipulated so colors match default RVIZ colors, and show the image via cv2.imshow. Because I did not test this code with gmapping running I did not confirm that openCV is in a good state to allow another entry into openCV on the next map update. As a test case though to show how to get the map into openCV, this should be enough.</p> <pre><code>#!/usr/bin/python import rospy from nav_msgs.msg import OccupancyGrid import cv2 import numpy as np def map_callback(msg): # Assuming msg.data contains the occupancy grid values occupancy_data = np.array(msg.data, dtype=np.uint8) # change pixel values so the image looks similar to default rviz colors occupancy_data[occupancy_data == 255] = 128 occupancy_data[occupancy_data == 0] = 255 occupancy_data[occupancy_data == 100] = 0 occupancy_image = np.reshape(occupancy_data, (msg.info.height, msg.info.width)) # in my case, crop since the image is 4000 x 4000 but full map fits in 500 x 500. cropped = occupancy_image[1750:2250, 1750:2250] #flip image to get coordiantes straight flipped = cv2.flip(cropped,0) cv2.imshow(&quot;Occupancy Grid Image&quot;, flipped) cv2.waitKey(0) print (&quot;Done with map as image&quot;) rospy.init_node('map_image_converter') rospy.Subscriber('/map', OccupancyGrid, map_callback) rospy.spin() </code></pre> <p>Full disclosure: This code was started by Chat-GPT. I had to debug it to get it working.</p> <p>I saw online there may also be solutions on github but did not investigate. <a href="https://i.stack.imgur.com/ebBnr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ebBnr.png" alt="enter image description here" /></a></p>
105792
2023-12-01T06:47:38.390
|ros-noetic|
<p>Can objects be recognized on the map during SLAM?</p> <p>The method I came up with is to recognize the created map using methods such as template matching using opencv.</p> <p>I'm curious whether real-time map data is passed to opencv for processing or if there is another way.</p> <p><a href="https://i.stack.imgur.com/pH6Je.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pH6Je.png" alt="enter image description here" /></a> In this type of map</p> <p><a href="https://i.stack.imgur.com/mEF1u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mEF1u.png" alt="enter image description here" /></a></p> <p>I want to find objects with these same patterns. (same size and shape)</p>
Object recognition during slam
<p>Typically messages contain a timestamp and a reference frame. If one needs an array of data, that array is typically created inside the custom message. If one is looking to use a custom message type for multiple sensors or actuators, the ROS convention is to publish each sensor or actuator separately rather than aggregating them into a single publisher.</p> <p>There examples of building messages consisting of other message types in the <code>geometry_msgs</code> library: <a href="https://docs.ros.org/en/noetic/api/geometry_msgs/html/index-msg.html" rel="nofollow noreferrer">https://docs.ros.org/en/noetic/api/geometry_msgs/html/index-msg.html</a>. In particular &quot;Polygon&quot;, &quot;PolygonStamped&quot;, and &quot;PoseWithCovariance&quot; might be good examples.</p>
105796
2023-12-01T13:46:44.937
|ros2|
<p>Let's say I created a custom message in ROS2. How would I create a second meta message consisting of an array of those messages?</p> <p>The documentation tutorial is very poor on creating anything but trivial messages.</p>
Create message which is array of submessages?
<blockquote> <p>The problem is the servo rotation angle and the link or frame angle for forward and inverse kinematics seems to be apart in my project.</p> </blockquote> <p>This is normal. You need a kinematic description (usually called <em>robot_description</em>) which describes the physical characteristics of your robot arm (e.g. link lengths and the 3d-orientation of the 'zero-position' of each joint.)</p> <p>The Forward Kinematics (FK) can then use this description, plus the current-joint-angle values, to calculate the current Transform Frame (TF) of a link.</p>
105809
2023-12-02T13:28:44.540
|robotic-arm|robot|industrial-robot|
<p>I have been programming for a 6DOF robot arm with forward and inverse kinematics functionality. The problem I am facing in my head is to how to correctly set different servo motor values to specific link angles. These are basically 6 MG996R servo motors which i have soldered from the pots inside to read the value to calculate the internal servo angles returned so far. The problem is, should I just set the servo angles in such a way to obtain a default robot positioning and then calculate the boundaries each motor may face for forward or inverse kinematics. I had Industrial robotics lessons back in my bachelors program but for the first time I am building something by myself.</p> <p>in terms of the angles, I read values from the terminal with UART communication and move the specific servos with the given angle. The problem is the servo rotation angle and the link or frame angle for forward and inverse kinematics seems to be apart in my project. For example the default starting orientation for my base frame is 90 degrees counter clockwise rotation from the default positioning. Should I just set the angles and the robots specific starting apart or should i do something more generic ?</p>
Mapping servo motor angles to 3d link angles
<p>I run ROS 2 Humble on a Pi4 2GB and do not have to limit build processes by having a swap file setup:</p> <p>Added to end of cmdline.txt:</p> <pre><code> zswap.enabled=1 zswap.compressor=lz4 zswap.zpool=z3fold </code></pre> <p>reboot then create_1GB_Swap.sh:</p> <pre><code>#!/bin/bash echo -e &quot;\n*** Creating 1GB Swapfile&quot; sudo swapoff /swapfile sudo fallocate -l 1G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile if ! grep -q '/swapfile' /etc/fstab; then sudo su -c &quot;echo '/swapfile swap swap defaults 0 0' &gt;&gt; /etc/fstab&quot; fi echo &quot;*** 1GB swapfile created&quot; free -h echo &quot;Does it show Swap now?&quot; <span class="math-container">```</span> </code></pre>
105813
2023-12-02T20:19:42.827
|cmake|raspberrypi|colcon|
<p>I am a newbie at ROS, so there is a lot of things to learn. I successfully installed Ubuntu Server 22.04 and ROS2 Humble on my Raspberry Pi 4B (2GB). When trying to build the examples with colcon, the system after some time gets extremely slow having almost no reaction anymore.</p> <p>I found out, that the root cause is not enough memory when 4 compiler runs are executed in parallel. I tried to enforce only one compiler instance by</p> <blockquote> <p>export CMAKE_BUILD_PARALLEL_LEVEL=1</p> </blockquote> <p>but this did not help. There is still 4 compiler instances running at the same time.</p> <p>Can anyone explain me how to block parallel compiler runs?</p> <p>Current status still does not work:</p> <pre><code>colcon build --symlink-install --executor sequential --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_PARALLEL_LEVEL=1 --cmake-force-configure --cmake-clean-first --packages-select composition --parallel-workers 1 Starting &gt;&gt;&gt; composition -- Found ament_cmake: 1.3.6 (/opt/ros/humble/share/ament_cmake/cmake) -- Override CMake install command with custom implementation using symlinks instead of copying resources -- Found example_interfaces: 0.9.3 (/home/ubuntu/ros2/install/example_interfaces/share/example_interfaces/cmake) -- Found rosidl_generator_c: 3.1.5 (/opt/ros/humble/share/rosidl_generator_c/cmake) -- Found rosidl_adapter: 3.1.5 (/opt/ros/humble/share/rosidl_adapter/cmake) -- Found rosidl_generator_cpp: 3.1.5 (/opt/ros/humble/share/rosidl_generator_cpp/cmake) -- Using all available rosidl_typesupport_c: rosidl_typesupport_fastrtps_c;rosidl_typesupport_introspection_c -- Using all available rosidl_typesupport_cpp: rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_introspection_cpp -- Found rclcpp: 16.0.7 (/opt/ros/humble/share/rclcpp/cmake) -- Found rmw_implementation_cmake: 6.1.1 (/opt/ros/humble/share/rmw_implementation_cmake/cmake) -- Found rmw_fastrtps_cpp: 6.2.5 (/opt/ros/humble/share/rmw_fastrtps_cpp/cmake) -- Using RMW implementation 'rmw_fastrtps_cpp' as default -- Found rclcpp_components: 16.0.7 (/opt/ros/humble/share/rclcpp_components/cmake) -- Found ament_lint_auto: 0.12.9 (/opt/ros/humble/share/ament_lint_auto/cmake) -- Found python_cmake_module: 0.10.0 (/opt/ros/humble/share/python_cmake_module/cmake) -- Using PYTHON_EXECUTABLE: /usr/bin/python3 -- Using PYTHON_INCLUDE_DIRS: /usr/include/python3.10 -- Using PYTHON_LIBRARIES: /usr/lib/aarch64-linux-gnu/libpython3.10.so -- Added test 'copyright' to check source files copyright and LICENSE -- Added test 'cppcheck' to perform static code analysis on C / C++ code -- Configured cppcheck include dirs: /home/ubuntu/ros2/src/demos/composition/include -- Configured cppcheck exclude dirs and/or files: -- Added test 'cpplint' to check C / C++ code against the Google style -- Configured cpplint exclude dirs and/or files: -- Added test 'flake8' to check Python code syntax and style conventions -- Added test 'lint_cmake' to check CMake code style -- Added test 'pep257' to check Python code against some of the docstring style conventions in PEP 257 -- Added test 'uncrustify' to check C / C++ code style -- Configured uncrustify additional arguments: -- Added test 'xmllint' to check XML markup files -- Configuring done -- Generating done -- Build files have been written to: /home/ubuntu/ros2/build/composition [ 12%] Building CXX object CMakeFiles/talker_component.dir/src/talker_component.cpp.o [ 12%] Building CXX object CMakeFiles/listener_component.dir/src/listener_component.cpp.o [ 25%] Building CXX object CMakeFiles/node_like_listener_component.dir/src/node_like_listener_component.cpp.o [ 25%] Building CXX object CMakeFiles/server_component.dir/src/server_component.cpp.o gmake[2]: *** [CMakeFiles/listener_component.dir/build.make:76: CMakeFiles/listener_component.dir/src/listener_component.cpp.o] Interrupt gmake[2]: *** [CMakeFiles/node_like_listener_component.dir/build.make:76: CMakeFiles/node_like_listener_component.dir/src/node_like_listener_component.cpp.o] Interrupt gmake[2]: *** [CMakeFiles/talker_component.dir/build.make:76: CMakeFiles/talker_component.dir/src/talker_component.cpp.o] Interrupt gmake[1]: *** [CMakeFiles/Makefile2:177: CMakeFiles/listener_component.dir/all] Interrupt gmake[2]: *** [CMakeFiles/server_component.dir/build.make:76: CMakeFiles/server_component.dir/src/server_component.cpp.o] Interrupt gmake[1]: *** [CMakeFiles/Makefile2:151: CMakeFiles/talker_component.dir/all] Interrupt gmake[1]: *** [CMakeFiles/Makefile2:203: CMakeFiles/node_like_listener_component.dir/all] Interrupt gmake[1]: *** [CMakeFiles/Makefile2:229: CMakeFiles/server_component.dir/all] Interrupt gmake: *** [Makefile:146: all] Interrupt </code></pre> <p>command.log shows:</p> <pre><code>Invoking command in '/home/ubuntu/ros2/build/composition': AMENT_PREFIX_PATH=/home/ubuntu/ros2/install/example_interfaces:<span class="math-container">${AMENT_PREFIX_PATH} CMAKE_PREFIX_PATH=/home/ubuntu/ros2/install/example_interfaces:/opt/ros/humble LD_LIBRARY_PATH=/home/ubuntu/ros2/install/example_interfaces/lib:$</span>{LD_LIBRARY_PATH} PYTHONPATH=/home/ubuntu/ros2/install/example_interfaces/local/lib/python3.10/dist-packages:<span class="math-container">${PYTHONPATH} /usr/bin/cmake /home/ubuntu/ros2/src/demos/composition -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DAMENT_CMAKE_SYMLINK_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/home/ubuntu/ros2/install/composition Invoked command in '/home/ubuntu/ros2/build/composition' returned '0': AMENT_PREFIX_PATH=/home/ubuntu/ros2/install/example_interfaces:$</span>{AMENT_PREFIX_PATH} CMAKE_PREFIX_PATH=/home/ubuntu/ros2/install/example_interfaces:/opt/ros/humble LD_LIBRARY_PATH=/home/ubuntu/ros2/install/example_interfaces/lib:<span class="math-container">${LD_LIBRARY_PATH} PYTHONPATH=/home/ubuntu/ros2/install/example_interfaces/local/lib/python3.10/dist-packages:$</span>{PYTHONPATH} /usr/bin/cmake /home/ubuntu/ros2/src/demos/composition -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DAMENT_CMAKE_SYMLINK_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/home/ubuntu/ros2/install/composition Invoking command in '/home/ubuntu/ros2/build/composition': AMENT_PREFIX_PATH=/home/ubuntu/ros2/install/example_interfaces:<span class="math-container">${AMENT_PREFIX_PATH} CMAKE_PREFIX_PATH=/home/ubuntu/ros2/install/example_interfaces:/opt/ros/humble LD_LIBRARY_PATH=/home/ubuntu/ros2/install/example_interfaces/lib:$</span>{LD_LIBRARY_PATH} PYTHONPATH=/home/ubuntu/ros2/install/example_interfaces/local/lib/python3.10/dist-packages:<span class="math-container">${PYTHONPATH} /usr/bin/cmake --build /home/ubuntu/ros2/build/composition --clean-first -- -j4 -l4 Invoked command in '/home/ubuntu/ros2/build/composition' returned '-2': AMENT_PREFIX_PATH=/home/ubuntu/ros2/install/example_interfaces:$</span>{AMENT_PREFIX_PATH} CMAKE_PREFIX_PATH=/home/ubuntu/ros2/install/example_interfaces:/opt/ros/humble LD_LIBRARY_PATH=/home/ubuntu/ros2/install/example_interfaces/lib:<span class="math-container">${LD_LIBRARY_PATH} PYTHONPATH=/home/ubuntu/ros2/install/example_interfaces/local/lib/python3.10/dist-packages:$</span>{PYTHONPATH} /usr/bin/cmake --build /home/ubuntu/ros2/build/composition --clean-first -- -j4 -l4 </code></pre> <p>So it looks like colcon is overriding my CMake setup configuration by command line option -j4 for the build command. I already have specified --executor sequential and parallel-workers 1 but I assume they are just used by colcon not to process packages in parallel.</p> <p>So, what I miss is a possibility to tell colcon not to pass the -j4 option by command line.</p> <p>Solution finally was found by setting MAKEFLAGS.</p> <p>Thanks to all of you helping to get to the solution!</p>
Compiler issues using Raspberry Pi 4B
<p>I figured it out. You need to insert all tags inside &lt; gazebo reference=&quot;link_name&quot;&gt; tag under &lt; robot&gt; tag and not under &lt; link&gt; tag. Here is document <a href="http://classic.gazebosim.org/tutorials?tut=ros_urdf&amp;cat=connect_ros#%3Ccollision%3Eand%3Cvisual%3Eelements" rel="nofollow noreferrer">GazeboURDF</a>. Like this works for me:</p> <pre><code>&lt;robot xmlns:xacro=&quot;http://www.ros.org/wiki/xacro&quot;&gt; &lt;gazebo reference=&quot;link_name&quot;&gt; &lt;minDepth&gt;0.01&lt;/minDepth&gt; &lt;material&gt;Gazebo/Orange&lt;/material&gt; &lt;mu2&gt;0.23&lt;/mu2&gt; &lt;/gazebo&gt; &lt;link name=&quot;link_name&quot;&gt; (other tags ...) &lt;/link&gt; &lt;/robot&gt; </code></pre>
105819
2023-12-03T13:12:45.790
|ros2|urdf|
<p>I am struggling to set friction to my model in gazebo. Issue is it is frictionless. It is walking in place and cannot move. I set my tags according to this document <a href="http://sdformat.org/spec?ver=1.5&amp;elem=collision#surface_friction" rel="nofollow noreferrer">SDFormat</a> but they are not visible in link inspection in Gazebo. Looks like surface tag is not propagated at all. I got gazebo 11.10.2 . Abd ros2 humble. Below is the screenshot:<a href="https://i.stack.imgur.com/75y0x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/75y0x.png" alt="enter image description here" /></a></p>
URDF surface tags are not propagated to gazebo
<p>There is no event-based mechanism in ROS 1 Navigation - use Nav2 which has this ability.</p> <p>If you want to hack around it, you could potentially set the replanning rate really high (e.g. 100hz) and evaluate yourself each cycle if you should actually replan or just resend the last one.</p>
105821
2023-12-03T14:26:59.140
|ros|move-base|global-planner|
<p>I've developed a custom global planner for a ROS project, which dynamically generates new paths based on certain conditions. This means that the global planner continuously produces new paths during its operation. I'm seeking advice on how to efficiently pass these dynamically generated paths to move_base.</p> <ol> <li><p>Is there a way to integrate this behavior with move_base without modifying its core code?</p> </li> <li><p>If modifications to move_base are necessary, what would be the approach to ensure integration?</p> </li> </ol>
How to Integrate a Custom Global Planner with Move_base for Dynamic Path Generation?
<p>That is very strange. Try turning off the static layer - are <strong>any</strong> laser scans working initially? Its not clear from your example that they are given that the other laser scans align with the map so that's already being inflated from the static layer. Any errors in the terminals? Perhaps the laser scans aren't actually making it into the costmap layers initially</p>
105837
2023-12-04T12:41:38.577
|ros2|ros-humble|nav2|global-costmap|
<p>I am using Ubuntu 22.04, ROS2 - Humble version.Installed all packages using package manager.</p> <p>I am building simulation for my robot and I noticed very strange behavior for global costmap. My robot has 180 degrees lidar in front of it. And the problem is, that after starting Nav2 system in simulation, global costmap updates only area, which is unseen previously.</p> <p>For-example, if robot has obstacle in front of it, it will not be included in global costmap at the beginning. I must turn robot away from obstacle and then back, only then it will be updates by global costmap. Here is my config file for global planner:</p> <pre class="lang-yaml prettyprint-override"><code>vikings_bot_1/global_costmap: global_costmap: ros__parameters: update_frequency: 1.0 publish_frequency: 1.0 global_frame: map map_topic: /map #transform_tolerance: 0.5 robot_base_frame: vikings_bot_1/base_link use_sim_time: True #robot_radius: 0.175 footprint: &quot;[[0.8, 0.45], [-0.3, 0.45], [-0.3, -0.45], [0.8, -0.45]]&quot; resolution: 0.05 track_unknown_space: true plugins: [&quot;static_layer&quot;, &quot;obstacle_layer&quot;, &quot;inflation_layer&quot;] obstacle_layer: plugin: &quot;nav2_costmap_2d::ObstacleLayer&quot; enabled: True observation_sources: scan scan: topic: /vikings_bot_1/lidar_scan max_obstacle_height: 2.0 clearing: True marking: True data_type: &quot;LaserScan&quot; raytrace_max_range: 5.0 raytrace_min_range: 0.0 obstacle_max_range: 4.5 obstacle_min_range: 0.0 static_layer: plugin: &quot;nav2_costmap_2d::StaticLayer&quot; map_subscribe_transient_local: True inflation_layer: plugin: &quot;nav2_costmap_2d::InflationLayer&quot; cost_scaling_factor: 4.0 inflation_radius: 0.65 always_send_full_costmap: True </code></pre> <p>Note: local costmap is updated correctly.</p> <p>Here is video for the problem, as it might be hard to understand from description.</p> <img src="https://i.imgur.com/5iOcdhU.gif"> <p>Any idea, where can be problem? I tried different planners as well, check parameters in config file..., but I could not find the cause of it.</p>
ROS2 NAV2 global costmap is updating only previosly unseen area
<p>We use v3.8 in Nav2 since its been stable and v4 has been under active development and bug fixing the last few months. Things are largely stable now and we do plan to move to v4.4 in January-February 2024 in conjunction with the BT.CPP maintainer, Davide Faconti.</p> <p>v4.4 will be available for Jazzy and newer, but we cannot backport support for v4.4 since your BT XML files will require changes to work with v4 and there are other behavioral changes that cannot be backported to existing distributions since it would break everyone instantly.</p>
105838
2023-12-04T12:42:47.743
|ros-humble|nav2|release|
<p>I am working in ROS 2 Humble, Nav 2 Stack for my robot's navigation, Now i can see that BT.CPP has released it's latest version of 4.4 with lot of new features, May I know what is the supported version of BT.CPP in Nav 2 also need to know about the plan to upgrade</p>
Nav2 Stack's Behavior tree (BT.CPP) version
<p>That really depends on what you are doing inside the hardware component. How do you connect it with your hardware? You might be able to mock the communication, but there is no way how to do that from ros2_control framework.</p> <p>Otherwise you will have to do a HIL test as you already mentioned.</p> <p>What you can do at least is to write tests for loading the component into the resource manager and check if it initialized well (<code>on_init()</code> and <code>export_state_interfaces</code> and <code>export_command_interfaces</code> work). Of course this depends where you actually start your hardware, we do that normally not before <code>on_configure</code>.</p>
105839
2023-12-04T12:43:10.693
|ros2-control|
<p>I am looking for an advice how to properly test hw interface which uses ros2 control.</p> <p>More details: I have been implementing several unit/integration tests before following ROS2 best practise. However, given the hw interface of ros2 control isn't a ros node, I am really struggling to think what is a best way and if it is at all possible.</p> <p>I understand that I could test my controllers in the simulation. BUT I need to test the hw_interface only (controllers are done by someone else). The only think I can think of is hardware-in-the-loop system testing. However, ideally I want to minimise the effect of the hw. Is there some way to mock it or something similar?</p> <p>UPDATE: I am writing the hw-interface for an industrial robotic arm, which comes with a library installed on Ubuntu 14.04! :/ So I am currently investigating best options how to connect to ROS2 which would also influence how I implement my hw-interface:</p> <p>A) docker on Ubuntu 14.04 with ROS2 (probably won't work). If this would be the way, then I would call methods of the arm library directly in the hw-interface.</p> <p>B) set up another PC with Ubuntu 22.04 and ROS2 which would communicate via MQTT/DDS/... with the Ubuntu14.04. In that case, my hw-interface would contain publishing/subscribing to the chosen protocol. Then, on the Ubuntu 14.04, I will need to have a code publishing/subscribing (NOT ros2, just mqtt or dds) and calling the appropriate functions of the arm library.</p> <p>I can see that option B would give me more options how to test as I could test both sides independently.</p>
Best practise for unit/integration/system testing of ros2_control hw_interfaces
<p>Because the <code>empy</code> version 4.0 will cause this problem.</p> <pre><code>$ pip install --user -U empy==3.3.4 pyros-genmsg setuptools </code></pre> <p>Try this version of <code>empy</code>, it will solve problem.</p>
105842
2023-12-04T15:12:02.980
|ros2|build|colcon|msg|buiding-errors|
<p>When building a pure ROS2 message package (<a href="https://github.com/ros-event-camera/event_camera_msgs/" rel="nofollow noreferrer">event_camera_msg</a>) on github (CI) using the <a href="https://github.com/ros-tooling/action-ros-ci" rel="nofollow noreferrer">ros-tooling/action-ros-ci@v0.3</a> I get the following cryptic error when building on any ROS2 distro (humble, iron, rolling etc).</p> <p>The package builds fine locally on humble. <em>It also built fine on 24-11-2023 (last week)</em> but without any modifications to the repo (no commits pushed, nothing), just rerunning the workflow today on 04-12-2023, the job fails.</p> <pre><code> /usr/bin/bash -c source /opt/ros/humble/setup.sh &amp;&amp; colcon build --symlink-install --event-handlers=console_cohesion+ ERROR:colcon.colcon_core.entry_point:Exception loading extension 'colcon_core.environment_variable.powershell_command': cannot import name 'OVERRIDE_OPT' from 'em' (/usr/local/bin/em.py) The Python package 'empy' must be installed and 'em' must not be installed since both packages share the same namespace Traceback (most recent call last): File &quot;/usr/local/lib/python3.10/dist-packages/colcon_core/entry_point.py&quot;, line 120, in load_entry_points extension_type = load_entry_point(entry_point) File &quot;/usr/local/lib/python3.10/dist-packages/colcon_core/entry_point.py&quot;, line 166, in load_entry_point return entry_point.load() File &quot;/usr/local/lib/python3.10/dist-packages/pkg_resources/__init__.py&quot;, line 2465, in load return self.resolve() File &quot;/usr/local/lib/python3.10/dist-packages/pkg_resources/__init__.py&quot;, line 2471, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File &quot;/usr/local/lib/python3.10/dist-packages/colcon_powershell/shell/powershell.py&quot;, line 17, in &lt;module&gt; from colcon_core.shell.template import expand_template File &quot;/usr/local/lib/python3.10/dist-packages/colcon_core/shell/template/__init__.py&quot;, line 19, in &lt;module&gt; raise e from None File &quot;/usr/local/lib/python3.10/dist-packages/colcon_core/shell/template/__init__.py&quot;, line 10, in &lt;module&gt; from em import OVERRIDE_OPT ImportError: cannot import name 'OVERRIDE_OPT' from 'em' (/usr/local/bin/em.py) The Python package 'empy' must be installed and 'em' must not be installed since both packages share the same namespace </code></pre> <p>Here <a href="https://github.com/ros-event-camera/event_camera_msgs/actions/runs/6982381554/job/19290023180" rel="nofollow noreferrer">a link to the full failed build log</a>.</p>
What causes build error: cannot import name 'OVERRIDE_OPT' from 'em'?
<p>I solved the issue by declaring the node in the global namespace <code>/</code>:</p> <pre class="lang-py prettyprint-override"><code>imu = Node( package=package_name, executable='imu_node', name='imu', namespace='/', # &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; parameters=[default_parameters, override_parameters], output='screen', emulate_tty=True ) </code></pre> <p>In this way, ros parameters are resolved correctly without any modification or namespace prefix on parameters declaration.</p>
105843
2023-12-04T15:22:19.443
|ros2|foxy|launch|
<p>I am using ROS2 foxy. I would like to launch a node with a set of default parameters in a .yaml file and add support for launch argument to override such parameters.</p> <p>Default parameters:</p> <pre class="lang-yaml prettyprint-override"><code>/imu: ros__parameters: spi_dev: &quot;/dev/spidev0.0&quot; output_rate: 200.0 # Hz # more params here </code></pre> <p>I tried the following but does not work, what am I missing? I fear that the parameters passed from launch arguments are not in the node namespace but global, thus are not picked up.</p> <pre class="lang-py prettyprint-override"><code>import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch_ros.actions import Node from launch.actions import DeclareLaunchArgument from launch.substitutions import LaunchConfiguration package_name = 'my_sensors' param_name = 'my_default_params.yaml' def generate_launch_description(): rate_arg = DeclareLaunchArgument( name='rate', default_value=&quot;100&quot;, description=&quot;the sensor output data rate&quot;) device_arg = DeclareLaunchArgument( name='device', default_value=&quot;/dev/spidev0.0&quot;, description=&quot;the imu spi device&quot;) arguments = [ rate_arg, device_arg, ] default_parameters = os.path.join( get_package_share_directory(package_name), 'config', param_name ) override_parameters = { 'output_rate': LaunchConfiguration('rate'), 'spi_dev': LaunchConfiguration('device'), } imu = Node( package=package_name, executable='imu_node', name='imu', parameters=[default_parameters, override_parameters], output='screen', emulate_tty=True ) return LaunchDescription([ *arguments, imu ]) </code></pre> <p>Thank you so much for any help.</p>
ROS2 parameters file and launch argument override
<p>Actually, yes! The code just has to provide the QoS override as a valid option:</p> <pre><code> node-&gt;create_publisher( &quot;chatter&quot;, KeepLast{10}, QosOverridingOptions{true}); // allow_reconfigurable all qos </code></pre> <p>Then it can be set:</p> <pre><code> /my/ns/node_name: ros__parameters: qos_overrides: # group for all the qos settings 'my/fully/qualified/topic/name/here': publisher: reliability: reliable history_depth: 100 history: keep_last </code></pre> <p>I'm of the personal belief that this override capability should be default to <code>true</code> but currently it needs to be explicitly set by the code to allow the launch-time configuration. This is available in Galactic and newer!</p>
105844
2023-12-04T16:30:39.477
|ros2|ros-humble|communication|composition|intraprocess-communication|
<p>I'm using composition to leverage IPC to convert ZED Cameras depth maps into virtual laser scans with the <code>depthimage_to_laserscan</code> package.</p> <p>The problem is that the defauls QoS of the <code>depthimage_to_laserscan::DepthImageToLaserScanROS</code> component are not correctly set and I get this exception when starting the node:</p> <pre><code>component_container-3] [ERROR] [1701705850.520313066] [zed.zed_depth_to_laserscan]: Component constructor threw an exception: intraprocess communication is not allowed with a zero qos history depth value [ERROR] [launch_ros.actions.load_composable_nodes]: Failed to load node 'depthimage_to_laserscan' of type 'depthimage_to_laserscan::DepthImageToLaserScanROS' in container '/zed/zed_depth_to_laserscan': Component constructor threw an exception: intraprocess communication is not allowed with a zero qos history depth value </code></pre> <p>Do you know any workaround to solve this problem?</p> <p>This is the part of my launch file that generates the problem:</p> <pre><code> # ZED Wrapper component zed_wrapper_component = ComposableNode( package='zed_components', namespace=camera_name_val, plugin='stereolabs::ZedCamera', name=zed_node_name, parameters=[ # YAML files config_common_path, # Common parameters config_camera_path, # Camera related parameters # Overriding { 'general.camera_name': camera_name_val, 'general.camera_model': camera_model_val, 'general.svo_file': svo_path, 'general.serial_number': serial_number } ], extra_arguments=[{'use_intra_process_comms': True}] ) # Depth to Laser scan component zed_cvt_component = ComposableNode( package='depthimage_to_laserscan', namespace=camera_name_val, plugin='depthimage_to_laserscan::DepthImageToLaserScanROS', name='depthimage_to_laserscan', parameters=[ config_path_cvt, # Overriding { 'output_frame': camera_depth_frame }], remappings=[ ('depth', zed_node_name_val + '/depth/depth_registered'), ('depth_camera_info', zed_node_name_val + '/depth/camera_info') ], extra_arguments=[ { 'use_intra_process_comms': True } ] ) # ROS 2 Component Container container = ComposableNodeContainer( name='zed_depth_to_laserscan', namespace=camera_name_val, package='rclcpp_components', executable='component_container', composable_node_descriptions=[ zed_wrapper_component, zed_cvt_component ], output='screen', ) <span class="math-container">```</span> </code></pre>
Is there a workaround to set QoS at launch time?
<p>I forgot to include the <code>message_generation</code> in the <code>find_package()</code>. The complete section of code should be like below:</p> <pre><code>find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation ) </code></pre>
105873
2023-12-05T13:01:48.970
|ros|ros-noetic|
<p>These are the code I include in my CMakeLists.txt</p> <pre><code>add_service_files( FILES AddTwoInts.srv ) </code></pre> <p>However, when I try to use <code>catkin_make</code> to build, the error says <code>Unknown CMake command &quot;add_service_files&quot;</code> and the error lies in the code above. However, I can't find anything wrong with these three lines of code.</p>
Unknown CMake command "add_service_files"
<p>Sorry for the long pause, i was trying stuff and wanted to write an answer when i had something to say.</p> <p>As far as i see it, the problem of not loading the .YAML-File is solved.</p> <p>All i did was changing my *.urdf file to a *.urdf.xacro file. To do this i did the following:</p> <p><strong>1. Change the Ending of the file</strong></p> <pre><code>`*.urdf -&gt; *.urdf.xacro` </code></pre> <p><strong>2. Add the Xacro Reference to the -tag inside the file</strong></p> <pre><code>Old: `&lt;robot name=&quot;model_picker_gestaenge&quot;&gt;` ` ... ` `&lt;robot/&gt;` New: `&lt;robot xmlns:xacro=&quot;https://wiki.ros.org/xacro.org&quot; name=&quot;model_picker_gestaenge&gt;` ` ... ` `&lt;robot/&gt;` </code></pre> <p><strong>3. Change Parsing Code</strong></p> <p>Old:</p> <blockquote> </blockquote> <pre><code>##### DATA INPUT START ##### urdf_file = 'model_picker.urdf' package_description = 'model_picker_description' ##### DATA INPUT END ##### print(&quot;Fetching URDF ==&gt;&quot;) robot_desc_path = os.path.join(get_package_share_directory(package_description), &quot;urdf&quot;, urdf_file) with open(robot_desc_path, 'r') as urdf_file: urdf_file_content = urdf_file.read() # print(&quot;urdf_file_content enthält:&quot;) # print(urdf_file_content) # print(&quot;Hier ist was in robot_desc_path steht:&quot;) # print(robot_desc_path) #Robot State Publisher Command(['xacro', str(robot_desc_path)] robot_state_publisher_node = Node( package='robot_state_publisher', executable='robot_state_publisher', name='robot_state_publisher_node', emulate_tty=True, parameters=[{'use_sim_time': True, 'robot_description': urdf_file_content}], output=&quot;screen&quot; ) </code></pre> <blockquote> </blockquote> <p>New:</p> <blockquote> </blockquote> <pre><code>##### DATA INPUT START ##### xacro_file = 'model_picker.urdf.xacro' package_description = 'model_picker_description' ##### DATA INPUT END ##### print(&quot;Fetching URDF ==&gt;&quot;) #Getting Path of the xacro file xacro_file_path = os.path.join(get_package_share_directory(package_description), &quot;urdf&quot;, xacro_file) #Convertig *.xacro-File into urdf-String via &quot;xacro&quot; Command -&gt; Ergebnis ist der String der URDF Datei + Wrapping String in ParameterValue so that roslaunch system will not falsely interpret it as a .yaml-File during parsing. urdf_file_content = launch.substitutions.Command(['xacro', &quot; &quot; , xacro_file_path]) #Wrapping String in ParameterValue so that roslaunch system will not falsely interpret it as a .yaml-File during parsing. urdf_file_content_wrapped = launch_ros.descriptions.ParameterValue( urdf_file_content, value_type=str) #Erstellen des dictionaries für das parsen der robot_description robot_description = [{'robot_description': urdf_file_content_wrapped}] #Robot State Publisher Command(['xacro', str(robot_desc_path)] robot_state_publisher_node = Node( package='robot_state_publisher', executable='robot_state_publisher', name='robot_state_publisher_node', emulate_tty=True, parameters=robot_description, output=&quot;screen&quot; ) </code></pre> <p>Now the .YAML File is found under the path i gave it and loaded. Now i have a different error message which i count as progress. :-)</p> <p>Can somebody explain to me why it makes such a huge difference? Or does somebody has an assumption?</p>
105880
2023-12-05T16:15:17.480
|gazebo|ros2|plugin|yaml|ros2-control|
<p>please excuse if i did not find the correct Thread with a similar problem. After multiple days searching for an answer i decided to post my concrete question.</p> <p>My setup: Ubuntu 20.04.6 LTS ROS2 Foxy Gazebo 11.13.0 installed via sudo apt-get -y install ros-foxy-gazebo</p> <p>Inside my URDF File i configured ros2_control as follows:</p> <pre><code> &lt;ros2_control name=&quot;GazeboSystem&quot; type=&quot;system&quot;&gt; &lt;hardware&gt; &lt;plugin&gt;gazebo_ros2_control/GazeboSystem&lt;/plugin&gt; &lt;!-- &lt;plugin&gt;test_system&lt;/plugin&gt; --&gt; &lt;/hardware&gt; &lt;joint name=&quot;Joint11_Grundplatte_Bizeps1&quot;&gt; &lt;command_interface name=&quot;position&quot;&gt; &lt;!-- &lt;param name=&quot;min&quot;&gt;-0.5236&lt;/param&gt; &lt;!-- -0.5236 = -30° --&gt; &lt;param name=&quot;max&quot;&gt;1.3963&lt;/param&gt; &lt;!--1.3963 = +80° --&gt; &lt;/command_interface&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;/joint&gt; &lt;/ros2_control&gt; </code></pre> <p>I also added the gazebo_ros2_control plugin to the URDF file:</p> <pre><code> &lt;gazebo&gt; &lt;plugin filename=&quot;libgazebo_ros2_control.so&quot; name=&quot;gazebo_ros2_control&quot;&gt; &lt;parameters&gt;$(find model_picker_description)/config/picker_controllers.yaml&lt;/parameters&gt; &lt;/plugin&gt; &lt;/gazebo&gt; </code></pre> <p>And thats the used config file <code>picker_controllers.yaml</code> :</p> <pre><code>controller_manager: ros__parameters: update_rate: 10 # Hz #use_sim_time: True #Publisher für Joint states joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster #&quot;forward_position_controller&quot; ist ein &quot;single joint&quot;-controller aus dem package &quot;ros2_controllers&quot;. Ich denke der ist richtig für mich. bizeps_position_controller: type: forward_command_controller/ForwardCommandController bizeps_position_controller: ros__parameters: #Für den ForwardCommandController sind das alle möglichen Parameter. #siehe: https://github.com/ros-controls/ros2_controllers/blob/master/forward_command_controller/src/forward_command_controller_parameters.yaml joints: Joint11_Grundplatte_Bizeps1 interface_name: position </code></pre> <p>Now lets get into the issue: I am starting my Simulations within two steps. First Step starts gazebo with an empty world. Second Step spawns my Models, starts Nodes, ... . During the First Step everything is fine. In my second Step when using the ros2_control hardware plugin gazebo_ros2_control/GazeboSystem im getting the following error:</p> <pre><code>[ros2_control_node-2] terminate called after throwing an instance of 'pluginlib::LibraryLoadException' [ros2_control_node-2] what(): According to the loaded plugin descriptions the class gazebo_ros2_control/GazeboSystem with base class type hardware_interface::SystemInterface does not exist. Declared types are fake_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem test_system [ERROR] [ros2_control_node-2]: process has died [pid 26536, exit code -6, cmd '/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_h9xe6lfo --params-file /home/Stefan/share/ros2_ws_raf/install/model_picker_description/share/model_picker_description/config/picker_controllers.yaml']. </code></pre> <p>In the CLI where gazebo with the empty world starts in Step 1 i am also getting the following error:</p> <pre><code>[gzserver-1] [ERROR] [1701789856.549460633] [gazebo_ros2_control]: parser error Couldn't parse params file: '--params-file $(find model_picker_description)/config/picker_controllers.yaml'. Error: Error opening YAML file, at /tmp/binarydeb/ros-foxy-rcl-yaml-param-parser-1.1.14/src/parser.c:198, at /tmp/binarydeb/ros-foxy-rcl-1.1.14/src/rcl/arguments.c:388 [gzserver-1] </code></pre> <p>In my gzserver Log-Files (~/.gazebo/server-11345$ nano default.log) there is no error message:</p> <pre><code>Gazebo multi-robot simulator, version 11.13.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org (1701789841 86590197) [Msg] Waiting for master. (1701789841 95590670) [Msg] Connected to gazebo master @ http://127.0.0.1:11345 (1701789841 95688797) [Msg] Publicized address: 172.21.0.2 (1701789841 327159780) [Msg] Loading world file [/home/Stefan/share/ros2_ws_raf/install/raf_gazebo/share/raf_gazebo/worlds/raf_empty.world] (1701789841 393870146) Init world[default] </code></pre> <p>When i search for the gazebo_ros2_control package i find inside <code>/opt/ros/foxy/share/gazebo_ros2_control/gazebo_hardware_plugins.xml</code> this:</p> <pre><code>&lt;library path=&quot;gazebo_hardware_plugins&quot;&gt; &lt;class name=&quot;gazebo_ros2_control/GazeboSystem&quot; type=&quot;gazebo_ros2_control::GazeboSystem&quot; base_class_type=&quot;gazebo_ros2_control::GazeboSystemInterface&quot;&gt; &lt;description&gt; GazeboPositionJoint &lt;/description&gt; &lt;/class&gt; &lt;/library&gt; </code></pre> <p>I am just a beginner but this tells me, that the plugin should be available.</p> <p>I also added the path to the plugin into the environment variable &quot;GAZEBO_PLUGIN_PATH&quot;, but nothing changed.</p> <p>So at this point i’m totally confused, because in my opinion the interfaces aren’t missing. I am trying to use the gazebo_ros2_control/GazeboSystem for the control of revolute Joints of a Delta Picker.</p> <p>Can anyone help me out? Any hint is appreciated. Thanks alot in advance.</p> <p>P.S. If any further documentation or log-files are needed just say so - i’m quiet new to this.</p> <p>Yours sincerely</p> <p>Spezies31</p> <p><strong>Additional Information after initial Post:</strong></p> <p><strong>Code of Launch-File #1:</strong> First Launch-File &quot;<code>start_world.launch.py</code>&quot; starts gazebo with an empty world:</p> <pre><code>#!/usr/bin/python3 # -*- coding: utf-8 -*- import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource from ament_index_python.packages import get_package_prefix def generate_launch_description(): pkg_gazebo_ros = get_package_share_directory('gazebo_ros')# Get the Path to Package &quot;gazebo_ros&quot;. Evtl. anderer Package Name notwendig (vllt. &quot;ros-foxy-gazebo&quot;) pkg_box_bot_gazebo = get_package_share_directory('raf_gazebo') # Get the Path to Package &quot;raf_gazebo&quot;. #We get the whole install dir #We do this to avoid having to copy or softlink manually the packages so that gazebo can find them description_package_name = &quot;raf_gazebo&quot; install_dir = get_package_prefix(description_package_name) # Get the Path to the Install directory of the Packages &quot;raf_gazebo&quot; # Set the path to the WORLD model files. Is to find the models inside the models folder in raf_gazebo package gazebo_models_path = os.path.join(pkg_box_bot_gazebo, 'models') # Generating the Path &quot;gazebo_models_path&quot; by appending 'models' to 'pkg_box_bot_gazebo' # os.environ[&quot;GAZEBO_MODEL_PATH&quot;] = gazebo_models_path if 'GAZEBO_MODEL_PATH' in os.environ: #Add Gazebo Model Path to &quot;GAZEBO_MODEL_PATH&quot;. So Gazebo can load the models. Otherwise gazebo is not able to find them. os.environ['GAZEBO_MODEL_PATH'] = os.environ['GAZEBO_MODEL_PATH'] + ':' + install_dir + '/share' + ':' + gazebo_models_path else: os.environ['GAZEBO_MODEL_PATH'] = install_dir + &quot;/share&quot; + ':' + gazebo_models_path if 'GAZEBO_PLUGIN_PATH' in os.environ: #Add Gazebo Plugin Path to &quot;GAZEBO_PLUGIN_PATH&quot;. So Gazebo can load the plugins. Otherwise gazebo is not able to find them. os.environ['GAZEBO_PLUGIN_PATH'] = os.environ['GAZEBO_PLUGIN_PATH'] + ':' + install_dir + '/lib' else: os.environ['GAZEBO_PLUGIN_PATH'] = install_dir + '/lib' print(&quot;Path pkg_gazebo_ros==&quot;, pkg_gazebo_ros) print(&quot;GAZEBO_MODELS_PATH==&quot;+str(os.environ[&quot;GAZEBO_MODEL_PATH&quot;])) #Visualize Generated Path to check them if they are right. print(&quot;GAZEBO_PLUGINS_PATH==&quot;+str(os.environ[&quot;GAZEBO_PLUGIN_PATH&quot;])) #Visualize Generated Path to check them if they are right. # Gazebo launch. Setting Path to Launch File we want to start. &quot;We want to start the gazebo.launch.py File in the directory launch from the package &quot;pkg_gazebo_ros&quot; &quot;&quot; gazebo = IncludeLaunchDescription( PythonLaunchDescriptionSource( os.path.join(pkg_gazebo_ros, 'launch', 'gazebo.launch.py'), ) ) # # gazebo Version from the gazebo_ros2_control_demos -&gt; cart_example_position.launch.py Beispiel. -&gt; Macht keinen Unterschied. # gazebo = IncludeLaunchDescription( # PythonLaunchDescriptionSource([os.path.join( # get_package_share_directory('gazebo_ros'), 'launch'), '/gazebo.launch.py']), # ) return LaunchDescription([ #Setting &quot;our&quot; world &quot;box_bot_empty.world&quot; as world we want to launch DeclareLaunchArgument( 'world', default_value=[os.path.join(pkg_box_bot_gazebo, 'worlds', 'raf_empty.world'), ''], description='SDF world file'), gazebo ]) </code></pre> <p><strong>Code of Launch-File #2:</strong> Second Launch file &quot;<code>publish_urdf.launch.py</code>&quot; starts a robot_state_publisher node to publish urdf description of my model and a (normally redundant) controller manager:</p> <pre><code># This launch will: # Publish the content of the URDF in the robot_description topic using the &quot;robot_state_publish_node&quot; # Publish the static transforms between links with the &quot;robot_state_publish_node&quot; import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.substitutions import Command from launch_ros.actions import Node #Added because of ros2_control from launch.substitutions import FindExecutable, LaunchConfiguration, PathJoinSubstitution from launch.conditions import IfCondition from launch.actions import DeclareLaunchArgument from launch_ros.substitutions import FindPackageShare from launch.actions import TimerAction #Für die Verzögerung des Controller_Manager notwendig # this is the function launch system will look for def generate_launch_description(): ##### DATA INPUT START ##### urdf_file = 'model_picker.urdf' package_description = 'model_picker_description' ##### DATA INPUT END ##### print(&quot;Fetching URDF ==&gt;&quot;) robot_desc_path = os.path.join(get_package_share_directory(package_description), &quot;urdf&quot;, urdf_file) with open(robot_desc_path, 'r') as urdf_file: urdf_file_content = urdf_file.read() # print(&quot;urdf_file_content enthält:&quot;) # print(urdf_file_content) # print(&quot;Hier ist was in robot_desc_path steht:&quot;) # print(robot_desc_path) #Robot State Publisher Command(['xacro', str(robot_desc_path)] robot_state_publisher_node = Node( package='robot_state_publisher', executable='robot_state_publisher', name='robot_state_publisher_node', emulate_tty=True, parameters=[{'use_sim_time': True, 'robot_description': urdf_file_content}], output=&quot;screen&quot; ) #Added because of ros2_control #Pfad zur &quot;picker_controller.yaml&quot; raussuchen und in die Variable &quot;picker_controller&quot; packen path_picker_controller_config = PathJoinSubstitution( [ FindPackageShare(&quot;model_picker_description&quot;), &quot;config&quot;, &quot;picker_controllers.yaml&quot;, ] ) controller_manager_node = Node( package=&quot;controller_manager&quot;, executable=&quot;ros2_control_node&quot;, parameters=[{'use_sim_time': True, 'robot_description': urdf_file_content}, path_picker_controller_config], output={ &quot;stdout&quot;: &quot;screen&quot;, &quot;stderr&quot;: &quot;screen&quot;, }, ) delayed_controller_manager = TimerAction(period=10.0, actions=[controller_manager_node]) # Verzögert die Ausführung des Controller manager Nodeu m 3 Sekunden. Notwendig, damit robot state publisher vorher fertig ist. Sonst startet der Controller Manager nicht und nichts funktioniert. #create and return launch description object return LaunchDescription( [ robot_state_publisher_node, controller_manager_node, delayed_controller_manager ] ) </code></pre>
ROS2/Gazebo/ros2_control: Class gazebo_ros2_control/GazeboSystem does not exist
<p>You posted this on github and the issue was found. Cross linking answer: <a href="https://github.com/ros-planning/navigation2/issues/4002" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/issues/4002</a></p>
105895
2023-12-06T08:58:09.157
|ros2|ros-humble|nav2|
<p>Hello i use ROS2 humble on ubuntu jammy 22.04 I have been trying to build this for three days this is repository i tried to use: <a href="https://github.com/ros-planning/navigation2/tree/main/nav2_simple_commander" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/tree/main/nav2_simple_commander</a></p> <p>terminal returns this: <a href="https://i.stack.imgur.com/G8YMX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G8YMX.png" alt="enter image description here" /></a></p> <p>it seems like the function expects two arguments instead of four but if i change the code deleting two of them it gets worse because it lacks certain handlers</p> <p>Code from noise generator test cpp file</p> <pre><code> ''' #include &lt;chrono&gt; #include &lt;thread&gt; #include &quot;gtest/gtest.h&quot; #include &quot;rclcpp/rclcpp.hpp&quot; #include &quot;nav2_mppi_controller/tools/noise_generator.hpp&quot; #include &quot;nav2_mppi_controller/models/optimizer_settings.hpp&quot; #include &quot;nav2_mppi_controller/models/state.hpp&quot; #include &quot;nav2_mppi_controller/models/control_sequence.hpp&quot; #include &lt;rclcpp_lifecycle/lifecycle_node.hpp&gt; #include &quot;../include/nav2_mppi_controller/tools/parameters_handler.hpp&quot; // Tests noise generator object class RosLockGuard { public: RosLockGuard() {rclcpp::init(0, nullptr);} ~RosLockGuard() {rclcpp::shutdown();} }; RosLockGuard g_rclcpp; using namespace mppi; // NOLINT TEST(NoiseGeneratorTest, NoiseGeneratorLifecycle) { // Tests shuts down internal thread cleanly NoiseGenerator generator; mppi::models::OptimizerSettings settings; settings.batch_size = 100; settings.time_steps = 25; auto node = std::make_shared&lt;rclcpp_lifecycle::LifecycleNode&gt;(&quot;node&quot;); node-&gt;declare_parameter(&quot;test_name.regenerate_noises&quot;, rclcpp::ParameterValue(false)); ParametersHandler handler(node); generator.initialize(settings, false, &quot;test_name&quot;, &amp;handler); generator.reset(settings, false); generator.shutdown(); } TEST(NoiseGeneratorTest, NoiseGeneratorMain) { // Tests shuts down internal thread cleanly auto node = std::make_shared&lt;rclcpp_lifecycle::LifecycleNode&gt;(&quot;node&quot;); node-&gt;declare_parameter(&quot;test_name.regenerate_noises&quot;, rclcpp::ParameterValue(true)); ParametersHandler handler(node); NoiseGenerator generator; mppi::models::OptimizerSettings settings; settings.batch_size = 100; settings.time_steps = 25; settings.sampling_std.vx = 0.1; settings.sampling_std.vy = 0.1; settings.sampling_std.wz = 0.1; // Populate a potential control sequence mppi::models::ControlSequence control_sequence; control_sequence.reset(25); for (unsigned int i = 0; i != control_sequence.vx.shape(0); i++) { control_sequence.vx(i) = i; control_sequence.vy(i) = i; control_sequence.wz(i) = i; } mppi::models::State state; state.reset(settings.batch_size, settings.time_steps); // Request an update with no noise yet generated, should result in identical outputs generator.initialize(settings, false, &quot;test_name&quot;, &amp;handler); generator.reset(settings, false); // sets initial sizing and zeros out noises generator.setNoisedControls(state, control_sequence); EXPECT_EQ(state.cvx(0), 0); EXPECT_EQ(state.cvy(0), 0); EXPECT_EQ(state.cwz(0), 0); EXPECT_EQ(state.cvx(9), 9); EXPECT_EQ(state.cvy(9), 9); EXPECT_EQ(state.cwz(9), 9); enter code here // Request an update with noise requested generator.generateNextNoises(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); generator.setNoisedControls(state, control_sequence); EXPECT_NE(state.cvx(0), 0); EXPECT_EQ(state.cvy(0), 0); // Not populated in non-holonomic EXPECT_NE(state.cwz(0), 0); EXPECT_NE(state.cvx(9), 9); EXPECT_EQ(state.cvy(9), 9); // Not populated in non-holonomic EXPECT_NE(state.cwz(9), 9); EXPECT_NEAR(state.cvx(0), 0, 0.3); EXPECT_NEAR(state.cvy(0), 0, 0.3); EXPECT_NEAR(state.cwz(0), 0, 0.3); EXPECT_NEAR(state.cvx(9), 9, 0.3); EXPECT_NEAR(state.cvy(9), 9, 0.3); EXPECT_NEAR(state.cwz(9), 9, 0.3); // Test holonomic setting generator.reset(settings, true); // Now holonomically generator.generateNextNoises(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); generator.setNoisedControls(state, control_sequence); EXPECT_NE(state.cvx(0), 0); EXPECT_NE(state.cvy(0), 0); // Now populated in non-holonomic EXPECT_NE(state.cwz(0), 0); EXPECT_NE(state.cvx(9), 9); EXPECT_NE(state.cvy(9), 9); // Now populated in non-holonomic EXPECT_NE(state.cwz(9), 9); EXPECT_NEAR(state.cvx(0), 0, 0.3); EXPECT_NEAR(state.cvy(0), 0, 0.3); EXPECT_NEAR(state.cwz(0), 0, 0.3); EXPECT_NEAR(state.cvx(9), 9, 0.3); EXPECT_NEAR(state.cvy(9), 9, 0.3); EXPECT_NEAR(state.cwz(9), 9, 0.3); generator.shutdown(); } ''' </code></pre> <p>I know it might be trivial issue but i am new to ubuntu and trying to make use of ros for me engineering project, thanks for help in advance</p>
ROS2 simple commander issue
<p>I'm not sure if this is possible from the ros2cli: the easiest way is to create a <a href="https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Publisher-And-Subscriber.html" rel="nofollow noreferrer">simple python publisher</a> for your test, where you can set the QoS settings.</p>
105898
2023-12-06T12:09:01.157
|ros2|publisher|qos|
<p>There is an active topic &quot;/control/drive_inputs&quot; that I'm trying to publish to using <code>ros2 topic pub /control/drive_inputs core/msg/DriveInput &quot;{...}&quot; -n test</code>. This creates the publisher node &quot;test&quot; with the following QoS Profile:</p> <p><a href="https://i.stack.imgur.com/sQ7BJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sQ7BJ.png" alt="enter image description here" /></a></p> <p>This raises an incompatible QoS policy error, where the last incompatible policy is the deadline. This is because the Infinite deadline needs to be set to 20 ms in order to be compatible with the subscriber node, which has a deadline of 20,000,000 ns:</p> <p><a href="https://i.stack.imgur.com/1vrOx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1vrOx.png" alt="enter image description here" /></a></p> <p>However, the &quot;test&quot; publisher node has no QoS deadline parameter for me to override during runtime, and I don't know how to change it's QoS deadline prior to running that <code>ros2 topic pub</code> command. What should I do?</p>
How to set/change QoS deadline for a publisher node during/before runtime
<p>There's some information about this in this issue:</p> <p><a href="https://github.com/ros-industrial/industrial_core/issues/253" rel="nofollow noreferrer">https://github.com/ros-industrial/industrial_core/issues/253</a></p> <p>in particular:</p> <p><a href="https://github.com/ros-industrial/industrial_core/issues/253#issuecomment-1726007620" rel="nofollow noreferrer">https://github.com/ros-industrial/industrial_core/issues/253#issuecomment-1726007620</a></p> <blockquote> <p>Thanks to all those that have posted here on this topic. We are jointly going to more explicitly line out our strategy relative to drivers and comms with manipulators and in parallel update Industrial Robot Driver Specification. As Gijs above illuminated there are now more OEMs offering external motion interfaces, and now more extensible and versionable ways to support ROS 2 interoperability with those interfaces, be it via microROS (Yaskawa) or ros2_control (UR). We will try to provide the resources to enable OEMs to develop, deploy and maintain ROS 2 support, in a way that benefits both developers and OEMs and sustains over changes to ROS 2 and to OEM controllers.</p> </blockquote> <p>It seems like there aren't plans to update <code>industrial_client</code>.</p>
105904
2023-12-06T17:02:26.467
|ros2|robotic-arm|ros-industrial|fanuc|
<p>I'm trying to use ROS2 to control a Fanuc CRX25ia arm. Following the Industrial Training docs, I got it working in Melodic, which was the latest version of the fanuc driver, and was planning to port my support, moveit, and the relevant fanuc_driver components to ROS2. However, the 'Industrial Training' for ros2 is missing the section &quot;Using MoveIt! with Physical Hardware&quot;, and trying to port the previous launch file it looks like many of the package's dependencies (<code>industrial_robot_client</code>, <code>industrial_msgs</code>,<code>industrial_utils</code>, <code>industrial_robot_simulator</code>, etc) no longer exist in Ros2 industrial. Are there alternatives, or another way to get the robot interface part working without rewriting those packages?</p>
ROS2 Industrial on Physical Hardware
<p>I made a working example <a href="https://github.com/danzimmerman/dz_launch_examples/blob/rolling/launch/yaml_param_passing.launch.yaml" rel="nofollow noreferrer">here</a>.</p> <p>In <code>dz_launch_examples/launch/yaml_param_passing.launch.yaml</code> I have launch file contents:</p> <pre class="lang-yaml prettyprint-override"><code>launch: - node: pkg: &quot;turtlesim&quot; exec: &quot;turtlesim_node&quot; name: &quot;sim&quot; namespace: &quot;turtlesim_dz&quot; param: - from: $(find-pkg-share dz_launch_examples)/config/turtlesim_custom_params.yaml </code></pre> <p>and I have a parameter file <code>dz_launch_examples/config/turtlesim_custom_params.yaml</code> with the contents:</p> <pre><code>/turtlesim_dz/sim: ros__parameters: background_b: 0 background_g: 204 background_r: 255 use_sim_time: false </code></pre> <p>This runs a turtlesim node with an orange background color.</p> <p>I've found that the <a href="https://docs.ros.org/en/rolling/How-To-Guides/Migrating-from-ROS1/Migrating-Launch-Files.html" rel="nofollow noreferrer">migration guide from ROS 1 to ROS 2</a> can be helpful in discovering how to do things in ROS 2 launch.</p> <p>In working out some of the launch examples <a href="https://github.com/danzimmerman/dz_launch_examples/" rel="nofollow noreferrer">here</a>, I've observed that YAML syntax closely mirrors XML examples, even if that results in (in my opinion) a non-obvious syntax for the YAML.</p> <p>In XML, passing parameters from file in ROS 2 is described <a href="https://docs.ros.org/en/rolling/How-To-Guides/Migrating-from-ROS1/Migrating-Launch-Files.html#rosparam" rel="nofollow noreferrer">here</a>. It uses the <code>from</code> attribute in a <code>&lt;param&gt;</code> tag:</p> <pre class="lang-xml prettyprint-override"><code>&lt;node pkg=&quot;my_package&quot; exec=&quot;my_executable&quot; name=&quot;my_node&quot; ns=&quot;/an_absolute_ns&quot;&gt; &lt;param from=&quot;/path/to/file&quot;/&gt; &lt;/node&gt; </code></pre> <p>In YAML this becomes:</p> <pre class="lang-yaml prettyprint-override"><code>- node: pkg: &quot;my_package&quot; exec: &quot;my_executable&quot; name: &quot;my_node&quot; namespace: &quot;/an_absolute_ns&quot; param: - from: &quot;/path/to/file&quot; </code></pre>
105910
2023-12-06T21:57:47.123
|ros2|launch-file|
<p>How do I use a YAML launch file to pass parameters to a node? The tutorial covers passing parameters using a python launch file but not YAML.</p>
ROS2: Adding parameters to YAML launch file
<p>the error you are getting is because humble has different dependencies.</p> <p>I wrote a ROS2 foxy driver last year that I recently added humble dependencies to. Might work with your MC.</p> <p>check out the humble branch of</p> <p><a href="https://github.com/CJdev99/roboteq_ros2_driver/tree/humble-dev" rel="nofollow noreferrer">https://github.com/CJdev99/roboteq_ros2_driver/tree/humble-dev</a></p> <p>Haven't tested with hardware but you can give it a go.</p>
105943
2023-12-08T02:33:51.560
|ros2|ros-control|driver|
<p>I have roboteq Controller for brushless DC Motor. I would like to use the driver abd the controller with ROS2 humble. I was using this fork <a href="https://github.com/DoanNguyenTrong/roboteq_controller_ros/tree/galactic-devel" rel="nofollow noreferrer">https://github.com/DoanNguyenTrong/roboteq_controller_ros/tree/galactic-devel</a> to build it with ROS2 humble but got error in ./controller_driver/src/roboteq_controller_ros/roboteq_controller/include/roboteq_controller/roboteq_controller_node.h in line 26 #include &quot;nav_msgs/msg/odometry.hpp&quot;. So can not find the header for the nav_msgs. But when just comment the line it works. So my question is do we need the header or how to fix it if need it?</p> <p>Thanks</p>
Error when using Roboteq Controller ROS2 driver
<p>I have solved this problem by installing Pangolin globally in my system. This approach along with adding a macro in <code>.bashrc</code> ensures the .so files are found by Cmake during run time from <code>/usr/local/lib</code> folder.</p> <p>The steps to installing Pangolin globally are as follows</p> <ol> <li><p>git clone and change directory into the downloaded folder using the following instructions in <code>https://github.com/stevenlovegrove/Pangolin</code></p> </li> <li><p>Install recommended software <code>./scripts/install_prerequisites.sh --dry-run recommended</code></p> </li> <li><p>Install recommended dependencies <code>./scripts/install_prerequisites.sh recommended</code></p> </li> <li><p><code>cmake -B build</code> create a build directory and configure using Cmake</p> </li> <li><p><code>cmake --build build -j4</code> build using 4 parallel processors</p> </li> <li><p><code>sudo cmake --install build</code> install pangolin system-wide with elevated privileges</p> </li> <li><p>Optional: test Pangolin is installed correctly by running one of the provided examples</p> </li> </ol> <p>8a. In a terminal, check if <code>/usr/lib/local</code> is added to Dynamic library path using <code>echo $LD_LIBRARY_PATH</code></p> <p>8b. Add <code>/usr/lib/local</code> and update ldconfig as follows</p> <pre><code>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/local sudo ldconfig </code></pre> <ol start="9"> <li>Open .bashrc file and then add the following lines at the very of the file</li> </ol> <pre><code>if [[ &quot;:$LD_LIBRARY_PATH:&quot; != *&quot;:/usr/local/lib:&quot;* ]]; then export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH fi </code></pre> <ol start="10"> <li>source the .bashrc file to solve the above problem <code>source ~/.bashrc</code></li> </ol> <p>With best, @mechazo11</p>
105973
2023-12-10T05:08:14.240
|cmake|ros-humble|target-link-libraries|
<p>Ubuntu 22.04, ROS2 Humble</p> <p>Hi,</p> <p>To port my research project to ROS2, I have been trying to make a native ROS2 implementation of ORB SLAM3 following the ROS1 implementation done by thien94 in <code>https://github.com/thien94/orb_slam3_ros/blob/master/</code>.</p> <p>As far I have understood, the ROS 1 implementation integrates ORB-SLAM3 as a shared library along with the executable node.</p> <p>My project structure looks like the following</p> <p><a href="https://i.stack.imgur.com/2iMmp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2iMmp.png" alt="enter image description here" /></a></p> <p>This Cmake configuration allows me to build the node and orb slam3 as a shared library</p> <pre><code>cmake_minimum_required(VERSION 3.8) project(orb_slam3_ros2) set(ENV{PYTHONPATH} &quot;/opt/ros/humble/lib/python3.10/site-packages/&quot;) # Must be set to match your installation # Must use C++17 to make it compatible with rclcpp set(CMAKE_C_FLAGS &quot;<span class="math-container">${CMAKE_C_FLAGS} -Wall -O3") set(CMAKE_CXX_FLAGS "$</span>{CMAKE_CXX_FLAGS} -Wall -O3&quot;) # Check C++17 support include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG(&quot;-std=c++17&quot; COMPILER_SUPPORTS_CXX17) if(COMPILER_SUPPORTS_CXX17) set(CMAKE_CXX_FLAGS &quot;<span class="math-container">${CMAKE_CXX_FLAGS} -std=c++17") add_definitions(-DCOMPILEDWITHC17) message(STATUS "Using flag -std=c++17.") else() message(FATAL_ERROR "The compiler $</span>{CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.&quot;) endif() LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules) # LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/orb_slam3/Thirdparty/g2o/cmake_modules) # find dependencies find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(std_msgs REQUIRED) find_package(sensor_msgs REQUIRED) find_package(custom_msg_interface REQUIRED) find_package(cv_bridge REQUIRED) find_package(OpenCV 4.2 REQUIRED) find_package(Eigen3 3.3.0 REQUIRED) # Matched with Sophus find_package(Pangolin REQUIRED) #message(&quot;Pangolin libraries: ${Pangolin_LIBRARIES}&quot;) find_package(image_transport REQUIRED) #find_package(Boost REQUIRED) # Doesn't work, needs to work with very old version as discussed here https://github.com/lrse/sptam/issues/49 # find_package(G2O REQUIRED) # if(NOT G2O_FOUND) # message(FATAL_ERROR &quot;G2O not found.&quot;) # endif() # Boost doesn't work # set(Boost_USE_STATIC_LIBS OFF) # set(Boost_USE_MULTITHREADED ON) # set(Boost_USE_STATIC_RUNTIME OFF) # find_package(Boost 1.83.0 REQUIRED COMPONENTS system serialization) # find_package(OpenSSL REQUIRED) # -------------------------- ORB SLAM3 library build includes include_directories(include) # This package include # Library's includes include_directories( <span class="math-container">${PROJECT_SOURCE_DIR} $</span>{PROJECT_SOURCE_DIR}/orb_slam3 <span class="math-container">${PROJECT_SOURCE_DIR}/orb_slam3/include $</span>{PROJECT_SOURCE_DIR}/orb_slam3/include/CameraModels <span class="math-container">${PROJECT_SOURCE_DIR}/orb_slam3/Thirdparty $</span>{PROJECT_SOURCE_DIR}/orb_slam3/Thirdparty/Sophus ${ament_INCLUDE_DIRS} ) include_directories(SYSTEM <span class="math-container">${EIGEN3_INCLUDE_DIRS} $</span>{Pangolin_INCLUDE_DIRS} ) set(THIS_PACKAGE_INCLUDE_DEPENDS rclcpp std_msgs sensor_msgs custom_msg_interface cv_bridge image_transport OpenCV Eigen3 Pangolin ) # Redundant? # include(<span class="math-container">${PROJECT_SOURCE_DIR}/orb_slam3/Thirdparty/DBoW2/CMakeLists.txt) # include($</span>{PROJECT_SOURCE_DIR}/orb_slam3/Thirdparty/g2o/CMakeLists.txt) # set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/orb_slam3/lib) # add_library(${PROJECT_NAME} SHARED add_library(orb_slam3_ros2 SHARED orb_slam3/src/System.cc orb_slam3/src/Tracking.cc orb_slam3/src/LocalMapping.cc orb_slam3/src/LoopClosing.cc orb_slam3/src/ORBextractor.cc orb_slam3/src/ORBmatcher.cc orb_slam3/src/FrameDrawer.cc orb_slam3/src/Converter.cc orb_slam3/src/MapPoint.cc orb_slam3/src/KeyFrame.cc orb_slam3/src/Atlas.cc orb_slam3/src/Map.cc orb_slam3/src/MapDrawer.cc orb_slam3/src/Optimizer.cc orb_slam3/src/Frame.cc orb_slam3/src/KeyFrameDatabase.cc orb_slam3/src/Sim3Solver.cc orb_slam3/src/Viewer.cc orb_slam3/src/ImuTypes.cc orb_slam3/src/G2oTypes.cc orb_slam3/src/CameraModels/Pinhole.cpp orb_slam3/src/CameraModels/KannalaBrandt8.cpp orb_slam3/src/OptimizableTypes.cpp orb_slam3/src/MLPnPsolver.cpp orb_slam3/src/GeometricTools.cc orb_slam3/src/TwoViewReconstruction.cc orb_slam3/src/Config.cc orb_slam3/src/Settings.cc orb_slam3/src/SystemUtils.cc orb_slam3/include/System.h orb_slam3/include/Tracking.h orb_slam3/include/LocalMapping.h orb_slam3/include/LoopClosing.h orb_slam3/include/ORBextractor.h orb_slam3/include/ORBmatcher.h orb_slam3/include/FrameDrawer.h orb_slam3/include/Converter.h orb_slam3/include/MapPoint.h orb_slam3/include/KeyFrame.h orb_slam3/include/Atlas.h orb_slam3/include/Map.h orb_slam3/include/MapDrawer.h orb_slam3/include/Optimizer.h orb_slam3/include/Frame.h orb_slam3/include/KeyFrameDatabase.h orb_slam3/include/Sim3Solver.h orb_slam3/include/Viewer.h orb_slam3/include/ImuTypes.h orb_slam3/include/G2oTypes.h orb_slam3/include/CameraModels/GeometricCamera.h orb_slam3/include/CameraModels/Pinhole.h orb_slam3/include/CameraModels/KannalaBrandt8.h orb_slam3/include/OptimizableTypes.h orb_slam3/include/MLPnPsolver.h orb_slam3/include/GeometricTools.h orb_slam3/include/TwoViewReconstruction.h orb_slam3/include/SerializationUtils.h orb_slam3/include/Config.h orb_slam3/include/Settings.h orb_slam3/include/SystemUtils.h ) set_target_properties(orb_slam3_ros2 PROPERTIES VERSION &quot;${orb_slam3_ros2_VERSION}&quot;) #set_target_properties(orb_slam3_ros2 PROPERTIES PROPERTIES LINKER_LANGUAGE CXX) ament_target_dependencies(orb_slam3_ros2 ${THIS_PACKAGE_INCLUDE_DEPENDS} ) # Works do not delete target_link_libraries(orb_slam3_ros2 <span class="math-container">${OpenCV_LIBS} $</span>{EIGEN3_LIBS} <span class="math-container">${Pangolin_LIBRARIES} $</span>{PROJECT_SOURCE_DIR}/orb_slam3/Thirdparty/DBoW2/lib/libDBoW2.so ${PROJECT_SOURCE_DIR}/orb_slam3/Thirdparty/g2o/lib/libg2o.so -lboost_system -lboost_serialization -lcrypto ) # Find your .so files (replace lib1.so and lib2.so with your actual file names) set(DBoW2_PATH &quot;<span class="math-container">${PROJECT_SOURCE_DIR}/orb_slam3/Thirdparty/DBoW2/lib/libDBoW2.so") set(g2o_PATH "$</span>{PROJECT_SOURCE_DIR}/orb_slam3/Thirdparty/g2o/lib/libg2o.so&quot;) # Install .so files to the lib directory in the install space install(FILES <span class="math-container">${DBoW2_PATH} DESTINATION lib) install(FILES $</span>{g2o_PATH} DESTINATION lib) # --------------------------------------- CPP node ------------------------------------------ # Add executable add_executable(agent0 src/agent0.cpp src/robot_slam.cpp ) #ament_target_dependencies(agent0 vslam_lib rclcpp std_msgs sensor_msgs custom_msg_interface cv_bridge Pangolin Eigen3 image_transport OpenCV) #ament_target_dependencies(agent0 rclcpp std_msgs sensor_msgs custom_msg_interface cv_bridge Pangolin Eigen3 image_transport OpenCV) ament_target_dependencies(agent0 PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS} ) target_link_libraries(agent0 PUBLIC orb_slam3_ros2 ) # Install the library install( TARGETS orb_slam3_ros2 EXPORT orb_slam3_ros2Targets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include/orb_slam3_ros2 ) # install( # TARGETS orb_slam3_ros2 # EXPORT export_orb_slam3_ros2 # LIBRARY DESTINATION lib # ARCHIVE DESTINATION lib # RUNTIME DESTINATION lib/orb_slam3_ros2 # INCLUDES DESTINATION include/orb_slam3_ros2 # ) # Install this executable install(TARGETS agent0 DESTINATION lib/orb_slam3_ros2 ) # This works install (DIRECTORY include/ DESTINATION include/orb_slam3_ros2 ) ament_export_include_directories(include) # &lt;-- superfluous? ament_export_libraries(rb_slam3_ros2Targets) # &lt;-- superfluous? ament_export_targets(orb_slam3_ros2Targets HAS_LIBRARY_TARGET) </code></pre> <p>With a <code>colcon build --packages-select orb_slam3_ros2</code> it builds successfully. But when I invoke this command</p> <pre><code>ros2 run orb_slam3_ros2 agent0 --ros-args -p agent_name:=robot0 </code></pre> <p>I am getting this error</p> <pre><code>/home/tigerwife/ros2_ws/install/orb_slam3_ros2/lib/orb_slam3_ros2/agent0: error while loading shared libraries: libpango_vars.so: cannot open shared object file: No such file or directory </code></pre> <p>I followed the official tutorial in <code>https://github.com/stevenlovegrove/Pangolin</code> and installed Pangolin in <code>home/pangolin/Pangolin</code>. My ROS workspace is here <code>home/ros2_ws</code></p> <p>Any help would be highly appreciated.</p> <p>With best @Mechazo11</p>
ROS2 port of ORB SLAM3. Can copy libDoW2.so and libg2o.so using Cmake but getting error while loading shared libraries: libpango_vars.so
<p>what solved it for me was Callback Groups in ros2 which user @JRTG introduced...(<a href="https://docs.ros.org/en/iron/How-To-Guides/Using-callback-groups.html" rel="nofollow noreferrer">https://docs.ros.org/en/iron/How-To-Guides/Using-callback-groups.html</a>)</p> <p>now i will put my code and explain how Callback Groups Solved it.</p> <pre><code>using namespace ego_planner; int main(int argc, char **argv) { rclcpp::init(argc, argv); auto node = rclcpp::Node::make_shared(&quot;ego_planner_node&quot;); EGOReplanFSM rebo_replan; rclcpp::executors::MultiThreadedExecutor executor; rebo_replan.init(node); executor.add_node(node); executor.spin(); rclcpp::shutdown(); return 0; } </code></pre> <p>here i make MultiThreadedExecutor Instance and spin the Node with it. i'm using MultiThreadedExecutor because in order to use Callback Groups Correctly one should use MultiThreadedExecutor based on the guide found in : <a href="https://docs.ros.org/en/iron/How-To-Guides/Using-callback-groups.html" rel="nofollow noreferrer">https://docs.ros.org/en/iron/How-To-Guides/Using-callback-groups.html</a></p> <pre><code>namespace ego_planner { void EGOReplanFSM::init(rclcpp::Node::SharedPtr node) { . . . auto target_callback_group = node-&gt;create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive); rclcpp::SubscriptionOptions options; options.callback_group = target_callback_group; waypoint_sub_ = node-&gt;create_subscription&lt;geometry_msgs::msg::PoseStamped&gt;( &quot;/move_base_simple/goal&quot;, 1, [this, node](const geometry_msgs::msg::PoseStamped::SharedPtr msg) { waypointCallback(msg, node);}, options); . . . }//EGOReplanFSM::init void EGOReplanFSM::waypointCallback(const geometry_msgs::msg::PoseStamped:EGOReplanFSM::init:SharedPtr &amp;msg,rclcpp::Node::SharedPtr node) { . . . planNextWaypoint(end_wp,node); }//EGOReplanFSM::waypointCallback void EGOReplanFSM::planNextWaypoint(const Eigen::Vector3d next_wp,rclcpp::Node::SharedPtr node) { . . . while (rclcpp::ok() &amp;&amp;exec_state_ != EXEC_TRAJ) { rclcpp::sleep_for(std::chrono::milliseconds(1)); } . . . }//EGOReplanFSM::planNextWaypoint }//ego_planner </code></pre> <p>in EGOReplanFSM::init function i have a subscription with the name of &quot;/move_base_simple/goal&quot;...this subscription's callback name is 'waypointCallback' and in it there is another function with the name of 'planNextWaypoint' and in this function lies the problematic &quot;while loop&quot;:</p> <pre><code>while (rclcpp::ok() &amp;&amp;exec_state_ != EXEC_TRAJ) { rclcpp::sleep_for(std::chrono::milliseconds(1)); } </code></pre> <p>by creating a callback group by the name of 'target_callback_group' and assigning &quot;/move_base_simple/goal&quot; Subscriber to it, i was able to solve this &quot;while loop&quot; deadlock... in this code i have two callback groups... one is 'target_callback_group' and its for &quot;/move_base_simple/goal&quot; subscriber and second is the node's default callback group for all the other callbacks...(when you don't specify a callback group, ros2 uses node's default callback group) and both of these callback groups are MutuallyExclusive.</p> <p>i tried to explain my problem and what solved it to the best of my abilities... i hope this help others as it helped me(sorry if my writing is not good, English is not my first language)</p>
105974
2023-12-10T10:52:50.297
|ros|ros2|roscpp|rclcpp|
<p>i'm trying to transform ego-planner-swarm founded in:</p> <p><a href="https://github.com/ZJU-FAST-Lab/ego-planner-swarm" rel="nofollow noreferrer">https://github.com/ZJU-FAST-Lab/ego-planner-swarm</a></p> <p>to ros2...</p> <p>the problem was in one of the subscription's callbacks there was a function in which there was a &quot;while loop&quot; with only delay in it... and this loop's condition was dependent on other timers callbacks... and if the other timers callbacks wouldn't be called, the code would stuck in while loop. in ros1 to slove this kind of problem we can use</p> <pre><code>ros::spinOnce(); </code></pre> <p>in the loop when the node is already spinning and that would prevent the code to stuck in the &quot;while loop&quot; but in ros 2 if the the node is already spinning and you use</p> <pre><code>rclcpp::spin_some(node); </code></pre> <p>in the loop, you would get</p> <blockquote> <p>terminate called after throwing an instance of 'std::runtime_error'</p> </blockquote> <blockquote> <p>what(): Node has already been added to an executor.</p> </blockquote> <p>that's because in ros2 when spin commands which get nodes as input argument are called, they automatically add node to an executor...</p> <p>the second thing i tried was spinning the node using SingleThreadedExecutor and passed the Executor Instance to the while loop. then i used spin commands with using the Executor Instance in the &quot;while loop&quot;... things like:</p> <pre><code>Executor.spin(); Executor.spin_some(); Executor.sp_once(); </code></pre> <p>this way i was not adding the node to an Executor... but i was trying to spin a node which is already spinning! and i got :</p> <blockquote> <p>terminate called after throwing an instance of 'std::runtime_error'</p> </blockquote> <blockquote> <p>what(): spin_once() called while already spinning</p> </blockquote> <p>then how i can fix this problem?</p>
ros2 spinning problem[SOLVED]
<p>I am the author of your reference [2]. I will try to help clarify a few things. First, the equivalent of sourcing the <code>/opt/ros/noetic</code> underlay is implicitly done in Ubuntu 22.04 when the <code>ros-core-dev</code> (or its derived packages, such as <code>ros-robot-dev</code> and <code>ros-desktop-dev</code>), are installed. So, there is no need to source any ROS1 underlay to start with.</p> <p>As for custom messages, you can take a look at the Dockerfile provided in [2], where I added a few message types and services that don't seem to have ROS1 pre-built binaries available (i.e., AddTwoInts and GripMap). The approach of adding them can be applied to any custom messages or services.</p> <p>Hope it helps.</p>
105992
2023-12-11T11:17:50.070
|ros2|ros-humble|ros-noetic|custom-message|ros-foxy|
<p>This question is relevant to the joint use of ROS 2 humble and ROS noetic, but with the explicit intent of using custom messages/services/actions for communication between them, under Ubuntu 22.04.</p> <p>From what I have understood so far, what is required for support of custom interfaces is that the bridge be able to source both ROS's <code>catkin_ws/devel/setup.bash</code>and ROS 2's <code>ros2_ws/install/local_setup.bash</code>, which is possible for the above configuraton (excluding actions) if humble is substituted for foxy and <a href="https://github.com/li9i/ros2-bridge-msgs-srvs-demos" rel="nofollow noreferrer">everything is docker-ised</a> via the <a href="https://hub.docker.com/layers/library/ros/foxy-ros1-bridge/images/sha256-7f3fea5f773eae8cc5ec19ac4b187c6ccdea246ebdde5f2f5cd15f0465925125?context=explore" rel="nofollow noreferrer">foxy-ros1-bridge</a> docker image. (The image's underlying Ubuntu distribution is 20.04, in which noetic and foxy debian packages are instantly available.)</p> <p>However, I have not been able to find anything pertaining to my original intent which concerns the humble distro. There are native solutions or docker images of humble + noetic + bridge <a href="https://docs.ros.org/en/humble/How-To-Guides/Using-ros1_bridge-Jammy-upstream.html?highlight=bridge#:%7E:text=the%20release%20of%20ros%202%20humble%20(and%20rolling)%20on%20ubuntu%2022.04%20jammy%20jellyfish%20marks%20the%20first%20ros%202%20release%20on%20a%20platform%20with%20no%20official%20ros%201%20release." rel="nofollow noreferrer">[0]</a><a href="https://github.com/contradict/ros-humble-ros1-bridge" rel="nofollow noreferrer">[1]</a><a href="https://github.com/TommyChangUMD/ros-humble-ros1-bridge-builder" rel="nofollow noreferrer">[2]</a><a href="https://github.com/brow1633/ros_docker" rel="nofollow noreferrer">[3]</a> but these do not result in a setup where a <code>/opt/ros/noetic</code> directory exists, which I understand is a prerequisite for sourcing the user's overlay. Since they do not conform to the &quot;triple sourcing&quot; needed (the bridge resides in its own workspace), and there is no guide that shows this explicitly, I do not know if these solutions are indeed able to produce a configuration where support for custom interfaces is possible.</p> <p>Does the community have a solution for this that I have overlooked or misunderstood? I am also asking this because, otherwise, if one has no choice but to use some old ROS packages in a system of new ROS 2 packages, then all ROS 2 packages which require custom communication with them will forever have to be foxy packages.</p>
ROS 2 humble + ROS noetic + bridge + support for custom messages
<p>The user in the video is pressing the <code>tab</code> key to get a list of possible completions of <code>rosmsg show std_msgs/</code>, you are pressing 'enter' and tring to execute that command, but it's invalid, it wants a specific message to show. (It'd be helpful if the video creator was using a program to show which keys they were pressing on screen)</p> <pre><code>rosmsg show std_msgs/ </code></pre> <p>don't press enter, press tab, then get this output:</p> <pre><code>std_msgs/Bool std_msgs/Empty std_msgs/Int16 std_msgs/Int8 std_msgs/UInt16 std_msgs/UInt8 std_msgs/Byte std_msgs/Float32 std_msgs/Int16MultiArray std_msgs/Int8MultiArray std_msgs/UInt16MultiArray std_msgs/UInt8MultiArray std_msgs/ByteMultiArray std_msgs/Float32MultiArray std_msgs/Int32 std_msgs/MultiArrayDimension std_msgs/UInt32 std_msgs/Char std_msgs/Float64 std_msgs/Int32MultiArray std_msgs/MultiArrayLayout std_msgs/UInt32MultiArray std_msgs/ColorRGBA std_msgs/Float64MultiArray std_msgs/Int64 std_msgs/String std_msgs/UInt64 std_msgs/Duration std_msgs/Header std_msgs/Int64MultiArray std_msgs/Time std_msgs/UInt64MultiArray </code></pre> <p>I usually do this to get a list of possible messages without using the tab completion:</p> <pre><code>rosmsg list | grep std_msgs </code></pre>
105996
2023-12-11T14:23:59.443
|ros|ros-noetic|
<p>I am a newbie to ROS and know absolutely nothing about it. I am following <a href="https://youtu.be/otGWUZqB9XE?si=4U5ESuUyJhqvQlSk&amp;t=329" rel="nofollow noreferrer">this tutorial</a> and at 5:33 he enters the following command <code>rosmsg show std_msgs/</code> and when I do the same in the terminal i get the following error, and I am not sure what the problem is. I have tried looking for an answer in other places but I couldn't find anything. Any help would be much appreciated.</p> <p>Error:</p> <pre><code>Unable to load msg [std_msgs/]: Cannot locate message [] in package [std_msgs] with paths [['/opt/ros/noetic/share/std_msgs/msg']] </code></pre>
rosmsg show unable to load message [std_msgs/]
<p>I was able to set it up after setting x11 server and x11 forwarding. Thank you for all of your support as well.</p>
105999
2023-12-11T15:00:02.853
|ros|ros2|rviz|raspberry-pi|
<p>I have a Raspberry Pi 4 running Ubuntu 22.04 with ros2 humble. My laptop is running Ubuntu 20.04 with ros1 noetic. I have connected a Slamtec RPLIDAR A3 with my Raspberry Pi and want to view its laser scan in RViz. I have added their <a href="https://github.com/Slamtec/sllidar_ros2/tree/main" rel="nofollow noreferrer">ros2 package</a> for my Raspberry Pi board. the launch file in the package opens the rviz2 in the Raspberry Pi, but there is no display connected to my Raspberry Pi.</p> <p>Can I view the laser scan readings from my raspberry pi using my laptops Rviz? Thank you for your time.</p>
Viewing laser scan data coming from Raspberry pi using Laptop
<p>Sure. You can use other language's action clients today like Python and C. If you have a Rust rcl API, you should be able to interact with Action, Service, or Topic APIs in any language. I can't speak to the Rust rcl ROS 2 client library myself, but there is a community effort to provide such a thing, but you should be aware its likely incomplete and not officially supported by the Foundation.</p> <p>You can write code in Rust should you have sufficient resources in the client library (or wrap your own, I suppose) and interact with Nav2 without a problem I imagine. The only exceptions are going to be composition nodes and plugins, whos mechanisms are C++-only.</p> <p>Plugins however do need to be C++ or wrapped at least from the pluginlib's perspective as C++. I've seen some people wrap python plugin implementations around a C++ wrapper to make that work, though not something I have a great amount of experience with behind glancing through the code just to see how they did it.</p>
106018
2023-12-12T14:11:38.753
|ros|ros2|nav2|
<p>I know C++ is the de-facto language for robotics. But Rust is also a decent language choice for this domain. Is it possible write an action/task server (planner, controller, etc) in another programming language and use it in Nav2? I would prefer the memory safety and robustness of Rust.</p> <p>It seems the action server for ROS2 can be written in any language</p> <ul> <li><a href="https://navigation.ros.org/tutorials/docs/adding_a_nav2_task_server.html" rel="nofollow noreferrer">https://navigation.ros.org/tutorials/docs/adding_a_nav2_task_server.html</a></li> </ul> <p>But the plugins for <code>pluginlib</code> need to be in C++?</p> <ul> <li><a href="https://navigation.ros.org/plugin_tutorials/docs/writing_new_bt_plugin.html#writing-new-nbt-plugin" rel="nofollow noreferrer">https://navigation.ros.org/plugin_tutorials/docs/writing_new_bt_plugin.html#writing-new-nbt-plugin</a></li> </ul>
Is it possible write a Nav2 task server (planner, controller, etc) in another programming language?
<p>The solution was to use ROS2 roslib.js classes for action client and action goal: <a href="https://github.com/RobotWebTools/roslibjs/issues/646#issuecomment-1855739957" rel="nofollow noreferrer">https://github.com/RobotWebTools/roslibjs/issues/646#issuecomment-1855739957</a></p> <p>Fixed to use ROS2 classes:</p> <pre><code>// Create an action client. this.actionClient = new ROSLIB.Action({ ros: this.ros, name: '/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory', actionType: 'control_msgs/FollowJointTrajectory' }); // Create a goal this.goal = new ROSLIB.ActionGoal({ trajectory: { joint_names: ['shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'], points: [ { positions: [3.02, -1.63, -1.88, 1.01, 1.51, 1.13], time_from_start: { sec: 5, nanosec: 500 } }, { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, -1.63], time_from_start: { sec: 6, nanosec: 500 } }, { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, 6.2], time_from_start: { sec: 50, nanosec: 500 } } ] }, goal_tolerance: [ { name: 'shoulder_pan_joint', position: 0.01 }, { name: 'shoulder_lift_joint', position: 0.01 }, { name: 'elbow_joint', position: 0.01 }, { name: 'wrist_1_joint', position: 0.01 }, { name: 'wrist_2_joint', position: 0.01 }, { name: 'wrist_3_joint', position: 0.01 } ] }); // Send the goal , following the example from https://github.com/RobotWebTools/roslibjs/blob/ros2-actions/examples/ros2_action_client.html var goal_id = this.actionClient.sendGoal(this.goal, (result) =&gt; { console.log('Result for action goal on ' + this.actionClient.name + ': ' + result.result.sequence); }, (feedback) =&gt; { console.log('Feedback for action on ' + this.actionClient.name + ': ' + feedback.partial_sequence); }, ); </code></pre>
107035
2023-12-13T13:02:56.437
|ros|ros2|webots|roslibjs|rosbridge-suite|
<p>I'm encountering difficulties sending a ROS2 action from roslib.js to rosbridge_suite. The action is supposed to be handled by rosbridge_suite, but I'm encountering issues related to the import of message classes, such as &quot;Unable to import msg class FollowJointTrajectoryGoal from package control_msgs.&quot;</p> <p>My setup:</p> <ul> <li>Ubuntu 22.04.2 LTS (Jammy) running on Windows 11 wsl</li> <li>ROS2 @ rolling distribution</li> <li>roslib.js @ ros2 branch ( <a href="https://github.com/RobotWebTools/roslibjs/commit/6a63a03da8df4f999d26cb4f93f991f39e9a16bf" rel="nofollow noreferrer">commit 6a63a03</a> )</li> <li>rosbridge_suite @ ros2-actions branch ( <a href="https://github.com/RobotWebTools/rosbridge_suite/commit/692f41a8a2eebff5b3d1c72c1846577ad7949bcc" rel="nofollow noreferrer">commit 692f41a</a> )</li> <li>ROS_PYTHON_VERSION=3</li> </ul> <p>This is the <a href="https://github.com/cyberbotics/webots_ros2/wiki/Example-Universal-Robots" rel="nofollow noreferrer">example</a> action I'm trying to send from roslib.js to rosbridge:</p> <pre><code>ros2 action send_goal /ur5e/ur_joint_trajectory_controller/follow_joint_trajectory control_msgs/action/FollowJointTrajectory &quot;{ trajectory: { joint_names: [shoulder_pan_joint, shoulder_lift_joint, elbow_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint], points: [ { positions: [3.02, -1.63, -1.88, 1.01, 1.51, 1.13], time_from_start: { sec: 5, nanosec: 500 } }, { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, -1.63], time_from_start: { sec: 6, nanosec: 500 } }, { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, 6.2], time_from_start: { sec: 50, nanosec: 500 } } ] }, goal_tolerance: [ { name: shoulder_pan_joint, position: 0.01 }, { name: shoulder_lift_joint, position: 0.01 }, { name: elbow_joint, position: 0.01 }, { name: wrist_1_joint, position: 0.01 }, { name: wrist_2_joint, position: 0.01 }, { name: wrist_3_joint, position: 0.01 } ] }&quot; </code></pre> <p>I use the <a href="https://github.com/RobotWebTools/roslibjs/blob/ros2-actions/build/roslib.js" rel="nofollow noreferrer">latest roslib.js build from ros2-actions branch</a> and I built and ran rosbridge_websocket (ros2 branch) with the following terminal commands. I could only find <a href="https://wiki.ros.org/rosbridge_suite/Tutorials/DevelopingRosbridge" rel="nofollow noreferrer">ROS1 rosbridge building steps</a>. I modified the steps after some research.</p> <pre><code>source /opt/ros/rolling/setup.bash mkdir ~/ws mkdir ~/ws/src cd ~/ws/src git clone https://github.com/RobotWebTools/rosbridge_suite.git -b ros2 cd ~/ws sudo apt install python3-colcon-common-extensions colcon build --symlink-install colcon test source install/setup.bash ros2 run rosbridge_server rosbridge_websocket </code></pre> <p>Here's my javascript code for sending the action using roslib.js:</p> <pre><code>/* eslint-disable no-undef */ import &quot;./roslib.js&quot;; // https://github.com/RobotWebTools/roslibjs/blob/ros2-actions/build/roslib.js class RosController { constructor() { this.ros = new ROSLIB.Ros({ url: &quot;ws://localhost:9090&quot;, }); this.ros.on('error', (error) =&gt; { console.error('Error connecting to ROS:', error); }); // Create an action client this.actionClient = new ROSLIB.ActionClient({ ros: this.ros, serverName: '/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory', actionName: 'control_msgs/action/FollowJointTrajectory' }); // Create a goal this.goal = new ROSLIB.Goal({ actionClient: this.actionClient, goalMessage: { trajectory: { joint_names: ['shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'], points: [ { positions: [3.02, -1.63, -1.88, 1.01, 1.51, 1.13], time_from_start: { sec: 5, nanosec: 500 } }, { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, -1.63], time_from_start: { sec: 6, nanosec: 500 } }, { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, 6.2], time_from_start: { sec: 50, nanosec: 500 } } ] }, goal_tolerance: [ { name: 'shoulder_pan_joint', position: 0.01 }, { name: 'shoulder_lift_joint', position: 0.01 }, { name: 'elbow_joint', position: 0.01 }, { name: 'wrist_1_joint', position: 0.01 }, { name: 'wrist_2_joint', position: 0.01 }, { name: 'wrist_3_joint', position: 0.01 } ] } }); // Check the status of the goal this.goal.on('status', (status) =&gt; { console.log('Goal status: ' + status.status); if (status.status === 5) { // 5 is the status code for REJECTED console.error('Goal was rejected'); } }); this.ros.on('error', (error) =&gt; { console.error('Error connecting to ROS:', error); }); this.ros.on('connection', () =&gt; { console.log('Connected to websocket server.'); // ROS is connected, now you can send the goal this.moveUR5eRobot(); }); this.ros.on('close', function () { console.log('Connection to websocket server closed.'); }); // Optional: Listen for result or feedback this.goal.on('result', (result) =&gt; { console.log('Action completed successfully:', result); }); this.goal.on('feedback', (feedback) =&gt; { console.log('Received feedback:', feedback); }); // Optional: Handle errors this.goal.on('timeout', () =&gt; { console.error('Action did not complete before timeout'); }); } getRos() { return this.ros; } /* https://docs.ros.org/en/iron/Tutorials/Advanced/Simulators/Webots/Installation-Windows.html#launch-the-webots-ros2-universal-robot-example https://index.ros.org/p/webots_ros2_universal_robot/#humble-overview https://github.com/cyberbotics/webots_ros2/wiki/Example-Universal-Robots */ moveUR5eRobot() { console.log(&quot;moveUR5eRobot&quot;); // Send the goal this.goal.send(); } } export { RosController }; </code></pre> <p>The rosbridge_suite prints errors indicating problems with importing message classes. I've tried both the rolling and iron distributions, and the issue persists. Am I missing something in my setup, or could the problem be in rosbridge or roslib.js?</p> <pre><code>tapani@Desktop:~/ws$ ros2 run rosbridge_server rosbridge_websocket registered capabilities (classes): - &lt;class 'rosbridge_library.capabilities.advertise.Advertise'&gt; - &lt;class 'rosbridge_library.capabilities.publish.Publish'&gt; - &lt;class 'rosbridge_library.capabilities.subscribe.Subscribe'&gt; - &lt;class 'rosbridge_library.capabilities.defragmentation.Defragment'&gt; - &lt;class 'rosbridge_library.capabilities.advertise_service.AdvertiseService'&gt; - &lt;class 'rosbridge_library.capabilities.call_service.CallService'&gt; - &lt;class 'rosbridge_library.capabilities.service_response.ServiceResponse'&gt; - &lt;class 'rosbridge_library.capabilities.unadvertise_service.UnadvertiseService'&gt; - &lt;class 'rosbridge_library.capabilities.advertise_action.AdvertiseAction'&gt; - &lt;class 'rosbridge_library.capabilities.action_feedback.ActionFeedback'&gt; - &lt;class 'rosbridge_library.capabilities.action_result.ActionResult'&gt; - &lt;class 'rosbridge_library.capabilities.send_action_goal.SendActionGoal'&gt; - &lt;class 'rosbridge_library.capabilities.unadvertise_action.UnadvertiseAction'&gt; [INFO] [1702467864.667909416] [rosbridge_websocket]: Rosbridge WebSocket server started on port 9090 [INFO] [1702467884.421195988] [rosbridge_websocket]: Calling services in existing thread [INFO] [1702467884.421448867] [rosbridge_websocket]: Sending action goals in existing thread [INFO] [1702467884.421979997] [rosbridge_websocket]: Client connected. 1 clients total. [ERROR] [1702467885.354114994] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] [id: advertise:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/goal:1] advertise: Unable to import msg class FollowJointTrajectoryGoal from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryGoal' [INFO] [1702467885.359658954] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] Subscribed to /ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/status [ERROR] [1702467885.359900905] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] [id: subscribe:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/feedback:4] subscribe: Unable to import msg class FollowJointTrajectoryFeedback from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryFeedback' [ERROR] [1702467885.360110707] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] [id: subscribe:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/result:5] subscribe: Unable to import msg class FollowJointTrajectoryResult from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryResult' [ERROR] [1702467885.360289265] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] [id: publish:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/goal:7] publish: Cannot infer topic type for topic /ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/goal as it is not yet advertised [ERROR] [1702467885.360480628] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] [id: subscribe:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/result:6] subscribe: Unable to import msg class FollowJointTrajectoryResult from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryResult' [INFO] [1702467885.491837270] [rosbridge_websocket]: Calling services in existing thread [INFO] [1702467885.492038974] [rosbridge_websocket]: Sending action goals in existing thread [INFO] [1702467885.492506295] [rosbridge_websocket]: Client connected. 2 clients total. [ERROR] [1702467886.352260753] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: advertise:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/goal:1] advertise: Unable to import msg class FollowJointTrajectoryGoal from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryGoal' [INFO] [1702467886.397142045] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] Subscribed to /ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/status [ERROR] [1702467886.397518737] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: subscribe:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/feedback:4] subscribe: Unable to import msg class FollowJointTrajectoryFeedback from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryFeedback' [ERROR] [1702467886.398005589] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: subscribe:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/result:5] subscribe: Unable to import msg class FollowJointTrajectoryResult from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryResult' [ERROR] [1702467886.398194954] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: publish:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/goal:7] publish: Cannot infer topic type for topic /ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/goal as it is not yet advertised [ERROR] [1702467886.398401323] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: subscribe:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/result:6] subscribe: Unable to import msg class FollowJointTrajectoryResult from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryResult' [ERROR] [1702467887.947030067] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: publish:/ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/goal:8] publish: Cannot infer topic type for topic /ur5e/ur_joint_trajectory_controller/follow_joint_trajectory/goal as it is not yet advertised </code></pre> <p>Related roslib.js github issue: <a href="https://github.com/RobotWebTools/roslibjs/issues/646" rel="nofollow noreferrer">https://github.com/RobotWebTools/roslibjs/issues/646</a></p>
Issues with Sending ROS2 Action from roslib.js to rosbridge_suite: Unable to Import Message Classes
<p>Without knowing details of the underlying implementation of your drive, I can only guess:</p> <ul> <li>If the drive takes new position commands without stopping the old target, you can use position command and regularily send a new setpoint, sampled by JTC. Then the drive might have safe software-end stops implemented etc.</li> <li>use the velocity interface of your drive, and use the joint_trajectory_controller with position control and velocity command interface. Unclear if end-stops work then?</li> </ul> <p>If you use the latter one: (More information <a href="https://control.ros.org/humble/doc/ros2_controllers/joint_trajectory_controller/doc/userdoc.html" rel="nofollow noreferrer">in the docs</a>)</p> <pre><code>command_interfaces: - velocity state_interfaces: - position - velocity </code></pre> <p>In the write method of the hardware component, you send the velocity to the hardware coming from the command interfaces. In the read method you get the data from your encoders, calculate the velocity from the signal, and update the state interfaces.</p>
107036
2023-12-13T13:20:14.180
|ros2|ros-humble|joint-trajectory-controller|ros2-controllers|
<p>I'm wondering if someone has some ideas about how to make a prismatic axis work with ros2 controllers.</p> <p>I am using a UR10e which is mountd on an igus drylin ZLW 7th Axis controlled by Dryve D1. I have an API for it to communicate with the Axis to initialize, run and control it. It has an encoder so after homing I can extrapolate the exact position, velocity and other info.</p> <p>I send the move command using the function <code>xAxis.profilePositionAbs_Async(pos, setvel, acc, dec);</code></p> <p>I have written a hardware interface with the following functions:</p> <pre class="lang-cpp prettyprint-override"><code>std::vector&lt;hardware_interface::StateInterface&gt; RRBotSystemPositionOnlyHardware::export_state_interfaces() { std::vector&lt;hardware_interface::StateInterface&gt; state_interfaces; state_interfaces.emplace_back(hardware_interface::StateInterface( axisName, hardware_interface::HW_IF_POSITION, &amp;pos)); return state_interfaces; } std::vector&lt;hardware_interface::CommandInterface&gt; RRBotSystemPositionOnlyHardware::export_command_interfaces() { std::vector&lt;hardware_interface::CommandInterface&gt; command_interfaces; command_interfaces.emplace_back(hardware_interface::CommandInterface( axisName, hardware_interface::HW_IF_POSITION, &amp;pos)); return command_interfaces; } hardware_interface::CallbackReturn RRBotSystemPositionOnlyHardware::on_deactivate( const rclcpp_lifecycle::State &amp; /*previous_state*/) { xAxis.waitForReady(); xAxis.setShutdown(); // Gracefully close everything down close(xAxis.sock); return hardware_interface::CallbackReturn::SUCCESS; } hardware_interface::return_type RRBotSystemPositionOnlyHardware::read( const rclcpp::Time &amp; /*time*/, const rclcpp::Duration &amp; /*period*/) { pos=xAxis.getCurrentPosInMM()/1000; std::cout &lt;&lt; &quot;position in meters&quot; &lt;&lt; pos &lt;&lt; std::endl; return hardware_interface::return_type::OK; } hardware_interface::return_type RRBotSystemPositionOnlyHardware::write( const rclcpp::Time &amp; /*time*/, const rclcpp::Duration &amp; /*period*/) { xAxis.profilePositionAbs_Async(pos*1000, setvel, acc, dec); return hardware_interface::return_type::OK; } </code></pre> <p>Now the problem is, as the profilePositionAbs_Async function is within the write function it gets called every loop, meaning the movement gets rerun continuously leading to a continuous accel- and deceleration.</p> <p>Also I seem to get issues due to the position parameter being used in both the state and command interface.</p> <p>So i was wondering, what is the best way to incorporate such an axis in a joint trajectory controller and handle the state/command interference</p> <p>EDIT: in order to elaborate on @ChristophFroehlich's reply i have added the description of the possible functions to interact with the driver:</p> <pre class="lang-cpp prettyprint-override"><code> void profilePositionAbs(float position, float velo, float accel, float decel=0); // Function &quot;Profile Position Mode&quot;; Move to an absolute position with given velocity, acceleration and deceleration void profilePositionRel(float position, float velo, float accel, float decel=0); // Function &quot;Profile Position Mode&quot;; Move to an relative position with given velocity, acceleration and deceleration void profileVelocity(float velo, float accel, float decel=0); // Function &quot;Profile Position Mode&quot;; Move with a set target velocity, acceleration and deceleration; Movement starts directly when the target velocity is not 0``` </code></pre>
Implementing a prismatic joint within a joint trajectory controller
<p>Thanks to Lucas Walter and Mike973 I realized that I forgot to properly configure the nodes in the launch file, setting the parameter use_sim_time to True.</p> <p>Thank you so much guys for the help!</p>
107047
2023-12-14T12:14:19.390
|rviz|mobile-robot|simulation|pointcloud|drone|
<p>I'm using ROS2 Humble on Ubuntu 22.04. In my project I'm trying to visualize in rviz2 a pointcloud generated by a depth camera, mounted on a drone simulated in gazebo garden. Thanks to <a href="https://robotics.stackexchange.com/questions/98136/pointcloud2-visualisation-in-rviz2">this topic</a> I've been able to visualize the pointcloud in rviz2, setting the mobile frame of the pointcloud as fixed frame, but, since I have a non trivial TF hierarchy, the resulting orientation of the points is wrong.<a href="https://i.stack.imgur.com/OF7VD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OF7VD.png" alt="TF graph by rqt" /></a></p> <p>The reason why the TF hierarchy has this shape is that the drone pose and attitude is updated republishing the autopilot (PX4) odometry, which consist in the transformation between a NED inertial frame and a FRD mobile frame. Since I'm interested in using an ENU fixed frame and FLU mobile frames, I published other two static TF to properly convert the notation. Finally, I added the last static transformation from the drone base_link to the depth_camera_frame, since the camera is pointing downwards.</p> <p>In my perspective rviz2 should be able to convert the points coming from the depth_camera_frame according to the TF hierarchy and display them in the map fixed frame. Unfortunately this is not happening. Does anyone have any clue about what I'm missing?</p> <p>Thank you so much</p> <p>EDIT:</p> <p>As Lucas suggested, I set as fixed frame all the available TFs. Doing so I realized that the TF which &quot;brokens&quot; the chain from the camera frame to the inertial frame is the time varying one. In other words, the frames base_link and base_link_frd, which are connected to depth_camera_frame by means of static TF only, are showing in some ways the points, while map_ned and map are just returning the message in rviz &quot;showing [0] points from [0] messages&quot;. I would say that problem like this could arise from the incorrect temporization of the pointcloud packets and the TF updates, but this is just an impression. Anyway I upload at <a href="https://we.tl/t-qUPQJSnhFv" rel="nofollow noreferrer">this link</a> a bag file in mcap format and below the source code of the odometry republisher code.</p> <p>Again, thank you so much for the help!</p> <pre><code>#!/usr/bin/env python3 import rclpy from rclpy.node import Node from rclpy.qos import QoSProfile, QoSReliabilityPolicy, QoSHistoryPolicy from geometry_msgs.msg import Quaternion from sensor_msgs.msg import JointState from tf2_ros import TransformBroadcaster, TransformStamped from px4_msgs.msg import VehicleOdometry import _thread class OdometryStatePublisher(Node): &quot;&quot;&quot;Node that converts the topic published by PX4 into topics listened by rviz &quot;&quot;&quot; def __init__(self): # Configure node super().__init__('odometry_state_publisher') # set node name self.nodeName = self.get_name() qos_subscriber = QoSProfile( reliability=QoSReliabilityPolicy.BEST_EFFORT, history=QoSHistoryPolicy.KEEP_LAST, depth=10) qos_publisher = QoSProfile( reliability=QoSReliabilityPolicy.RELIABLE, history=QoSHistoryPolicy.KEEP_LAST, depth=10) # Configure subscription to PX4 odometry self.odometryPosition=[0, 0, 0] # set initial odometry self.odometryQuaternion=[1, 0, 0, 0] # q0,qx,qy,qz self.px4OdometrySubscription = self.create_subscription(msg_type=VehicleOdometry, topic='/fmu/out/vehicle_odometry', callback=self.odometry_updater, qos_profile=qos_subscriber) # Configure transfer function publisher self.tfBroadcaster = TransformBroadcaster(self, qos=qos_publisher) # Configure publishing thread self.endOfProgram=False self.publishing_rate = self.create_rate(10) #Hz # Start publishing thread try: _thread.start_new_thread(self.topicPublisher, ()) except: print(&quot;Error in thread creation!!!&quot;) # Log that the node is started self.get_logger().info(&quot;{0} started&quot;.format(self.nodeName)) # Callback executed by the odometry subscriber def odometry_updater(self, msg): self.odometryPosition=msg.position self.odometryQuaternion=msg.q # Function executed in the publishing thread def topicPublisher(self): odometryTF = TransformStamped() odometryTF.header.frame_id = 'map_ned' odometryTF.child_frame_id = 'base_link_frd' # Loop while(not(self.endOfProgram)): # Create current TF and publish it now = self.get_clock().now() odometryTF.header.stamp = now.to_msg() odometryTF.transform.translation.x = float(self.odometryPosition[0]) odometryTF.transform.translation.y = float(self.odometryPosition[1]) odometryTF.transform.translation.z = float(self.odometryPosition[2]) odometryTF.transform.rotation = Quaternion(x=float(self.odometryQuaternion[1]), y=float(self.odometryQuaternion[2]), z=float(self.odometryQuaternion[3]), w=float(self.odometryQuaternion[0])) self.tfBroadcaster.sendTransform(odometryTF) # Print logs #self.get_logger().info(&quot;p: &quot; + str(self.odometryPosition) + &quot;; q: &quot; + str(self.odometryQuaternion)) # Sleep until next loop self.publishing_rate.sleep() # Main thread def main(self): try: rclpy.spin(self) except KeyboardInterrupt: # this happens after Ctrl+C pass self.endOfProgram=True print(&quot;\nShutdown now!&quot;) ############################################################################ # Workaround to avoid configuring entry points in a package without setup.py def odometryStatePublisher_main(args=None): rclpy.init(args=args) # initialize ROS communication node = OdometryStatePublisher() node.main() if __name__ == '__main__': odometryStatePublisher_main() </code></pre> <p>SOLUTION: Thanks to Lucas Walter and Mike973 I realized that I forgot to properly configure the nodes in the launch file, setting the parameter use_sim_time to True.</p> <p>Thank you so much guys for the help!</p>
SOLVED: How to visualize in rviz2 fixed frame a Pointcloud2 collected w.r.t. a mobile frame
<p>If you are new to ros, it's a bad idea to try to configure a mixed ros1 / ros2 system. Debugging the problems you are sure to have requires advanced ros knowledge.</p> <p>If your physical robot uses melodic, and you want a desktop computer to interact with it, the desktop should run ros melodic too. The best option is to first install Ubuntu 18 on the desktop, but if that is difficult, then the next best thing is to run a Docker container with melodic on your linux desktop computer.</p> <p>You will have to follow an install guide. There are firewall, networking and graphics configuration you need to do if you want this to work.</p>
107050
2023-12-14T12:45:21.510
|rviz|mobile-robot|ros-humble|
<p>It cound't be control and it shows me <code>Could not contact ROS master at [http://192.168.1.245:11311], retrying..</code>.how should I do to resolve it.Should I try to use ros1bridge or install a docker ros-melodic</p>
I have a ros-humble pc and a ros-melodic bot, how should I use the pc to control the bot remotely with rviz
<p>If you're looking to fuse the sensor readings together into one better measurement, the right tool for the job is generally a Kalman Filter. It's not ROS specific, but OpenCV has a <a href="https://vovkos.github.io/doxyrest-showcase/opencv/sphinx_rtd_theme/class_cv_KalmanFilter.html" rel="nofollow noreferrer">Kalman Filter Implementation</a>. The OpenCV kalman filter is available in python and C++. It's well documented and there are plenty of <a href="https://pieriantraining.com/kalman-filter-opencv-python-example/" rel="nofollow noreferrer">online tutorials</a> available for it that may apply directly to your use.</p>
107052
2023-12-14T14:07:40.470
|ros2|lidar|sensor-fusion|gazebo-camera|object-detection|
<p>I am trying to achieve sensor fusion between two sensors(camera and lidar). I have two separate node(one is publishing detection results using camera, and other is using lidar and they both are operating on a seperate deep learning based object detection methods) which are publishing detection results in the form of vision_msgs detection array.</p> <p>Now I want to fuse these detection results. How can I go further? I am using ros2 humble with gazebo fortress and I am trying this experiments in the simulated environment only. (no real sensors)</p>
sensor fusion of lidar and camera detection
<p>When you start your Docker ROS container are you telling it --net=host ?</p> <p>This is my start ROS 2 Docker (on Raspberry Pi5 but you'll get the idea):</p> <pre><code>#!/bin/bash cd ~/pi5desk/ros2ws # --rm removes container after exit # --w working dir to start in echo -e &quot;\n*** STARTING ROS 2 HUMBLE PLUS IN DOCKER ***&quot; docker run -it --net=host -v /home/pi:/home/pi -w /home/pi/pi5desk/ros2ws --rm r2hdp echo -e &quot;\n*** EXITED DOCKER ***&quot; </code></pre> <p>If you used the first example - it should have worked.</p> <pre><code>ros2 run demo_nodes_cpp listener &amp; ros2 run demo_nodes_cpp talker </code></pre> <p>Did it?</p> <p>Did you start the Docker container detached and connect two terminal sessions to the same container? (That should have worked without needing a network.)</p> <p>If you started two docker containers interactively, without specifying a network - the two containers cannot see each other. That will not work.</p> <p>Please clarify exactly your sequence of commands to start docker, and run the talker and listener.</p>
107065
2023-12-15T06:35:42.787
|ros2|docker|macos|
<p>I have Sonoma 14.2 on my M1-Max and can not make it run for talker/listener couple of ROS2 in docker container</p> <p>I followed steps at <a href="https://docs.ros.org/en/iron/How-To-Guides/Run-2-nodes-in-single-or-separate-docker-containers.html" rel="nofollow noreferrer">here</a></p> <p>Talker sends messages but no response from listener.</p> <p>How should I discover the issue ?</p> <p>I am running talker/listener in same container and not giving any config definition for startup</p> <blockquote> <p>docker run -it osrf/ros:iron-desktop</p> </blockquote> <p>in docker shell :</p> <blockquote> <p>ros2 run demo_nodes_cpp listener &amp;</p> <p>ros2 run demo_nodes_cpp talker</p> </blockquote>
ROS2 listener/talker only works for talker on MacOS Sonoma 14.2 on M1-Max within docker
<p>In ros, the convention for camera-like devices is to orient the &quot;optical frame&quot; so that +x points right, +y points down, and the +z points forward (toward the scene.)</p> <p>One method to get the correct TF tree is to add a fixed joint from the camera_frame to the camera_optical_frame; this joint bends the z-axis from &quot;up&quot; to &quot;forward&quot;. The usual rpy used <strong>for a joint</strong> is &quot;-1.570796 0 -1.570796&quot;.</p>
107067
2023-12-15T08:59:05.940
|gazebo|rviz|transform|pointcloud|ros-noetic|
<p>I am trying to correctly orient the pointcloud data coming from a Depth camera sensor Gazebo model into the Rviz, but it's not working.</p> <p>Camera Model:</p> <pre><code>&lt;gazebo reference=&quot;camera_link_1&quot;&gt; &lt;material&gt;Gazebo/Red&lt;/material&gt; &lt;sensor name=&quot;camera&quot; type=&quot;depth&quot;&gt; &lt;pose&gt;0 0 0 0 0 0 &lt;/pose&gt; &lt;visualize&gt;true&lt;/visualize&gt; &lt;update_rate&gt;30&lt;/update_rate&gt; &lt;camera&gt; &lt;horizontal_fov&gt;1.089&lt;/horizontal_fov&gt; &lt;image&gt; &lt;format&gt;B8G8R8&lt;/format&gt; &lt;width&gt;640&lt;/width&gt; &lt;height&gt;480&lt;/height&gt; &lt;/image&gt; &lt;clip&gt; &lt;near&gt;0.05&lt;/near&gt; &lt;far&gt;5.0&lt;/far&gt; &lt;/clip&gt; &lt;noise&gt; &lt;type&gt;gaussian&lt;/type&gt; &lt;!-- Noise is sampled independently per pixel on each frame. That pixel's noise value is added to each of its color channels, which at that point lie in the range [0,1]. --&gt; &lt;mean&gt;0.0&lt;/mean&gt; &lt;stddev&gt;0.035&lt;/stddev&gt; &lt;/noise&gt; &lt;/camera&gt; &lt;plugin name=&quot;camera_controller&quot; filename=&quot;libgazebo_ros_openni_kinect.so&quot;&gt; &lt;baseline&gt;0.2&lt;/baseline&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;!-- Keep this zero, update_rate in the parent &lt;sensor&gt; tag will control the frame rate. --&gt; &lt;updateRate&gt;0.0&lt;/updateRate&gt; &lt;cameraName&gt;ur5_1/&lt;/cameraName&gt; &lt;imageTopicName&gt;/ur5/depth/image_raw_1&lt;/imageTopicName&gt; &lt;cameraInfoTopicName&gt;/ur5/depth/camera_info_1&lt;/cameraInfoTopicName&gt; &lt;depthImageTopicName&gt;/ur5/depth/image_raw_1&lt;/depthImageTopicName&gt; &lt;depthImageInfoTopicName&gt;/ur5/depth/camera_info_1&lt;/depthImageInfoTopicName&gt; &lt;pointCloudTopicName&gt;/ur5/depth/points_1&lt;/pointCloudTopicName&gt; &lt;frameName&gt;camera_link_1&lt;/frameName&gt; &lt;min_depth&gt;0.1&lt;/min_depth&gt; &lt;max_depth&gt;50.0&lt;/max_depth&gt; &lt;pointCloudCutoff&gt;0.05&lt;/pointCloudCutoff&gt; &lt;distortionK1&gt;0&lt;/distortionK1&gt; &lt;distortionK2&gt;0&lt;/distortionK2&gt; &lt;distortionK3&gt;0&lt;/distortionK3&gt; &lt;distortionT1&gt;0&lt;/distortionT1&gt; &lt;distortionT2&gt;0&lt;/distortionT2&gt; &lt;CxPrime&gt;0&lt;/CxPrime&gt; &lt;Cx&gt;0&lt;/Cx&gt; &lt;Cy&gt;0&lt;/Cy&gt; &lt;focalLength&gt;0&lt;/focalLength&gt; &lt;hackBaseline&gt;0&lt;/hackBaseline&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; &lt;joint name=&quot;camera_world_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;world&quot; /&gt; &lt;child link = &quot;camera_link_1&quot; /&gt; &lt;origin xyz=&quot;0.9 -0.079916 2.00&quot; rpy=&quot;0.0 1.20 3.14&quot; /&gt; &lt;/joint&gt; </code></pre> <p><a href="https://i.stack.imgur.com/GRqmS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GRqmS.png" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/1FuMr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1FuMr.png" alt="enter image description here" /></a></p> <p>I would really appreciate some help/guidance on this issue.</p>
Wrong Point Cloud orientation in Rviz
<p>I believe user37925 is indicating that you're working with the incorrect branch and suggests switching from the 'master' branch to the 'humble' branch.</p> <p>Alternatively, you can create a new, clean workspace and when cloning the ros2_canopen use the following commands in src directory:</p> <ol> <li>git clone -b humble <a href="https://github.com/ros-industrial/ros2_canopen.git" rel="nofollow noreferrer">https://github.com/ros-industrial/ros2_canopen.git</a></li> <li>cd ..</li> <li>rosdep install --from-paths src/ros2_canopen --ignore-src -r -y</li> <li>colcon build</li> </ol>
107069
2023-12-15T10:26:36.860
|ros2|rclcpp|
<p>I am trying to run ros2-canopen from VirtualBox in Ubuntu 22.04.03., the host is Windows11. I have installed ros2 following instructions from: <a href="https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html</a>,<br /> and downloaded ros2-canopen from: <a href="https://ros-industrial.github.io/ros2_canopen/manual/humble/quickstart/installation.html" rel="nofollow noreferrer">https://ros-industrial.github.io/ros2_canopen/manual/humble/quickstart/installation.html</a> in the workspace's source folder folder ros2_ws/src.</p> <p>However, when i do colcon build i get the following error message:</p> <pre><code>/home/a/ros2_ws/src/ros2_canopen/canopen_core/src/node_interfaces/node_canopen_driver.cpp: In member function ‘void ros2_canopen::node_interfaces::NodeCanopenDriver&lt;NODETYPE&gt;::demand_set_master() [with NODETYPE = rclcpp::Node]’: /home/a/ros2_ws/src/ros2_canopen/canopen_core/src/node_interfaces/node_canopen_driver.cpp:30:32: error: cannot convert ‘rclcpp::QoS’ to ‘const rmw_qos_profile_t&amp;’ {aka ‘const rmw_qos_profile_s&amp;’} 30 | init_service_name, rclcpp::QoS(10), client_cbg_); | ^~~~~~~ | | | rclcpp::QoS In file included from /opt/ros/humble/include/rclcpp/rclcpp/node.hpp:1321, from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28, from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22, from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155, from /home/a/ros2_ws/src/ros2_canopen/canopen_core/include/canopen_core/node_interfaces/node_canopen_driver.hpp:33, from /home/a/ros2_ws/src/ros2_canopen/canopen_core/src/node_interfaces/node_canopen_driver.cpp:14: /opt/ros/humble/include/rclcpp/rclcpp/node_impl.hpp:127:29: note: initializing argument 2 of ‘typename rclcpp::Client&lt;ServiceT&gt;::SharedPtr rclcpp::Node::create_client(const string&amp;, const rmw_qos_profile_t&amp;, rclcpp::CallbackGroup::SharedPtr) [with ServiceT = canopen_interfaces::srv::CONode; typename rclcpp::Client&lt;ServiceT&gt;::SharedPtr = std::shared_ptr&lt;rclcpp::Client&lt;canopen_interfaces::srv::CONode&gt; &gt;; std::string = std::__cxx11::basic_string&lt;char&gt;; rmw_qos_profile_t = rmw_qos_profile_s; rclcpp::CallbackGroup::SharedPtr = std::shared_ptr&lt;rclcpp::CallbackGroup&gt;]’ 127 | const rmw_qos_profile_t &amp; qos_profile, | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ /home/a/ros2_ws/src/ros2_canopen/canopen_core/src/node_interfaces/node_canopen_driver.cpp: In member function ‘void ros2_canopen::node_interfaces::NodeCanopenDriver&lt;NODETYPE&gt;::demand_set_master() [with NODETYPE = rclcpp_lifecycle::LifecycleNode]’: /home/a/ros2_ws/src/ros2_canopen/canopen_core/src/node_interfaces/node_canopen_driver.cpp:73:32: error: cannot convert ‘rclcpp::QoS’ to ‘const rmw_qos_profile_t&amp;’ {aka ‘const rmw_qos_profile_s&amp;’} 73 | init_service_name, rclcpp::QoS(10), client_cbg_); | ^~~~~~~ | | | rclcpp::QoS In file included from /opt/ros/humble/include/rclcpp_lifecycle/rclcpp_lifecycle/lifecycle_node.hpp:996, from /home/a/ros2_ws/src/ros2_canopen/canopen_core/include/canopen_core/node_interfaces/node_canopen_driver.hpp:34, from /home/a/ros2_ws/src/ros2_canopen/canopen_core/src/node_interfaces/node_canopen_driver.cpp:14: /opt/ros/humble/include/rclcpp_lifecycle/rclcpp_lifecycle/lifecycle_node_impl.hpp:103:29: note: initializing argument 2 of ‘typename rclcpp::Client&lt;ServiceT&gt;::SharedPtr rclcpp_lifecycle::LifecycleNode::create_client(const string&amp;, const rmw_qos_profile_t&amp;, rclcpp::CallbackGroup::SharedPtr) [with ServiceT = canopen_interfaces::srv::CONode; typename rclcpp::Client&lt;ServiceT&gt;::SharedPtr = std::shared_ptr&lt;rclcpp::Client&lt;canopen_interfaces::srv::CONode&gt; &gt;; std::string = std::__cxx11::basic_string&lt;char&gt;; rmw_qos_profile_t = rmw_qos_profile_s; rclcpp::CallbackGroup::SharedPtr = std::shared_ptr&lt;rclcpp::CallbackGroup&gt;]’ 103 | const rmw_qos_profile_t &amp; qos_profile, | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ gmake[2]: *** [CMakeFiles/node_canopen_driver.dir/build.make:76: CMakeFiles/node_canopen_driver.dir/src/node_interfaces/node_canopen_driver.cpp.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... gmake[1]: *** [CMakeFiles/Makefile2:211: CMakeFiles/node_canopen_driver.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... gmake: *** [Makefile:146: all] Error 2 --- Failed &lt;&lt;&lt; canopen_core [8.31s, exited with code 2] Summary: 5 packages finished [26.2s] 1 package failed: canopen_core 2 packages had stderr output: canopen_core lely_core_libraries 8 packages not processed </code></pre>
rclcpp::QoS error when running colcon build
<p><em>I already had the same problem as you are describing: But this is not yet possible directly from ros2_control side. I'll bring that up on the roadmap for the next LTS version Jazzy. (We recently added this for controllers in the rolling version.) In the meantime, the only workaround is to add a node to your hardware_component and parse the URDF from a parameter or add a subscriber to the /robot_description topic.</em></p> <p>Edit: I was wrong, this should be possible already since <a href="https://github.com/ros-controls/ros2_control/pull/709/files" rel="nofollow noreferrer">this PR</a>: The full URDF is inside <code>hardware_info.original_xml</code>.</p>
107073
2023-12-15T17:33:31.337
|ros2|urdf|ros2-control|transmission|
<p>I'm trying to write a custom transmission interface for ros2 control for the robotiq 3f, and I need access to the joint limits defined by the urdf, but the Joint handle does seem to contain that info, and I can't see any way to access the URDF. Any suggestions or good workarounds?</p>
How to access URDF info inside a transmission interface?
<p>I just updated nav2, and now it’s working. I’m not sure if it’s because of the update or if I was doing something wrong.</p>
107074
2023-12-15T18:02:33.300
|nav2|turtlebot-bringup|
<p>I am encountering issues when attempting to pass my own parameter file while launching nav2_bringup. It appears that none of my configurations take effect. The command <code>ros2 launch nav2_bringup tb3_simulation_launch.py params_file:=my_nav2_params.yaml</code> is not working for me in Rolling.</p> <p>I checked the launch.py script, and it seems that params_file is being taken into account. I’m unsure of what might be happening. Do you have any ideas?</p>
Problem when launching nav2_bringup with your own param file
<p>i didnt properly source my workspace it was supposed to be like</p> <pre><code>ubuntu@ubuntu:~/dev_ws<span class="math-container">$ source /opt/ros/humble/setup.bash ubuntu@ubuntu:~/dev_ws$</span> source install/setup.bash </code></pre> <p>rookie mistake!</p>
107096
2023-12-17T09:15:54.373
|ubuntu|ros-humble|ros2-launch|
<p>I'm using ROS 2 ubuntu 22.04 Humble.</p> <p>i had made a model in fusion 360 and would like to make a gazebo simulation from it. i have tried the extension by <a href="https://github.com/dheena2k2/fusion2urdf-ros2" rel="nofollow noreferrer">https://github.com/dheena2k2/fusion2urdf-ros2</a>. i built the package, sourced it and tried to run it using ros2 launch rover_description display.launch.py. it gives me an error saying</p> <p>[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: substitution args not supported: No module named 'roslaunch'.</p> <p>These are the steps i did:</p> <pre><code>ubuntu@ubuntu:~<span class="math-container">$ source /opt/ros/humble/setup.bash ubuntu@ubuntu:~$</span> cd dev_ws/ ubuntu@ubuntu:~/dev_ws$ colcon build Starting &gt;&gt;&gt; my_bot Starting &gt;&gt;&gt; my_package Starting &gt;&gt;&gt; rover_description Finished &lt;&lt;&lt; my_package [1.38s] Finished &lt;&lt;&lt; my_bot [1.54s] Finished &lt;&lt;&lt; rover_description [2.24s] Summary: 3 packages finished [3.54s] ubuntu@ubuntu:~/dev_ws<span class="math-container">$ source install/setup.bash ubuntu@ubuntu:~/dev_ws$</span> ros2 launch rover_description display.launch.py [INFO] [launch]: All log files can be found below /home/ubuntu/.ros/log/2023-12-17-08-11-52-523673-ubuntu-4146 [INFO] [launch]: Default logging verbosity is set to INFO [ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: substitution args not supported: No module named 'roslaunch' </code></pre> <p>My <code>display.launch.py</code> file looks like this</p> <pre class="lang-py prettyprint-override"><code>from launch_ros.actions import Node from launch import LaunchDescription import launch_ros.descriptions from launch.actions import DeclareLaunchArgument,ExecuteProcess from launch.substitutions import LaunchConfiguration from launch.conditions import IfCondition, UnlessCondition import xacro import os from ament_index_python.packages import get_package_share_directory def generate_launch_description(): share_dir = get_package_share_directory('rover_description') xacro_file = os.path.join(share_dir, 'urdf', 'rover.xacro') robot_description_config = xacro.process_file(xacro_file) robot_urdf = robot_description_config.toxml() rviz_config_file = os.path.join(share_dir, 'config', 'display.rviz') gui_arg = DeclareLaunchArgument( name='gui', default_value='True' ) show_gui = LaunchConfiguration('gui') robot_state_publisher_node = Node( package='robot_state_publisher', executable='robot_state_publisher', name='robot_state_publisher', parameters=[ {'robot_description': robot_urdf} ] ) joint_state_publisher_node = Node( condition=UnlessCondition(show_gui), package='joint_state_publisher', executable='joint_state_publisher', name='joint_state_publisher' ) joint_state_publisher_gui_node = Node( condition=IfCondition(show_gui), package='joint_state_publisher_gui', executable='joint_state_publisher_gui', name='joint_state_publisher_gui' ) rviz_node = Node( package='rviz2', executable='rviz2', name='rviz2', arguments=['-d', rviz_config_file], output='screen' ) return LaunchDescription([ gui_arg, robot_state_publisher_node, joint_state_publisher_node, joint_state_publisher_gui_node, rviz_node ]) <span class="math-container">```</span> </code></pre>
Trouble launching display.launch.py file
<p>The easiest way is going to be to have two separate callback functions which wrap some common set of code. You can make this a lot cleaner using python's lambda function feature. For example, in ROS 1:</p> <pre><code>import rospy from std_msgs.msg import String def callback(data, source): rospy.loginfo(f&quot;I heard {data.data} from {source}&quot;) def listener(): rospy.init_node('listener', anonymous=True) rospy.Subscriber(&quot;chatter_1&quot;, String, lambda data: callback(data, 1)) rospy.Subscriber(&quot;chatter_2&quot;, String, lambda data: callback(data, 2)) rospy.spin() if __name__ == '__main__': listener() </code></pre> <p>and in ROS 2:</p> <pre><code>import rclpy from std_msgs.msg import String def callback(data, source): rospy.loginfo(f&quot;I heard '{data.data}' from {source}&quot;) def listener(): rclpy.init() node = rclpy.create_node('listener') node.create_subscription(String, 'chatter_1', lambda msg: callback(msg, 1), 10) node.create_subscription(String, 'chatter_2', lambda msg: callback(msg, 2), 10) rclpy.spin(node) node.destroy_node() rclpy.shutdown() if __name__ == '__main__': listener() </code></pre>
107108
2023-12-18T12:50:25.550
|ros2|camera|callback|topic|
<p>I have two cameras subscribing camera1/image_raw and camera2/image_raw respectively. And both subscribers call image_callback when they received any topic. I want to show camera1 image in window1 and camera2 image in window2 while using the same callback function.</p> <p>So, in the callback function, I would like to determine the topic name (or which subscriber executed the callback function) and if it is camera1, show it in window1 and otherwise in window2.</p> <p>But, I can't figure out how to determine which subscriber executed the callback in python. Can anyone help me out with this problem? Thank you!</p>
How to get a topic name in a callback function (Python, Ros2)
<p>Turns out ALL occurrences of the joint name need to be replaced, especially(!!) the one in the urdf ros2_control node, which assigns the joint name to the hardware interface.</p>
107114
2023-12-18T14:06:57.143
|ros2|ros2-control|
<p>in the launch files of the ros2_control examples it says</p> <pre class="lang-py prettyprint-override"><code> declared_arguments.append( DeclareLaunchArgument( &quot;prefix&quot;, default_value='&quot;&quot;', description=&quot;Prefix of the joint names, useful for \ multi-robot setup. If changed than also joint names in the controllers' configuration \ have to be updated.&quot;, ) ) </code></pre> <p>Therefore, using the prefix &quot;axis_&quot; and following the examples I tried to change variable names in my joint trajectory controller in the following manner</p> <p>from</p> <pre><code>joint_trajectory_position_controller: ros__parameters: joints: - joint1 </code></pre> <p>to</p> <pre><code>joint_trajectory_position_controller: ros__parameters: joints: - axis_joint1 </code></pre> <p>However i still get this error and it doesnt work:</p> <pre><code>[ros2_control_node-1] terminate called after throwing an instance of 'std::runtime_error' [ros2_control_node-1] what(): Wrong state or command interface configuration. [ros2_control_node-1] missing state interfaces: [ros2_control_node-1] ' axis_joint1/position ' [ros2_control_node-1] missing command interfaces: [ros2_control_node-1] ' axis_joint1/position ' </code></pre> <p>What else needs to be changed for this to work? I would appreciate any help, and I think it would be great if an example with a working prefix change could be added to the ros2_control examples.</p>
Using and implementing prefixes with ros2-control
<p>All floating point Parameters end up being doubles under the hood - so your &quot;declare_parameter&quot; is basically being recast as &quot;declare_parameter&quot; - and then the implicit conversion from double to float generates the warning.</p> <p>My suggestion would be to explicitly do the cast - which should get rid of the warning:</p> <blockquote> <p>float linear_acceleration_stddev = static_cast&lt;double&gt;(declare_parameter(&quot;linear_acceleration_stddev&quot;, 1e-3));</p> </blockquote> <p>As a side note - rclcpp will NOT do this automatic recasting the it is a vector (for instance, you can have a vector&lt;double&gt; parameter type - but vector&lt;float&gt; won't even compile). This very fun limitation is the sole reason I had once dug deep enough into rclcpp to be able to answer your question...</p>
107117
2023-12-18T17:23:31.257
|ros2|c++|parameters|rclcpp|
<p>Compiling a node with the following snippet and <code>-Wfloat-conversion</code> leads to the following:</p> <pre><code>component.cpp:24:56: warning: conversion from ‘double’ to ‘float’ may change value [-Wfloat-conversion] 24 | float linear_acceleration_stddev = declare_parameter&lt;float&gt;(&quot;linear_acceleration_stddev&quot;, 1e-3f); </code></pre> <p>even if:</p> <ol> <li>I used <code>float</code> as template param</li> <li>I assigned as default value a <code>float</code> literal</li> <li>I am assigning to a <code>float</code> variable</li> </ol> <p>What am I doing wrong?</p>
rclcpp - float conversion warning when using `declare_parameter<float>`
<p>I think the problem is the trailing comma on your launch arg declaration:</p> <pre class="lang-py prettyprint-override"><code>settings_file_name_launch_arg = DeclareLaunchArgument( &quot;settings_file_name&quot;, default_value=TextSubstitution(text='file_not_set'), # EuRoC, TUM2 # description='Settings file name i.e. EuoRoC, TUM2 etc', ), #&lt;&lt;&lt; trailing comma here </code></pre> <p>Instead of the expected launch object, which would have a <code>.describe_sub_entities()</code> method, you're then passing a one-element tuple to the launch system:</p> <p><code>(settings_file_name_launch_arg, )</code></p>
107124
2023-12-18T21:08:04.627
|roslaunch|ros-humble|
<p>Ubuntu 22.04, ROS 2 Humble</p> <p>Hi, I am following the official tutorial to pass arguments to a cpp node via a python launch file</p> <p><a href="https://docs.ros.org/en/humble/How-To-Guides/Launch-file-different-formats.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/How-To-Guides/Launch-file-different-formats.html</a></p> <p>My launch file is as follows</p> <pre><code>import os # https://docs.ros.org/en/humble/How-To-Guides/Launch-file-different-formats.html from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, LogInfo from launch.actions import IncludeLaunchDescription from launch.actions import GroupAction from launch.launch_description_sources import PythonLaunchDescriptionSource from launch.substitutions import LaunchConfiguration from launch.substitutions import TextSubstitution from launch_ros.actions import Node from launch_ros.actions import PushRosNamespace from ament_index_python.packages import get_package_share_directory #* Required to get YAML file # Define path to package home_directory = os.path.expanduser(&quot;~&quot;) path_to_orbslam3_pck = home_directory + &quot;/&quot; + &quot;ros2_ws/src/orb_slam3_ros2&quot; # Build global paths voc_path = os.path.join(path_to_orbslam3_pck, 'orb_slam3/Vocabulary/ORBvoc.txt.bin') settings_path = os.path.join(path_to_orbslam3_pck, 'orb_slam3/config/Monocular/') # https://roboticscasual.com/tutorial-ros2-launch-files-all-you-need-to-know/#cmd-line-args-hand-over def generate_launch_description(): ld = LaunchDescription() # If you want to load some YAML files # config_robot1 = os.path.join( # get_package_share_directory('my_launcher'), #* Nothing fancy here, this is how the syntax goes # 'config', # 'params.yaml' # ) # voc_file_launch_arg = DeclareLaunchArgument( # &quot;voc_file&quot;, # default_value=TextSubstitution(text=voc_path), # # description='Path to the Vocabulary file for ORB-SLAM3', # ), # settings_file_path_launch_arg = DeclareLaunchArgument( # &quot;settings_file_path&quot;, # default_value=TextSubstitution(text=settings_path), # #description='Path to the Vocabulary file for ORB-SLAM3', # ), settings_file_name_launch_arg = DeclareLaunchArgument( &quot;settings_file_name&quot;, default_value=TextSubstitution(text='file_not_set'), # EuRoC, TUM2 # description='Settings file name i.e. EuoRoC, TUM2 etc', ), robot0_vslam_node = Node( package=&quot;orb_slam3_ros2&quot;, # Remember, the (,) are very important executable=&quot;agent0&quot;, name = &quot;robot0_vslam&quot;, # # if you have a namespace, use this tutorial to add it https://www.youtube.com/watch?v=wY8MrBGVxYA #parameters=[config_robot1] # when using YAML configuration files #* List with tuples parameters=[ {&quot;agent_name_arg&quot;: 'robot0'}, #{&quot;voc_file_arg&quot;: LaunchConfiguration('voc_file')}, #{&quot;settings_file_path_arg&quot;: LaunchConfiguration('settings_file_path')}, {&quot;settings_file_name_arg&quot;: LaunchConfiguration('settings_file_name')} ] # When setting individual parameters, set it as a tuple ) # https://answers.ros.org/question/382167/is-it-possible-to-have-a-conditional-in-a-launch-file-using-declarelaunchargument/ #ld.add_action(voc_file_launch_arg) #ld.add_action(settings_file_path_launch_arg) ld.add_action(settings_file_name_launch_arg) ld.add_action(robot0_vslam_node) # This adds the node to the description return ld </code></pre> <p>This code builds without any issue. To make the testing simpler, I am only trying to pass one argument to my CPP node to see if it receives it.</p> <p>However, when I try running this command</p> <pre><code>ros2 launch my_launcher my_app_launch.py settings_file_name:=&quot;TUM2&quot; </code></pre> <p>I am getting this following error</p> <pre><code>[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'tuple' object has no attribute 'describe_sub_entities' </code></pre> <p>Note that, I had tried returning <code>LaunchDescription</code> in the following way</p> <pre><code>return LaunchDescription([ launch_args, node ]) </code></pre> <p>Both gives the error shown above.</p> <p>My questions are the following</p> <ol> <li>What is `describe_sub_entities' in context of the above problem?</li> <li>What changes are required to get the desired behavior?</li> </ol> <p>Thanks @Mechazo11</p>
ROS2 Humble: How to pass arguments to python launch files from command-line?
<p>In the defining class, the Duration is a const. You must provide a method that matches the definition.</p>
107127
2023-12-19T00:48:01.927
|ros2|ros-humble|hardware-interface|ros2-control|
<p>I have been following several examples in defining a custom hardware interface using <code>ros2_control</code> in ROS2 Humble. I am trying to replicate these concepts for a prismatic joint, controlled with a velocity servo. Like the examples, my script inherits multiple virtual functions from the <code>hardware_interface::SystemInterface</code> class. Most of these virtual functions are correctly overridden, but the two pure virtual functions <code>read</code> and <code>write</code> generate the following error:</p> <pre><code>In file included from /ros2_ws/src/linear-slider/linear_slider_controller/src/linear_slider_system_interface.cpp:1: /ros2_ws/src/linear-slider/linear_slider_controller/include/linear_slider_controller/linear_slider_system_interface.hpp:60:45: error: ‘hardware_interface::return_type linear_slider_system_interface::LinearSliderSystemInterface::read(const rclcpp::Time&amp;, rclcpp::Duration&amp;)’ marked ‘override’, but does not override 60 | hardware_interface::return_type read(const rclcpp::Time&amp; time, rclcpp::Duration&amp; period) override; | ^~~~ /ros2_ws/src/linear-slider/linear_slider_controller/include/linear_slider_controller/linear_slider_system_interface.hpp:63:45: error: ‘hardware_interface::return_type linear_slider_system_interface::LinearSliderSystemInterface::write(const rclcpp::Time&amp;, rclcpp::Duration&amp;)’ marked ‘override’, but does not override 63 | hardware_interface::return_type write(const rclcpp::Time&amp; time, rclcpp::Duration&amp; period) override; | /opt/ros/humble/include/class_loader/class_loader/meta_object.hpp: In instantiation of ‘B* class_loader::impl::MetaObject&lt;C, B&gt;::create() const [with C = linear_slider_system_interface::LinearSliderSystemInterface; B = hardware_interface::SystemInterface]’: /opt/ros/humble/include/class_loader/class_loader/meta_object.hpp:216:7: required from here /opt/ros/humble/include/class_loader/class_loader/meta_object.hpp:218:12: error: invalid new-expression of abstract class type ‘linear_slider_system_interface::LinearSliderSystemInterface’ 218 | return new C; | ^~~~~ In file included from /ros2_ws/src/linear-slider/linear_slider_controller/src/linear_slider_system_interface.cpp:1: /ros2_ws/src/linear-slider/linear_slider_controller/include/linear_slider_controller/linear_slider_system_interface.hpp:28:11: note: because the following virtual functions are pure within ‘linear_slider_system_interface::LinearSliderSystemInterface’: 28 | class LinearSliderSystemInterface : public hardware_interface::SystemInterface | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /ros2_ws/src/linear-slider/linear_slider_controller/include/linear_slider_controller/linear_slider_system_interface.hpp:12, from /ros2_ws/src/linear-slider/linear_slider_controller/src/linear_slider_system_interface.cpp:1: /opt/ros/humble/include/hardware_interface/system_interface.hpp:175:23: note: ‘virtual hardware_interface::return_type hardware_interface::SystemInterface::read(const rclcpp::Time&amp;, const rclcpp::Duration&amp;)’ 175 | virtual return_type read(const rclcpp::Time &amp; time, const rclcpp::Duration &amp; period) = 0; | ^~~~ /opt/ros/humble/include/hardware_interface/system_interface.hpp:186:23: note: ‘virtual hardware_interface::return_type hardware_interface::SystemInterface::write(const rclcpp::Time&amp;, const rclcpp::Duration&amp;)’ 186 | virtual return_type write(const rclcpp::Time &amp; time, const rclcpp::Duration &amp; period) = 0; | ^~~~~ </code></pre> <p>I am overriding the <code>SystemInterface::export_command_interfaces()</code> and <code>SystemInterface::export_state_interfaces()</code> methods correctly, as I do not get this error. After many reviews, I cannot find any notable differences between my implementation and the examples I have been following, including the demo examples from the ros2_control_demos repository. Can you spot where I am going wrong in this override?</p> <p>My code is below:</p> <p><strong>linear_slider_system_interface.hpp</strong>:</p> <pre><code>#ifndef __LINEAR_SLIDER_CONTROLLER__HARDWARE_INTERFACE_H__ #define __LINEAR_SLIDER_CONTROLLER__HARDWARE_INTERFACE_H__ #include &lt;chrono&gt; #include &lt;cstdint&gt; #include &lt;memory&gt; #include &lt;string&gt; #include &lt;vector&gt; #include &quot;hardware_interface/handle.hpp&quot; #include &quot;hardware_interface/hardware_info.hpp&quot; #include &quot;hardware_interface/system_interface.hpp&quot; #include &quot;hardware_interface/types/hardware_interface_return_values.hpp&quot; #include &quot;rclcpp/clock.hpp&quot; #include &quot;rclcpp/duration.hpp&quot; #include &quot;rclcpp/macros.hpp&quot; #include &quot;rclcpp/time.hpp&quot; #include &quot;rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp&quot; #include &quot;rclcpp_lifecycle/state.hpp&quot; #include &quot;linear_slider_controller/visibility_control.h&quot; #include &quot;linear_slider_controller/clearcore_comms.hpp&quot; #include &quot;linear_slider_controller/teknic_motor.hpp&quot; namespace linear_slider_system_interface { class LinearSliderSystemInterface : public hardware_interface::SystemInterface { public: RCLCPP_SHARED_PTR_DEFINITIONS(LinearSliderSystemInterface) LINEAR_SLIDER_CONTROLLER_PUBLIC hardware_interface::CallbackReturn on_init(const hardware_interface::HardwareInfo&amp; info) override; LINEAR_SLIDER_CONTROLLER_PUBLIC std::vector&lt;hardware_interface::StateInterface&gt; export_state_interfaces() override; // publishes to the rest of ros2_control so that we know what we can read/write to LINEAR_SLIDER_CONTROLLER_PUBLIC std::vector&lt;hardware_interface::CommandInterface&gt; export_command_interfaces() override; LINEAR_SLIDER_CONTROLLER_PUBLIC hardware_interface::return_type read(const rclcpp::Time&amp; time, rclcpp::Duration&amp; period) override; LINEAR_SLIDER_CONTROLLER_PUBLIC hardware_interface::return_type write(const rclcpp::Time&amp; time, rclcpp::Duration&amp; period) override; private: // Comms ClearCoreComms comms_; // Teknic Motor TeknicMotor teknic_motor_; }; } // namespace linear_slider_system_interface #endif // __LINEAR_SLIDER_CONTROLLER__HARDWARE_INTERFACE_H__ </code></pre> <p><strong>linear_slider_system_interface.cpp</strong>:</p> <pre><code>#include &quot;linear_slider_controller/linear_slider_system_interface.hpp&quot; #include &lt;chrono&gt; #include &lt;memory&gt; #include &lt;cmath&gt; #include &lt;limits&gt; #include &lt;string&gt; #include &lt;vector&gt; #include &quot;hardware_interface/types/hardware_interface_type_values.hpp&quot; #include &quot;rclcpp/rclcpp.hpp&quot; namespace linear_slider_system_interface { hardware_interface::CallbackReturn LinearSliderSystemInterface::on_init(const hardware_interface::HardwareInfo&amp; info) { /* Checks whether the hardware interface matches the robot description */ if (hardware_interface::SystemInterface::on_init(info) != hardware_interface::CallbackReturn::SUCCESS) { return hardware_interface::CallbackReturn::ERROR; } // Set up motor teknic_motor_.begin(&quot;teknic_clearpath_mc&quot;); for (const hardware_interface::ComponentInfo&amp; joint : info_.joints) { // The linear slider has one state and one command interface on the single prismatic joint, make sure they exist // Command interface check if (joint.command_interfaces.size() != 1) { RCLCPP_FATAL( rclcpp::get_logger(&quot;LinearSliderSystemHardware&quot;), &quot;Joint '%s' has %zu command interfaces found. 1 expected.&quot;, joint.name.c_str(), joint.command_interfaces.size() ); return hardware_interface::CallbackReturn::ERROR; } if (!(joint.command_interfaces[0].name == hardware_interface::HW_IF_VELOCITY)) { RCLCPP_FATAL( rclcpp::get_logger(&quot;LinearSliderSystemHardware&quot;), &quot;Joint '%s' has %s command interface. Expected %s.&quot;, joint.name.c_str(), joint.command_interfaces[0].name.c_str(), hardware_interface::HW_IF_VELOCITY ); return hardware_interface::CallbackReturn::ERROR; } // State interface check if (joint.state_interfaces.size() != 1) { RCLCPP_FATAL( rclcpp::get_logger(&quot;LinearSliderSystemHardware&quot;), &quot;Joint '%s' has %zu state interfaces. 1 expected.&quot;, joint.name.c_str(), joint.state_interfaces.size() ); return hardware_interface::CallbackReturn::ERROR; } if (!(joint.state_interfaces[0].name == hardware_interface::HW_IF_VELOCITY)) { RCLCPP_FATAL( rclcpp::get_logger(&quot;LinearSliderSystemHardware&quot;), &quot;Joint '%s' has %s state interface. Expected %s.&quot;, joint.name.c_str(), joint.state_interfaces[0].name.c_str(), hardware_interface::HW_IF_VELOCITY ); return hardware_interface::CallbackReturn::ERROR; } } return hardware_interface::CallbackReturn::SUCCESS; } std::vector&lt;hardware_interface::CommandInterface&gt; LinearSliderSystemInterface::export_command_interfaces() { /* Tells the rest of ros2_control which control interfaces are accessible */ std::vector&lt;hardware_interface::CommandInterface&gt; command_interfaces; command_interfaces.emplace_back(hardware_interface::CommandInterface( teknic_motor_.name, hardware_interface::HW_IF_VELOCITY, &amp;teknic_motor_.vel_cmd )); return command_interfaces; } std::vector&lt;hardware_interface::StateInterface&gt; LinearSliderSystemInterface::export_state_interfaces() { /* Tells the rest of ros2_control which state interfaces are accessible */ std::vector&lt;hardware_interface::StateInterface&gt; state_interfaces; state_interfaces.emplace_back(hardware_interface::StateInterface( teknic_motor_.name, hardware_interface::HW_IF_VELOCITY, &amp;teknic_motor_.vel_state )); } hardware_interface::return_type LinearSliderSystemInterface::read(const rclcpp::Time &amp; time, rclcpp::Duration &amp; period) { /* Read data from the linear slider. Converts RPM speeds to linear velocities */ char* msg = comms_.read_data(); if (msg[0] != '\0'){ // convert rpm message to float velocity, store in teknic_motor_.rpm_state. Additionally, update teknic_motor_.vel_state } return hardware_interface::return_type::OK; } hardware_interface::return_type LinearSliderSystemInterface::write(const rclcpp::Time &amp; time, rclcpp::Duration &amp; period) { /* Write data to the linear slider. Converts linear velocities to RPM speeds */ // convert teknic_motor_.vel_cmd to teknic_motor_.rpm_cmd. Convert this value to str, send via comms_ teknic_motor_.rpm_cmd = teknic_motor_.vel_to_rpm(teknic_motor_.vel_cmd); // TODO: this should probably either be completely internal, or completely external, but not both. std::string cmd = std::to_string(teknic_motor_.rpm_cmd); comms_.send_data(cmd.c_str()); return hardware_interface::return_type::OK; } } // namespace linear_slider_system_interface #include &quot;pluginlib/class_list_macros.hpp&quot; PLUGINLIB_EXPORT_CLASS( linear_slider_system_interface::LinearSliderSystemInterface, hardware_interface::SystemInterface ) </code></pre> <p>Thank you for any help, it is greatly appreciated. Please let me know if I missed sharing any important information.</p>
ros2_control hardware_interface override function not working for "read" and "write" methods
<p>I believe your issue is not using the right QoS [1] so that the message isn't being received due to incompatibility in the middleware. You can mess with the QoS on the commandline, but you may be better served testing with a Python3 script to make your life easier.</p> <p>[1] <a href="https://github.com/ros-planning/navigation2/blob/7872bfae096ac548a4af72c12a72c025648050fa/nav2_behavior_tree/plugins/action/planner_selector_node.cpp#L44" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/blob/7872bfae096ac548a4af72c12a72c025648050fa/nav2_behavior_tree/plugins/action/planner_selector_node.cpp#L44</a></p>
107141
2023-12-19T13:44:46.043
|navigation|ros2|nav2|planner|
<p>I want to use the <strong>PlannerSelector</strong> action in <strong>Nav2</strong> in order to use <strong>multiple planners</strong> and choose which one to use in the runtime. I modified the default behavior tree xml a little bit in order to do this, and I added a PlannerSelector BT node in my xml file as you can see in the xml file below.</p> <p>The main issue is that the robot always uses the default planner. I tried to change the planner by publishing the string message &quot;GridBased1&quot; in the topic /planner_selector (<em>ros2 topic pub /planner_selector std_msgs/msg/String &quot;data: GridBased1&quot;</em>) but the robot was still using the default planner. If I change the default planner before starting the robot and execute the process again then the planner normally changes.</p> <p>To sum up, it seems that the different planners work normally when assigning them as default_planner in the PlannerSelector but the system always uses the default planner and it cannot be changed by publishing in the /planner_selector topic.</p> <p>Below you can see the parameters related to planner_server:</p> <pre><code>planner_server: ros__parameters: expected_planner_frequency: 20.0 use_sim_time: True planner_plugins: [&quot;GridBased&quot;, &quot;GridBased1&quot;] GridBased: plugin: &quot;nav2_navfn_planner/NavfnPlanner&quot; tolerance: 0.5 use_astar: false allow_unknown: true GridBased1: plugin: &quot;nav2_straightline_planner/StraightLine&quot; interpolation_resolution: 0.1 </code></pre> <p>Below you can see the BT's xml file that I use:</p> <pre><code>&lt;root main_tree_to_execute=&quot;MainTree&quot;&gt; &lt;BehaviorTree ID=&quot;MainTree&quot;&gt; &lt;RecoveryNode number_of_retries=&quot;6&quot; name=&quot;NavigateRecovery&quot;&gt; &lt;PipelineSequence name=&quot;NavigateWithReplanning&quot;&gt; &lt;RateController hz=&quot;1.0&quot;&gt; &lt;PipelineSequence name=&quot;SelectPlanner&quot;&gt; &lt;PlannerSelector selected_planner=&quot;{selected_planner}&quot; default_planner=&quot;GridBased&quot; topic_name=&quot;planner_selector&quot;/&gt; &lt;RecoveryNode number_of_retries=&quot;1&quot; name=&quot;ComputePathToPose&quot;&gt; &lt;ComputePathToPose goal=&quot;{goal}&quot; path=&quot;{path}&quot; planner_id=&quot;{selected_planner}&quot;/&gt; &lt;ReactiveFallback name=&quot;ComputePathToPoseRecoveryFallback&quot;&gt; &lt;GoalUpdated/&gt; &lt;ClearEntireCostmap name=&quot;ClearGlobalCostmap-Context&quot; service_name=&quot;global_costmap/clear_entirely_global_costmap&quot;/&gt; &lt;/ReactiveFallback&gt; &lt;/RecoveryNode&gt; &lt;/PipelineSequence&gt; &lt;/RateController&gt; &lt;RecoveryNode number_of_retries=&quot;1&quot; name=&quot;FollowPath&quot;&gt; &lt;FollowPath path=&quot;{path}&quot; controller_id=&quot;FollowPath&quot;/&gt; &lt;ReactiveFallback name=&quot;FollowPathRecoveryFallback&quot;&gt; &lt;GoalUpdated/&gt; &lt;ClearEntireCostmap name=&quot;ClearLocalCostmap-Context&quot; service_name=&quot;local_costmap/clear_entirely_local_costmap&quot;/&gt; &lt;/ReactiveFallback&gt; &lt;/RecoveryNode&gt; &lt;/PipelineSequence&gt; &lt;ReactiveFallback name=&quot;RecoveryFallback&quot;&gt; &lt;GoalUpdated/&gt; &lt;RoundRobin name=&quot;RecoveryActions&quot;&gt; &lt;Sequence name=&quot;ClearingActions&quot;&gt; &lt;ClearEntireCostmap name=&quot;ClearLocalCostmap-Subtree&quot; service_name=&quot;local_costmap/clear_entirely_local_costmap&quot;/&gt; &lt;ClearEntireCostmap name=&quot;ClearGlobalCostmap-Subtree&quot; service_name=&quot;global_costmap/clear_entirely_global_costmap&quot;/&gt; &lt;/Sequence&gt; &lt;Spin spin_dist=&quot;1.57&quot;/&gt; &lt;Wait wait_duration=&quot;5&quot;/&gt; &lt;BackUp backup_dist=&quot;0.15&quot; backup_speed=&quot;0.025&quot;/&gt; &lt;/RoundRobin&gt; &lt;/ReactiveFallback&gt; &lt;/RecoveryNode&gt; </code></pre> <p>I am using:</p> <ul> <li>turtlebot3 package for the simulation with the default launchers for the gazebo and navigation packages</li> <li>ROS2 galactic</li> <li>Ubuntu 20.04</li> </ul> <p><strong>If you have any workable BT xml file with a PlannerSelector feel free to share. It's not necessary to correct my specific implementation. I generally try to figure out how the PlannerSelector node is used inside the behavior tree.</strong></p> <p>Thanks</p>
How to use Planner Selector in the Nav2 BT's xml file
<p>The serialization / saving features are just ROS Services, you can call that service whenever you like with whatever filename you'd like to save it to. You don't need to use the Rviz tool - the Rviz tool just uses service calls under the hood to tell SLAM Toolbox to perform the serialization of the state.</p> <p>You can write a pretty simple script in Python or even in Bash to save on some fixed frequency or based on events from your application software.</p>
107144
2023-12-19T15:24:25.883
|ros|
<p>fisrt of all I need the info that is about the overwriting or re-saving the map with serialize or deserialize process while using lifelong mapping mode in slamoolbox with melodic version. I have seacrhed github, ros answers, robotics stack exc. sites and also I read slide is about slamtoolbox but I couldn't get the exact answer about it. I need this answer because I have a dynamic, huge map and I need to overwrite existing map while I am using lifelong mapping mode. Is it possible to so so or do I need to use serialize/desrialize tool in rqt config? OR If it is already exist where and how to use? When I shoot a glance the environment there is a possiblity of saving the new map with wrong datas (like slamtoolbox is confusing when I start the robot with similar corridor and puts things in this corridor even if the things dont belong this corridor etc.) Is there any suggestion to overcome this issue and to automate map saving with less (closes to zero error I prefer) error? If I am not obvious I can give more details. Have a nice day!</p>
Slam Toolbox Map saving automation
<p>You should be able to get the rgbd camera pose through the <a href="https://github.com/gazebosim/gz-sim/blob/8b40b546e050ad1e8a3e08897e8146a4869d6d3e/src/systems/pose_publisher/PosePublisher.hh#L35" rel="nofollow noreferrer">pose publisher plugin</a>.</p> <p>See also the <a href="https://github.com/gazebosim/gz-sim/blob/gz-sim8/examples/worlds/pose_publisher.sdf" rel="nofollow noreferrer">pose_publisher.sdf</a> demo world.</p>
107152
2023-12-19T23:38:05.173
|ros|gazebo|transform|transforms|rgbd|
<p>I need the depth ground truth of a camera view in gazebo and decided to go with an rgbd camera which produces a pointcloud. In order to visualize this I need to somehow publish the transform of the rgbd camera. How can I publish such a transform in gazebo? I can transfer gazebo topics to ros topics with my setup but I don't know how to publish the transforms from the simulation in the first place. Any ideas?</p> <p>I am working with a gazebo garden setup where I use a gz-ros2 and ros2-ros1 bridge in order to work with ros as well (I know this is not a good setup and the endeavor is to only use ros2 at some point.)</p>
Gazebo Garden: How to publish the transform of elements in a simulation
<p>I agree with @Russ76 that you should get in touch with clearpath about this, but I would point out that Clearpath does a pretty good job of documenting their platforms and open-sourcing code. For example, here's <a href="https://github.com/husky/husky" rel="nofollow noreferrer">code for the Husky</a> on GitHub, and <a href="https://docs.clearpathrobotics.com/docs/robots/outdoor_robots/husky/user_manual_husky/" rel="nofollow noreferrer">here's the user manual</a>.</p> <p>I would contact clearpath first to make sure they've given you everything you ordered, but if they have: I would install ROS to some laptop or SBC, then load the Husky packages onto that device (just like any other ROS package).</p>
107153
2023-12-19T23:57:59.183
|ros2|control|husky|
<p>Somehow a Husky UGV came into the lab without any sensors or onboard PC. Fortunately, there is a laptop with ROS2 Humble installed and a PS4 controller.</p> <p>Q1. What do I need to do to act as an Onboard PC connecting a laptop with ROS2 Humble installed between the robot and the controller?</p> <p>Q2. What do I do to connect a laptop and a robot, then connect a PS4 controller for wireless control?</p>
About Husky UGV Connection
<p>The gazebo-classic simulator is implemented using two applications which work together: gzserver and gzclient. The gui part is handled by gzclient.</p> <p>The job of /usr/bin/gazebo is to launch gzserver and gzclient. All of this code is open source, so you can easily see what the developers did to perform this task. IIRC, the src file is <code>gazebo/gazebo_main.cc</code>.</p> <p><a href="https://github.com/gazebosim/gazebo-classic" rel="nofollow noreferrer">https://github.com/gazebosim/gazebo-classic</a></p>
107155
2023-12-20T02:24:51.453
|gazebo|gazebo-11|
<p>I am trying to use gazebo through c++ (without calling from command line). I have a main.cpp file something like following</p> <pre><code>#include &lt;gazebo/gazebo.hh&gt; #include &lt;gazebo/common/common.hh&gt; #include &lt;gazebo/physics/physics.hh&gt; int main(int _argc, char **_argv) { // Initialize gazebo. gazebo::setupServer(_argc, _argv); // Load a world gazebo::physics::WorldPtr world = gazebo::loadWorld(&quot;simple_world.world&quot;); gazebo::physics::ModelPtr robot = world-&gt;ModelByName(&quot;robot&quot;); while (true) { gazebo::runWorld(world, 1); } // Close everything. gazebo::shutdown(); } </code></pre> <p>However no gui will spawn by running this but the robot will move around if I set velocity to the robot. I can spawn gazebo gui if I use command line tools <code>gazebo simple_world.world</code>.</p> <p>Does anyone know if I missed anything here? I would really appreciate any help here. Thank you</p>
Using standalone gazebo 11, and no gui will spawn
<p>it is possible to use a single Python file as both a subscriber and a publisher, lets your sensor return feedback to you in radians and if you would like to convert that data to degrees, then you would use both a publisher and a subscriber. Here is an example code:</p> <pre><code>import rclpy import math from rclpy.node import Node from std_msgs.msg import Float32 class MyNode(Node): def __init__(self): super().__init__('my_node') self.subscription = self.create_subscription(Float32, 'input_topic', self.listener_callback, 10) self.publisher = self.create_publisher(Float32, 'output_topic', 10) def listener_callback(self, msg): radians = msg.data degrees = radians * 180 / math.pi self.publisher.publish(Float32(data=degrees)) def main(args=None): rclpy.init(args=args) node = MyNode() rclpy.spin(node) node.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p>Remember to add changes to the setup.py file. I wish you all the best.</p>
107187
2023-12-21T20:07:55.787
|turtlebot|python|
<p>I've been exploring ROS with Python and TurtleBot recently, and I'm currently working on a project that involves utilizing both publishers and subscribers within the same Python file. I've managed to independently use publishers and subscribers in separate files, but I'm facing challenges integrating them into a single script...what I'm attempting to achieve:</p> <p>Sending out the Goods: Got this publisher shooting out sensor data from my trusty TurtleBot. Receiving the Goods: Simultaneously, I've got this subscriber eagerly waiting for control commands for my TurtleBot's fancy moves.</p> <p>The issue arises when I try to combine these functionalities into one Python script. I'd greatly appreciate any insights, code examples, or suggestions on how to effectively structure and manage publishers and subscribers within the same Python script for ROS with TurtleBot. Are there specific ROS functionalities or Python libraries that might streamline this integration process?</p> <p>Any advice, guidance, or examples that demonstrate the integration of publishers and subscribers within the same Python script in a ROS environment using TurtleBot would be incredibly helpful. Thank you in advance for your support!</p>
Using Publishers and Subscribers in Python for ROS with TurtleBot
<p>I interpret the comment in <code>LaserScan.msg</code> to mean it is the interval, in float seconds, from the start-of-LaserScan-msg-N to start-of-LaserScan-msg-(N+1).</p> <p>That said, I don't think this field is very critical, and I suspect you could probably set it to 0.0 without a problem.</p> <p>For what it is worth, I've never seen a ros driver output distinct LaserScan messages with 22.5 degree arcs like you describe. It's far more typical for the ros driver to assemble a single message with 360-degrees of data in it.</p>
107188
2023-12-21T20:28:13.697
|lidar|message|
<p>I have a LiDAR device that reports the entire 360 degree range, but split into scans of 22.5 degrees each, and I'm trying to assemble my LaserScan messages correctly.</p> <p>As I understand, each 22.5 scan (17 measurements) will have its own message, but my confusion is regarding <code>scan_time</code>, which is defined as <code>time between scans</code>.</p> <p>From <a href="https://robotics.stackexchange.com/questions/86988/explanation-on-sensor-msgs-laserscan-and-time">this answer</a>:</p> <blockquote> <p>Think of scan time as the time taken for a full rotation of the sensor even if it's only producing data for part of that revolution.</p> </blockquote> <p>Which makes sense for that particular question, because their sensor is only reporting a single range of angles, but mine reports a full rotation, albeit in multiple scans. Does the same &quot;full rotation&quot; argument works for my case? Or the time between scans in my case is the time for a single 22.5 scan?</p> <p>Also this question <a href="https://robotics.stackexchange.com/questions/57509/laserscanscan-time-doubt">this question</a> tells me that I should use the time for a single 22.5 scan.</p>
LaserScan scan_time for multiple scans in a single rotation
<p>Finally I'm able to communicate with the Gazebo API. So following steps worked out for me:</p> <p><strong>1. Installing Ubuntu with WSL2</strong><br /> Make sure to use WSL2. You can meet this condition with <code>wsl --set-default-version 2</code> before installing Ubuntu or changing the Version of a existing distribution with <code>wsl --set-version Ubuntu 2</code>. Double check the version with <code>wsl -l -v</code>. I would also recommend to use a fresh installation to build from your Gazebo source, since I could solve some weird errors just by setting up a new distribution.</p> <p>Stick to <a href="https://learn.microsoft.com/de-de/windows/wsl/install" rel="nofollow noreferrer">this guide</a> for more detailled information.</p> <p><strong>2. Building from Gazebo src</strong><br /> The <a href="https://gazebosim.org/docs/harmonic/install_ubuntu_src" rel="nofollow noreferrer">official tutorial</a> describes this process pretty well and with a fresh distribution I nearly had no problems. But you should consider to copy the multi-line code instructions to your favorite text editor first, so you can see which code lines are interrupted by a line break, since the formatting of the webpage can be a bit confusing here. Best practice for me was to not copy multiple commands at once.</p> <p><strong>3. Install Gazebo from binaries</strong><br /> I only installed the source to compile the needed libraries, but my actual Gazebo instance is running from the binaries.</p> <p>Stick to the <a href="https://gazebosim.org/docs/harmonic/install_ubuntu" rel="nofollow noreferrer">official guide</a> and you are fine.</p> <p><strong>4. Create your CMake Project</strong><br /> There is an <a href="https://learn.microsoft.com/en-us/cpp/build/walkthrough-build-debug-wsl2?view=msvc-170" rel="nofollow noreferrer">official help page from Microsoft</a> especially for this. In short I did this:</p> <ul> <li>Installed following components for Visual Studio 2022 <ul> <li>C++ Cmake -Tools for Windows</li> <li>C++ Cmake -Tools for Linux</li> <li>C++ for Linux development</li> </ul> </li> <li>Create your CMake Project from the CMake Project Template</li> <li>Select <code>WSL: Ubuntu</code> (if Ubuntu is the name of your distro) as connection an <code>Linux Debug</code> as your configuration.</li> <li>Run the Hello World example program to check if your system is set up properly (Hello World should be printed by your Linux terminal)</li> </ul> <p><strong>5. Configure your CMake Project</strong><br /> First I copied the header files and the libraries into my own CMakeProject directory.</p> <p>The /include and /lib directories are copied from the /install dir of the source dir from step 2.2.</p> <p>Make sure to delete all 0KB sized files from the /lib dir and it's subdirectories, because this will lead to errors with rsync in later steps.</p> <p>For Gazebo API Integration, modify your CMakeLists.txt from your CMake Project main dir like this:<br /> <code>cmake_minimum_required (VERSION 3.20)</code><br /> Gazebo is using the function <code>cmake_path</code> that was just introduced with cmake 3.20.<br /> In my case Visual Studio was using version 3.19 and it wasn't that easy to change the cmake version used by Visual Studio. This line just makes sure that the minimal required cmake version is used.</p> <p>My CMakeLists.txt from my executable project looks like this:</p> <pre><code>include_directories(${CMakeProject_SOURCE_DIR}/CMakeProject/include/) find_package(gz-msgs10 QUIET REQUIRED OPTIONAL_COMPONENTS log) find_package(gz-transport13 QUIET REQUIRED OPTIONAL_COMPONENTS log) set(GZ_MSGS_VER <span class="math-container">${gz-msgs10_VERSION_MAJOR}) set(GZ_TRANSPORT_VER $</span>{gz-transport13_VERSION_MAJOR}) target_link_libraries(CMakeProject gz-transport<span class="math-container">${GZ_TRANSPORT_VER}) target_link_libraries(CMakeProject gz-msgs$</span>{GZ_MSGS_VER}) </code></pre> <p>My problem with the missing libraries got fixed with the functions <code>find_package</code> and <code>target_link_libraries</code>.</p> <p>Including <code>&lt;gz/transport.hh&gt;</code> and <code>&lt;gz/msgs.hh&gt;</code> should be working fine if you didn't encounter any problems in the prior steps. From here on I recommend to have a look in the examples directories from gz-transport or any other plugin you want to integrate.</p> <p>I still got a problem with Intellisense not recognizing the members from the namespace gz:transport, but that doesn't affect the linking process. Maybe I can give a heads up for this as soon as it's working, too.</p>
107196
2023-12-22T10:09:59.037
|gazebo|
<p>I'm completely new to gazebo and did some of the well explained tutorials to learn how the basic functionality of gazebo is working. So this is my setup:</p> <p>I'm using Windows 10 and installed gazebo with WSL2 on a Ubuntu distribution. From here I did some of the tutorials and was able to interact with the simulation with the gui and also via messages from the powershell (using wsl). So from the powershell I'm able to start the simulation and also can send and receive commands to move the robot or read out some sensor data.</p> <p>My plan is, to use this functionality inside of a C++ or C# application without using the powershell. So I like to use the C++ API given by gazebo.</p> <p>My idea is, to write some code in Visual Studio on my Windows machine and execute this code via cross compilation on my wsl2 instance, where my actual gazebo instance is running.</p> <p><strong>My key question is, how to integrate the gazebo library into Visual Studio and to be able to interact with my gazebo instance? For the beginning i would just start a scene &quot;my_world.sdf&quot; and read out some sensor data.</strong></p> <p>Currently I am struggeling with the integration into Visual Studio 2022.</p> <p>I would be really grateful for any advice given to this topic.</p> <p><strong>Update</strong></p> <p>I think I'm getting closer here, so a short recap what I did so far:</p> <p>I created a cmake-project in Visual Studio 2022, because this seems to be the recommended way to be able to connect via WSL.</p> <p>There is a nice tutorial for this <a href="https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170" rel="nofollow noreferrer">here</a>.</p> <p>Running a simple Hello World output via WSL2 in terminal works fine.</p> <p>Then I built harmonic source files in a fresh ubuntu distribution (see also my <a href="https://robotics.stackexchange.com/questions/107713/gazebo-fortress-ubuntu-building-from-source-fails/107758#107758">different post</a>). I wasn't able to run gz sim after building the source files, so I installed gz from the binaries, but kept the source files to be able to link the header files and libraries in my CMake project.</p> <p>From here I copied the contents from the source files from {workspace}/install/include and {workspace}/install/lib to my CMake project dir.</p> <p>In my CMakeProject in the CMakeLists.txt I added:</p> <pre><code>include_directories(<span class="math-container">${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/cmake3) include_directories($</span>{CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/common5) include_directories(<span class="math-container">${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/fuel_tools9) include_directories($</span>{CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/gui8) include_directories(<span class="math-container">${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/launch7) include_directories($</span>{CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/math7) include_directories(<span class="math-container">${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/msgs10) include_directories($</span>{CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/physics7) include_directories(<span class="math-container">${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/plugin2) include_directories($</span>{CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/rendering8) include_directories(<span class="math-container">${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/sdformat14) include_directories($</span>{CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/sensors8) include_directories(<span class="math-container">${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/sim8) include_directories($</span>{CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/transport13) include_directories(${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/include/gz/utils2) link_directories(${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/lib) </code></pre> <p>In my CMakeProject.cpp I simply added:</p> <pre><code>#include &quot;gz/transport.hh&quot; </code></pre> <p>There have been some issues with missing files, like:</p> <ul> <li>google/protobuf</li> <li>tinyxml2.h</li> <li>zmq.hpp</li> <li>uuid/uuid.h</li> </ul> <p>I fixed the missing dependencies while installing the packages with apt-get, but I don't know why they were missing initially.</p> <p>Now I got a lot of undefined references from the linker:</p> <ul> <li>gzTransportNodeCreate</li> <li>gzTransportNodeDestroy</li> <li>gzTransportAdvertise</li> <li>...</li> </ul> <p>To fix this I tried to add this to my CMakeLists.txt:</p> <pre><code>link_libraries(<span class="math-container">${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/lib/libgz-transport13.so.13.0.0) link_libraries($</span>{CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/lib/libgz-transport13-log.so.13.0.0) link_libraries(${CMakeProject_SOURCE_DIR}/CMakeProject/gz-harmonic/install/lib/libgz-transport13-parameters.so.13.0.0) </code></pre> <p>Unfortunately this didn't help, I still got the undefined references.</p> <p>Am I missing out something here? I have been working on this for over a week now and don't just want to quit here, but I'm running out of ideas.</p>
How to get started using the C++ API for Gazebo Harmonic?
<p>Welcome to Robotics Stack Exchange!</p> <p>Looking at your urdf file, we can find &quot;boggiesidelegl_1&quot; is defined twice as shown below:</p> <pre><code>259:&lt;link name=&quot;boggiesidelegl_1&quot;&gt; 268: &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/boggiesidelegl_1.stl" scale="0.001 0.001 0.001"/&gt; 275: &lt;mesh filename="file://$</span>(find mars_description)/meshes/boggiesidelegl_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; 343:&lt;link name=&quot;boggiesidelegl_1&quot;&gt; 352: &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/boggiesidelegl_1.stl" scale="0.001 0.001 0.001"/&gt; 359: &lt;mesh filename="file://$</span>(find mars_description)/meshes/boggiesidelegl_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; </code></pre> <p>Please merge them together to make only one link.</p>
107222
2023-12-24T14:12:16.220
|ros2|urdf|ros-humble|robot-state-publisher|errors|
<p>I am using ubuntu 22.04 ROS2 HUMBLE</p> <p>i used <a href="https://github.com/dheena2k2/fusion2urdf-ros2/tree/master" rel="nofollow noreferrer">https://github.com/dheena2k2/fusion2urdf-ros2/tree/master</a> to create a urdf for my project. when i try running ros2 launch mars_description display.launch.py, i get an error saying</p> <pre><code>[robot_state_publisher-1] Error: link 'boggiesidelegl_1' is not unique. </code></pre> <p>my .xacro file looks like this</p> <pre><code>&lt;?xml version=&quot;1.0&quot; ?&gt; &lt;robot name=&quot;mars&quot; xmlns:xacro=&quot;http://www.ros.org/wiki/xacro&quot;&gt; &lt;xacro:include filename=&quot;<span class="math-container">$(find mars_description)/urdf/materials.xacro" /&gt; &lt;xacro:include filename="$</span>(find mars_description)/urdf/mars.trans&quot; /&gt; &lt;xacro:include filename=&quot;<span class="math-container">$(find mars_description)/urdf/mars.gazebo" /&gt; &lt;link name="base_link"&gt; &lt;inertial&gt; &lt;origin xyz="0.1079014386962853 -0.018704254362633656 0.6454702576619512" rpy="0 0 0"/&gt; &lt;mass value="1123.0178027625177"/&gt; &lt;inertia ixx="42.702699" iyy="66.247576" izz="91.981429" ixy="-2.722801" iyz="0.096354" ixz="1.746058"/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz="0 0 0" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/base_link.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;silver&quot;/&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;mesh filename=&quot;file://$(find mars_description)/meshes/base_link.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;leg_bigr_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.08026176688942216 0.02500033810921609 -0.15057691313293592&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;22.546629703835407&quot;/&gt; &lt;inertia ixx=&quot;0.328749&quot; iyy=&quot;2.046875&quot; izz=&quot;1.727521&quot; ixy=&quot;0.0&quot; iyz=&quot;-0.0&quot; ixz=&quot;0.322481&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;-0.028011 -0.292969 -0.648297&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/leg_bigr_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="-0.028011 -0.292969 -0.648297" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/leg_bigr_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;leg_bigl_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.08026176688941755 -0.02499966189078373 -0.1505769131329358&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;22.546629703835407&quot;/&gt; &lt;inertia ixx=&quot;0.328749&quot; iyy=&quot;2.046875&quot; izz=&quot;1.727521&quot; ixy=&quot;0.0&quot; iyz=&quot;-0.0&quot; ixz=&quot;0.322481&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;-0.028011 0.347031 -0.648297&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/leg_bigl_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="-0.028011 0.347031 -0.648297" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/leg_bigl_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;leg_smallr_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.0641436530031968 0.02500033810921981 -0.0835318655770268&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;21.006548439283524&quot;/&gt; &lt;inertia ixx=&quot;0.162855&quot; iyy=&quot;1.268194&quot; izz=&quot;1.114091&quot; ixy=&quot;0.0&quot; iyz=&quot;-0.0&quot; ixz=&quot;0.048486&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.396172 -0.342969 -0.41332&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/leg_smallr_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.396172 -0.342969 -0.41332" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/leg_smallr_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;leg_smalll_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.07117981414108449 -0.02499966189077979 -0.07762348003982011&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;21.006548439283524&quot;/&gt; &lt;inertia ixx=&quot;0.178501&quot; iyy=&quot;1.268194&quot; izz=&quot;1.098446&quot; ixy=&quot;0.0&quot; iyz=&quot;-0.0&quot; ixz=&quot;0.130339&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.396172 0.397031 -0.41332&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/leg_smalll_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.396172 0.397031 -0.41332" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/leg_smalll_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;wheel2_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;4.6187777968942356e-07 -0.08499966189077818 2.1514828360547078e-07&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;24.630675452766535&quot;/&gt; &lt;inertia ixx=&quot;0.231272&quot; iyy=&quot;0.343906&quot; izz=&quot;0.231272&quot; ixy=&quot;0.0&quot; iyz=&quot;0.0&quot; ixz=&quot;-0.0&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.729843 0.447031 -0.156291&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/wheel2_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.729843 0.447031 -0.156291" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/wheel2_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;wheel1_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-3.179377151552032e-07 0.08500033810922158 -5.305311800984924e-08&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;24.630675452766535&quot;/&gt; &lt;inertia ixx=&quot;0.231272&quot; iyy=&quot;0.343906&quot; izz=&quot;0.231272&quot; ixy=&quot;0.0&quot; iyz=&quot;-0.0&quot; ixz=&quot;-0.0&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.706171 -0.392969 -0.128188&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/wheel1_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.706171 -0.392969 -0.128188" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/wheel1_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;wheel4_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;2.529740886214604e-07 0.08500033810921648 3.7330526453382973e-07&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;24.630675452766535&quot;/&gt; &lt;inertia ixx=&quot;0.231272&quot; iyy=&quot;0.343906&quot; izz=&quot;0.231272&quot; ixy=&quot;0.0&quot; iyz=&quot;-0.0&quot; ixz=&quot;0.0&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.052627 -0.392969 -0.175811&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/wheel4_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.052627 -0.392969 -0.175811" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/wheel4_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;wheel26_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-7.933437029539192e-08 0.0850003381092132 3.1630714458774634e-07&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;24.630675452766535&quot;/&gt; &lt;inertia ixx=&quot;0.231272&quot; iyy=&quot;0.343906&quot; izz=&quot;0.231272&quot; ixy=&quot;0.0&quot; iyz=&quot;0.0&quot; ixz=&quot;0.0&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;-0.434229 -0.342969 -0.191392&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/wheel26_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="-0.434229 -0.342969 -0.191392" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/wheel26_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;wheel3_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-2.4651678172393776e-07 -0.08499966189078317 2.5749494830806796e-07&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;24.630675452766535&quot;/&gt; &lt;inertia ixx=&quot;0.231272&quot; iyy=&quot;0.343906&quot; izz=&quot;0.231272&quot; ixy=&quot;0.0&quot; iyz=&quot;-0.0&quot; ixz=&quot;0.0&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.074634 0.447031 -0.146773&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/wheel3_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.074634 0.447031 -0.146773" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/wheel3_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;wheel5_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-7.933437534690668e-08 -0.08499966189078612 3.1630714411590155e-07&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;24.630675452766535&quot;/&gt; &lt;inertia ixx=&quot;0.231272&quot; iyy=&quot;0.343906&quot; izz=&quot;0.231272&quot; ixy=&quot;0.0&quot; iyz=&quot;-0.0&quot; ixz=&quot;0.0&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;-0.434229 0.397031 -0.191392&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/wheel5_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="-0.434229 0.397031 -0.191392" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/wheel5_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;boggiesidelegr_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.3354348448034716 0.032519338109216644 -0.666434058596638&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;0.16957453765781244&quot;/&gt; &lt;inertia ixx=&quot;0.000188&quot; iyy=&quot;0.000192&quot; izz=&quot;6e-06&quot; ixy=&quot;0.0&quot; iyz=&quot;0.0&quot; ixz=&quot;4e-06&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;-0.363607 -0.31545 -1.399928&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/boggiesidelegr_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="-0.363607 -0.31545 -1.399928" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/boggiesidelegr_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;boggiesidelegl_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.40452915519652305 -0.027480661890782798 -0.659159058596637&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;0.16957453765781244&quot;/&gt; &lt;inertia ixx=&quot;0.000188&quot; iyy=&quot;0.000192&quot; izz=&quot;6e-06&quot; ixy=&quot;0.0&quot; iyz=&quot;-0.0&quot; ixz=&quot;4e-06&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.376357 0.37455 -1.392653&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/boggiesidelegl_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.376357 0.37455 -1.392653" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/boggiesidelegl_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;boggiemiddleshit_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.13875725093888558 0.027030338109217733 -0.5040354381025404&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;0.036370775253551875&quot;/&gt; &lt;inertia ixx=&quot;2e-06&quot; iyy=&quot;2e-06&quot; izz=&quot;1e-06&quot; ixy=&quot;-0.0&quot; iyz=&quot;0.0&quot; ixz=&quot;-0.0&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.215019 0.054061 -1.316123&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/boggiemiddleshit_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.215019 0.054061 -1.316123" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/boggiemiddleshit_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;boggiesidelegupl_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.05639229827838968 9.925958193768292e-06 -0.015470958365142118&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;0.16957453765781244&quot;/&gt; &lt;inertia ixx=&quot;1e-05&quot; iyy=&quot;0.00019&quot; izz=&quot;0.000186&quot; ixy=&quot;-1.6e-05&quot; iyz=&quot;2e-06&quot; ixz=&quot;1.9e-05&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.075908 -0.342969 -0.822081&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/boggiesidelegupl_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.075908 -0.342969 -0.822081" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/boggiesidelegupl_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;boggiesidelegupr_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.05639079038116439 -9.154467956962176e-06 -0.015476453623781805&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;0.16957453765781244&quot;/&gt; &lt;inertia ixx=&quot;1e-05&quot; iyy=&quot;0.00019&quot; izz=&quot;0.000186&quot; ixy=&quot;1.6e-05&quot; iyz=&quot;-2e-06&quot; ixz=&quot;1.9e-05&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.075908 0.397031 -0.822081&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/boggiesidelegupr_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.075908 0.397031 -0.822081" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/boggiesidelegupr_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;boggiesidelegl_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.008267844803476948 3.381092172349831e-07 -0.057672058596637155&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;0.16957453765781244&quot;/&gt; &lt;inertia ixx=&quot;0.000188&quot; iyy=&quot;0.000192&quot; izz=&quot;6e-06&quot; ixy=&quot;0.0&quot; iyz=&quot;-0.0&quot; ixz=&quot;4e-06&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;-0.03644 0.402031 -0.791166&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/boggiesidelegl_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="-0.03644 0.402031 -0.791166" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/boggiesidelegl_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;boggiesidelegr_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.00826784480347154 3.381092166798716e-07 -0.05767205859663793&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;0.16957453765781244&quot;/&gt; &lt;inertia ixx=&quot;0.000188&quot; iyy=&quot;0.000192&quot; izz=&quot;6e-06&quot; ixy=&quot;0.0&quot; iyz=&quot;0.0&quot; ixz=&quot;4e-06&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;-0.03644 -0.347969 -0.791166&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/boggiesidelegr_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="-0.03644 -0.347969 -0.791166" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/boggiesidelegr_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;boggiebiglink_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.00017673760116454496 3.3810921771723623e-07 0.004997178425846904&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;2.133721996073983&quot;/&gt; &lt;inertia ixx=&quot;0.097387&quot; iyy=&quot;0.000258&quot; izz=&quot;0.097608&quot; ixy=&quot;-0.0&quot; iyz=&quot;0.0&quot; ixz=&quot;8e-06&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0.075908 0.027031 -0.822081&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;file://<span class="math-container">$(find mars_description)/meshes/boggiebiglink_1.stl" scale="0.001 0.001 0.001"/&gt; &lt;/geometry&gt; &lt;material name="silver"/&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz="0.075908 0.027031 -0.822081" rpy="0 0 0"/&gt; &lt;geometry&gt; &lt;mesh filename="file://$</span>(find mars_description)/meshes/boggiebiglink_1.stl&quot; scale=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;Revolute 1&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.028011 0.292969 0.648297&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;leg_bigr_1&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 -0.0&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Revolute 2&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.028011 -0.347031 0.648297&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;leg_bigl_1&quot;/&gt; &lt;axis xyz=&quot;-0.0 -1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Revolute 3&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-0.424183 0.05 -0.234977&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;leg_bigr_1&quot;/&gt; &lt;child link=&quot;leg_smallr_1&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 -0.0&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Revolute 4&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-0.424183 -0.05 -0.234977&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;leg_bigl_1&quot;/&gt; &lt;child link=&quot;leg_smalll_1&quot;/&gt; &lt;axis xyz=&quot;-0.0 -1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Revolute 6&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-0.333671 -0.05 -0.257029&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;leg_smalll_1&quot;/&gt; &lt;child link=&quot;wheel2_1&quot;/&gt; &lt;axis xyz=&quot;-0.0 -1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Revolute 7&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-0.309999 0.05 -0.285132&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;leg_smallr_1&quot;/&gt; &lt;child link=&quot;wheel1_1&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 -0.0&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Revolute 8&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.343545 0.05 -0.237509&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;leg_smallr_1&quot;/&gt; &lt;child link=&quot;wheel4_1&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 -0.0&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Revolute 9&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.406218 0.05 -0.456905&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;leg_bigr_1&quot;/&gt; &lt;child link=&quot;wheel26_1&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 -0.0&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Revolute 10&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.321538 -0.05 -0.266547&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;leg_smalll_1&quot;/&gt; &lt;child link=&quot;wheel3_1&quot;/&gt; &lt;axis xyz=&quot;-0.0 -1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Revolute 11&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.406218 -0.05 -0.456905&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;leg_bigl_1&quot;/&gt; &lt;child link=&quot;wheel5_1&quot;/&gt; &lt;axis xyz=&quot;-0.0 -1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Rigid 13&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;0.008429 0.055 0.142869&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;leg_bigr_1&quot;/&gt; &lt;child link=&quot;boggiesidelegr_1&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Rigid 14&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;0.008429 -0.055 0.142869&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;leg_bigl_1&quot;/&gt; &lt;child link=&quot;boggiesidelegl_1&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Rigid 20&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;-0.215019 -0.054061 1.316123&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;boggiemiddleshit_1&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Ball 21&quot; type=&quot;Ball&quot;&gt; &lt;origin xyz=&quot;0.0 0.37 0.0&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;boggiebiglink_1&quot;/&gt; &lt;child link=&quot;boggiesidelegupl_1&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Ball 22&quot; type=&quot;Ball&quot;&gt; &lt;origin xyz=&quot;0.0 -0.37 0.0&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;boggiebiglink_1&quot;/&gt; &lt;child link=&quot;boggiesidelegupr_1&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Ball 23&quot; type=&quot;Ball&quot;&gt; &lt;origin xyz=&quot;0.112348 -0.005 -0.030915&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;boggiesidelegupr_1&quot;/&gt; &lt;child link=&quot;boggiesidelegl_1&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Ball 24&quot; type=&quot;Ball&quot;&gt; &lt;origin xyz=&quot;0.112348 0.005 -0.030915&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;boggiesidelegupl_1&quot;/&gt; &lt;child link=&quot;boggiesidelegr_1&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;Revolute 25&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.139111 0.02703 -0.494042&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;parent link=&quot;boggiemiddleshit_1&quot;/&gt; &lt;child link=&quot;boggiebiglink_1&quot;/&gt; &lt;axis xyz=&quot;0.035366 0.0 0.999374&quot;/&gt; &lt;/joint&gt; </code></pre> <p>I only have 1 .STL file of the name boggiesidelegl_1</p>
Error: link 'boggiesidelegl_1' is not unique
<p>I have encountered the need to add specific model paths when including custom models in Gazebo worlds. The following two explanations will help you tidy up the paths:</p> <ul> <li><p><strong>Edit the related environment variable:</strong></p> <p>Gazebo uses the <code>GAZEBO_MODEL_PATH</code> to determine where to look for models. If you've added paths, they might have been appended to this variable. You can edit or clear this variable in your shell (like ~/.bashrc) to clear it or <code>export GAZEBO_MODEL_PATH=/new/desirable/path</code> to set it to a new directory.</p> <p>You can know the value of this variable in shell using</p> <pre><code>echo $GAZEBO_MODEL_PATH </code></pre> <p>If you do not see the paths you want to remove, then check the next point.</p> </li> <li><p><strong>Directly modify the configuration file:</strong></p> <p>Gazebo stores certain model paths in a configuration file in the home directory under <code>.gazebo/gui.ini</code>. You can open this file in a text editor and manually edit or delete the lines of model paths you want to remove.</p> <p><strong>After editing the file, close the terminal and open Gazebo in a new terminal environment.</strong></p> </li> </ul> <p>I tried those solutions on my machine just before posting the anwer, and the second one did the trick. Hope this helps!</p>
107228
2023-12-25T04:46:54.707
|gazebo|
<p>I add model into gazebo classic using the insert -&gt; add path. However it started to overflow the tab and making the tab messy. Other than that it will not delete the path that was already deleted manually. And for some reasons, sometimes it will not renew the file under the path and causes problem for me to add new models under the same path. My Gazebo version is 11.14.0. (I know this is kinda a duplicated question of <a href="https://robotics.stackexchange.com/questions/20601/how-to-remove-insert-paths-in-gazebo-ui">this</a>, but it was never answered for really long time.)</p>
How to delete model path in "add path" under the insert tab in gazebo classic?