Answer
stringlengths
44
28.2k
Id
stringlengths
1
6
CreationDate
stringlengths
23
23
Tags
stringlengths
4
94
Body
stringlengths
54
35.7k
Title
stringlengths
13
150
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am not aware of any standard ros package that has the behavior you ask for. I think you need to write custom code to implement this. If you are using <code>ros_control</code>, I'd investigate adding this new behavior to the <code>FollowJointTrajectory</code> Action Server.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-06-27</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-06-27</strong>:<br /> The <code>scaled_joint_trajectory_controller</code> in <a href="https://github.com/UniversalRobots/Universal_Robots_ROS_scaled_controllers" rel="nofollow noreferrer">UniversalRobots/Universal_Robots_ROS_scaled_controllers</a> implements a version of the <code>JointTrajectoryController</code> which can dynamically update the 'rate' at which it executes trajectories. That <em>could</em> be something the OP could use.</p> <p>Provided the &quot;robotic arm&quot; mentioned is <code>ros_control</code> compatible.</p> <p>But: it's certainly not safety rated, so depending on the requirements would not be sufficient for a truly safe environment. Especially with humans close by.</p>
103371
2023-06-27T04:24:59.000
|ros|moveit|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello<br><br> I am working on a robotic arm.<br> The issue I'm working on right now is security.<br> My aim is to slow down the speed of the robotic arm if a human enters the environment while the robotic arm is moving.<br> The closer the human gets to the robotic arm, the more I want to slow down the robotic arm.<br></p> <p>I used <strong>setMaxVelocityScalingFactor</strong> and <strong>setMaxAccelerationScalingFactor</strong> for this, but these can be used <strong>before execution</strong>.<br> The speed of the robotic arm should slow down <strong>during execution</strong>.<br> that is, I want to reduce the speed of the robotic arm when a human enters the environment <strong>while the robotic arm is moving</strong>.</p> <p>Thank you so much</p> <hr /> <p><a href="https://answers.ros.org/question/416906/robotic-arm-safety-with-proximity-sensor/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/45833/omeranar1/" rel="nofollow noreferrer">omeranar1</a> on ROS Answers with karma: 31 on 2023-06-27</p> <p>Post score: 0</p>
robotic arm safety with proximity sensor
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am going to give you the answer you don't want to hear:</p> <p>It is not implemented yet. See these issues:</p> <p><a href="https://github.com/ros2/rcl/issues/232" rel="nofollow noreferrer">https://github.com/ros2/rcl/issues/232</a> <a href="https://github.com/ros2/rcl/issues/233" rel="nofollow noreferrer">https://github.com/ros2/rcl/issues/233</a> <a href="https://github.com/ros2/rcl/issues/234" rel="nofollow noreferrer">https://github.com/ros2/rcl/issues/234</a></p> <p>At least now you know... </p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/124778/jrtg/" rel="nofollow noreferrer">jrtg</a> with karma: 145 on 2023-06-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103373
2023-06-27T05:09:01.000
|ros|ros2|roslaunch|remapping|remap|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I try to remap a set of topic using the '**' wildcard as explain in <a href="http://design.ros2.org/articles/static_remapping.html#replacement-part-of-a-rule" rel="nofollow noreferrer">http://design.ros2.org/articles/static_remapping.html#replacement-part-of-a-rule</a></p> <p>I got the error :</p> <pre><code>rclpy._rclpy_pybind11.RCLError: failed to initialize rcl: Couldn't parse remap rule: '-r /fmu/in/**:=/px4_1/\1'. Error: Wildcard '**' is not implemented, at ./src/rcl/arguments.c:1167, at ./src/rcl/arguments.c:371 </code></pre> <p>Have I written the rule wrong or does this wildcard really not implemented ?</p> <p>Note: I got the same behaviour with '*'.</p> <p>extract from my yaml file</p> <pre><code> - node: remap: - from: '/fmu/*' to: '/px4_$(var i)/fmu/\\1' </code></pre> <hr /> <p><a href="https://answers.ros.org/question/416910/ros2-remapping-wildcard/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/146607/s%C3%A9bastienl/" rel="nofollow noreferrer">SébastienL</a> on ROS Answers with karma: 32 on 2023-06-27</p> <p>Post score: 0</p>
ros2 remapping wildcard
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>As a follow-up: This has been resolved in the driver. See <a href="https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/issues/677" rel="nofollow noreferrer">https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/issues/677</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/26760/fexner/" rel="nofollow noreferrer">fexner</a> with karma: 221 on 2023-07-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103375
2023-06-27T08:55:37.000
|ros|universal-robots|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm trying to control an UR5 Robot arm using ROS2. To achieve this i've been using the following repo as guideline: <a href="https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/humble" rel="nofollow noreferrer">https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/humble</a></p> <p>I'm running this on Ubuntu 22.04.02 and using ROS2 Humble</p> <p>When i try to launch the driver i get the following logs:</p> <pre><code>ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5 robot_ip:=10.100.129.39 launch_rviz:=false [INFO] [launch]: All log files can be found below /home/ur-control/.ros/log/2023-06-27-15-10-38-716282-u22lts-urcontrol-46884 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [dashboard_client-2]: process started with pid [46889] [INFO] [controller_stopper_node-3]: process started with pid [46891] [INFO] [ur_ros2_control_node-1]: process started with pid [46887] [INFO] [robot_state_publisher-4]: process started with pid [46893] [INFO] [spawner-5]: process started with pid [46895] [INFO] [spawner-6]: process started with pid [46897] [INFO] [spawner-7]: process started with pid [46899] [INFO] [spawner-8]: process started with pid [46901] [INFO] [spawner-9]: process started with pid [46930] [INFO] [spawner-10]: process started with pid [46937] [dashboard_client-2] [INFO] [1687871439.398742580] [UR_Client_Library]: Connected: Universal Robots Dashboard Server [dashboard_client-2] [controller_stopper_node-3] [INFO] [1687871439.398103120] [Controller stopper]: Waiting for switch controller service to come up on controller_manager/switch_controller [ur_ros2_control_node-1] terminate called after throwing an instance of 'std::runtime_error' [ur_ros2_control_node-1] what(): text not specified in the tf_prefix tag [robot_state_publisher-4] [INFO] [1687871439.427927325] [robot_state_publisher]: got segment base [robot_state_publisher-4] [INFO] [1687871439.428226479] [robot_state_publisher]: got segment base_link [robot_state_publisher-4] [INFO] [1687871439.428249023] [robot_state_publisher]: got segment base_link_inertia [robot_state_publisher-4] [INFO] [1687871439.428257832] [robot_state_publisher]: got segment flange [robot_state_publisher-4] [INFO] [1687871439.428265292] [robot_state_publisher]: got segment forearm_link [robot_state_publisher-4] [INFO] [1687871439.428272157] [robot_state_publisher]: got segment ft_frame [robot_state_publisher-4] [INFO] [1687871439.428278847] [robot_state_publisher]: got segment shoulder_link [robot_state_publisher-4] [INFO] [1687871439.428285812] [robot_state_publisher]: got segment tool0 [robot_state_publisher-4] [INFO] [1687871439.428292984] [robot_state_publisher]: got segment upper_arm_link [robot_state_publisher-4] [INFO] [1687871439.428301409] [robot_state_publisher]: got segment world [robot_state_publisher-4] [INFO] [1687871439.428312288] [robot_state_publisher]: got segment wrist_1_link [robot_state_publisher-4] [INFO] [1687871439.428322226] [robot_state_publisher]: got segment wrist_2_link [robot_state_publisher-4] [INFO] [1687871439.428332326] [robot_state_publisher]: got segment wrist_3_link [ERROR] [ur_ros2_control_node-1]: process has died [pid 46887, exit code -6, cmd '/home/ur-control/workspace/ros_ur_driver/install/ur_robot_driver/lib/ur_robot_driver/ur_ros2_control_node --ros-args --params-file /tmp/launch_params_v5mj3prx --params-file /home/ur-control/workspace/ros_ur_driver/install/ur_robot_driver/share/ur_robot_driver/config/ur5e_update_rate.yaml --params-file /home/ur-control/workspace/ros_ur_driver/install/ur_robot_driver/share/ur_robot_driver/config/ur_controllers.yaml']. [spawner-10] [INFO] [1687871441.826413906] [spawner_forward_position_controller]: Waiting for '/controller_manager' node to exist [spawner-5] [INFO] [1687871441.848227602] [spawner_scaled_joint_trajectory_controller]: Waiting for '/controller_manager' node to exist [spawner-6] [INFO] [1687871441.886653953] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-9] [INFO] [1687871441.903905257] [spawner_force_torque_sensor_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-8] [INFO] [1687871441.911055867] [spawner_speed_scaling_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-7] [INFO] [1687871441.920189700] [spawner_io_and_status_controller]: Waiting for '/controller_manager' node to exist [spawner-10] [INFO] [1687871443.849888060] [spawner_forward_position_controller]: Waiting for '/controller_manager' node to exist [spawner-5] [INFO] [1687871443.871522619] [spawner_scaled_joint_trajectory_controller]: Waiting for '/controller_manager' node to exist [spawner-6] [INFO] [1687871443.910050317] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-9] [INFO] [1687871443.926036279] [spawner_force_torque_sensor_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-8] [INFO] [1687871443.934576269] [spawner_speed_scaling_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-7] [INFO] [1687871443.943109006] [spawner_io_and_status_controller]: Waiting for '/controller_manager' node to exist [spawner-10] [INFO] [1687871445.872573721] [spawner_forward_position_controller]: Waiting for '/controller_manager' node to exist [spawner-5] [INFO] [1687871445.892843767] [spawner_scaled_joint_trajectory_controller]: Waiting for '/controller_manager' node to exist [spawner-6] [INFO] [1687871445.932238611] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-9] [INFO] [1687871445.946847240] [spawner_force_torque_sensor_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-8] [INFO] [1687871445.956192171] [spawner_speed_scaling_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-7] [INFO] [1687871445.966376156] [spawner_io_and_status_controller]: Waiting for '/controller_manager' node to exist [spawner-10] [INFO] [1687871447.894589500] [spawner_forward_position_controller]: Waiting for '/controller_manager' node to exist [spawner-5] [INFO] [1687871447.915575034] [spawner_scaled_joint_trajectory_controller]: Waiting for '/controller_manager' node to exist [spawner-6] [INFO] [1687871447.954223894] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-9] [INFO] [1687871447.968323321] [spawner_force_torque_sensor_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-8] [INFO] [1687871447.978319658] [spawner_speed_scaling_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-7] [INFO] [1687871447.989146442] [spawner_io_and_status_controller]: Waiting for '/controller_manager' node to exist [spawner-10] [ERROR] [1687871449.917023615] [spawner_forward_position_controller]: Controller manager not available [spawner-5] [ERROR] [1687871449.939288109] [spawner_scaled_joint_trajectory_controller]: Controller manager not available [spawner-6] [ERROR] [1687871449.974735907] [spawner_joint_state_broadcaster]: Controller manager not available [spawner-9] [ERROR] [1687871449.990382404] [spawner_force_torque_sensor_broadcaster]: Controller manager not available [spawner-8] [ERROR] [1687871450.001533371] [spawner_speed_scaling_state_broadcaster]: Controller manager not available [spawner-7] [ERROR] [1687871450.012905398] [spawner_io_and_status_controller]: Controller manager not available [ERROR] [spawner-10]: process has died [pid 46937, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner forward_position_controller --controller-manager /controller_manager --controller-manager-timeout 10 --inactive --ros-args']. [ERROR] [spawner-5]: process has died [pid 46895, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner scaled_joint_trajectory_controller -c /controller_manager --controller-manager-timeout 10 --ros-args']. [ERROR] [spawner-6]: process has died [pid 46897, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --controller-manager /controller_manager --controller-manager-timeout 10 --ros-args']. [ERROR] [spawner-9]: process has died [pid 46930, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner force_torque_sensor_broadcaster --controller-manager /controller_manager --controller-manager-timeout 10 --ros-args']. [ERROR] [spawner-8]: process has died [pid 46901, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner speed_scaling_state_broadcaster --controller-manager /controller_manager --controller-manager-timeout 10 --ros-args']. [ERROR] [spawner-7]: process has died [pid 46899, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner io_and_status_controller --controller-manager /controller_manager --controller-manager-timeout 10 --ros-args']. </code></pre> <p>I've also tried using the recommended IP settings, however this did not make any difference. I'm pretty confident that the communication between the UR5 and my PC is working, since i was able to extract some callibration data using this comand:</p> <pre><code><span class="math-container">$ ros2 launch ur_calibration calibration_correction.launch.py \ robot_ip:=&lt;robot_ip&gt; target_filename:="$</span>{HOME}/my_robot_calibration.yaml&quot; </code></pre> <p>Im very much a noob at ROS but i'm pretty sure that the issue lies with the 'tf_prefix' variable somehow or there is an issue with missing packages. If anyone can help me solve this or give me some pointers to find the issue, i would be very thankfull.</p> <p>I've followed this section of the documentation to install and setup my workspace: <a href="https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/humble#build-from-source" rel="nofollow noreferrer">https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/humble#build-from-source</a></p> <p>Heres some additional information about my ROS enviroment:</p> <pre><code>ROS_VERSION=2 ROS_PYTHON_VERSION=3 ROS_LOCALHOST_ONLY=0 ROS_DISTRO=humble </code></pre> <p>If any other information would be helpfull, i will be happy to provide it asap.</p> <hr /> <p><a href="https://answers.ros.org/question/416924/universal-robots-driver-ros2-not-working/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/156115/ledrag/" rel="nofollow noreferrer">ledrag</a> on ROS Answers with karma: 1 on 2023-06-27</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-06-27</strong>:<br /> Looks like <a href="https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/issues/718" rel="nofollow noreferrer">UniversalRobots/Universal_Robots_ROS2_Driver#718</a>.</p> <p>As this is an actual problem with the sw, as opposed to some configuration or usage question, I'd recommend diagnosing on the issue tracker instead of here on ROS Answers.</p>
Universal Robots Driver ROS2 not working
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It seems like changing the order in my code fixed the issue.</p> <p>When I set<code>add_on_set_parameters_callback</code> before actually declaring parameter, it ensures that parameter override value is triggering the callback and then populating the value to my function.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/64636/holunder/" rel="nofollow noreferrer">holunder</a> with karma: 20 on 2023-06-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/64636/holunder/" rel="nofollow noreferrer">holunder</a> on 2023-06-29</strong>:<br /> if someone with higher reputation could mark this reply as an answer, the questions could be closed properly.</p>
103377
2023-06-28T03:19:18.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I've defined a callback for parameter value change:</p> <pre><code>MyNode::MyNode() : Node(&quot;myNode&quot;) { // subscriber, publisher, .... // Define callback to update parameter parameter_set_callback = this-&gt;add_on_set_parameters_callback(std::bind(&amp;MyNode::update_parameter_callback, this, _1)); } </code></pre> <p>The function <code>update_parameter_callback</code> itself sets the changed parameter values in my application.</p> <pre><code>rcl_interfaces::msg::SetParametersResult MyNode::update_parameter_callback(const std::vector&lt;rclcpp::Parameter&gt; &amp;parameters) { rcl_interfaces::msg::SetParametersResult res; // Update parameter res = UpdateParameter_MyCode(parameters); return res; } </code></pre> <p>This works well when setting parameter during runtime via <code>ros2 param set</code></p> <p>When I set a default value in launch file, this callback is not triggered:</p> <pre><code>&lt;node pkg = &quot;my_pkg&quot; name = &quot;MyNode&quot; exec = &quot;MyNode&quot; &gt; &lt;param name=&quot;bar&quot; value=&quot;201.0&quot;/&gt; &lt;/node&gt; </code></pre> <p>Is there any chance to re-use existing callback for parameter that are set within launch?</p> <hr /> <p><a href="https://answers.ros.org/question/416966/ros2-add_on_set_parameters_callback-not-triggered-for-launch-parameter/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/64636/holunder/" rel="nofollow noreferrer">holunder</a> on ROS Answers with karma: 20 on 2023-06-28</p> <p>Post score: 0</p>
ROS2 add_on_set_parameters_callback not triggered for launch parameter
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>&quot;Transformer&quot; is part of the tf ros package, so in your CMakeLists.txt you need to specify that your plugin has a dependency on this package. There are other tf-related ros packages you may also need (tf2, tf2_ros, tf_conversions), but I'm pretty sure that particular error is from tf.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-07-02</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/140466/peter_feng/" rel="nofollow noreferrer">peter_feng</a> on 2023-07-03</strong>:<br /> I added all of them(tf, tf2_ros, tf_conversions) to the configuration file.</p> <p>It worked! Thank you.</p>
103379
2023-06-30T02:27:11.000
|ros|navigation|costmap|2dcostmap|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I wrote a custom costmap plugin.</p> <p>It can work on local costmap.The configuration is as follows:</p> <blockquote> <p>plugins:<br /> - {name: grid_layer, type: &quot;simple_layer_namespace::GridLayer&quot;}<br /> - {name: inflation_layer, type: &quot;costmap_2d::InflationLayer&quot;}</p> </blockquote> <p>But if I configure it to the global costmap,it will report an error.</p> <blockquote> <p>[ INFO] [1688106907.862182415, 1687920714.481622674]: global_costmap: Using plugin &quot;grid_layer&quot; terminate called after throwing an instance of 'pluginlib::LibraryLoadException' what(): Failed to load library /home/msy/ros_ws/devel/lib//libgrid_layer.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /home/msy/ros_ws/devel/lib//libgrid_layer.so: undefined symbol: _ZN2tf11Transformer18DEFAULT_CACHE_TIMEE)</p> </blockquote> <p>The configuration is as follows:</p> <blockquote> <p>plugins:<br /> # - {name: static_layer, type: &quot;costmap_2d::StaticLayer&quot;}<br /> # - {name: obstacle_layer, type: &quot;costmap_2d::ObstacleLayer&quot;}<br /> - {name: grid_layer, type: &quot;simple_layer_namespace::GridLayer&quot;}<br /> - {name: inflation_layer, type: &quot;costmap_2d::InflationLayer&quot;}</p> </blockquote> <p>What went wrong?</p> <hr /> <p><a href="https://answers.ros.org/question/417037/poco-exception-=-/home/msy/ros_ws/devel/lib//libgrid_layer.so:-undefined-symbol:-_zn2tf11transformer18default_cache_timee/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/140466/peter_feng/" rel="nofollow noreferrer">peter_feng</a> on ROS Answers with karma: 3 on 2023-06-30</p> <p>Post score: 0</p>
Poco exception = /home/msy/ros_ws/devel/lib//libgrid_layer.so: undefined symbol: _ZN2tf11Transformer18DEFAULT_CACHE_TIMEE
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The <a href="https://github.com/ros-controls/ros_controllers/blob/dce87855e1adf3a66271db8243d58561da9f2cdb/diff_drive_controller/include/diff_drive_controller/diff_drive_controller.h" rel="nofollow noreferrer">DiffDriveController</a> forwards incoming velocity commands to the <code>VelocityJointInterface</code>s <a href="https://github.com/ros-controls/ros_controllers/blob/dce87855e1adf3a66271db8243d58561da9f2cdb/diff_drive_controller/src/diff_drive_controller.cpp#L346-L354" rel="nofollow noreferrer">it has been configured to control</a>, after <a href="https://github.com/ros-controls/ros_controllers/blob/dce87855e1adf3a66271db8243d58561da9f2cdb/diff_drive_controller/src/diff_drive_controller.cpp#L461-L500" rel="nofollow noreferrer">converting the <code>Twist</code> into velocities for the individual joints</a>.</p> <blockquote> <p>I don't understand why the PID parameters are not set ?</p> </blockquote> <p>You don't specify <em>which</em> PIDs you refer to, but since this is an open-loop (most likely always linear) conversion, there are no gains to configure.</p> <blockquote> <p>If these parameters are not useful, then I would like to understand how the system manages to regulate itself ?</p> </blockquote> <p>To answer your question very directly: there is nothing to regulate, at least not at the <code>DiffDriveController</code> level, with an open-loop hw interface, and the default configurations.</p> <p>The <code>VelocityJointInterface</code> handles which communicate with the underlying system/controller/embedded-hw/something else have the responsibility to ensure the wheels attain the velocities commanded by the <code>DiffDriveController</code>.</p> <p>In other words: the <code>DiffDriveController</code> does not consider it its responsibility to close the loop at the velocity level. That responsibility is delegated to whatever entity is actually controlling motor/wheel velocity, and which accepts the setpoints the <code>DiffDriveController</code> calculates (based on the incoming <code>Twist</code>).</p> <p><code>ros_control</code> nomenclature for this would be something akin to the <a href="http://wiki.ros.org/forward_command_controller" rel="nofollow noreferrer">forward_command</a> controllers, which also don't close the loop, but open-loop forward whatever command they receive to the underlying hw.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-07-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 3</p>
103381
2023-06-30T15:43:35.000
|ros|diff-drive-controller|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am trying to understand how <strong>diff_drive_controller</strong> works by following the documentation: <a href="http://wiki.ros.org/diff_drive_controller" rel="nofollow noreferrer">http://wiki.ros.org/diff_drive_controller</a></p> <p>1 - I don't understand why the PID parameters are not set ?</p> <p>2 - If these parameters are not useful, then I would like to understand how the system manages to regulate itself ?</p> <hr /> <p>Thank you for your answer, I understand.</p> <p>So DiffDriveController allows to calculate the speed of each wheel then send this speed to the motor (VelocityJointInterface) the motor must be controlled by the speed.</p> <p>In the case where a DC motor driven with an arduino and H bridge is used, the speed control loop is implemented at the level of the arduino, which makes configuration difficult.</p> <p>For my part I wrote an effort controller (effort_controllers/JointVelocityController) for each wheel. This controller allows to control each wheel individually in speed.</p> <pre><code>drive_train: wheels_state_controller: type: joint_state_controller/JointStateController publish_rate: 50 left_wheel_joint_velocity_controller: type: effort_controllers/JointVelocityController joint: left_wheel_joint pid: {p: 6.0, i: 21.0, d: 0.0, i_clamp_min: -255.0, i_clamp_max: 255, antiwindup: True} right_wheel_joint_velocity_controller: type: effort_controllers/JointVelocityController joint: right_wheel_joint pid: {p: 6.0, i: 21.0, d: 0.0, i_clamp_min: -255.0, i_clamp_max: 255, antiwindup: True} </code></pre> <p>Is it possible to use the controller I just wrote in DiffDriveController. Indeed the real time constraint will not be respected, but it is more logical from an architectural point of view. If possible can you show me how to do it..</p> <hr /> <p><a href="https://answers.ros.org/question/417072/how-to-define-pid--in-diff_drive_controller/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/155797/hdd--robot/" rel="nofollow noreferrer">hdd--robot</a> on ROS Answers with karma: 38 on 2023-06-30</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-07-01</strong>:<br /> It's not clear what question you are asking.</p> <p>To support experimentation, <code>move_base</code> &amp; <code>ros_control</code> are highly modular, and support control-feedback mechanisms in multiple places. You are unlikely to understand the big picture just by looking at the <code>diff_drive_controller</code> plugin to ros_control. Part of the story is explained by <a href="http://wiki.ros.org/ros_control" rel="nofollow noreferrer">http://wiki.ros.org/ros_control</a> (but this page is not a tutorial.)</p>
How to define PID in diff_drive_controller
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The results look to be consistent with what you're stating as the problem.</p> <p>I'm not sure why you expect the point of interest to be &quot;just about 0.5m away from the origin of the planner frame&quot; For that simple statement if you look at your lower plot it shows it being at a similar distance as (0.5,0,5) if you remember that the distance on the diagonal is going to be .707 m to that point from both the origin of the map and the origin of the planner. Your result is very similar but rotated slightly.</p> <p>I'd suggest that you try doing the math out yourself by hand fully with a calculator or in python to verify. You can probably take out the rotation to simplify the manual math too at first.</p> <p>The math in tf2 is very heavily used and well tested making a computational error very unlikely.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2023-06-30</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on 2023-06-30</strong>:<br /> First of all, thank you for your quick response. I am sorry. I think I might need to rephrase my question. Indeed, the distance is about 0.707 meters from the origin of the &quot;planner&quot; frame.</p> <p>However, my real expectation is that the <strong>|x value|</strong> (in ros standard) of the &quot;planner&quot; frame should be <strong>&lt; 0.5 meters,</strong> as refect in the updated graph.</p> <p>I have updated the question description.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on 2023-07-01</strong>:<br /> After reading your answer and doing some calculations, I realize that it is my fault. The length of the square should be 0.707m , not 0.5 meters. Thank you very much for your help!</p>
103383
2023-06-30T17:17:17.000
|ros|ros2|transform|tf2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Platform: ubuntu 20.02 ROS2: Galactic, installed through 'apt'</p> <p>ROS environment : ROS_VERSION=2 ROS_PYTHON_VERSION=3 ROS_LOCALHOST_ONLY=0 ROS_DISTRO=galactic</p> <p><strong>Problem:</strong></p> <p>Currently, I have a static tf2 transform between &quot;map&quot; and &quot;planner&quot; frame. The relationship is shown below.</p> <pre><code>$ ros2 run tf2_ros tf2_echo map planner [INFO] [1688158439.517036056] [tf2_echo]: Waiting for transform map -&gt; planner: Invalid frame ID &quot;map&quot; passed to canTransform argument target_frame - frame does not exist At time 0.0 - Translation: [0.000, -1.000, 0.000] - Rotation: in Quaternion [0.000, 0.000, -0.383, 0.924] </code></pre> <p>Basically, the &quot;planner&quot; frame is offset from the &quot;map&quot; frame by <strong>1 meter in the y-axis and -45 degree in yaw</strong> ( all in ros2 unit standard).</p> <p>However, when I tried to use the tf_buffer to transform (-0.645, -0.705) in &quot;map&quot; frame to &quot;planner&quot; frame, I got</p> <blockquote> <p>x -0.6646803743153546 y -0.2474873734152917</p> </blockquote> <p>, which is not the answer I expected. Originally, I was expecting both x should be <strong>less than 0.5 meters</strong> from the origin in &quot;planner&quot; frame. <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1688170267241313.png" alt="image description" /></p> <p>Because base on the x-y graph below (I have transformed the point from ROS standard to normal cartesian coordinate), I was expecting the <strong>|x-value| of &quot;planner&quot; frame is &lt; 0.5 meters.</strong> , but it turned out to be <strong>-0.66468</strong></p> <p><strong>code for doing the transform</strong></p> <pre><code>def on_timer(self): # my_pose = Pose() # my_pose.position.x = -0.745000 # my_pose.position.y = -0.705000 # my_pose.position.z = 0.0 # my_pose.orientation.x = 0.0 # my_pose.orientation.y = 0.0 # my_pose.orientation.z = 0.0 # my_pose.orientation.w = 1.0 # testPose = PoseStamped() # testPose.pose = my_pose # testPose.header.frame_id = &quot;map&quot; # testPose.header.stamp = self.get_clock().now().to_msg() # resultPose = self.tf_buffer.transform(PoseStamped, &quot;planner&quot;, rclpy.time.Time() ) # self.get_logger().info(&quot; x &quot; + str(resultPose.pose.position.x) + &quot;y &quot; + str(resultPose.pose.position.y)) # Define the input pose in the source frame source_pose = PoseStamped() source_pose.header.frame_id = 'map' source_pose.pose.position.x = -0.645 source_pose.pose.position.y = -0.705 source_pose.pose.position.z = 0.0 source_pose.pose.orientation.x = 0.0 source_pose.pose.orientation.y = 0.0 source_pose.pose.orientation.z = 0.0 source_pose.pose.orientation.w = 1.0 # q = quaternion_from_euler(0, 0, -45* (3.14/180)) # source_pose.pose.orientation.x = q[0] # source_pose.pose.orientation.y = q[1] # source_pose.pose.orientation.z = q[2] # source_pose.pose.orientation.w = q[3] # Transform the pose to the target frame d = Duration() try: target_pose = self.tf_buffer.transform(source_pose, 'planner', d ) self.get_logger().info(&quot;Transformed pose: x &quot;+ str( target_pose.pose.position.x) + &quot; y &quot; + str( target_pose.pose.position.y)) except tf2_ros.TransformException as e: self.get_logger().error(&quot;Transform failed: %s&quot;, str(e)) </code></pre> <p>Thus, I am wondering if this is a bug in the tf2? Or could I have misunderstood something?</p> <hr /> <p><a href="https://answers.ros.org/question/417076/inaccurate-result-from-tf2-transform/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on ROS Answers with karma: 45 on 2023-06-30</p> <p>Post score: 0</p>
Inaccurate result from tf2 transform
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>As <a href="https://answers.ros.org/question/242154/time-from-rostime0-to-rostimenow/?answer=242157#post-id-242157" rel="nofollow noreferrer">mintar</a> puts it:</p> <blockquote> <p>The value of <code>ros::time::now()</code> depends on whether the parameter <code>use_sim_time</code> is set.</p> </blockquote> <blockquote> <ol> <li>If <code>use_sim_time == false</code>, <code>ros::time::now()</code> gives you system time (seconds since 1970-01-01 0:00, so something like &gt; 1471868323.123456).</li> <li>If <code>use_sim_time == true</code>, and you play a <code>rosbag, ros::time::now()</code> gives you the time when the rosbag was recorded (probably also something like 1471868323.123456).</li> <li>If <code>use_sim_time == true</code>, and you run a simulator like Gazebo, <code>ros::time::now()</code> gives you the time from when the simulation was started, starting with zero (so probably something like 63.123456 if the simulator has been running for 63.123456 seconds).</li> </ol> </blockquote> <p>So in your case if you want the nodes to use the time from where the rosbag was recorded, you have to append <code>--clock</code> to <code>rosbag play</code> so that it publishes simulated time in <code>/clock</code>, and well as set the param <code>use_time_time</code> before any other node starts in a fresh <code>roscore</code> instance.</p> <p>There might not be a difference in <code>rospy.TIme(0)</code> and <code>rospy.Time()</code> because the default arguments are <code>0</code> anyway, <a href="http://wiki.ros.org/rospy/Overview/Time#Creating_Time_instances" rel="nofollow noreferrer">see API</a>.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/156073/guess-giant/" rel="nofollow noreferrer">Guess Giant</a> with karma: 26 on 2023-07-02</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103385
2023-07-02T20:19:15.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Given I have a topic <code>/tf</code> in rosbag, I want to run the rosbag and use <code>lookupTransform</code> to get transform between different frames. The most usual way to get latest transform is <code>lookupTransform(&quot;target_frame&quot;, &quot;source_frame&quot;, rospy.Time(0))</code>. What time system does the function <code>lookupTransform</code> use, does this function use the wall clock time of the computer calling the function <code>lookupTransform</code>, or does it use the timestamp in rosbag. Also, is there any difference when using <code>lookupTransform(&quot;target_frame&quot;, &quot;source_frame&quot;, rospy.Time(0))</code> and <code>lookupTransform(&quot;target_frame&quot;, &quot;source_frame&quot;, rospy.Time())</code></p> <hr /> <p><a href="https://answers.ros.org/question/417104/time-system-when-using-tf2-lookuptransform/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/96442/hck007/" rel="nofollow noreferrer">hck007</a> on ROS Answers with karma: 29 on 2023-07-02</p> <p>Post score: 0</p>
Time system when using tf2 lookupTransform
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Try changing your declaration to the following. You've declared for <code>ConstPtr</code> but using for <code>SharedPtr</code>.</p> <p><code>std::queue&lt;sensor_msgs::msg::PointCloud2::SharedPtr&gt; pointCloudBuf;</code></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/72874/gaurav-gupta/" rel="nofollow noreferrer">Gaurav Gupta</a> with karma: 276 on 2023-07-03</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-07-03</strong>:<br /> @chrissunny94: the problem is that your code has incompatible types for the queue and the callback argument.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/33207/chrissunny94/" rel="nofollow noreferrer">chrissunny94</a> on 2023-07-04</strong>:<br /> @Gaurav Gupta (small world!), thanks a lot . saw your answer just now . .</p> <p><strong>Comment by <a href="https://answers.ros.org/users/33207/chrissunny94/" rel="nofollow noreferrer">chrissunny94</a> on 2023-07-04</strong>:<br /> @Mike Scheutzow , yup looks like my code has a lot of incompatible types , sorting it now . Will post my finding soond .</p> <p><strong>Comment by <a href="https://answers.ros.org/users/33207/chrissunny94/" rel="nofollow noreferrer">chrissunny94</a> on 2023-07-05</strong>:<br /> @Gaurav Gupta ,yup making it into shared_ptr , seems to have solved the problem . Someone in office also suggested the same solution .</p> <p><strong>Comment by <a href="https://answers.ros.org/users/72874/gaurav-gupta/" rel="nofollow noreferrer">Gaurav Gupta</a> on 2023-07-05</strong>:<br /> Yup! Glad it is all sorted now :)</p>
103387
2023-07-03T04:45:23.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>i have a <strong>std::queue</strong> defined like this</p> <pre><code>std::queue&lt;sensor_msgs::PointCloud2ConstPtr&gt; pointCloudBuf; </code></pre> <p>I wanted to understand how to define this in ROS2 , i tried the following but</p> <pre><code>std::queue&lt;sensor_msgs::msg::PointCloud2::ConstPtr&gt; pointCloudBuf; </code></pre> <p>When trying to push to the queue</p> <pre><code>void velodyneHandler(const sensor_msgs::msg::PointCloud2::SharedPtr laserCloudMsg) { mutex_lock.lock(); pointCloudBuf.push(*laserCloudMsg); mutex_lock.unlock(); } </code></pre> <p>i am getting the following error</p> <pre><code>no matching function for call to ‘std::queue&lt;std::shared_ptr&lt;const sensor_msgs::msg::PointCloud2_&lt;std::allocator&lt;void&gt; &gt; &gt; &gt;::push(std::__shared_ptr_access&lt;sensor_msgs::msg::PointCloud2_&lt;std::allocator&lt;void&gt; &gt;, __gnu_cxx::_S_atomic, false, false&gt;::element_type&amp;)’ 61 | pointCloudBuf.push(*laserCloudMsg); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ </code></pre> <p>UPDATE</p> <pre><code>std::queue&lt;sensor_msgs::msg::PointCloud2::SharedPtr&gt; pointCloudBuf; </code></pre> <p>This seem to have solved my compilation issues , dont know if it will break something else down the line .</p> <p>Anyhow , thankyou ROS community !</p> <hr /> <p><a href="https://answers.ros.org/question/417122/ros1-ros2-porting-help-?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/33207/chrissunny94/" rel="nofollow noreferrer">chrissunny94</a> on ROS Answers with karma: 142 on 2023-07-03</p> <p>Post score: 0</p>
ROS1 ROS2 porting help?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I manually set the velocity from joint_states topic</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/103087/mth_sousa/" rel="nofollow noreferrer">mth_sousa</a> with karma: 35 on 2023-07-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103389
2023-07-03T14:24:09.000
|ros|moveit|joint-states|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Is it possible to get the velocity of each joint using Moveit 2 Robot State? Is there any better approach?</p> <p>I tried the following:</p> <pre><code>robot_model_loader::RobotModelLoader robot_model_loader(node); const moveit::core::RobotModelPtr&amp; kinematic_model = robot_model_loader.getModel(); const moveit::core::JointModelGroup* joint_model_group = kinematic_model-&gt;getJointModelGroup(&quot;my_arm&quot;); const moveit::core::RobotState current_robot_state = moveit::core::RobotState(kinematic_model); auto velocities = current_robot_state.getVariableVelocities(); // velocities = garbage std::vector&lt;double&gt; actualVelocity; current_robot_state.copyJointGroupVelocities(joint_model_group, actualVelocity); // actualVelocity = garbage also </code></pre> <p>I can get the joints positions without any problem. The velocity is published to <code>/joint_states</code> topic correctly.</p> <p>The only solution is subscribe to <code>/joint_states</code>?</p> <hr /> <p><a href="https://answers.ros.org/question/417132/how-to-get-joint-velocity-from-moveit-2-robot-state?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/103087/mth_sousa/" rel="nofollow noreferrer">mth_sousa</a> on ROS Answers with karma: 35 on 2023-07-03</p> <p>Post score: 0</p>
How to get joint velocity from Moveit 2 Robot State?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It has something to do with the implementation of <a href="https://github.com/ros/ros_comm/blob/030e132884d613e49a576d4339f0b8ec6f75d2d8/clients/rospy/src/rospy/timer.py#L116" rel="nofollow noreferrer"><code>rospy.timer.sleep</code></a></p> <p>When you start up the program, it will print out</p> <blockquote> <p>[INFO] [1688140488.717273, 2.000000]: hello world 0.0</p> </blockquote> <p>And it will be blocked on</p> <blockquote> <p>rate.sleep()</p> </blockquote> <p>More specifically It will wait in this <a href="https://github.com/ros/ros_comm/blob/030e132884d613e49a576d4339f0b8ec6f75d2d8/clients/rospy/src/rospy/timer.py#L145C19-L145C19" rel="nofollow noreferrer">while loop</a> until it gets non-zero time value.</p> <p>When you set the sim time to 1, It will break out from the above-mentioned while loop and enters the second <a href="https://github.com/ros/ros_comm/blob/030e132884d613e49a576d4339f0b8ec6f75d2d8/clients/rospy/src/rospy/timer.py#L155" rel="nofollow noreferrer">while loop</a> which will wait for the required time to pass. (In this case 0.1 second.)</p> <p>When you set the sim time to 2, It will break out from the second while loop, and printing out</p> <blockquote> <p>[INFO] [1688140488.719683, 2.000000]: hello world 2.0</p> </blockquote> <p>After that, it will try to sleep again. Since the time has proceeded 1 second, which is greater than the period that it is supposed to sleep. In this <a href="https://github.com/ros/ros_comm/blob/030e132884d613e49a576d4339f0b8ec6f75d2d8/clients/rospy/src/rospy/timer.py#L81" rel="nofollow noreferrer">function</a>, It tries to compute the duration that it is suppose to sleep. However, the remaining waiting time will result in a negative value which will make the sleep function to return immediately, and prints out the second</p> <blockquote> <p>[INFO] [1688140488.719683, 2.000000]: hello world 2.0</p> </blockquote> <p>Hope this explains the issue you are experiencing.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63550/hank880907/" rel="nofollow noreferrer">hank880907</a> with karma: 50 on 2023-07-04</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103391
2023-07-04T02:55:16.000
|ros|use-sim-time|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I followed this tutorial (<a href="http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28python%29" rel="nofollow noreferrer">ROS/Tutorials/WritingPublisherSubscriber(python) - ROS Wiki</a>) and everything works fine for real/wall time.</p> <p>But then I tested the same code with simulation time (in separate windows/terminals):</p> <pre><code>$ roscore $ rosparam set use_sim_time true $ ./talker.py [INFO] [1688140481.155550, 0.000000]: hello world 0.0 $ ./listener.py $ rostopic pub /clock rosgraph_msgs/Clock [1,0] --use-rostime publishing and latching message. Press ctrl-C to terminate </code></pre> <p>The &quot;talker&quot; didn't react to the updated ROS time. Then I cancelled (Ctrl-c) and I tried:</p> <pre><code>$ rostopic pub /clock rosgraph_msgs/Clock [2,0] --use-rostime publishing and latching message. Press ctrl-C to terminate </code></pre> <p>Then the talker printed two messages for time = 2.0 seconds:</p> <pre><code>[INFO] [1688140488.717273, 2.000000]: hello world 2.0 [INFO] [1688140488.719683, 2.000000]: hello world 2.0 </code></pre> <p>This is not what I expected.</p> <ol> <li>Why doesn't the talker react to the new simulation time of 1 second?</li> <li>Why does the the talker see two messages, when the simulation time is updated to 2 seconds?</li> </ol> <p>ROS environment variables:</p> <pre><code>ROS_VERSION=1 ROS_DISTRO=noetic ROS_ETC_DIR=/opt/ros/noetic/etc/ros ROSLISP_PACKAGE_DIRECTORIES= ROS_MASTER_URI=http://localhost:11311 ROS_PYTHON_VERSION=3 ROS_ROOT=/opt/ros/noetic/share/ros ROS_PACKAGE_PATH=/opt/ros/noetic/share </code></pre> <hr /> <p><a href="https://answers.ros.org/question/417137/publisher-from-tutorial-doesn%27t-react-to-simulation-time-of-1s/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/157385/maxgyver/" rel="nofollow noreferrer">MaxGyver</a> on ROS Answers with karma: 3 on 2023-07-04</p> <p>Post score: 0</p>
publisher from tutorial doesn't react to simulation time of 1s
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <ul> <li><p>To get the end effector's pose information, you need to use the <a href="https://moveit.picknik.ai/main/api/html/classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#details" rel="nofollow noreferrer">Move Group Interface</a>. <br/>This is done by using the <a href="https://moveit.picknik.ai/main/api/html/classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ae4f5b55d67c26e0c68330abf953a2041" rel="nofollow noreferrer">getCurrentPose()</a> function provided by the said interface. However, you cannot access this function directly, as this requires a <a href="https://github.com/ros-planning/moveit/issues/1187" rel="nofollow noreferrer">prior thread to be running</a> to retrieve current state information.</p> </li> <li><p>You need to spin up a <a href="https://docs.ros.org/en/iron/Concepts/Intermediate/About-Executors.html#types-of-executors" rel="nofollow noreferrer">SingleThreadExecutor</a> first so that the robot joint states can be relayed onto the current state monitor. This is done as follows:</p> <pre><code>rclcpp::executors::SingleThreadedExecutor executor; executor.add_node(node); std::thread spinner = std::thread([&amp;executor]() { executor.spin(); }); </code></pre> </li> </ul> <p>Then, we can access the <code>getCurrentPose()</code> function. Failure to do so will result in the following error message on your console:</p> <pre><code> [INFO] [moveit_ros.current_state_monitor]: Didn't receive robot state (joint angles) with recent timestamp within 1.000000 seconds. Requested time, but latest received state has time 0.000000. Check clock synchronization if your are running ROS across multiple machines! [ERROR] [move_group_interface]: Failed to fetch current robot state </code></pre> <ul> <li><p>The following is adjusted according to the codebase attached in the question's <a href="https://github.com/Fadi-Eid/panda_arm/blob/main/src/hello_moveit/src/hello_moveit.cpp" rel="nofollow noreferrer">link</a>:</p> <pre><code>/** * Program to print end-effector pose */ #include &lt;moveit/move_group_interface/move_group_interface.h&gt; #include &lt;geometry_msgs/msg/pose.hpp&gt; #include &lt;rclcpp/rclcpp.hpp&gt; int main(int argc, char* argv[]) { // Initialize ROS rclcpp::init(argc, argv); // Declare Node std::shared_ptr&lt;rclcpp::Node&gt; node = std::make_shared&lt;rclcpp::Node&gt;(&quot;get_eef_pose&quot;, rclcpp::NodeOptions().automatically_declare_parameters_from_overrides( true)); // We spin up a SingleThreadedExecutor for the current state monitor to get // information about the robot's state. rclcpp::executors::SingleThreadedExecutor executor; executor.add_node(node); std::thread spinner = std::thread([&amp;executor]() { executor.spin(); }); // Create the MoveIt MoveGroup Interface moveit::planning_interface::MoveGroupInterface move_group_interface = moveit::planning_interface::MoveGroupInterface(node, &quot;arm&quot;); // print current pose geometry_msgs::msg::Pose current_pose = move_group_interface.getCurrentPose().pose; // Print the current pose of the end effector RCLCPP_INFO(node-&gt;get_logger(), &quot;Current pose: %f %f %f %f %f %f %f&quot;, current_pose.position.x, current_pose.position.y, current_pose.position.z, current_pose.orientation.x, current_pose.orientation.y, current_pose.orientation.z, current_pose.orientation.w); // Shutdown ROS rclcpp::shutdown(); spinner.join(); return 0; } </code></pre> </li> </ul> <h3>References</h3> <ul> <li><a href="https://github.com/ros-planning/moveit2_tutorials/blob/main/doc/tutorials/visualizing_in_rviz/hello_moveit.cpp" rel="nofollow noreferrer">MoveIt2! Tutorials Hello MoveIt</a></li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/72874/gaurav-gupta/" rel="nofollow noreferrer">Gaurav Gupta</a> with karma: 276 on 2023-07-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
103393
2023-07-06T01:33:51.000
|ros2|moveit|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I created a URDF for my custom robot and gone through MoveIt Setup Assistant successfully generating RVIZ launch files for ROS2/Moveit2 Humble distro. I can drag the interactive marker and plan/execute the final end effector position. I want to be able to extract the current end effector position and orientation so I can know where the gripper is in respect to the base of the arm (Forward kinematics). Any way I can do it in a simple way? Any guidance would be great.</p> <p>My workspace is similar to this as per the packages and functionalities: <a href="https://github.com/Fadi-Eid/panda_arm" rel="nofollow noreferrer">link text</a></p> <hr /> <p><a href="https://answers.ros.org/question/417209/how-to-extract-position-of-the-gripper-in-ros2/moveit2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/150829/fadi-eid/" rel="nofollow noreferrer">fadi eid</a> on ROS Answers with karma: 15 on 2023-07-06</p> <p>Post score: 1</p>
How to extract position of the gripper in ROS2/MoveIt2
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>Apparently, this just copied and pasted these files to DESTINATION lib/${PROJECT_NAME}.</p> </blockquote> <p>This is the &quot;proper&quot; way to do this. That's exactly what an install rule is supposed to do. In general after you have built the runtime environment should only be interacting with installed files. After installation it should run without the source tree available on disk anymore.</p> <p>In ROS 1 we did quite a bit of non-standard work to make things work from the source workspace but they are convenient for many use cases, but turn into problems when you try to flesh out all corner cases. So ROS 2 does it the standard way with requiring installation of resources.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2023-07-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63550/hank880907/" rel="nofollow noreferrer">hank880907</a> on 2023-07-06</strong>:<br /> I see! Thanks for the explanation!</p>
103395
2023-07-06T07:55:29.000
|ros|ros2|colcon|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi there,</p> <p>In my ros2 package, I want to compile the node with a shared library, which is an SDK shared library provided by the manufacturer of the hardware. I am able to compile my code with <code>link_directories</code> that points to the location of the shared library (which locates inside the ros2 package).</p> <p>Back in ROS1, that's it. I could execute my node and it will load the shared library correctly during runtime.</p> <p>However, in ROS2, I have to install all the files to <code>DESTINATION lib/${PROJECT_NAME}</code> like this:</p> <pre><code>install(FILES <span class="math-container">${ORBBEC_SDK_LIB_DIR}/libOrbbecSDK.so.1.5 $</span>{ORBBEC_SDK_LIB_DIR}/libOrbbecSDK.so.1.5.7 <span class="math-container">${ORBBEC_SDK_LIB_DIR}/libOrbbecSDK.so $</span>{ORBBEC_SDK_LIB_DIR}/libudev.so <span class="math-container">${ORBBEC_SDK_LIB_DIR}/libudev.so.1 $</span>{ORBBEC_SDK_LIB_DIR}/libudev.so.1.6.3 DESTINATION lib/${PROJECT_NAME} ) </code></pre> <p>Apparently, this just copied and pasted these files to <code>DESTINATION lib/${PROJECT_NAME}</code>.</p> <p>Another option that could work is that I can make an environment hook to add the folder of the shared library to <code>LD_LIBRARY_PATH</code>.</p> <p>Both solutions are kind of gross.</p> <p>What is the proper way of doing this?</p> <p>In ROS 1 how does it find the shared library in the src folder? Since the setup.bash does not modify the <code>LD_LIBRARY_PATH</code>, I have no idea how does it find the shared library object. (I am sure the .so file is not in the system library.)</p> <hr /> <p><a href="https://answers.ros.org/question/417227/compile-ros2-package-with-pre-compiled-shared-library/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/63550/hank880907/" rel="nofollow noreferrer">hank880907</a> on ROS Answers with karma: 50 on 2023-07-06</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/134470/magladko/" rel="nofollow noreferrer">magladko</a> on 2023-07-06</strong>:<br /> I am using pre-compiled libraries by invoking:</p> <pre><code>INCLUDE_DIRECTORIES( <span class="math-container">${LIBRARY_INCLUDE_DIRECTORIES} ) LINK_DIRECTORIES( $</span>{LIBRARY_DIRECTORIES} ) TARGET_LINK_DIRECTORIES(<span class="math-container">${TARGET} $</span>{LIBRARY_DIRECTORIES}) </code></pre> <p>I did not notice any copy-pasting and the package works alright.</p>
Compile ROS2 package with pre-compiled shared library
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>If you want to keep the older bag files, you should not be using the <code>--max-splits 1</code> option. The command:</p> <pre><code>rosbag record --help </code></pre> <p>explains what the options do.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-07-09</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
103397
2023-07-06T16:10:47.000
|ros|linux|ros-melodic|rosbag|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am recording data from a <a href="https://github.com/SICKAG/sick_scan_xd/tree/master" rel="nofollow noreferrer">range scanner</a> with ROS Melodic using the following command:</p> <blockquote> <p>rosbag record -o nav310_ws/bagFiles/session --split --duration=1 --max-splits 1 /cloud</p> </blockquote> <p>In the <code>bagFiles</code> folder, only the latest bag files are kept. So I was wondering how to copy all recorded bag files and save them to another folder. I tried the following command just after the first one, but it did do anything.</p> <blockquote> <p>cp -a nav310_ws/bagFiles/. nav310_ws/allBags/</p> </blockquote> <p>Thank you for any suggestion you could provide.</p> <hr /> <p><a href="https://answers.ros.org/question/417241/save-all-recorded-bag-files-with-%60rosbag-record%60/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/98380/ben-brian/" rel="nofollow noreferrer">Ben Brian</a> on ROS Answers with karma: 3 on 2023-07-06</p> <p>Post score: 0</p>
Save all recorded bag files with `rosbag record`
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I solved the issue by myself, I was trying to pass enable intra process comm parameter to the script from the launch file but the respective cpp file did not have the parameter defined, now the error has gone away.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> with karma: 115 on 2023-07-13</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103399
2023-07-07T10:18:05.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone, I am working on developing intra process communication using the realsense camera D435i and trying to run this launch file - <a href="https://github.com/IntelRealSense/realsense-ros/blob/ros2-development/realsense2_camera/launch/rs_intra_process_demo_launch.py" rel="nofollow noreferrer">https://github.com/IntelRealSense/realsense-ros/blob/ros2-development/realsense2_camera/launch/rs_intra_process_demo_launch.py</a> but I am getting this error in the command prompt -</p> <pre><code>[component_container-1] terminate called after throwing an instance of 'std::invalid_argument' [component_container-1] what(): intraprocess communication allowed only with volatile durability </code></pre> <p>I have all the necessary files in the package. As far as I an understand, it has something to do with the QoS settings but I am not able to figure out how and where exactly should the settings be changed. If anybody has experience of solving this issue, please help me, thank you.</p> <hr /> <p><a href="https://answers.ros.org/question/417267/qos-intra-process-communication-issue/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> on ROS Answers with karma: 115 on 2023-07-07</p> <p>Post score: 0</p>
QoS Intra Process Communication Issue
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I would organize the code differently: have the TranslationNode class handle just one drone, and pass the name (or prefix) to the constructor. Then in main(), create a new instance of TranslationNode for each drone, storing the objects in an array (so the instance doesn't go out of scope &amp; get garbage collected.)</p> <p>With this alternate design, you do not need to pass an extra argument to the subscribe callback - the needed info is already available in self.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-07-09</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/158114/csanchez5/" rel="nofollow noreferrer">csanchez5</a> on 2023-08-10</strong>:<br /> Apologies for late response. This method seemed to work. The messages are getting translated and published properly. Thanks!</p> <p>Here are the parts of the code I adjusted:</p> <pre><code>class TranslationNode: def __init__ (self, name=None): self.prefix = name self.pose_sub = rospy.Subscriber(self.prefix +'/pose_cmd', Pose, self.pose_cb, queue_size=10) ... def main(): rospy.init_node('translation_node', anonymous=True) with open('crazyswarm/ros_ws/src/crazyswarm/launch/crazyflies.yaml', 'r') as file: cfs_yaml = yaml.safe_load(file) cf_list = [] for entry in cfs_yaml[&quot;crazyflies&quot;]: id = entry['id'] prefix = (&quot;cf&quot; + str(id)) cf_list.append(TranslationNode(prefix)) rospy.spin() </code></pre>
103401
2023-07-07T16:57:24.000
|ros|translation|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I currently using script which subscribes to 3 separate topics with different message types, converts the data from those topics into one message type, and publishes the combined data into a topic which controls a drone (i.e takes Pose, Twist, and Acceleration (Vector3) data and converts it into the message type &quot;FullState&quot; and publishes). This works well for one drone, but I need to expand the code to work for multiple drones.</p> <p>The topics are named based on the ID of the drone, which is set in a .yaml file (cf1/pose, cf1/twist, cf1/acc, cf2/pose, cf2/twist, ..., cf1/cmd_full_state, cf2/cmd_full_state, ...)</p> <p>I need to make sure that the data from the 'cf1' topics are being converted and published correctly to the 'cf1/cmd_full_state' topic, and the same thing to happen for cf2, cf3, etc.</p> <p>Here is the code I have so far, which sets up the topics for each drone in the .yaml file.</p> <pre><code>#!/usr/bin/env python import rospy import yaml from std_msgs.msg import String from std_msgs.msg import Float32 from crazyswarm.msg import FullState from geometry_msgs.msg import Pose from geometry_msgs.msg import Twist from geometry_msgs.msg import Vector3 with open('crazyswarm/ros_ws/src/crazyswarm/launch/crazyflies.yaml', 'r') as file: cfs_yaml = yaml.safe_load(file) class TranslationNode: def __init__ (self): for entry in cfs_yaml[&quot;crazyflies&quot;]: id = entry['id'] prefix = (&quot;cf&quot; + str(id)) self.pose_sub = rospy.Subscriber(prefix +'/pose_cmd', Pose, self.pose_cb, callback_args = prefix, queue_size=10) self.twist_sub = rospy.Subscriber(prefix + '/twist_cmd', Twist, self.twist_cb, callback_args = prefix, queue_size=10) self.acc_sub = rospy.Subscriber(prefix + '/acc_cmd', Vector3, self.acc_cb, callback_args = prefix, queue_size=10) self.full_state_pub = rospy.Publisher(prefix + '/cmd_full_state', FullState, queue_size=10) self.pose = None self.twist = None self.acc = None self._full_state_timer = rospy.Timer(rospy.Duration(0.01),self.full_state_cb) def pose_cb(self,data,args): prefix = args self.pose = data def twist_cb(self,data,args): prefix = args self.twist = data def acc_cb(self,data,args): prefix = args self.acc = data def full_state_cb(self, event): if self.pose is not None and self.twist is not None and self.acc is not None: full_state_msg = FullState() full_state_msg.header.stamp = rospy.Time.now() full_state_msg.header.seq += 1 full_state_msg.pose = self.pose full_state_msg.twist = self.twist full_state_msg.acc = self.acc self.full_state_pub.publish(full_state_msg) def main(): rospy.init_node('translation_node', anonymous=True) translation_node = TranslationNode() rospy.spin() if __name__ == '__main__': try: main() except rospy.ROSInterruptException: pass </code></pre> <p>This is able to receive the messages from all of the Pose, Twist, and Acc topics and converts them to the FullState message type correctly. However, it only publishes the data to the topic with the last drone ID (i.e if we have 3 drones labeled cf1, cf2, and cf3, the script publishes all of the data to the 'cf3/cmd_full_state' topic)</p> <p>I am relatively new to ROS so there's probably a simple fix or a better/cleaner method to use. Is there any way to make sure the data gets transferred to the correct topics without setting up each subscriber/publisher individually? Any help would be appreciated.</p> <hr /> <p><a href="https://answers.ros.org/question/417270/how-to-transfer-data-from-a-set-of-topics-to-another-based-on-name/prefix-of-topic?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/158114/csanchez5/" rel="nofollow noreferrer">csanchez5</a> on ROS Answers with karma: 3 on 2023-07-07</p> <p>Post score: 0</p>
How to transfer data from a set of topics to another based on name/prefix of topic?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi!</p> <p>To the best of my knowledge, and as confirmed by <a href="http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers" rel="nofollow noreferrer">rospy</a> and <a href="http://wiki.ros.org/roscpp/Overview/Publishers%20and%20Subscribers" rel="nofollow noreferrer">rosccp</a> documentation, there is no option to do such a thing. As for the <em>not to drop anything at all</em> part, you can try to achieve such a behavior by increasing a lot your queue, though I would not advise you to do so.</p> <p>Alternatively, you could implement your own queue. E.g. in Python you could use the <a href="https://docs.python.org/3/library/queue.html" rel="nofollow noreferrer">queue</a> library to implement your own queueing method. The idea would be to have a subscriber that just receives the message (maybe unpacks it), and adds it to the queue. You can check if the queue is full via the <code>Queue.full()</code> method, and, for example, decide to discard the newest instead of the older message. Be aware that this will work smoothly if and only if the operations described above are faster than the rate at which messages are sent to the subscriber.</p> <p>Then, you will have a forever loop in your node that looks into your queue, selects the message to process (based on your preferred criteria), and do your awesome stuff!</p> <p>TL;DR: such option(s) do not exist, but you can implement your own logic to achieve the same result!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> with karma: 221 on 2023-07-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103403
2023-07-08T04:52:47.000
|ros|ros-kinetic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Is it possible to decide what action should be taken when the queue size of a publisher or subscriber is reached? e.g. to let the newest message drop instead of the oldest, or to not drop anything at all,...?</p> <hr /> <p><a href="https://answers.ros.org/question/417277/queue-full:-chose-drop-actions?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/148621/joshe/" rel="nofollow noreferrer">JoshE</a> on ROS Answers with karma: 5 on 2023-07-08</p> <p>Post score: 0</p>
Queue full: chose drop actions?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi!</p> <p>The error with the <strong>No such file or directory</strong> could be due to the fact that you are giving a relative path for <code>radar_config30hz.cfg</code>, assuming that the working directory of your node will be the one in which the <code>.py</code> file is. Be aware that this is not the case unless you specify it with the <a href="https://wiki.ros.org/roslaunch/XML/node" rel="nofollow noreferrer"><code>cwd</code> attribute</a> on launch. Find below some possible solutions:</p> <ul> <li>From inside your Python script, get the location of the ROS package <a href="https://wiki.ros.org/Packages#Client_Library_Support" rel="nofollow noreferrer">with <code>rospack</code></a> and specify the absolute path to the <code>.cfg</code> file. This is what I would personally do.</li> <li>From inside your Python script, get the location of the Python file by following <a href="https://stackoverflow.com/questions/3430372/how-do-i-get-the-full-path-of-the-current-files-directory">these instructions</a> and specify the absolute path to the <code>.cfg</code> file</li> <li>Specify the working directory to be the one where your <code>.cfg</code> file lies with the <code>cwd</code> argument in the launch file.</li> </ul> <p>As for the <strong>Resource not found</strong> error, from what you have written, the error is simply that your package name is <code>radar_uart</code>, but then you ask ROS to <code>find radar</code> instead.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> with karma: 221 on 2023-07-10</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/149103/lilipop/" rel="nofollow noreferrer">Lilipop</a> on 2023-07-11</strong>:<br /> Hello,</p> <p>Thanks for the answer, effectively I was giving a path related to my src directory before doing the catkin_make, I looked for the ROS package and added the cfg file then modified the path based on its location in the ROS package.</p> <p>Thanks a lot :)</p> <p><strong>Comment by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> on 2023-07-11</strong>:<br /> Glad it helped!</p> <p>A minor piece of advice on the use of ROS Answers: the message you have just posted, should have been a comment to my previous answer, rather than an answer itself. Sorry for being so pedantic!</p>
103405
2023-07-10T02:52:49.000
|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello ROS community,</p> <p>I have a python code for a hardware device (radar) that uses a parameters.cfg file for hardware settings (independantly of ROS).</p> <p>In the same code, I am creating a ROS node so that the device publishes its collected data.</p> <p>When I use a launch file, the basic format is as follows :</p> <pre><code>&lt;launch&gt; &lt;node pkg=&quot;radar_uart&quot; name=&quot;radar&quot; type=&quot;radar.py&quot; output=&quot;screen&quot;&gt; &lt;/node&gt; &lt;/launch&gt; </code></pre> <p>But when I do my $roslaunch radar radar.launch command, I get the error that it could not find the config file : [ <strong>No such file or directory 'radar_config30hz.cfg'</strong> ]</p> <p>I tested by adding this line to the launch file, so the config would be loaded when launching the node :</p> <pre><code>&lt;rosparam file=&quot;$(find radar)/src/radar_config30hz.cfg&quot; command=&quot;load&quot;/&gt; </code></pre> <p>It is still not working and the new error is : [ <strong>Ressource not found: your_package_name</strong> ]</p> <p>PS : As said the file is a not a dynamic reconfigure file, it just contains parameters to be used by the radar Hardware.</p> <p>Please enlighten me on how to simly make the ros node find the file and use it when it launches.</p> <p>Thanks and regards,</p> <p>Lilia</p> <hr /> <p><a href="https://answers.ros.org/question/417320/add-files-to-be-loaded-when-ros-node-is-launched/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/149103/lilipop/" rel="nofollow noreferrer">Lilipop</a> on ROS Answers with karma: 9 on 2023-07-10</p> <p>Post score: 0</p>
Add files to be loaded when ROS node is launched
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Officially? No.</p> <p>Iron requires Python <code>3.8.2</code> at a minimum (on Windows), and various versions of Python 3 on other platforms.</p> <p>The newest would be <code>3.10.8</code> on macOS, but on Ubuntu (<code>jammy</code>), it standardised on <code>3.10.6</code>.</p> <p>This means that the Ubuntu binary packages (which is what most ROS users will be using to install ROS 2 Iron) will only be built for Python <code>3.10.6</code>. Note that some of the core ROS 2 Python packages (such as <code>rclpy</code>) are mixed Python &amp; C/C++, so using a different interpreter is not always just a matter of updating the path to the <code>python</code> binary.</p> <p>See <a href="https://www.ros.org/reps/rep-2000.html#iron-irwini-may-2023-november-2024" rel="nofollow noreferrer">REP 2000: ROS 2 Releases and Target Platforms: Iron Irwini (May 2023 - November 2024)</a> for all the details.</p> <p>Note: you <em>may</em> be able to build ROS 2 Iron from source for your desired Python 3 version, but no one can guarantee you it will work, and it would not be officially supported.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-07-10</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/53946/songyuc/" rel="nofollow noreferrer">songyuc</a> on 2023-07-10</strong>:<br /> Thank you sincerely for your guide!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-07-11</strong>:<br /> Could you please mark the question as answered by ticking the checkmark (✓) to the left of the answer if you feel it has been answered? Thanks.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/53946/songyuc/" rel="nofollow noreferrer">songyuc</a> on 2023-07-12</strong>:<br /> OK, I did it.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/53946/songyuc/" rel="nofollow noreferrer">songyuc</a> on 2023-07-12</strong>:<br /> Hi! Is there any official plan of newest ROS2 like Ridley, for the support on Win11?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-07-12</strong>:<br /> Not that I know of, but I would not be the person in charge of that.</p> <p>You'd want to ask the main ROS 2 developers.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/53946/songyuc/" rel="nofollow noreferrer">songyuc</a> on 2023-07-12</strong>:<br /> Got it, and thanks again.</p>
103407
2023-07-10T04:51:11.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, guys! I want to know whether ROS2 supports python 3.11, currently?</p> <p>Your answer and guide will be appreciated!</p> <hr /> <p><a href="https://answers.ros.org/question/417325/does-ros2-support-python-3.11?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/53946/songyuc/" rel="nofollow noreferrer">songyuc</a> on ROS Answers with karma: 83 on 2023-07-10</p> <p>Post score: 0</p>
Does ROS2 support python 3.11?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Try this:</p> <p>Add an import for launch_ros.descriptions to your launch file:</p> <pre><code>import launch_ros.descriptions </code></pre> <p>Then wrap your xacro command with a parameter value:</p> <pre><code>parameters=[{'robot_description': launch_ros.descriptions.ParameterValue( launch.substitutions.Command(['xacro ',os.path.join(turtlebot2_description_package,'robots/kobuki_conveyor.urdf.xacro')]), value_type=str) }] </code></pre> <p>Not using the ParameterValue to wrap the xacro output is unsafe unless you have a well curated xacro/urdf. If ANY text in the xacro output can be interpreted as yaml, the roslaunch system will try to interpret the ENTIRE text as yaml instead of passing on the string. The biggest cause of this false interpretation is commenting out xacro calls since the <code>xacro:property</code> or similar looks a lot like a yaml <code>key:value</code> pair. Comments are not removed by xacro so they are included in the output.</p> <p>In this case the Error text is trying to guide you on how to fix this exact issue.</p> <p>Hope this helps!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/74140/djchopp/" rel="nofollow noreferrer">djchopp</a> with karma: 328 on 2023-07-17</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/142720/djinn/" rel="nofollow noreferrer">Djinn</a> on 2023-07-18</strong>:<br /> It worked, thank you very much!</p>
103409
2023-07-11T10:19:18.000
|ros2|roslaunch|turtlebot2|turtlebot|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I am currently trying to run my TurtleBot2 on ROS2 Humble (using Ubuntu 22.04), but have troubles to import my modified URDF files. The bringup launch file worked for the preset URDF files but after importing the URDF files of my TurtleBot2 (it has a construction frame with a Asus Xtion Pro live, a Hokuyo URG-04-LX-UG01 , aswell as 2 Dynamixel AX12A mounted on ) it keeps showing me this error whenever I launch the turtlebot_bringup.launch.py file:</p> <pre><code>`[INFO] [launch]: Default logging verbosity is set to INFO [ERROR] [launch]: Caught exception in launch (see debug for traceback): Unable to parse the value of parameter robot_description as yaml. If the parameter is meant to be a string, try wrapping it in launch_ros.parameter_descriptions.ParameterValue(value, value_type=str)` </code></pre> <p>turtlebot_bringup.launch.py:</p> <pre><code> import os from struct import pack from setuptools import Command from ament_index_python import get_package_share_directory, get_package_share_path import launch import launch.launch_description_sources import launch.substitutions import launch_ros import launch_ros.substitutions def generate_launch_description(): kobuki_package = launch_ros.substitutions.FindPackageShare(package='kobuki_node').find('kobuki_node') urg_package = launch_ros.substitutions.FindPackageShare(package='urg_node2').find('urg_node2') turtlebot2_bringup_package = launch_ros.substitutions.FindPackageShare(package='turtlebot2_bringup').find('turtlebot2_bringup') turtlebot2_description_package = launch_ros.substitutions.FindPackageShare(package='turtlebot2_description').find('turtlebot2_description') ekf_config_params = os.path.join(turtlebot2_bringup_package,'config/ekf_config.yaml') kobuki_node_launch = launch.actions.IncludeLaunchDescription( launch.launch_description_sources.PythonLaunchDescriptionSource( os.path.join( kobuki_package, 'launch/kobuki_node-launch.py') ) ) ekf_node = launch_ros.actions.Node( package='robot_localization', executable='ekf_node', output='screen', parameters=[ekf_config_params], remappings=[(&quot;odometry/filtered&quot;, &quot;odom&quot;)] ) urg_node = launch.actions.IncludeLaunchDescription( launch.launch_description_sources.PythonLaunchDescriptionSource( os.path.join( urg_package, 'launch/urg_node2.launch.py' ) ), launch_arguments= {'sensor_interface':'serial'}.items() ) robot_state_publisher_node = launch_ros.actions.Node( package='robot_state_publisher', executable='robot_state_publisher', parameters=[{'robot_description': launch.substitutions.Command(['xacro ',os.path.join(turtlebot2_description_package,'robots/kobuki_conveyor.urdf.xacro')])}] ) joint_state_publisher_node = launch_ros.actions.Node( package='joint_state_publisher', executable='joint_state_publisher', name='joint_state_publisher' ) rviz_node = launch_ros.actions.Node( package='rviz2', executable='rviz2', name='rviz2', output='screen', arguments=['-d',os.path.join(turtlebot2_bringup_package,'rviz/bringup.rviz')], condition=launch.conditions.IfCondition(launch.substitutions.LaunchConfiguration(&quot;open_rviz&quot;)) ) return launch.LaunchDescription([ launch.actions.DeclareLaunchArgument( 'open_rviz', default_value='false', description='open rviz'), kobuki_node_launch, urg_node, robot_state_publisher_node, joint_state_publisher_node, rviz_node, #ekf_node ]) </code></pre> <p>kobuki_conveyor.urdf.xacro:</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;!-- - Base : kobuki - Stacks : conveyor - 3d Sensor : asus xtion pro live : hokuyo --&gt; &lt;robot name=&quot;turtlebot&quot; xmlns:xacro=&quot;http://ros.org/wiki/xacro&quot;&gt; &lt;!-- &lt;xacro:include filename=&quot;<span class="math-container">$(find turtlebot2_description)/urdf/turtlebot_library.urdf.xacro" /&gt; --&gt; &lt;xacro:include filename="$</span>(find turtlebot2_description)/urdf/turtlebot_common_library.urdf.xacro&quot; /&gt; &lt;!-- &lt;xacro:include filename=&quot;<span class="math-container">$(find turtlebot2_description)/urdf/turtlebot_properties.urdf.xacro" /&gt; --&gt; &lt;xacro:include filename="$</span>(find kobuki_description)/urdf/kobuki.urdf.xacro&quot; /&gt; &lt;xacro:include filename=&quot;$(find turtlebot2_description)/urdf/stacks/conveyor.urdf.xacro&quot; /&gt; &lt;xacro:kobuki/&gt; &lt;xacro:stack_conveyor parent=&quot;base_link&quot;/&gt; &lt;!-- &lt;xacro:sensor_asus_xtion_pro1 parent=&quot;base_link&quot;/&gt; &lt;xacro:sensor_asus_xtion_pro2 parent=&quot;base_link&quot;/&gt; &lt;xacro:sensor_hokuyo parent=&quot;base_link&quot;/&gt; --&gt; </code></pre> <p>conveyor.urdf.xacro:</p> <pre><code> &lt;?xml version=&quot;1.0&quot;?&gt; &lt;!-- Hexagon stacks --&gt; &lt;robot name=&quot;stack_conveyor&quot; xmlns:xacro=&quot;http://ros.org/wiki/xacro&quot;&gt; &lt;xacro:include filename=&quot;<span class="math-container">$(find turtlebot2_description)/urdf/common_properties.urdf.xacro"/&gt; &lt;!--&lt;xacro:include filename="$</span>(find turtlebot2_description)/urdf/turtlebot_properties.urdf.xacro&quot;/&gt; --&gt; &lt;!-- Xacro properties --&gt; &lt;xacro:property name=&quot;M_SCALE&quot; value=&quot;0.001&quot;/&gt; &lt;xacro:property name=&quot;tower_mesh_scale&quot; value=&quot;0.000985&quot;/&gt; &lt;xacro:property name=&quot;cam_pz_1&quot; value=&quot;0.5350&quot; /&gt; &lt;xacro:property name=&quot;cam_px_1&quot; value=&quot;0.045&quot; /&gt; &lt;!-- &lt;xacro:property name=&quot;cam_py_1&quot; value=&quot;0.022&quot; /&gt; &lt;xacro:property name=&quot;cam_or_1&quot; value=&quot;0&quot; /&gt; &lt;xacro:property name=&quot;cam_op_1&quot; value=&quot;0&quot; /&gt; &lt;xacro:property name=&quot;cam_oy_1&quot; value=&quot;0&quot; /&gt; &lt;xacro:property name=&quot;cam_px_2&quot; value=&quot;-0.045&quot; /&gt; &lt;xacro:property name=&quot;cam_py_2&quot; value=&quot;-0.022&quot; /&gt; &lt;xacro:property name=&quot;cam_pz_2&quot; value=&quot;0.5350&quot; /&gt; --&gt; &lt;!-- Xacro macros --&gt; &lt;!-- Pole macros --&gt; &lt;xacro:macro name=&quot;stack_conveyor&quot; params=&quot;parent&quot;&gt; &lt;joint name=&quot;merged_laser&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;0.000 0.00 ${cam_pz_1}&quot; rpy=&quot;0 0 3.14159&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;base_merged_laser_link&quot; /&gt; &lt;/joint&gt; &lt;link name=&quot;base_merged_laser_link&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;box size=&quot;0.01 0.01 0.01&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;green&quot; /&gt; &lt;/visual&gt; &lt;inertial&gt; &lt;mass value=&quot;0.000001&quot; /&gt; &lt;origin xyz=&quot;0 0 0&quot; /&gt; &lt;inertia ixx=&quot;0.0001&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.0001&quot; iyz=&quot;0.0&quot; izz=&quot;0.0001&quot; /&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;tower_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;tower_link&quot;/&gt; &lt;origin xyz=&quot;0.00 0 0.05199&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;axis xyz=&quot;0 0 0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;tower_link&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://turtlebot2_description/meshes/stacks/conveyor/baugestell.stl&quot; scale=&quot;<span class="math-container">${tower_mesh_scale} $</span>{tower_mesh_scale} <span class="math-container">${tower_mesh_scale}" /&gt; &lt;/geometry&gt; &lt;origin xyz="0.16 -0.162 -0.026" rpy="$</span>{M_PI/2} 0 ${M_PI/2}&quot;/&gt; &lt;xacro:insert_block name=&quot;material_grey&quot;/&gt; &lt;/visual&gt; &lt;inertial&gt; &lt;mass value=&quot;0.01&quot; /&gt; &lt;origin xyz=&quot;0 0 0&quot; /&gt; &lt;inertia ixx=&quot;0.001&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.001&quot; iyz=&quot;0.0&quot; izz=&quot;0.001&quot; /&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;cam_gestell_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;cam_gestell_link&quot;/&gt; &lt;origin xyz=&quot;0 0 <span class="math-container">${cam_pz_1-0.37}" rpy="0 0 0"/&gt; &lt;axis xyz="0 0 0"/&gt; &lt;/joint&gt; &lt;link name="cam_gestell_link"&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename="package://turtlebot2_description/meshes/stacks/conveyor/asus_xtion_pro_live.stl" scale="$</span>{tower_mesh_scale} <span class="math-container">${tower_mesh_scale} $</span>{tower_mesh_scale}&quot; /&gt; &lt;/geometry&gt; &lt;origin xyz=&quot;0.16 -0.162 -0.026&quot; rpy=&quot;<span class="math-container">${M_PI/2} 0 $</span>{M_PI/2}&quot;/&gt; &lt;xacro:insert_block name=&quot;material_grey&quot;/&gt; &lt;/visual&gt; &lt;inertial&gt; &lt;mass value=&quot;0.01&quot; /&gt; &lt;origin xyz=&quot;0 0 0&quot; /&gt; &lt;inertia ixx=&quot;0.001&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.001&quot; iyz=&quot;0.0&quot; izz=&quot;0.001&quot; /&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;belt_motor_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;belt_motor_link&quot;/&gt; &lt;origin xyz=&quot;0.00 0 0.04499&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;axis xyz=&quot;0 0 0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;belt_motor_link&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://turtlebot2_description/meshes/stacks/conveyor/foerderband.stl&quot; scale=&quot;<span class="math-container">${tower_mesh_scale} $</span>{tower_mesh_scale} <span class="math-container">${tower_mesh_scale}" /&gt; &lt;/geometry&gt; &lt;origin xyz="0.16 -0.162 -0.026" rpy="$</span>{M_PI/2} 0 ${M_PI/2}&quot;/&gt; &lt;xacro:insert_block name=&quot;material_dark_grey&quot;/&gt; &lt;/visual&gt; &lt;inertial&gt; &lt;mass value=&quot;0.01&quot; /&gt; &lt;origin xyz=&quot;0 0 0&quot; /&gt; &lt;inertia ixx=&quot;0.001&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.001&quot; iyz=&quot;0.0&quot; izz=&quot;0.001&quot; /&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;belt_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;belt_link&quot;/&gt; &lt;origin xyz=&quot;0.00 0 0.0455&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;axis xyz=&quot;0 0 0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;belt_link&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://turtlebot2_description/meshes/stacks/conveyor/foerdergurt.stl&quot; scale=&quot;<span class="math-container">${tower_mesh_scale} $</span>{tower_mesh_scale} <span class="math-container">${tower_mesh_scale}" /&gt; &lt;/geometry&gt; &lt;origin xyz="0.16 -0.162 -0.026" rpy="$</span>{M_PI/2} 0 <span class="math-container">${M_PI/2}"/&gt; &lt;xacro:insert_block name="material_black"/&gt; &lt;/visual&gt; &lt;inertial&gt; &lt;mass value="0.01" /&gt; &lt;origin xyz="0 0 0" /&gt; &lt;inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001" /&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;!-- &lt;joint name="bottle_joint" type="fixed"&gt; &lt;parent link="base_link"/&gt; &lt;child link="bottle_link"/&gt; &lt;origin xyz="0.00 0 0.0465" rpy="0 0 0"/&gt; &lt;axis xyz="0 0 0"/&gt; &lt;/joint&gt; &lt;link name="bottle_link"&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename="package://turtlebot2_description/meshes/stacks/conveyor/flasche.stl" scale="$</span>{tower_mesh_scale} <span class="math-container">${tower_mesh_scale} $</span>{tower_mesh_scale}&quot; /&gt; &lt;/geometry&gt; &lt;origin xyz=&quot;0.16 -0.162 -0.026&quot; rpy=&quot;<span class="math-container">${M_PI/2} 0 $</span>{M_PI/2}&quot;/&gt; &lt;xacro:insert_block name=&quot;material_blue&quot;/&gt; &lt;/visual&gt; &lt;inertial&gt; &lt;mass value=&quot;0.01&quot; /&gt; &lt;origin xyz=&quot;0 0 0&quot; /&gt; &lt;inertia ixx=&quot;0.001&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.001&quot; iyz=&quot;0.0&quot; izz=&quot;0.001&quot; /&gt; &lt;/inertial&gt; &lt;/link&gt; --&gt; &lt;/xacro:macro&gt; &lt;/robot&gt; </code></pre> <p>Could anyone help me out please? Thank you in advance!</p> <hr /> <p><a href="https://answers.ros.org/question/417369/caught-exception-in-launch-(see-debug-for-traceback):-unable-to-parse-the-value-of-parameter-robot_description-as-yaml/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/142720/djinn/" rel="nofollow noreferrer">Djinn</a> on ROS Answers with karma: 13 on 2023-07-11</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/142720/djinn/" rel="nofollow noreferrer">Djinn</a> on 2023-07-17</strong>:<br /> @djchopp I've seen that you've answered a similiar question, I hope you don't mind me tagging you. Could you maybe take a look and tell me if you see any mistakes?</p>
Caught exception in launch (see debug for traceback): Unable to parse the value of parameter robot_description as yaml
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I solved this issue by myself, turns out there was issue with the correct use of namespace for the composable nodes and also how the parameters need to be read from the configuration yaml file.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> with karma: 115 on 2023-08-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103411
2023-07-11T16:00:19.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello everyone, I am trying to combine the realsense node and openvins node using this launch file -</p> <pre><code>from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, LogInfo, OpaqueFunction from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, TextSubstitution from launch_ros.actions import ComposableNodeContainer from launch_ros.descriptions import ComposableNode from launch_ros.actions import Node from ament_index_python.packages import get_package_share_directory, get_package_prefix import os import sys def generate_launch_description(): # Define launch arguments launch_args = [ DeclareLaunchArgument(name=&quot;namespace&quot;, default_value=&quot;ov_msckf&quot;, description=&quot;namespace&quot;), DeclareLaunchArgument( name=&quot;ov_enable&quot;, default_value=&quot;true&quot;, description=&quot;enable OpenVINS node&quot; ), DeclareLaunchArgument( name=&quot;rviz_enable&quot;, default_value=&quot;false&quot;, description=&quot;enable rviz node&quot; ), DeclareLaunchArgument( name=&quot;config&quot;, default_value=&quot;euroc_mav&quot;, description=&quot;euroc_mav, tum_vi, rpng_aruco...&quot;, ), DeclareLaunchArgument( name=&quot;config_path&quot;, default_value=&quot;&quot;, description=&quot;path to estimator_config.yaml. If not given, determined based on provided 'config' above&quot;, ), DeclareLaunchArgument( name=&quot;verbosity&quot;, default_value=&quot;INFO&quot;, description=&quot;ALL, DEBUG, INFO, WARNING, ERROR, SILENT&quot;, ), DeclareLaunchArgument( name=&quot;use_stereo&quot;, default_value=&quot;true&quot;, description=&quot;if we have more than 1 camera, if we should try to track stereo constraints between pairs&quot;, ), DeclareLaunchArgument( name=&quot;max_cameras&quot;, default_value=&quot;2&quot;, description=&quot;how many cameras we have 1 = mono, 2 = stereo, &gt;2 = binocular (all mono tracking)&quot;, ), DeclareLaunchArgument( name=&quot;save_total_state&quot;, default_value=&quot;false&quot;, description=&quot;record the total state with calibration and features to a txt file&quot;, ) ] def launch_setup(context): config_path = LaunchConfiguration(&quot;config_path&quot;).perform(context) if not config_path: configs_dir = os.path.join(get_package_share_directory(&quot;ov_msckf&quot;), &quot;config&quot;) available_configs = os.listdir(configs_dir) config = LaunchConfiguration(&quot;config&quot;).perform(context) if config in available_configs: config_path = os.path.join( get_package_share_directory(&quot;ov_msckf&quot;), &quot;config&quot;,config,&quot;estimator_config.yaml&quot; ) else: return [ LogInfo( msg=&quot;ERROR: unknown config: '{}' - Available configs are: {} - not starting OpenVINS&quot;.format( config, &quot;, &quot;.join(available_configs) ) ) ] else: if not os.path.isfile(config_path): return [ LogInfo( msg=&quot;ERROR: config_path file: '{}' - does not exist. - not starting OpenVINS&quot;.format( config_path) ) ] node1 = Node( package=&quot;ov_msckf&quot;, executable=&quot;run_subscribe_msckf&quot;, condition=IfCondition(LaunchConfiguration(&quot;ov_enable&quot;)), namespace=LaunchConfiguration(&quot;namespace&quot;), output='screen', parameters=[ {&quot;verbosity&quot;: LaunchConfiguration(&quot;verbosity&quot;)}, {&quot;use_stereo&quot;: LaunchConfiguration(&quot;use_stereo&quot;)}, {&quot;max_cameras&quot;: LaunchConfiguration(&quot;max_cameras&quot;)}, {&quot;save_total_state&quot;: LaunchConfiguration(&quot;save_total_state&quot;)}, {&quot;config_path&quot;: config_path}, ], ) node2 = Node( package=&quot;rviz2&quot;, executable=&quot;rviz2&quot;, condition=IfCondition(LaunchConfiguration(&quot;rviz_enable&quot;)), arguments=[ &quot;-d&quot;, os.path.join( get_package_share_directory(&quot;ov_msckf&quot;), &quot;launch&quot;, &quot;display_ros2.rviz&quot; ), &quot;--ros-args&quot;, &quot;--log-level&quot;, &quot;warn&quot;, ], ) # Config file config_file = os.path.join( get_package_share_directory('argos_launch'), 'config', 'sensors', 'realsense_ov.yaml') # Realsense driver node realsense_node = ComposableNode( namespace=&quot;camera&quot;, package='realsense2_camera', plugin='realsense2_camera::RealSenseNodeFactory', parameters=[config_file], remappings = [(&quot;/camera/imu&quot;, &quot;/imu0&quot;)]) # Container realsense_container = ComposableNodeContainer( name='realsense_container', namespace='', package='rclcpp_components', executable='component_container', composable_node_descriptions=[ realsense_node, ], output='screen') return [node1, node2, realsense_container] opfunc = OpaqueFunction(function=launch_setup) ld = LaunchDescription(launch_args) ld.add_action(opfunc) return ld </code></pre> <p>But whenever I run the launch file and run this command in another terminal -</p> <pre><code>ros2 topic hz /ov_msckf/odomimu </code></pre> <p>I do not get any output, please can anybody help me solve this issue and tell me what could be going wrong, I tried remapping the topics also but still I don't get any output</p> <hr /> <p><a href="https://answers.ros.org/question/417372/no-output-from-ros2-topic/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> on ROS Answers with karma: 115 on 2023-07-11</p> <p>Post score: 0</p>
No output from ros2 topic
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Solved it!</p> <p>I realized the issue using an rqt graph.</p> <p>The problem:</p> <ol> <li>The hexapod was publishing its joint states to <code>/joint_states</code></li> <li>Robotic arm was publishing to <code>/mobile_wx250s/joint_states</code></li> <li>Then the joint_state_publisher was combining both of them using <code>&lt;rosparam param=&quot;source_list&quot;&gt;[&quot;/joint_states&quot;,&quot;mobile_wx250s/joint_states&quot;]&lt;/rosparam&gt;</code> and sending them off back to <code>/joint_states</code></li> <li>Therefore, there were two set of joint states being published to <code>/joint_states</code> and obviously this is why sometimes I would see the states of only hexapod and sometimes of both robots.</li> </ol> <p>All I had to do was move the hexapod nodes into their own namespace using <code>&lt;group ns=&quot;pi_robot&quot;&gt;</code> and then combine them using the joint_state_publisher using <code>&lt;rosparam param=&quot;source_list&quot;&gt;[&quot;pi_robot/joint_states&quot;,&quot;mobile_wx250s/joint_states&quot;]&lt;/rosparam&gt;</code>.</p> <p>This fixed the issue and then an independent robot_state_publisher was properly publishing the <code>/tf</code> as well.</p> <p>Seems like a rookie mistake but using the <strong>rqt_graph</strong> helped me a lot.</p> <p>Hope this is helpful to someone.</p> <p>Cheers!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/161673/anirudh_chhabra/" rel="nofollow noreferrer">anirudh_chhabra</a> with karma: 16 on 2023-07-13</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-07-14</strong>:\</p> <blockquote> <p>All I had to do was move the hexapod nodes into their own workspace [..]</p> </blockquote> <p><em>namespace</em> perhaps?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/161673/anirudh_chhabra/" rel="nofollow noreferrer">anirudh_chhabra</a> on 2023-07-15</strong>:<br /> oops. made a big typo there. I guess excitement wins over everything. Thanks. I will edit the answer.</p>
103413
2023-07-13T11:55:35.000
|moveit|joint-state-publisher|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello</p> <p>I am trying to combine two robots using Moveit for combined motion planning. However, I am facing some issues. They could be very minor since I am new to this but would appreciate the help.</p> <p>Following are some details.</p> <p>Platforms and Libraries:</p> <p><strong>Platform 1: PI 6-DOF Hexapod H.811.i2</strong></p> <p>Product Link - <a href="https://www.pi-usa.us/en/products/6-axis-hexapods-parallel-positioners/h-811i2-6-axis-miniature-hexapod-700886" rel="nofollow noreferrer">https://www.pi-usa.us/en/products/6-axis-hexapods-parallel-positioners/h-811i2-6-axis-miniature-hexapod-700886</a></p> <p>ROS package: <a href="https://github.com/PI-PhysikInstrumente/PI_ROS_Driver" rel="nofollow noreferrer">https://github.com/PI-PhysikInstrumente/PI_ROS_Driver</a></p> <p><strong>Platform 2: WidowX 250 Mobile Robot 6-DOF</strong></p> <p>Product Link: <a href="https://www.trossenrobotics.com/widowx-250-mobile-robot-arm-6dof.aspx" rel="nofollow noreferrer">https://www.trossenrobotics.com/widowx-250-mobile-robot-arm-6dof.aspx</a></p> <p>ROS Package: <a href="https://github.com/Interbotix/interbotix_ros_manipulators/tree/main/interbotix_ros_xsarms" rel="nofollow noreferrer">https://github.com/Interbotix/interbotix_ros_manipulators/tree/main/interbotix_ros_xsarms</a></p> <h2><strong>Problem Description:</strong></h2> <p>I have placed the robotic arm on top of the hexapod and fixed it. To represent this, I combine the two urdf files and make a fixed joint between them. To achieve this, I use the xacro format.</p> <p>Then, I use the MoveIt setup assistant to generate the MoveIt files. Everything works as expected during the simulation on rviz.</p> <p>I move on to add the hardware interface nodes using the official packages and test the physical operation of the robot. To do that, my controllers.yaml looks like follows:</p> <pre><code>controller_list: - name: &quot;joint_trajectory_controller&quot; action_ns: follow_joint_trajectory type: FollowJointTrajectory joints: [cart_x, cart_y, cart_z, ang_u, ang_v, ang_w] - name: &quot;mobile_wx250s/arm_controller&quot; action_ns: follow_joint_trajectory type: FollowJointTrajectory joints: [waist, shoulder, elbow, forearm_roll, wrist_angle, wrist_rotate] </code></pre> <p>As shown above, I load both the controllers for each robot. The hexapod publishes joint states as '/joint_states' and the robotic arm publishes as 'mobile_wx250s/joint_states'.</p> <p>Therefore, I define the joint state publisher such that both the states are published to /tf.</p> <p>Also, I go to move_group and remap 'mobile_wx250s/joint_states' to 'joint_states' so that planner knows all of them as a single body.</p> <p>When I run the robots now, the /joint_states output is very weird - it fluctuates so that sometimes I don't receive any of the robotic arm states. The output of 'rostopic echo /joint_states/name' is as follows:</p> <pre><code>- cart_x - cart_y - cart_z - ang_u - ang_v - ang_w - axis0_base_anchor_joint_x - axis0_base_anchor_joint_y - axis0_base_anchor_joint_z - axis1_base_anchor_joint_x - axis1_base_anchor_joint_y - axis1_base_anchor_joint_z - axis2_base_anchor_joint_x - axis2_base_anchor_joint_y - axis2_base_anchor_joint_z - axis3_base_anchor_joint_x - axis3_base_anchor_joint_y - axis3_base_anchor_joint_z - axis4_base_anchor_joint_x - axis4_base_anchor_joint_y - axis4_base_anchor_joint_z - axis5_base_anchor_joint_x - axis5_base_anchor_joint_y - axis5_base_anchor_joint_z - axis0_platform_anchor_joint_x - axis0_platform_anchor_joint_y - axis0_platform_anchor_joint_z - axis1_platform_anchor_joint_x - axis1_platform_anchor_joint_y - axis1_platform_anchor_joint_z - axis2_platform_anchor_joint_x - axis2_platform_anchor_joint_y - axis2_platform_anchor_joint_z - axis3_platform_anchor_joint_x - axis3_platform_anchor_joint_y - axis3_platform_anchor_joint_z - axis4_platform_anchor_joint_x - axis4_platform_anchor_joint_y - axis4_platform_anchor_joint_z - axis5_platform_anchor_joint_x - axis5_platform_anchor_joint_y - axis5_platform_anchor_joint_z - waist - shoulder - elbow - forearm_roll - wrist_angle - wrist_rotate </code></pre> <p>and sometimes as :</p> <pre><code>- ang_u - ang_v - ang_w - axis0_base_anchor_joint_x - axis0_base_anchor_joint_y - axis0_base_anchor_joint_z - axis0_platform_anchor_joint_x - axis0_platform_anchor_joint_y - axis0_platform_anchor_joint_z - axis1_base_anchor_joint_x - axis1_base_anchor_joint_y - axis1_base_anchor_joint_z - axis1_platform_anchor_joint_x - axis1_platform_anchor_joint_y - axis1_platform_anchor_joint_z - axis2_base_anchor_joint_x - axis2_base_anchor_joint_y - axis2_base_anchor_joint_z - axis2_platform_anchor_joint_x - axis2_platform_anchor_joint_y - axis2_platform_anchor_joint_z - axis3_base_anchor_joint_x - axis3_base_anchor_joint_y - axis3_base_anchor_joint_z - axis3_platform_anchor_joint_x - axis3_platform_anchor_joint_y - axis3_platform_anchor_joint_z - axis4_base_anchor_joint_x - axis4_base_anchor_joint_y - axis4_base_anchor_joint_z - axis4_platform_anchor_joint_x - axis4_platform_anchor_joint_y - axis4_platform_anchor_joint_z - axis5_base_anchor_joint_x - axis5_base_anchor_joint_y - axis5_base_anchor_joint_z - axis5_platform_anchor_joint_x - axis5_platform_anchor_joint_y - axis5_platform_anchor_joint_z - cart_x - cart_y - cart_z </code></pre> <p><strong>Also, on the main roslaunch terminal window, I see the following:</strong></p> <pre><code>[ WARN] [1689202843.877877212]: The complete state of the robot is not yet known. Missing waist, shoulder, elbow, forearm_roll, wrist_angle, wrist_rotate [ WARN] [1689202843.885522041]: New joint state for joint 'ang_u' is not newer than the previous state. Assuming your rosbag looped. [ WARN] [1689202843.929407546]: New joint state for joint 'cart_x' is not newer than the previous state. Assuming your rosbag looped. </code></pre> <p><strong>This is causing some issues to use the Move Group Python API since the /joint_states is not complete all the time.</strong></p> <p><strong>So my question is: WHAT AM I MISSING?</strong></p> <p>NOTE: I have created individual packages for both the robots using MoveIt while following the same process and they work like butter.</p> <p>Here are some files probably needed to understand my moveit setup.</p> <p>joint_names.yaml</p> <pre><code>controller_joint_names: [cart_x, cart_y, cart_z, ang_u, ang_v, ang_w, waist, shoulder, elbow, forearm_roll, wrist_angle, wrist_rotate] </code></pre> <p>my_planner.launch</p> <pre><code>&lt;launch&gt; &lt;rosparam command=&quot;load&quot; file=&quot;$(find my_pkg)/config/joint_names.yaml&quot;/&gt; &lt;arg name=&quot;sim&quot; default=&quot;true&quot; /&gt; &lt;arg name=&quot;robot_ip&quot; unless=&quot;$(arg sim)&quot; /&gt; &lt;include file=&quot;$(find my_pkg)/launch/planning_context.launch&quot; &gt; &lt;arg name=&quot;load_robot_description&quot; value=&quot;true&quot; /&gt; &lt;/include&gt; &lt;group if=&quot;<span class="math-container">$(arg sim)"&gt; &lt;include file="$</span>(find industrial_robot_simulator)/launch/robot_interface_simulator.launch&quot; /&gt; &lt;node name=&quot;robot_state_publisher&quot; pkg=&quot;robot_state_publisher&quot; type=&quot;robot_state_publisher&quot; /&gt; &lt;/group&gt; &lt;node name=&quot;pi_hardware_interface&quot; pkg=&quot;pi_hexapod_control&quot; type=&quot;pi_hexapod_control_node&quot; output=&quot;screen&quot; required=&quot;true&quot;&gt; &lt;rosparam command=&quot;load&quot; file=&quot;<span class="math-container">$(arg hexapod_params)" /&gt; &lt;param name="using_tcp_ip_connection" type="bool" value="$</span>(arg using_tcp_ip_connection)&quot; /&gt; &lt;param name=&quot;hexapod_ip&quot; type=&quot;str&quot; value=&quot;<span class="math-container">$(arg hexapod_ip)" /&gt; &lt;param name="hexapod_port" type="int" value="$</span>(arg hexapod_port)&quot; /&gt; &lt;param name=&quot;using_rs232_connection&quot; type=&quot;bool&quot; value=&quot;<span class="math-container">$(arg using_rs232_connection)" /&gt; &lt;param name="rs232_port_nr" type="int" value="$</span>(arg rs232_port_nr)&quot; /&gt; &lt;param name=&quot;baudrate&quot; type=&quot;int&quot; value=&quot;<span class="math-container">$(arg baudrate)" /&gt; &lt;param name="is_sim" type="bool" value="$</span>(arg sim)&quot; /&gt; &lt;param name=&quot;auto_referencing&quot; type=&quot;bool&quot; value=&quot;<span class="math-container">$(arg auto_referencing)" /&gt; &lt;param name="prefer_stop_over_halt" type="bool" value="$</span>(arg prefer_stop_over_halt)&quot; /&gt; &lt;/node&gt; &lt;include file=&quot;<span class="math-container">$(find interbotix_xsarm_ros_control)/launch/xsarm_ros_control.launch"&gt; &lt;arg name="robot_model" value="$</span>(arg robot_model)&quot;/&gt; &lt;arg name=&quot;robot_name&quot; value=&quot;<span class="math-container">$(arg robot_name)"/&gt; &lt;arg name="base_link_frame" value="$</span>(arg base_link_frame)&quot;/&gt; &lt;arg name=&quot;show_ar_tag&quot; value=&quot;<span class="math-container">$(arg show_ar_tag)"/&gt; &lt;arg name="use_world_frame" value="$</span>(arg use_world_frame)&quot;/&gt; &lt;arg name=&quot;external_urdf_loc&quot; value=&quot;<span class="math-container">$(arg external_urdf_loc)"/&gt; &lt;arg name="use_rviz" value="false"/&gt; &lt;arg name="mode_configs" value="$</span>(arg mode_configs)&quot;/&gt; &lt;arg name=&quot;dof&quot; value=&quot;$(arg dof)&quot;/&gt; &lt;/include&gt; &lt;node name=&quot;joint_state_publisher&quot; pkg=&quot;joint_state_publisher&quot; type=&quot;joint_state_publisher&quot;&gt; &lt;rosparam param=&quot;source_list&quot;&gt;[&quot;/joint_states&quot;,&quot;/mobile_wx250s/joint_states&quot;]&lt;/rosparam&gt; &lt;param name=&quot;rate&quot; value=&quot;100&quot;/&gt; &lt;param name=&quot;ignore_timestamp&quot; value=&quot;true&quot;/&gt; &lt;/node&gt; &lt;node pkg=&quot;robot_state_publisher&quot; type=&quot;robot_state_publisher&quot; name=&quot;robot_state_publisher&quot;&gt; &lt;param name=&quot;ignore_timestamp&quot; value=&quot;true&quot;/&gt; --&gt; &lt;/node&gt; &lt;node name=&quot;ros_control_controller_spawner&quot; pkg=&quot;controller_manager&quot; type=&quot;spawner&quot; respawn=&quot;false&quot; output=&quot;screen&quot; args=&quot;$(arg controllers)&quot;&gt; &lt;/node&gt; &lt;node name=&quot;ros_control_stopped_spawner&quot; pkg=&quot;controller_manager&quot; type=&quot;spawner&quot; respawn=&quot;false&quot; output=&quot;screen&quot; args=&quot;--stopped $(arg stopped_controllers)&quot;&gt; &lt;/node&gt; &lt;/group&gt; &lt;include file=&quot;$(find my_pkg)/launch/move_group.launch&quot;&gt; &lt;arg name=&quot;publish_monitored_planning_scene&quot; value=&quot;true&quot; /&gt; &lt;/include&gt; &lt;!-- By default, we are not in debug mode --&gt; &lt;arg name=&quot;debug&quot; default=&quot;false&quot; /&gt; &lt;include file=&quot;<span class="math-container">$(find my_pkg)/launch/moveit_rviz.launch"&gt; &lt;!-- &lt;arg name="config" value="true"/&gt; --&gt; &lt;arg name="rviz_config" value="$</span>(dirname)/moveit.rviz&quot;/&gt; &lt;arg name=&quot;debug&quot; value=&quot;$(arg debug)&quot;/&gt; &lt;/include&gt; &lt;/launch&gt; </code></pre> <hr /> <p><a href="https://answers.ros.org/question/417417/moveit!-for-combining-multiple-robots/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/161673/anirudh_chhabra/" rel="nofollow noreferrer">anirudh_chhabra</a> on ROS Answers with karma: 16 on 2023-07-13</p> <p>Post score: 0</p>
Moveit! for combining multiple robots
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I finally figured out the issue (and a solution) today. The python IDL interfaces for my version of ROS used python3.10. Despite the normal python install on my machine being python3.10, for whatever reason, when I ran colcon build it was finding a spurious python3.6 install, so the python IDL interfaces for the packages in my workspace were being built using that (and were not compatible with the CLI commands). So the IDL products would be under the path <code>/home/user/ws/install/test_msgs/local/lib/python3.10/dist-packages/test_msgs</code>, but the IDL libraries were <code>test_msgs_s__rosidl_typesupport_*.cpython-3.6-*.so</code> instead of <code>*.cpython-3.10*.so.</code></p> <p>I did not find a quick way to specify that colcon/cmake explicitly use python3.10, so I fixed this issue by removing python3.6 from my machine, removing the build, install, and log folders, and doing a fresh build.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/36591/squidonthebass/" rel="nofollow noreferrer">squidonthebass</a> with karma: 26 on 2023-08-02</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-08-03</strong>:<br /> Good sleuthing. Thanks for posting your findings here.</p>
103415
2023-07-13T12:34:47.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello. I have starting to migrate from ROS1 to ROS2 and have encountered some issues trying to use the topic tools in the command line. I can use the &quot;ros2 topic&quot; tools just fine with message types that came installed with ROS2 humble (std_msgs, etc.). However, I discovered that some of these tools are not working for me for a package I've been porting to ROS2 that contains and uses custom-defined messages. The package which includes the custom messages builds just fine and runs, but I can't call &quot;ros2 topic echo&quot; or &quot;pub&quot; for the topics with the types defined in that package (but work fine on other types).</p> <p>I've tried to follow this example as closely as possible, and present a minimal package below which replicates this issue for me. The error text when trying to call &quot;ros2 topic pub/echo&quot; (after sourcing the workspace) is displayed at the bottom of my question.</p> <p>test_msgs/msg/TestMessage.msg</p> <pre><code>std_msgs/Int16 data </code></pre> <p>test_msgs/CMakeLists.txt</p> <pre><code>cmake_minimum_required(VERSION 3.8 FATAL_ERROR) project(test_msgs) set(CMAKE_CXX_STANDARD 17) find_package(ament_cmake REQUIRED) find_package(rosidl_default_generators REQUIRED) find_package(std_msgs REQUIRED) set(MSG_FILES &quot;msg/TestMessage.msg&quot;) rosidl_generate_interfaces(<span class="math-container">${PROJECT_NAME} $</span>{MSG_FILES} DEPENDENCIES std_msgs) ament_export_dependencies(rosidl_default_runtime) ament_package() </code></pre> <p>test_msgs/package.xml</p> <pre><code>&lt;package format=&quot;3&quot;&gt; &lt;name&gt;test_msgs&lt;/name&gt; &lt;version&gt;0.0.0&lt;/version&gt; &lt;description&gt;No&lt;/description&gt; &lt;maintainer email=&quot;no@no.no&quot;&gt;No&lt;/maintainer&gt; &lt;license&gt;Test&lt;/license&gt; &lt;buildtool_depend&gt;ament_cmake&lt;/buildtool_depend&gt; &lt;buildtool_depend&gt;rosidl_default_generators&lt;/buildtool_depend&gt; &lt;exec_depend&gt;rosidl_default_runtime&lt;/exec_depend&gt; &lt;test_depend&gt;ament_lint_common&lt;/test_depend&gt; &lt;member_of_group&gt;rosidl_interface_packages&lt;/member_of_group&gt; &lt;export&gt; &lt;build_type&gt;ament_cmake&lt;/build_type&gt; &lt;/export&gt; &lt;/package&gt; </code></pre> <p>After building, the built interface shows up using the ros2 interface tool:</p> <pre><code>ros2 interface list | grep test </code></pre> <p>returns:</p> <pre><code>pendulum_msgs/msg/RttestResults test_msgs/msg/TestMessage </code></pre> <p>as expected. I can also show the fields of the message from the command line without error:</p> <pre><code>ros2 interface show test_msgs/msg/TestMessage </code></pre> <p>returns:</p> <pre><code>int16 data </code></pre> <p>as expected.</p> <p>I can publish a topic with a type from the nominal ROS2 distribution:</p> <pre><code>ros2 topic pub /test std_msgs/Int16 &quot;data: 0&quot; publisher: beginning loop publishing #1: std_msgs.msg.Int16(data=0) </code></pre> <p>However, I get this error when trying to publish a topic with my custom message (after sourcing the workspace, of course):</p> <pre><code>ros2 topic pub /test test_msgs/msg/TestMessage &quot;data: {data: 0}&quot; Traceback (most recent call last): File &quot;/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/import_type_support_impl.py&quot;, line 46, in import_type_support return importlib.import_module(module_name, package=pkg_name) File &quot;/usr/lib/python3.10/importlib/__init__.py&quot;, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1050, in _gcd_import File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027, in _find_and_load File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'test_msgs.test_msgs_s__rosidl_typesupport_c' During handling of the above exception, another exception occurred: Traceback (most recent call last): File &quot;/opt/ros/humble/bin/ros2&quot;, line 33, in &lt;module&gt; sys.exit(load_entry_point('ros2cli==0.18.6', 'console_scripts', 'ros2')()) File &quot;/opt/ros/humble/lib/python3.10/site-packages/ros2cli/cli.py&quot;, line 89, in main rc = extension.main(parser=parser, args=args) File &quot;/opt/ros/humble/lib/python3.10/site-packages/ros2topic/command/topic.py&quot;, line 41, in main return extension.main(args=args) File &quot;/opt/ros/humble/lib/python3.10/site-packages/ros2topic/verb/pub.py&quot;, line 222, in main return main(args) File &quot;/opt/ros/humble/lib/python3.10/site-packages/ros2topic/verb/pub.py&quot;, line 240, in main return publisher( File &quot;/opt/ros/humble/lib/python3.10/site-packages/ros2topic/verb/pub.py&quot;, line 275, in publisher pub = node.create_publisher(msg_module, topic_name, qos_profile) File &quot;/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/node.py&quot;, line 1290, in create_publisher check_is_valid_msg_type(msg_type) File &quot;/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/type_support.py&quot;, line 35, in check_is_valid_msg_type check_for_type_support(msg_type) File &quot;/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/type_support.py&quot;, line 29, in check_for_type_support msg_or_srv_type.__class__.__import_type_support__() File &quot;/home/squid/ws/install/test_msgs/local/lib/python3.10/dist-packages/test_msgs/msg/_test_message.py&quot;, line 29, in __import_type_support__ module = import_type_support('test_msgs') File &quot;/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/import_type_support_impl.py&quot;, line 48, in import_type_support raise UnsupportedTypeSupport(pkg_name) rosidl_generator_py.import_type_support_impl.UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package 'test_msgs' </code></pre> <p>The built python package in my workspace seems to have a number of built typesupport packages for test_msgs as well:</p> <pre><code>/home/squid/ws/install/test_msgs/local/lib/python3.10/dist-packages/test_msgs$ ls __init__.py libtest_msgs__rosidl_generator_py.so msg __pycache__ _test_msgs_s.ep.rosidl_typesupport_c.c _test_msgs_s.ep.rosidl_typesupport_fastrtps_c.c _test_msgs_s.ep.rosidl_typesupport_introspection_c.c test_msgs_s__rosidl_typesupport_c.cpython-36m-x86_64-linux-gnu.so test_msgs_s__rosidl_typesupport_fastrtps_c.cpython-36m-x86_64-linux-gnu.so test_msgs_s__rosidl_typesupport_introspection_c.cpython-36m-x86_64-linux-gnu.so </code></pre> <p>Thanks in advance for any help. This issue has had me confused all day.</p> <hr /> <p><a href="https://answers.ros.org/question/417418/can%27t-publish-or-echo-topics-with-custom-message-types-from-command-line/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/36591/squidonthebass/" rel="nofollow noreferrer">squidonthebass</a> on ROS Answers with karma: 26 on 2023-07-13</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-07-14</strong>:<br /> Quick comment: I've seen this happen whenever I forget to <code>source</code> the <code>setup.bash</code> (or <code>local_setup.bash</code>) after building a new msg package. Just something to check.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/36591/squidonthebass/" rel="nofollow noreferrer">squidonthebass</a> on 2023-07-14</strong>:<br /> Yeah, I have triple checked this, and unfortunately is not the issue.</p>
Can't publish or echo topics with custom message types from command line
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I solved this issue by myself, turns out there was issue with the correct use of namespace for the composable nodes and also how the parameters need to be read from the configuration yaml file.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> with karma: 115 on 2023-08-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103417
2023-07-13T17:01:02.000
|ros|ros2|intel|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone, I am updating my question, I am trying to integrate the realsense d435i camera and openvins nodes in one launch file in ROS2 Foxy. I have converted the openvins node into a composable node and am running it with the realsense composable node in a single container, the launch file runs and the opevins node subscribes to the camera and imu topics but still I don't see any output on /trackhist or /odomimu. If anybody has worked on this before and encountered this issue, please help me out. Here is the launch file -</p> <pre><code>import os from ament_index_python.packages import get_package_share_directory, get_package_prefix from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, LogInfo, OpaqueFunction from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, TextSubstitution from launch_ros.actions import Node from launch_ros.actions import ComposableNodeContainer from launch_ros.descriptions import ComposableNode def generate_launch_description(): # Define launch arguments launch_args = [ DeclareLaunchArgument(name=&quot;namespace&quot;, default_value=&quot;ov_msckf&quot;, description=&quot;namespace&quot;), DeclareLaunchArgument(name=&quot;ov_enable&quot;, default_value=&quot;true&quot;, description=&quot;enable OpenVINS node&quot;), DeclareLaunchArgument(name=&quot;rviz_enable&quot;, default_value=&quot;false&quot;, description=&quot;enable rviz node&quot;), DeclareLaunchArgument(name=&quot;config&quot;, default_value=&quot;rs435i&quot;, description=&quot;euroc_mav, tum_vi, rpng_aruco...&quot;), DeclareLaunchArgument(name=&quot;config_path&quot;, default_value=&quot;&quot;, description=&quot;path to estimator_config.yaml. If not given, determined based on provided 'config' above&quot;), DeclareLaunchArgument(name=&quot;verbosity&quot;, default_value=&quot;INFO&quot;, description=&quot;ALL, DEBUG, INFO, WARNING, ERROR, SILENT&quot;), DeclareLaunchArgument(name=&quot;use_stereo&quot;, default_value=&quot;true&quot;, description=&quot;if we have more than 1 camera, if we should try to track stereo constraints between pairs&quot;), DeclareLaunchArgument(name=&quot;max_cameras&quot;, default_value=&quot;2&quot;, description=&quot;how many cameras we have 1 = mono, 2 = stereo, &gt;2 = binocular (all mono tracking)&quot;), DeclareLaunchArgument(name=&quot;save_total_state&quot;, default_value=&quot;false&quot;, description=&quot;record the total state with calibration and features to a txt file&quot;), ] config_path = os.path.join( get_package_share_directory('ov_msckf'), 'config', 'rs_d435', 'estimator_config.yaml') # Config file config_file = os.path.join( get_package_share_directory('argos_launch'), 'config', 'sensors', 'realsense_ov.yaml') realsense_node = ComposableNode( namespace=&quot;camera&quot;, package='realsense2_camera', plugin='realsense2_camera::RealSenseNodeFactory', parameters=[config_file], remappings = [(&quot;/camera/imu&quot;, &quot;/imu0&quot;), (&quot;/camera/infra1/image_rect_raw&quot;, &quot;/cam1/image_raw&quot;), (&quot;/camera/infra2/image_rect_raw&quot;, &quot;/cam0/image_raw&quot;)] ) open_vins_node = ComposableNode( package='ov_msckf', plugin='ov_msckf::OpenVinsNode', parameters=[ {&quot;verbosity&quot;: LaunchConfiguration(&quot;verbosity&quot;)}, {&quot;use_stereo&quot;: LaunchConfiguration(&quot;use_stereo&quot;)}, {&quot;max_cameras&quot;: LaunchConfiguration(&quot;max_cameras&quot;)}, {&quot;save_total_state&quot;: LaunchConfiguration(&quot;save_total_state&quot;)}, #{&quot;config_path&quot;: config_path}, ], ) container = ComposableNodeContainer( name='my_container', namespace='', package='rclcpp_components', executable='component_container', composable_node_descriptions=[ realsense_node, open_vins_node, ], output='screen', ) ld = LaunchDescription(launch_args) ld.add_action(container) return ld </code></pre> <hr /> <p><a href="https://answers.ros.org/question/417426/integration-of-realsense-d435i-camera-and-openvins/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/90798/robo_guy/" rel="nofollow noreferrer">Robo_guy</a> on ROS Answers with karma: 115 on 2023-07-13</p> <p>Post score: 0</p>
Integration of realsense d435i camera and openvins
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>For the simulated lidar, we use this in melodic and noetic:</p> <pre><code> &lt;plugin name=&quot;lidar_model&quot; filename=&quot;libgazebo_ros_laser.so&quot;&gt; &lt;topicName&gt;/scan&lt;/topicName&gt; &lt;frameName&gt;scan_link&lt;/frameName&gt; &lt;/plugin&gt; </code></pre> <p>Also, having the <code>sensor name=</code> and the <code>plugin name=</code> the same might be an issue for gazebo, I'm not sure.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-07-15</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/109236/the_one/" rel="nofollow noreferrer">the_one</a> on 2023-07-17</strong>:<br /> yes i changed that after i did not find the libgazebo_ros_ray_sensor.so file in the gazebo_ros package, also i read the gazebo documentation from gazebo... what @mike suggested is right way to do the laser part.</p>
103419
2023-07-14T01:17:15.000
|ros|laser-scan|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi folks, I am currently implementing a 4wheel bot. I added a laser_scan topic in urdf file, you can see the file below...when i run the launch file, i can't visualize any laser and the &quot;/scan&quot; topic also when i run the rostopic list. Am i doing anything wrong? this is my urdf file</p> <p>` </p> <pre><code>&lt;xacro:property name=&quot;constant&quot; value = &quot;0.083333333&quot;/&gt; #1/12 &lt;xacro:property name=&quot;mass&quot; value = &quot;0.5&quot;/&gt; &lt;xacro:property name=&quot;width&quot; value = &quot;0.75&quot;/&gt; &lt;xacro:property name=&quot;height&quot; value = &quot;0.15&quot;/&gt; &lt;xacro:property name=&quot;depth&quot; value = &quot;0.4&quot;/&gt; &lt;xacro:property name=&quot;radius&quot; value = &quot;0.033&quot;/&gt; &lt;xacro:property name=&quot;length&quot; value = &quot;0.018&quot;/&gt; &lt;!-- rover base link --&gt; &lt;link name=&quot;world&quot;/&gt; &lt;joint name=&quot;Chassis_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;world&quot;/&gt; &lt;child link=&quot;Chassis&quot;/&gt; &lt;origin xyz=&quot;0.0 0.0 0.135&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;axis xyz=&quot;0.0 0.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;Chassis&quot;&gt; &lt;inertial&gt; &lt;mass value=&quot;0.5&quot;/&gt; &lt;origin xyz=&quot;0.0 0.0 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;inertia ixx=&quot;0.007601&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.03009&quot; iyz=&quot;0.0&quot; izz=&quot;0.024365&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;geometry&gt; &lt;box size=&quot;0.75 0.4 0.15&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;1.0 0.3 0.1 1.0&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.75 0.4 0.15&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference = &quot;Chassis&quot;&gt; &lt;material&gt; Gazebo/Orange &lt;/material&gt; &lt;/gazebo&gt; &lt;!-- camera/sensor mount --&gt; &lt;joint name=&quot;mount_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;Chassis&quot;/&gt; &lt;child link=&quot;mount_link&quot;/&gt; &lt;origin xyz=&quot;0.2 0.0 0.124&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;axis xyz=&quot;0.0 0.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;mount_link&quot;&gt; &lt;inertial&gt; &lt;mass value=&quot;0.0&quot;/&gt; &lt;origin xyz=&quot;0.0 0.0 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;inertia ixx=&quot;0.0&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.0&quot; iyz=&quot;0.0&quot; izz=&quot;0.0&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;geometry&gt; &lt;cylinder radius=&quot;0.08&quot; length=&quot;0.1&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.0 0.0 0.0 1.0&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;cylinder radius=&quot;0.08&quot; length=&quot;0.1&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference = &quot;mount_link&quot;&gt; &lt;material&gt; Gazebo/Black&lt;/material&gt; &lt;/gazebo&gt; &lt;!-- defining xacro style for repeating elements --&gt; &lt;xacro:macro name=&quot;wheel&quot; params=&quot;name path x y&quot;&gt; &lt;joint name=&quot;<span class="math-container">${name}_wheel_joint" type="continuous"&gt; &lt;parent link="Chassis"/&gt; &lt;child link="$</span>{name}_wheel&quot;/&gt; &lt;origin xyz=&quot;<span class="math-container">${x} $</span>{y} 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;<span class="math-container">${name}_wheel"&gt; &lt;inertial&gt; &lt;mass value="0.5"/&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;inertia ixx="0.00042" ixy="0.0" ixz="0.0" iyy="0.00014" iyz="0.0" izz="0.00063" /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename="$</span>{path}&quot; scale=&quot;0.005 0.005 0.005&quot;/&gt; #length = 0.018 radius = &quot;0.066&quot; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;1.0 0.0 0.0 1.0&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;mesh filename=&quot;${path}&quot; scale=&quot;0.005 0.005 0.005&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference = &quot;${name}_wheel&quot;&gt; &lt;material&gt; Gazebo/Red &lt;/material&gt; &lt;/gazebo&gt; &lt;/xacro:macro&gt; &lt;!-- wheel creating using macros --&gt; &lt;xacro:wheel name = &quot;front_left&quot; path =&quot;package://mobile_robot/meshes/right_tire.stl&quot; x = &quot;0.187&quot; y = &quot;0.25&quot;/&gt; &lt;xacro:wheel name = &quot;front_right&quot; path =&quot;package://mobile_robot/meshes/left_tire.stl&quot; x = &quot;0.187&quot; y = &quot;-0.25&quot;/&gt; &lt;xacro:wheel name = &quot;rear_left&quot; path =&quot;package://mobile_robot/meshes/right_tire.stl&quot; x = &quot;-0.187&quot; y = &quot;0.25&quot;/&gt; &lt;xacro:wheel name = &quot;rear_right&quot; path =&quot;package://mobile_robot/meshes/left_tire.stl&quot; x = &quot;-0.187&quot; y = &quot;-0.25&quot;/&gt; &lt;!-- camera/sensor mount --&gt; &lt;joint name=&quot;lidar_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;mount_link&quot;/&gt; &lt;child link=&quot;lidar_link&quot;/&gt; &lt;origin xyz=&quot;0.0 0.0 0.1&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;axis xyz=&quot;0.0 0.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;lidar_link&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;cylinder radius=&quot;0.08&quot; length=&quot;0.1&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.0 0.0 0.8 1.0&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;cylinder radius=&quot;0.08&quot; length=&quot;0.1&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;0.1&quot;/&gt; &lt;origin xyz=&quot;0.0 0.0 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;inertia ixx=&quot;0.00024&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.00024&quot; iyz=&quot;0.0&quot; izz=&quot;0.00005&quot; /&gt; &lt;/inertial&gt; &lt;sensor name = &quot;laser&quot; type = &quot;ray&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;10&lt;/update_rate&gt; &lt;ray&gt; &lt;scan&gt; &lt;horizontal&gt; &lt;samples&gt;360&lt;/samples&gt; &lt;resolution&gt;1&lt;/resolution&gt; &lt;min_angle&gt;-2.356194&lt;/min_angle&gt; &lt;!-- -135 degrees in radians --&gt; &lt;max_angle&gt;2.356194&lt;/max_angle&gt; &lt;!-- 135 degrees in radians --&gt; &lt;/horizontal&gt; &lt;/scan&gt; &lt;range&gt; &lt;min&gt;0.02&lt;/min&gt; &lt;!-- Minimum range in meters --&gt; &lt;max&gt;15.0&lt;/max&gt; &lt;!-- Maximum range in meters --&gt; &lt;resolution&gt;0.01&lt;/resolution&gt; &lt;!-- Range resolution in meters --&gt; &lt;/range&gt; &lt;/ray&gt; &lt;plugin name=&quot;laser&quot; filename=&quot;libgazebo_ros_ray_sensor.so&quot;&gt; &lt;ros&gt; &lt;argument&gt;~/out:=scan&lt;/argument&gt; &lt;/ros&gt; &lt;output_type&gt;sensor_msgs/LaserScan&lt;/output_type&gt; &lt;frame_name&gt;lidar_link&lt;/frame_name&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/link&gt; &lt;gazebo reference = &quot;lidar_link&quot;&gt; &lt;material&gt; Gazebo/Blue &lt;/material&gt; &lt;/gazebo&gt; </code></pre> <p>` this is my gazebo.launch file</p> <p>` </p> <pre><code>&lt;param name=&quot;robot_description&quot; command=&quot;xacro '<span class="math-container">$(find mobile_robot)/urdf/rover.urdf.xacro'"/&gt; &lt;arg name="rviz_config_file" default="$</span>(find mobile_robot)/config/robot_config.rviz&quot;/&gt; &lt;node pkg=&quot;robot_state_publisher&quot; type=&quot;robot_state_publisher&quot; name=&quot;robot_state_publisher&quot; output = &quot;screen&quot;/&gt; &lt;node pkg=&quot;joint_state_publisher_gui&quot; type=&quot;joint_state_publisher_gui&quot; name=&quot;joint_state_publisher_gui&quot;/&gt; &lt;node pkg=&quot;rviz&quot; type=&quot;rviz&quot; name=&quot;rviz&quot; args = &quot;-d $(arg rviz_config_file)&quot;/&gt; &lt;include file=&quot;$(find gazebo_ros)/launch/empty_world.launch&quot;&gt; &lt;arg name=&quot;use_sim_time&quot; value=&quot;true&quot;/&gt; &lt;/include&gt; &lt;node name=&quot;spawning_urdf&quot; pkg=&quot;gazebo_ros&quot; type=&quot;spawn_model&quot; args = &quot;-urdf -model rover -param robot_description&quot; /&gt; </code></pre> <p>`</p> <p>this is my rostopic list command output</p> <p>*/clicked_point /clock /gazebo/link_states /gazebo/model_states /gazebo/parameter_descriptions /gazebo/parameter_updates /gazebo/performance_metrics /gazebo/set_link_state /gazebo/set_model_state /initialpose /joint_states /move_base_simple/goal /rosout /rosout_agg /tf /tf_static * and this is the image of gazebo <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16893151778064401.png" alt="image description" /></p> <p>And i want to drive it using diff_drive_controller, how can i do that?</p> <hr /> <p><a href="https://answers.ros.org/question/417431/laser_scan(/scan)-topic-not-showing-and-driving-4wheel-bot-using-diff_drive_controller/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/109236/the_one/" rel="nofollow noreferrer">the_one</a> on ROS Answers with karma: 41 on 2023-07-14</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-07-15</strong>:<br /> I suggest that you look at a project like turtlebot3 that already has all these things implemented. You can even download a complete world &amp; simulation if you want to.</p> <p><a href="https://wiki.ros.org/turtlebot3_simulations" rel="nofollow noreferrer">https://wiki.ros.org/turtlebot3_simulations</a></p>
laser_scan(/scan) topic not showing and driving 4wheel bot using diff_drive_controller
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>i changed the wheel tag like this</p> <pre><code> &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;<span class="math-container">${path}" scale="0.005 0.005 0.005"/&gt; &lt;/geometry&gt; &lt;material name=""&gt; &lt;color rgba="1.0 0.0 0.0 1.0"/&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="$</span>{radius}&quot; length=&quot;${length}&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; </code></pre> <p>it solved both the issue. Hope it helps someone in the future someone facing the same problem.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/109236/the_one/" rel="nofollow noreferrer">the_one</a> with karma: 41 on 2023-07-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103421
2023-07-17T04:26:59.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello everyone, So i am having this error</p> <pre><code>[ERROR] [1689583588.994400924, 0.150000000]: Wheel link front_left_wheel is NOT modeled as a cylinder or sphere! [ERROR] [1689583588.994569868, 0.150000000]: Couldn't retrieve front_left_wheel_joint wheel radius [ERROR] [1689583588.994729367, 0.150000000]: Failed to initialize the controller [ERROR] [1689583588.995644288, 0.150000000]: Initializing controller 'my_rover_diff_drive_controller' failed [ERROR] [1689583590.002104, 0.353000]: Failed to load my_rover_diff_drive_controller </code></pre> <p>when i run the launch file.... the wheel part is i added a mesh file instead of cylinder or sphere. the diff_drive_controller part i don't have any idea about why that error showing... I will attach my files below for your reference...</p> <p>rover.urdf</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;my_rover&quot;&gt; &lt;xacro:property name=&quot;constant&quot; value = &quot;0.083333333&quot;/&gt; #1/12 &lt;xacro:property name=&quot;mass&quot; value = &quot;0.5&quot;/&gt; &lt;xacro:property name=&quot;width&quot; value = &quot;0.75&quot;/&gt; &lt;xacro:property name=&quot;height&quot; value = &quot;0.15&quot;/&gt; &lt;xacro:property name=&quot;depth&quot; value = &quot;0.4&quot;/&gt; &lt;xacro:property name=&quot;radius&quot; value = &quot;0.033&quot;/&gt; &lt;xacro:property name=&quot;length&quot; value = &quot;0.018&quot;/&gt; &lt;!-- rover base link --&gt; &lt;link name=&quot;world&quot;/&gt; &lt;joint name=&quot;Chassis_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;world&quot;/&gt; &lt;child link=&quot;Chassis&quot;/&gt; &lt;origin xyz=&quot;0.0 0.0 0.135&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;axis xyz=&quot;0.0 0.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;Chassis&quot;&gt; &lt;inertial&gt; &lt;mass value=&quot;0.5&quot;/&gt; &lt;origin xyz=&quot;0.0 0.0 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;inertia ixx=&quot;0.007601&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.03009&quot; iyz=&quot;0.0&quot; izz=&quot;0.024365&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;geometry&gt; &lt;box size=&quot;0.75 0.4 0.15&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;1.0 0.3 0.1 1.0&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.75 0.4 0.15&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference = &quot;Chassis&quot;&gt; &lt;material&gt; Gazebo/Orange &lt;/material&gt; &lt;/gazebo&gt; &lt;!-- camera/sensor mount --&gt; &lt;joint name=&quot;mount_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;Chassis&quot;/&gt; &lt;child link=&quot;mount_link&quot;/&gt; &lt;origin xyz=&quot;0.2 0.0 0.124&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;axis xyz=&quot;0.0 0.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;mount_link&quot;&gt; &lt;inertial&gt; &lt;mass value=&quot;0.0&quot;/&gt; &lt;origin xyz=&quot;0.0 0.0 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;inertia ixx=&quot;0.0&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.0&quot; iyz=&quot;0.0&quot; izz=&quot;0.0&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;geometry&gt; &lt;cylinder radius=&quot;0.08&quot; length=&quot;0.1&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.0 0.0 0.0 1.0&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;cylinder radius=&quot;0.08&quot; length=&quot;0.1&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference = &quot;mount_link&quot;&gt; &lt;material&gt; Gazebo/Black&lt;/material&gt; &lt;/gazebo&gt; &lt;!-- defining xacro style for repeating elements --&gt; &lt;xacro:macro name=&quot;wheel&quot; params=&quot;name path x y&quot;&gt; &lt;joint name=&quot;<span class="math-container">${name}_wheel_joint" type="continuous"&gt; &lt;parent link="Chassis"/&gt; &lt;child link="$</span>{name}_wheel&quot;/&gt; &lt;origin xyz=&quot;<span class="math-container">${x} $</span>{y} 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;<span class="math-container">${name}_wheel"&gt; &lt;inertial&gt; &lt;mass value="0.5"/&gt; &lt;origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/&gt; &lt;inertia ixx="0.00042" ixy="0.0" ixz="0.0" iyy="0.00014" iyz="0.0" izz="0.00063" /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename="$</span>{path}&quot; scale=&quot;0.005 0.005 0.005&quot;/&gt; #length = 0.018 radius = &quot;0.066&quot; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;1.0 0.0 0.0 1.0&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;mesh filename=&quot;${path}&quot; scale=&quot;0.005 0.005 0.005&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference = &quot;${name}_wheel&quot;&gt; &lt;material&gt; Gazebo/Red &lt;/material&gt; &lt;mu1 value=&quot;200.0&quot;/&gt; &lt;mu2 value=&quot;100.0&quot;/&gt; &lt;kp value=&quot;10000000.0&quot; /&gt; &lt;kd value=&quot;1.0&quot; /&gt; &lt;/gazebo&gt; &lt;transmission name=&quot;<span class="math-container">${name}_wheel_trans"&gt; &lt;type&gt;transmission_interface/SimpleTransmission&lt;/type&gt; &lt;actuator name="$</span>{name}_wheel_motor&quot;&gt; &lt;mechanicalReduction&gt;1&lt;/mechanicalReduction&gt; &lt;/actuator&gt; &lt;joint name=&quot;${name}_wheel_joint&quot;&gt; &lt;hardwareInterface&gt;hardware_interface/VelocityJointInterface&lt;/hardwareInterface&gt; &lt;/joint&gt; &lt;/transmission&gt; &lt;/xacro:macro&gt; &lt;!-- wheel creating using macros --&gt; &lt;xacro:wheel name = &quot;front_left&quot; path =&quot;package://mobile_robot/meshes/right_tire.stl&quot; x = &quot;0.187&quot; y = &quot;0.25&quot;/&gt; &lt;xacro:wheel name = &quot;front_right&quot; path =&quot;package://mobile_robot/meshes/left_tire.stl&quot; x = &quot;0.187&quot; y = &quot;-0.25&quot;/&gt; &lt;xacro:wheel name = &quot;rear_left&quot; path =&quot;package://mobile_robot/meshes/right_tire.stl&quot; x = &quot;-0.187&quot; y = &quot;0.25&quot;/&gt; &lt;xacro:wheel name = &quot;rear_right&quot; path =&quot;package://mobile_robot/meshes/left_tire.stl&quot; x = &quot;-0.187&quot; y = &quot;-0.25&quot;/&gt; &lt;/robot&gt; </code></pre> <p>this is my diff_drive_controller.yaml file</p> <pre><code> type: &quot;diff_drive_controller/DiffDriveController&quot; publish_rate: 50 left_wheel: ['front_left_wheel_joint', 'rear_left_wheel_joint'] right_wheel: ['front_right_wheel_joint', 'rear_right_wheel_joint'] wheel_separation: 0.4 pose_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03] twist_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03] # Top level frame (link) of the robot description base_frame_id: Chassis # Velocity and acceleration limits for the robot linear: x: has_velocity_limits : true max_velocity : 0.2 # m/s has_acceleration_limits: true max_acceleration : 0.6 # m/s^2 angular: z: has_velocity_limits : true max_velocity : 2.0 # rad/s has_acceleration_limits: true max_acceleration : 6.0 # rad/s^2 </code></pre> <p>gazebo.launch file</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;launch&gt; &lt;rosparam file=&quot;$(find mobile_robot)/config/diff_drive_controller.yaml&quot; command=&quot;load&quot; ns = &quot;my_rover_diff_drive_controller&quot;/&gt; &lt;rosparam file=&quot;$(find mobile_robot)/config/joint_state_controller.yaml&quot; command=&quot;load&quot; ns = &quot;my_rover_joint_state_controller&quot;/&gt; &lt;param name=&quot;robot_description&quot; command=&quot;xacro '$(find mobile_robot)/urdf/rover.urdf.xacro'&quot;/&gt; &lt;arg name=&quot;rviz_config_file&quot; default=&quot;$(find mobile_robot)/config/robot_config.rviz&quot;/&gt; &lt;node name=&quot;my_rover_controller_spawner&quot; pkg=&quot;controller_manager&quot; type=&quot;spawner&quot; args=&quot; my_rover_joint_state_controller my_rover_diff_drive_controller&quot; /&gt; &lt;node pkg=&quot;robot_state_publisher&quot; type=&quot;robot_state_publisher&quot; name=&quot;robot_state_publisher&quot; output = &quot;screen&quot;/&gt; &lt;node pkg=&quot;rviz&quot; type=&quot;rviz&quot; name=&quot;rviz&quot; args = &quot;-d $(arg rviz_config_file)&quot;/&gt; &lt;include file=&quot;$(find gazebo_ros)/launch/empty_world.launch&quot;&gt; &lt;arg name=&quot;paused&quot; default=&quot;false&quot;/&gt; &lt;arg name=&quot;use_sim_time&quot; default=&quot;true&quot;/&gt; &lt;arg name=&quot;gui&quot; default=&quot;true&quot;/&gt; &lt;arg name=&quot;headless&quot; default=&quot;false&quot;/&gt; &lt;arg name=&quot;debug&quot; default=&quot;false&quot;/&gt; &lt;/include&gt; &lt;node name=&quot;spawning_lidar&quot; pkg=&quot;gazebo_ros&quot; type=&quot;spawn_model&quot; args=&quot;-urdf -param robot_description -model my_rover&quot; /&gt; &lt;node name=&quot;rqt_robot_steering&quot; pkg=&quot;rqt_robot_steering&quot; type=&quot;rqt_robot_steering&quot;&gt; &lt;param name=&quot;default_topic&quot; value=&quot;/my_rover/cmd_vel&quot;/&gt; &lt;/node&gt; &lt;/launch&gt; </code></pre> <p>how can i solve those? what did i do wrong?</p> <hr /> <p><a href="https://answers.ros.org/question/417490/wheel-link-is-not-modeled-as-a-cylinder-or-sphere/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/109236/the_one/" rel="nofollow noreferrer">the_one</a> on ROS Answers with karma: 41 on 2023-07-17</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/109236/the_one/" rel="nofollow noreferrer">the_one</a> on 2023-07-18</strong>:<br /> I changed the wheel tag like this</p> <pre><code>&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;cylinder radius=&quot;<span class="math-container">${radius}" length="$</span>{length}&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; </code></pre> <p>it solved both the issue. But i face this issue in robot model in rviz for the world status like this &quot;No transform [world] to [odom]&quot;. the bot is moving in rviz when i change the rqt_steering console, but the bot don't move in gazebo(wheels are running). And the generated view_frames.pdf file don't have world frame even tho i gave the link in urdf file.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> on 2023-07-18</strong>:<br /> Hi!</p> <p>Glad you solved! Please post the solution to the original issue as an <strong>answer</strong> instead of a comment. Then open a new question for the new issue you have found.</p>
Wheel link is not modeled as a cylinder or sphere
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Yes, this is expected. As the odometry of your robot drifts (see this answer for more details: <a href="https://answers.ros.org/question/188882/why-can-the-odom-frame-drift/?answer=188887#post-id-188887" rel="nofollow noreferrer">https://answers.ros.org/question/188882/why-can-the-odom-frame-drift/?answer=188887#post-id-188887</a>) the robot-localization package starts to compensate for the drift and therefore &quot;map&quot; and &quot;odom&quot; frames will diverge.</p> <p>If the final position error is acceptable for your application, then I would say your robot localization is configured properly, although there is always room for improvement.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/1108/martin-peris/" rel="nofollow noreferrer">Martin Peris</a> with karma: 5625 on 2023-07-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on 2023-07-19</strong>:<br /> Thanks for the clear explanation!</p>
103423
2023-07-17T08:36:48.000
|ros|ros2|transform|tf2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello all,</p> <p>Recently, I am using the robot-localization package to fuse all my sensors and does the localization for my robot. And as I was testing the localization result outdoors, I found something strange in rviz2.</p> <p>In this test, I made the robot move in a rectangular shape.<br /> In rviz2: The <em><strong>red</strong></em> arrow represents odometry topic on /odom/local; the <em><strong>green</strong></em> arrow represents odometry topic on /odom/global</p> <p>At first, the <strong>Odom tf</strong> and the <strong>Map tf is close</strong> to each other, as shown in picture 1.</p> <p>However, during the rectangular movement, the Odom tf began to <strong>move away</strong> from the Map tf, as show in picture 2,3</p> <p>In the end, I moved the robot back to where it started. Although both /odom/local and /odom/global (the red and green arrow) <strong>indicate that the robot is back to where it began</strong> (the origin in the map frame). But the Map tf and the Odom tf are <strong>far apart from each other.</strong></p> <p>Thus, I wonder if this is something expected? And if that is expected, does this mean that I have my robot-localization configured properly? In the end, both <strong>/odom/local</strong> and <strong>/odom/global</strong> indicate that my robot is <strong>only about 0.5 meters</strong> away from where it begins, which is acceptable to my requirement.</p> <h2>image 1</h2> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16896002824946944.png" alt="image description" /></p> <h2>image 2</h2> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16896002908875264.png" alt="image description" /></p> <h2>image 3</h2> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16896003088699626.png" alt="image description" /></p> <h2>image 4</h2> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16896003186387801.png" alt="image description" /></p> <hr /> <p><a href="https://answers.ros.org/question/417498/robot-localization:-odom-tf-is-far-offset-from-map-tf/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on ROS Answers with karma: 45 on 2023-07-17</p> <p>Post score: 0</p>
Robot localization: Odom tf is far offset from Map tf
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In the end, I've found a solution. Using a global variable <code>std::weak_ptr&lt;MyNode&gt; MyNode::instance_;</code>, I've initialized it in the main and registered it as a signal handler:</p> <pre><code>// Set the instance pointer to the shared pointer of the main node MyNode::setInstance(node); // Register the signal handler for SIGINT (CTRL+C) signal(SIGINT, MyNode::signalHandler); </code></pre> <p>before adding and spinning the node.</p> <p>I had to add some function to the node, of course:</p> <pre><code>class MyNode : public rclcpp::Node { public: std::atomic&lt;bool&gt; is_terminated_ {false}; void stopThread(); void startThread(); static void signalHandler(int signum); static std::shared_ptr&lt;MyNode&gt; getInstance(); static void setInstance(rclcpp::Node::SharedPtr instance); private: std::thread helping_thread_; static std::weak_ptr&lt;MyNode&gt; instance_; // Weak pointer to the instance of the node } void MyNode::setInstance(rclcpp::Node::SharedPtr instance) { instance_ = std::static_pointer_cast&lt;MyNode&gt;(instance); } std::shared_ptr&lt;MyNode&gt; MyNode::getInstance() { return instance_.lock(); } void MyNode::signalHandler(int signum) { // Stop the thread gracefully std::shared_ptr&lt;MyNode&gt; node = getInstance(); if (node) { node-&gt;stopThread(); } rclcpp::shutdown(); } void MyNode::startThread() { if (!this-&gt;helping_thread_.joinable()) { this-&gt;helping_thread_ = std::thread(&amp;MyNode::spawnedThread, this); } } void MyNode::stopThread() { if (this-&gt;helping_thread_.joinable()) { this-&gt;is_terminated_ = true; this-&gt;helping_thread_.join(); } } </code></pre> <p>where <code>spawnedThread</code> is the main function used in the additional thread.</p> <p>I don't really like using global variables and such, but for now this works as intended.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/145981/slim71/" rel="nofollow noreferrer">slim71</a> with karma: 18 on 2023-07-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103425
2023-07-17T12:51:33.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all! In my project I'm spawning a thread which contains a while loop, simply like so:</p> <pre><code>std::thread worker([this]() { this-&gt;ballotCheckingThread(); }); std::unique_lock&lt;std::mutex&gt; lock(this-&gt;candidate_mutex_); </code></pre> <p>where the thread code is like this</p> <pre><code>void ballotCheckingThread() { while (!this-&gt;checkVotingCompleted() &amp;&amp; !this-&gt;checkForExternalLeader()) { // Simulate some delay between checks std::this_thread::sleep_for(std::chrono::milliseconds(200)); } // Notify the first thread to stop waiting cv.notify_all(); } </code></pre> <p>Unfortunately, when I use CTRL-C to terminate the node, this thread remains hanging and I have to manually kill it.</p> <p>Right now in the main function I'm doing this:</p> <pre><code>int main(int argc, char *argv[]) { std::cout &lt;&lt; &quot;Starting node...&quot; &lt;&lt; std::endl; setvbuf(stdout, NULL, _IONBF, BUFSIZ); rclcpp::init(argc, argv); rclcpp::Node::SharedPtr node = std::make_shared&lt;myNode&gt;(); rclcpp::executors::MultiThreadedExecutor executor; executor.add_node(node); try { executor.spin(); } catch (std::exception&amp; e) { std::cout &lt;&lt; &quot;rclcpp shutting down...&quot; &lt;&lt; std::endl; rclcpp::shutdown(); return 0; } } </code></pre> <p>but I guess that's not enough. Is there a standard way to do this?</p> <hr /> <p><a href="https://answers.ros.org/question/417513/%5Bros2%5D-close-all-threads-when-using-ctrl-c/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/145981/slim71/" rel="nofollow noreferrer">slim71</a> on ROS Answers with karma: 18 on 2023-07-17</p> <p>Post score: 0</p>
[ROS2] Close all threads when using CTRL-C
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Looking at the additional info posted, I think your second design more-or-less makes sense. You should not use <code>spin</code> though because that's intended to move program control to callbacks only, and it only ends when the node shuts down. Instead, you can create the subscription and then in the <code>while self.__var is None</code> loop you can call <code>spin_once</code> on an executor. This will let callbacks run but return control to you afterwards. I don't think you need a reentrant callback group or a multi-threaded executor in this scenario.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/2128/jdlangs/" rel="nofollow noreferrer">jdlangs</a> with karma: 971 on 2023-07-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/146607/s%C3%A9bastienl/" rel="nofollow noreferrer">SébastienL</a> on 2023-07-19</strong>:<br /> Thank you for the explanations. I tried to spin_once and it worked. I'll work with that on my real case.</p>
103427
2023-07-18T06:35:53.000
|ros|ros2|sleep|multi-thread|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I want to get a value from a topic and after perform some operations on the value retrieved (can't be in the callback function).</p> <p>I imagine a subscriber and this simple loop (python)</p> <pre><code>while self.__var is None: self.get_logger().info(&quot;__var has no value yet.&quot;) # wait </code></pre> <p>On my first attempt, I used <code>time.sleep</code> for the &quot;wait&quot;, which pause the whole Node, including the subscriber if I don't misunderstand. Then I used a callback_group to handle the subscription, it didn't work either. I read that time.sleep should never be used and prefer rate.sleep instead, inside another thread. So i tried this</p> <pre><code>def retrieve_value(self): self.__var = None # Spin in a separate thread thread = threading.Thread(target=rclpy.spin, args=(self, ), daemon=True) thread.start() self.get_logger().info(&quot;thread starts.&quot;) rate = self.create_rate(1) self.__sub_var = self.create_subscription( String, f'/var_values', self.__set_var_value, # simply self.__var = msg.data 10, callback_group=self.__listener_cb_grp ) while self.__var is None: self.get_logger().info(&quot;¤¤¤__var has not value yet.&quot;) rate.sleep() # rclpy.shutdown() # the node crash if uncomment and the node seem to stop when commented self.get_logger().info(&quot;thread stops.&quot;) thread.join() </code></pre> <p>Last I used a MultiThreadedExecutor and it still did not work. Obviously I don't understand the thread management here.</p> <p>Can someone help me ?</p> <hr /> <p><a href="https://answers.ros.org/question/417525/i%27m-confused-with-callback_groups-and-threads/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/146607/s%C3%A9bastienl/" rel="nofollow noreferrer">SébastienL</a> on ROS Answers with karma: 32 on 2023-07-18</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/2128/jdlangs/" rel="nofollow noreferrer">jdlangs</a> on 2023-07-18</strong>:<br /> Can you provide the full program context? How is <code>retrieve_value</code> being run?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/146607/s%C3%A9bastienl/" rel="nofollow noreferrer">SébastienL</a> on 2023-07-19</strong>:<br /> I'll post more code. I suspect I did not understand how ROS2 nodes are supposed to be used.</p>
I'm confused with callback_groups and threads
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi!</p> <p>There is an open <a href="https://github.com/AprilRobotics/apriltag_ros/issues/153" rel="nofollow noreferrer">issue</a> on the <code>apriltag_ros</code> GitHub repo. I suggest you subscribe to the issue, so to receive notifications if there is any update.</p> <p>For the sake of completeness, I report here what, to date, is stated in the GitHub issue:</p> <ul> <li><p>If you do not need to publish the image with the result, you can go to <code>continuous_detector.cpp</code> and set <code>draw_tag_detections_image_</code> to false. You will not get the annotated image anymore, but you can still get the detection without the node to crash.</p> </li> <li><p>If you have built the <code>apriltag_ros</code> package from source, you may try to install it via <code>apt</code> as the released version does not -reportedly- have this issue.</p> </li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> with karma: 221 on 2023-07-27</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103429
2023-07-19T02:03:43.000
|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hey everyone, why does apriltag_ros continuous_detection.launch process died when it detects a required tag? I am using a intel realsense d435 camera trying to setup apriltag detection. Running on Ubuntu 18.04 in a conda env using python 3.8.17.</p> <p>Issue: When I show a tag to the camera that is required to be detected the process instantly died.</p> <pre><code>[apriltag_ros_continuous_node-2] process has died [pid 1454, exit code -11, cmd /home/ubuntu/apriltag_ws/devel/lib/apriltag_ros/apriltag_ros_continuous_node image_rect:=/Front_D435/color/image_raw camera_info:=/Front_D435/color __name:=apriltag_ros_continuous_node __log:=/home/ubuntu/.ros/log/bb93716c-25fe-11ee-813e-14857f44b28b/apriltag_ros_continuous_node-2.log]. log file: /home/ubuntu/.ros/log/bb93716c-25fe-11ee-813e-14857f44b28b/apriltag_ros_continuous_node-2*.log </code></pre> <p>But it is able to detect tags that are not required.</p> <pre><code>[ WARN] [1689749511.600538788]: Requested description of standalone tag ID [26], but no description was found... </code></pre> <h2>My config files:</h2> <p>tags.yaml</p> <pre><code>standalone_tags: [ {id: 0, size: 0.4}, {id: 1, size: 0.4}, {id: 2, size: 0.4}, {id: 3, size: 0.4}, {id: 4, size: 0.4}, {id: 5, size: 0.4}, {id: 6, size: 0.4}, {id: 7, size: 0.4}, {id: 8, size: 0.4}, {id: 9, size: 0.4}, {id: 10, size: 0.4}, {id: 11, size: 0.4}, {id: 12, size: 0.4}, {id: 13, size: 0.4}, {id: 14, size: 0.4}, {id: 15, size: 0.4}, {id: 16, size: 0.4}, {id: 17, size: 0.4}, {id: 18, size: 0.4} ] </code></pre> <p>settings.yaml</p> <pre><code># AprilTag 3 code parameters # Find descriptions in apriltag/include/apriltag.h:struct apriltag_detector # apriltag/include/apriltag.h:struct apriltag_family tag_family: 'tag36h11' # options: tagStandard52h13, tagStandard41h12, tag36h11, tag25h9, tag16h5, tagCustom48h12, tagCircle21h7, tagCircle49h12 tag_threads: 2 # default: 2 tag_decimate: 1.0 # default: 1.0 tag_blur: 0.0 # default: 0.0 tag_refine_edges: 1 # default: 1 tag_debug: 0 # default: 0 max_hamming_dist: 2 # default: 2 (Tunable parameter with 2 being a good choice - values &gt;=3 consume large amounts of memory. Choose the largest value possible.) # Other parameters publish_tf: true # default: false transport_hint: &quot;raw&quot; # default: raw, see http://wiki.ros.org/image_transport#Known_Transport_Packages for options </code></pre> <hr /> <p><a href="https://answers.ros.org/question/417551/apriltag_ros,-process-died-when-detected-required-tag/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/146276/rowbot/" rel="nofollow noreferrer">RowBot</a> on ROS Answers with karma: 35 on 2023-07-19</p> <p>Post score: 0</p>
apriltag_ros, process died when detected required tag
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>There are hundreds of robotics companies using this open source stack for their products. Look no further than the sponsors of ROSCon, folks on navigation.ros.org's robot's using page, or any number of other documents.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-07-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/163911/fengxianeric/" rel="nofollow noreferrer">FengxianEric</a> on 2023-07-24</strong>:<br /> Thanks support, in product view what is key advantages and disadvantages between ros1 and ros2 sw stack ?</p>
103431
2023-07-19T13:21:48.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi I can see open source robot solution (e.g., ros,opentcs...) and can search the chipset for demo robot, but I am doing industry mobile robot and thinking how far such kind of software from real-life product ? Thanks</p> <hr /> <p><a href="https://answers.ros.org/question/417583/how-far-is-the-open-source-software-stack-from-real-amr-product-?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/163911/fengxianeric/" rel="nofollow noreferrer">FengxianEric</a> on ROS Answers with karma: 1 on 2023-07-19</p> <p>Post score: 0</p>
How far is the open source software stack from real AMR product?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You should be using Nav2's action interface to request navigation commands which will provide you with feedback and ultimately a result once navigation is complete. You should not be monitoring topics or hacking into action server's internal topics.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-07-22</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103433
2023-07-21T07:01:19.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I am using ROS2 humble navigation2 package.</p> <p>I am now trying to check if the robot reached the goal by monitoring a specific topic.</p> <p>I found out that the length of message which goes to /plan topic reduces as it gets closer to the target goal.</p> <p>But I'd like to ask if there's better way to find out whether it reached a goal or not. Thank you!</p> <hr /> <p><a href="https://answers.ros.org/question/417628/which-nav2-topic-message-changes-when-reached-the-goal?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/126519/kenloumixx/" rel="nofollow noreferrer">kenloumixx</a> on ROS Answers with karma: 7 on 2023-07-21</p> <p>Post score: 0</p>
which Nav2 topic message changes when reached the goal?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>By wobble/bounce, do you mean a small movement at the robot's start position? If that is the case, it is probably because the offset from ground maybe too low, and the wheel of the robot rubs against the <a href="https://github.com/arpg/Gazebo/blob/master/models/ground_plane/model.sdf" rel="nofollow noreferrer">ground_plane</a> of the world, causing the weight shift. <br/></p> <pre><code>Node( package='gazebo_ros', executable='spawn_entity.py', arguments=[ '-topic', 'robot_description', '-entity', 'm2wr', '-x', '0', '-y', '0', '-z', '0.0' # No offset ], output='screen' ), </code></pre> <img src="https://github.com/leander-dsouza/atreus/assets/45683974/e794efb9-3618-4242-91bd-e424b1abd33b"/> <p>There is indeed a small bounce/wobble when you try calling the service with no offset</p> <p>To combat this, you could spawn the robot at a small offset from the origin (say 5cm):</p> <pre><code>Node( package='gazebo_ros', executable='spawn_entity.py', arguments=[ '-topic', 'robot_description', '-entity', 'm2wr', '-x', '0', '-y', '0', '-z', '0.05' # Minimal offset ], output='screen' ), </code></pre> <img src="https://github.com/leander-dsouza/atreus/assets/45683974/aead4534-2d6f-4c62-8b29-403bb0edc355"/> <p>As indicated above, <strong>spawning at a minimal offset removes all bounce</strong>.</p> <h2>Note</h2> <ul> <li><p>If you want to reset only the robot without resetting all the poses of the models in the simulation, you can use the <code>/set_entity_state</code> service after adding the following block to your world file:</p> <p>Snippet to be added to your world:</p> <pre><code> &lt;plugin name=&quot;gazebo_ros_state&quot; filename=&quot;libgazebo_ros_state.so&quot;&gt; &lt;ros&gt; &lt;namespace&gt;/&lt;/namespace&gt; &lt;remapping&gt;model_states:=model_states_demo&lt;/remapping&gt; &lt;remapping&gt;link_states:=link_states_demo&lt;/remapping&gt; &lt;/ros&gt; &lt;update_rate&gt;50.0&lt;/update_rate&gt; &lt;/plugin&gt; </code></pre> </li> </ul> <p>ROS2 Service Call:</p> <pre><code> ros2 service call /set_entity_state gazebo_msgs/SetEntityState &quot;state: {name: m2wr, pose: {position: {x: 0.0, y: 0.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}, reference_frame: world}&quot; </code></pre> <br/> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/72874/gaurav-gupta/" rel="nofollow noreferrer">Gaurav Gupta</a> with karma: 276 on 2023-07-26</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103435
2023-07-24T16:54:33.000
|ros|gazebo|ros2|service|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, I am trying to reset a model to it's original position but when I call the &quot;/reset_world&quot; service (without a large time delay with time.sleep) the model bounces in the air. Any help to prevent this bounce/ wobble would be appreciated as many resets will be needed in the simulation (after every episode for Q-Learning) so it would save a lot of time. (Below is the code for controlling the model and resetting the simulation as well as the URDF)</p> <pre><code>for episode in range(5000): episode_rewards = 0 rclpy.spin_once(self.imu_sub) self.observation = self.imu_sub.get_latest_observation() while(not self.is_episode_finished()): current_state = self.discretise_observation() action = self.choose_action(current_state) self.cmd_vel_pub.publish(action) #move_robot() rclpy.spin_once(self.imu_sub) self.observation = self.imu_sub.get_latest_observation() new_state = self.discretise_observation() reward = self.get_reward(new_state[0]) episode_rewards += reward lr = self.get_learning_rate(episode+1) self.Q_table[current_state][action] = self.Q_table[current_state][action] + lr * (reward + self.DISCOUNT_FACTOR * np.max(self.Q_table[new_state]) - self.Q_table[current_state][action]) self.get_logger().info(f&quot;{episode}| Episode rewards: {episode_rewards}&quot;) self.epsilon = max(0.01, self.epsilon * self.epsilon_decay) self.all_rewards.append(episode_rewards) self.resetSim.send_request() class ResetSim(Node): def __init__(self): super().__init__(&quot;minimum_reset_client&quot;) self.client = self.create_client(Empty, &quot;/reset_world&quot;) while not self.client.wait_for_service(): self.get_logger().info(&quot;Service not available, waiting again...&quot;) self.req = Empty.Request() def send_request(self): self.future = self.client.call_async(self.req) rclpy.spin_until_future_complete(self, self.future) return self.future.result() &lt;robot name=&quot;m2wr&quot; xmlns:xacro=&quot;https://www.ros.org/wiki/xacro&quot; &gt; &lt;link name=&quot;link_chassis&quot;&gt; &lt;!-- pose and inertial --&gt; &lt;pose&gt;0 0 0 0 0 0&lt;/pose&gt; &lt;inertial&gt; &lt;mass value=&quot;5&quot;/&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&quot;0 0 0.1&quot;/&gt; &lt;inertia ixx=&quot;0.0395416666667&quot; ixy=&quot;0&quot; ixz=&quot;0&quot; iyy=&quot;0.106208333333&quot; iyz=&quot;0&quot; izz=&quot;0.106208333333&quot;/&gt; &lt;/inertial&gt; &lt;collision name=&quot;collision_chassis&quot;&gt; &lt;geometry&gt; &lt;box size=&quot;0.5 0.5 0.8&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;visual&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;box size=&quot;0.5 0.5 0.8&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;blue&quot;/&gt; &lt;/visual&gt; &lt;/link&gt; &lt;!-- Create wheel right --&gt; &lt;link name=&quot;link_right_wheel&quot;&gt; &lt;inertial&gt; &lt;mass value=&quot;0.2&quot;/&gt; &lt;origin rpy=&quot;0 1.5707 1.5707&quot; xyz=&quot;0 0 0&quot;/&gt; &lt;inertia ixx=&quot;0.00052666666&quot; ixy=&quot;0&quot; ixz=&quot;0&quot; iyy=&quot;0.00052666666&quot; iyz=&quot;0&quot; izz=&quot;0.001&quot;/&gt; &lt;/inertial&gt; &lt;collision name=&quot;link_right_wheel_collision&quot;&gt; &lt;origin rpy=&quot;0 1.5707 1.5707&quot; xyz=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;cylinder length=&quot;0.1&quot; radius=&quot;0.2&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;visual name=&quot;link_right_wheel_visual&quot;&gt; &lt;origin rpy=&quot;0 1.5707 1.5707&quot; xyz=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;cylinder length=&quot;0.1&quot; radius=&quot;0.2&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;/link&gt; &lt;!-- Joint for right wheel --&gt; &lt;joint name=&quot;joint_right_wheel&quot; type=&quot;continuous&quot;&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&quot;0 0.3 -0.4&quot;/&gt; &lt;child link=&quot;link_right_wheel&quot; /&gt; &lt;parent link=&quot;link_chassis&quot;/&gt; &lt;axis rpy=&quot;0 0 0&quot; xyz=&quot;0 -1 0&quot;/&gt; &lt;limit effort=&quot;10000&quot; velocity=&quot;1000&quot;/&gt; &lt;joint_properties damping=&quot;1.0&quot; friction=&quot;1.0&quot; /&gt; &lt;/joint&gt; &lt;!-- Left Wheel link --&gt; &lt;link name=&quot;link_left_wheel&quot;&gt; &lt;inertial&gt; &lt;mass value=&quot;0.2&quot;/&gt; &lt;origin rpy=&quot;0 1.5707 1.5707&quot; xyz=&quot;0 0 0&quot;/&gt; &lt;inertia ixx=&quot;0.00052666666&quot; ixy=&quot;0&quot; ixz=&quot;0&quot; iyy=&quot;0.00052666666&quot; iyz=&quot;0&quot; izz=&quot;0.001&quot;/&gt; &lt;/inertial&gt; &lt;collision name=&quot;link_left_wheel_collision&quot;&gt; &lt;origin rpy=&quot;0 1.5707 1.5707&quot; xyz=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;cylinder length=&quot;0.1&quot; radius=&quot;0.2&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;visual name=&quot;link_left_wheel_visual&quot;&gt; &lt;origin rpy=&quot;0 1.5707 1.5707&quot; xyz=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;cylinder length=&quot;0.1&quot; radius=&quot;0.2&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;/link&gt; &lt;!-- Joint for right wheel --&gt; &lt;joint name=&quot;joint_left_wheel&quot; type=&quot;continuous&quot;&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&quot;0 -0.3 -0.4&quot;/&gt; &lt;child link=&quot;link_left_wheel&quot; /&gt; &lt;parent link=&quot;link_chassis&quot;/&gt; &lt;axis rpy=&quot;0 0 0&quot; xyz=&quot;0 1 0&quot;/&gt; &lt;limit effort=&quot;10000&quot; velocity=&quot;1000&quot;/&gt; &lt;joint_properties damping=&quot;1.0&quot; friction=&quot;1.0&quot; /&gt; &lt;/joint&gt; &lt;gazebo&gt; &lt;plugin name=&quot;differential_drive_controller&quot; filename=&quot;libgazebo_ros_diff_drive.so&quot;&gt; &lt;update_rate&gt;20&lt;/update_rate&gt; &lt;left_joint&gt;joint_left_wheel&lt;/left_joint&gt; &lt;right_joint&gt;joint_right_wheel&lt;/right_joint&gt; &lt;wheel_separation&gt;0.4&lt;/wheel_separation&gt; &lt;wheel_diameter&gt;0.2&lt;/wheel_diameter&gt; &lt;wheel_torque&gt;0.1&lt;/wheel_torque&gt; &lt;command_topic&gt;cmd_vel&lt;/command_topic&gt; &lt;odometry_topic&gt;odom&lt;/odometry_topic&gt; &lt;odometry_frame&gt;odom&lt;/odometry_frame&gt; &lt;robot_base_frame&gt;link_chassis&lt;/robot_base_frame&gt; &lt;/plugin&gt; &lt;/gazebo&gt; &lt;gazebo reference=&quot;link_chassis&quot;&gt; &lt;sensor name=&quot;my_imu&quot; type=&quot;imu&quot;&gt; &lt;always_on&gt;true&lt;/always_on&gt; &lt;!-- Publish at 30 hz --&gt; &lt;update_rate&gt;30&lt;/update_rate&gt; &lt;plugin name=&quot;my_imu_plugin&quot; filename=&quot;libgazebo_ros_imu_sensor.so&quot;&gt; &lt;ros&gt; &lt;!-- Will publish to /imu/data --&gt; &lt;namespace&gt;/imu&lt;/namespace&gt; &lt;remapping&gt;~/out:=data&lt;/remapping&gt; &lt;/ros&gt; &lt;frame_name&gt;link_chassis&lt;/frame_name&gt; &lt;initial_orientation_as_reference&gt;false&lt;/initial_orientation_as_reference&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; </code></pre> <hr /> <p><a href="https://answers.ros.org/question/417697/model-bounces-when-calling-the-%22reset_world%22-service-in-gazebo/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/77954/vertical_beef576/" rel="nofollow noreferrer">vertical_beef576</a> on ROS Answers with karma: 17 on 2023-07-24</p> <p>Post score: 0</p>
Model bounces when calling the "reset_world" service in gazebo
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The coordinate frames for mobile platforms are defined in <a href="https://www.ros.org/reps/rep-0105.html" rel="nofollow noreferrer">REP 105</a> including <code>base_link</code>. Which you appear to be following correctly. The most common location on ackermann vehicles is the center of the rear axle.</p> <p>I don't think that the problem that you're having is related to your coordinate frames.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2023-07-27</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/148408/timoth%C3%A9e/" rel="nofollow noreferrer">Timothée</a> on 2023-07-31</strong>:<br /> You are perfectly right, my problem was a combination of bad settings for my controller, and my node controlling the wheels not turning at the right speed so my robot could not follow the path. Now it does work well, without any changes in the tf tree.</p>
103437
2023-07-25T04:58:02.000
|ros|ros2|transform|tf2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, I am currently working with a physical, ackermann steering robot (car like). Right now my TF is setup with base_link on the ground between the two rear wheels. However, I notice strange behavior with navigation2, including trying to steer but not move. I then wondered whether my tf is setup correctly, maybe I need to give navigation 2 a link at the center of my robot, or between the two front wheels ? I didn't find anything online so I think it would be great to have something detailed on it. In navigation2 I use a MPPI controller with Reeds_Shepp motion model, the path seems to be correctly generated and every link in the parameters is setup to base_link. Also, base_link is setup as X forward,Y on the left and Z up, and I work on Humble. I hope someone will be able to help me, tell me if you need more info and I'll try to give them as fast as possible !</p> <hr /> <p><a href="https://answers.ros.org/question/417706/how-is-tf2-supposed-to-be-set-up-for-an-ackerman-steering-robot-with-navigation2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/148408/timoth%C3%A9e/" rel="nofollow noreferrer">Timothée</a> on ROS Answers with karma: 23 on 2023-07-25</p> <p>Post score: 0</p>
How is TF2 supposed to be set up for an Ackerman steering robot with Navigation2
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I solved it, it seems the open_loop parameter has to be false in order for the system to use the feedback.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/106635/ammar-albakri/" rel="nofollow noreferrer">Ammar Albakri</a> with karma: 31 on 2023-07-27</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103439
2023-07-25T06:22:06.000
|ros|ros2|hardware-interface|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Configuration:</p> <ul> <li>ROS 2 Distro: Humble</li> <li>OS Version: Ubuntu 22.04</li> </ul> <p>Hi there, I have a 2 wheeled robot with differential drive kinematics and odometry setup, I implemented <code>EKF</code> and added an IMU.</p> <p>The robot has an emergency button feature that cuts any velocity command sent to the motors (while <code>cmd_vel</code> is still publishing in the background). I am using a position and velocity <code>state_interface</code> and I made sure that the feedback is reaching the <code>diff drive</code> plugin.</p> <p>The problem is that my odometry twist values are taken directly from the <code>cmd_vel</code> topic, so even though the robot isn't moving the odometry keeps going on.</p> <p>How can I integrate my wheel velocity feedback with the <code>diff drive</code> plugin??</p> <p>ros2_control tag:</p> <pre><code>&lt;ros2_control name=&quot;${name}&quot; type=&quot;system&quot;&gt; &lt;hardware&gt; &lt;plugin&gt;amr_control/DiffDriveSystemHardware&lt;/plugin&gt; &lt;param name=&quot;wheel_radius&quot;&gt;0.098&lt;/param&gt; &lt;param name=&quot;wheel_seperation&quot;&gt;0.705&lt;/param&gt; &lt;/hardware&gt; &lt;joint name=&quot;left_wheel_joint&quot;&gt; &lt;command_interface name=&quot;velocity&quot;&gt; &lt;param name=&quot;min&quot;&gt;-1.5&lt;/param&gt; &lt;param name=&quot;max&quot;&gt;1.5&lt;/param&gt; &lt;/command_interface&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;right_wheel_joint&quot;&gt; &lt;command_interface name=&quot;velocity&quot;&gt; &lt;param name=&quot;min&quot;&gt;-1.5&lt;/param&gt; &lt;param name=&quot;max&quot;&gt;1.5&lt;/param&gt; &lt;/command_interface&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;/joint&gt; &lt;/ros2_control&gt; </code></pre> <p>HW Interface read Implementation:</p> <pre><code>hardware_interface::return_type DiffDriveSystemHardware::read(const rclcpp::Time &amp;time, const rclcpp::Duration &amp;period) { for (uint i = 0; i &lt; hw_commands_.size(); i++) { hw_positions_[i] = comms-&gt;getPosition(info_.joints[i].name.c_str()); hw_velocities_[i] = comms-&gt;getVelocity(info_.joints[i].name.c_str()); } return hardware_interface::return_type::OK; } </code></pre> <p>Example Scenario:</p> <pre><code>cmd_vel topic -&gt; linear.x = 0.5 real_motor -&gt; linear.x = 0.0 (because of the emergency stop) HW interface joint state -&gt; linear.x = 0.0 (reading from real hardware) diff_drive/odom -&gt; linear.x = 0.5 (same as cmd_vel) </code></pre> <hr /> <p><a href="https://answers.ros.org/question/417708/%5Bros2%5D-odometry-with-velocity-feedback/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/106635/ammar-albakri/" rel="nofollow noreferrer">Ammar Albakri</a> on ROS Answers with karma: 31 on 2023-07-25</p> <p>Post score: 0</p>
[ROS2] Odometry with Velocity feedback
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Solving QoS mismatch and compatibility issues when compiling depthimage_to_laserscan package for ROS2 Galactic</p> <p>The depthimage_to_laserscan package on the ros2 branch <strong>is not directly compatible with ROS2 distributions Galactic or later</strong> due to dependency errors related to image_geometry and rclcpp_components. Changes in the ROS2 API cause these errors.</p> <p>One solution is <strong>to compile the foxy-devel branch instead</strong>, which has been adapted to newer API changes and is confirmed to build successfully in Galactic. These modifications can be analyzed by comparing the ros2 and foxy-devel branches, as shown in this <a href="https://github.com/octocat/linguist/compare/master...octocat:an-example-comparison-for-docs" rel="nofollow noreferrer">comparison link</a>.</p> <p>However, even with these modifications, an additional problem can arise when running the nodes: <strong>mismatched</strong> the <strong>Quality of Service (QoS)</strong> settings for the depth camera plugin and the depthimage_to_laserscan package.</p> <p>The default Gazebo camera plugin publishes data with a &quot;<strong>Best Effort</strong>&quot; reliability policy, but the depthimage_to_laserscan package expects a &quot;<strong>Reliable</strong>&quot; QoS setting. This mismatch can be diagnosed by examining the QoS settings of the publishers and subscribers in the ROS system:</p> <pre><code> ros2 topic info -v /camera/depth/image_raw or </code></pre> <p>or</p> <pre><code> ros2 topic info -v /depthimage_to_laserscan/scan </code></pre> <p>Type: sensor_msgs/msg/LaserScan</p> <p>Publisher count: 1</p> <pre><code>Node name: depthimage_to_laserscan Node namespace: / Topic type: sensor_msgs/msg/LaserScan Endpoint type: PUBLISHER GID: 92.e2.10.01.7d.66.f8.f5.48.6d.4b.b3.00.00.17.03.00.00.00.00.00.00.00.00 QoS profile: Reliability: RELIABLE Durability: VOLATILE Lifespan: 9223372036854775807 nanoseconds Deadline: 9223372036854775807 nanoseconds Liveliness: AUTOMATIC Liveliness lease duration: 9223372036854775807 nanoseconds Subscription count: 1 Node name: rviz Node namespace: / Topic type: sensor_msgs/msg/LaserScan Endpoint type: SUBSCRIPTION GID: e7.0b.10.01.a6.72.90.06.d0.aa.e8.d8.00.00.62.04.00.00.00.00.00.00.00.00 QoS profile: Reliability: BEST_EFFORT Durability: VOLATILE Lifespan: 9223372036854775807 nanoseconds Deadline: 9223372036854775807 nanoseconds Liveliness: AUTOMATIC Liveliness lease duration: 9223372036854775807 nanoseconds </code></pre> <p>After modifying the source code &quot;<strong>DepthImageToLaserScanROS.cpp</strong>:</p> <pre><code>DepthImageToLaserScanROS::DepthImageToLaserScanROS(const rclcpp::NodeOptions &amp; options): rclcpp::Node(&quot;depthimage_to_laserscan&quot;, options){ // auto qos = rclcpp:: SystemDefaultsQoS(); // Changed because depth camera publisher does not use RELIABLE (default) QoS but BestEffort auto qos = rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default)); qos.reliability(rclcpp::ReliabilityPolicy::BestEffort); </code></pre> <p>, the workspace must be rebuilt using colcon build. The change should resolve the QoS mismatch and allow the depthimage_to_laserscan node to successfully subscribe to the depth camera images.</p> <p>A video displaying this fix working <a href="https://www.youtube.com/watch?v=vt7lEzhAsYU" rel="nofollow noreferrer">Depth to Scan</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/37882/vini71/" rel="nofollow noreferrer">Vini71</a> with karma: 266 on 2023-07-28</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103441
2023-07-25T18:25:46.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I am trying to convert a depth image to a laser scan using the <strong>depthimage_to_laserscan</strong> package in <strong>ROS2 Galactic,</strong> but I am having trouble getting the node to publish the converted LaserScan data. Despite being able to subscribe to the input depth image topic (/kinect_sensor/depth/image_raw), the node <strong>doesn't seem to be publishing</strong> the converted data to the /kinect_scan topic. Or the node is not properly doing its task: converting the data...</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16903273297195892.png" alt="image description" /></p> <p>Here's the launch file snippet for the depthimage_to_laserscan node:</p> <h1>Kinect depthimage to laserscan conversion node</h1> <pre><code>depthimage_to_laserscan_node = Node( package='depthimage_to_laserscan', executable='depthimage_to_laserscan_node', name='depthimage_to_laserscan', parameters=[kinect_params_file, {'use_sim_time': use_sim_time}], remappings=[('depth', '/kinect_sensor/depth/image_raw'), ('scan', '/kinect_scan')], output='screen') </code></pre> <p>And my <strong>kinect_params.yaml</strong> file:</p> <pre><code>depthimage_to_laserscan_node: ros__parameters: output_frame: kinect_depth_frame scan_height: 1 range_min: 0.45 range_max: 10.0 scan_topic: /kinect_scan </code></pre> <p>When I inspect the /depthimage_to_laserscan node using ros2 node info, it shows that the node subscribes to /kinect_sensor/depth/image_raw and publishes to /kinect_scan. However, when I echo the /kinect_scan topic, <strong>it is empty and produces no output</strong>.</p> <p>Here is a <a href="https://www.youtube.com/watch?v=zO1zfmNWjS4" rel="nofollow noreferrer">LINK</a> to a video demonstrating the issue.</p> <p>I have already tried changing the scan_topic to the original /scan topic in the parameter file and have also checked that the frame_id in the header of the depth image messages is consistent with the output_frame parameter, but these didn't solve the issue.</p> <p>Could anyone please help me to understand what might be going wrong and how to get the depthimage_to_laserscan node to publish the LaserScan data correctly?</p> <p>I am facing a similar issue and behavior using other packages <strong>image-proc</strong>, as related here: <a href="https://github.com/ros-perception/image_pipeline/issues/832" rel="nofollow noreferrer">https://github.com/ros-perception/image_pipeline/issues/832</a></p> <p>Thank you in advance for your help.</p> <hr /> <p><a href="https://answers.ros.org/question/417736/depth_image_to_laserscan-not-publishing-to-/kinect_scan-topic-in-ros2-galactic/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/37882/vini71/" rel="nofollow noreferrer">Vini71</a> on ROS Answers with karma: 266 on 2023-07-25</p> <p>Post score: 0</p>
depth_image_to_laserscan not publishing to /kinect_scan topic in ROS2 Galactic
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>First, and pedantic, but: Melodic is EOL. There is no support for it any more.</p> <p>As to your connection issue: I'd suggest to make sure you installed everything on the robot controller as well, and have started the TP programs on the Fanuc teach pendant. Without those programs, the ROS nodes will not be able to connect.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-07-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/166056/787500229/" rel="nofollow noreferrer">787500229</a> on 2023-07-30</strong>:<br /> Thank you, I noticed that Fanuc's TP program was not activated.</p>
103443
2023-07-26T10:04:14.000
|ros|fanuc|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi All,</p> <p>I'm having difficulty connecting to my fanuc robot with ROS Melodic. I followed this tutorial to configure &quot;http://wiki.ros.org/fanuc/Tutorials&quot;. When I send this command:</p> <pre><code>robot_interface_streaming.launch robot_ip:=192.168.20.22 J23_factor:=0 use_bswap:=true </code></pre> <p>I got this error:</p> <pre><code>Failed to connect to server, rc: -1. Error: 'Connection refused' (errno: 111) Failed to receive message lenth Failed to receive incoming message </code></pre> <p>when I <code>ping 192.168.20.22</code>, I received responses from the robot. So I don't know what went wrong, or did I configure something wrong? Does the operation of the Fanuc controller require any operation, which I do not know at this time.</p> <hr /> <p><a href="https://answers.ros.org/question/417753/failed-to-connect--to-server-(when-ros-is-connected-to-the-robot)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/166056/787500229/" rel="nofollow noreferrer">787500229</a> on ROS Answers with karma: 3 on 2023-07-26</p> <p>Post score: 0</p>
Failed to connect to server (When ROS is connected to the robot)
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>since it felt weird, to be sure, I been through the installation procedure</p> <p>I reinstalled ros-humble-ros-base package, it update or installed tons of packages</p> <p>while I am 100% sure I installed it before, I even wrote the procedure in my blog</p> <p>so you were right @billy. thx for your help, man !</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/51234/phil123456/" rel="nofollow noreferrer">phil123456</a> with karma: 51 on 2023-07-28</p> <p>This answer was <strong>NOT ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/26871/billy/" rel="nofollow noreferrer">billy</a> on 2023-07-28</strong>:<br /> No problem.</p>
103445
2023-07-27T12:14:45.000
|ros|build|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I am trying to build the examples from the tutorials</p> <p>I did precisely this</p> <pre><code>mkdir -p ros2_ws/src cd ros2_ws git clone https://github.com/ros2/examples src/examples -b foxy cd src colcon build --symlink-install </code></pre> <p>I get this</p> <pre><code>pi@ros-pi:~/WORK/ros2_ws$ colcon build --symlink-install Starting &gt;&gt;&gt; examples_rclcpp_async_client Starting &gt;&gt;&gt; examples_rclcpp_cbg_executor Starting &gt;&gt;&gt; examples_rclcpp_minimal_action_client Starting &gt;&gt;&gt; examples_rclcpp_minimal_action_server --- stderr: examples_rclcpp_minimal_action_client CMake Error at CMakeLists.txt:14 (find_package): By not providing &quot;Findexample_interfaces.cmake&quot; in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by &quot;example_interfaces&quot;, but CMake did not find one. Could not find a package configuration file provided by &quot;example_interfaces&quot; with any of the following names: example_interfacesConfig.cmake example_interfaces-config.cmake Add the installation prefix of &quot;example_interfaces&quot; to CMAKE_PREFIX_PATH or set &quot;example_interfaces_DIR&quot; to a directory containing one of the above files. If &quot;example_interfaces&quot; provides a separate development package or SDK, be sure it has been installed. --- Failed &lt;&lt;&lt; examples_rclcpp_minimal_action_client [4.11s, exited with code 1] Aborted &lt;&lt;&lt; examples_rclcpp_minimal_action_server [4.08s] Aborted &lt;&lt;&lt; examples_rclcpp_async_client [4.18s] Aborted &lt;&lt;&lt; examples_rclcpp_cbg_executor [8.65s] Summary: 0 packages finished [9.83s] 1 package failed: examples_rclcpp_minimal_action_client 3 packages aborted: examples_rclcpp_async_client examples_rclcpp_cbg_executor examples_rclcpp_minimal_action_server 3 packages had stderr output: examples_rclcpp_async_client examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server 18 packages not processed </code></pre> <hr /> <p><a href="https://answers.ros.org/question/417802/ros2---cannot-build-examples/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/51234/phil123456/" rel="nofollow noreferrer">phil123456</a> on ROS Answers with karma: 51 on 2023-07-27</p> <p>Post score: 0</p>
ROS2 - Cannot build examples
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Your catkin workspace &quot;remembers&quot; the things you previously sourced. Making it &quot;forget&quot; requires these steps, <strong>in this order</strong>:</p> <ul> <li>in your <code>catkin_ws</code>, delete the top-level <code>devel</code> and <code>build</code> directories</li> <li>source /opt/ros/noetic/setup.bash # only this one!</li> <li>run your <code>catkin_make</code> or <code>catkin build</code> command</li> <li>if the build succeeded, source devel/setup.bash</li> </ul> <p>People also call this &quot;doing a clean build&quot;.</p> <p>Note: in general it's unwise to modify your ROS_PACKAGE_PATH env variable in your ~/.bashrc file, but it is <strong>especially</strong> unwise when the path you are adding is already inside your <code>catkin_ws</code> directory.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-07-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75377/gts_63/" rel="nofollow noreferrer">gts_63</a> on 2023-07-30</strong>:<br /> Thank you. I noticed from the ROS wiki that ROS_PACKAGE_PATH doesn't need to be manually updated since catkin was introduced.</p>
103448
2023-07-27T14:17:09.000
|ros|build|ros-package-path|rospack|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>My system: Ubuntu 20.04, ROS noetic.</p> <p>My issue: I'm working with two packages that have ros1 packages with the same name ORB_SLAM3 which causes an issue with ROS_PACKAGE_PATH and thus with ROS finding the appropriate package to run. The packages I have installed are:</p> <ol> <li><a href="https://github.com/VIS4ROB-lab/covins" rel="nofollow noreferrer">https://github.com/VIS4ROB-lab/covins</a>. This package uses ORB-SLAM3 as a frontend and can also run on ROS1. Per the instructions on the page, I have this project installed in ~/ws/covins_ws. <a href="https://github.com/VIS4ROB-lab/covins/blob/master/docs/run_COVINS.md#run_ros" rel="nofollow noreferrer">Per the instructions on the section for ROS, I have sourced the file ~/ws/covins_ws/devel/setup.bash</a>.</li> <li>The ORB_SLAM3 package <a href="https://github.com/UZ-SLAMLab/ORB_SLAM3" rel="nofollow noreferrer">https://github.com/UZ-SLAMLab/ORB_SLAM3</a>, which originally is not a ROS package but offers an option to run on ROS as per <a href="https://github.com/UZ-SLAMLab/ORB_SLAM3#7-ros-examples" rel="nofollow noreferrer">section 7</a>.</li> </ol> <p>Where I run into an issue is when trying to build the ROS package for the second package above, specifically at the step <code>./build_ros.sh</code> with the following error message:</p> <pre><code>[rosbuild] Building package ORB_SLAM3 [rosbuild] Error from directory check: /opt/ros/noetic/share/ros/core/rosbuild/bin/check_same_directories.py /home/glenn/ws/covins_ws/src/covins/orb_slam3/Examples/ROS/ORB_SLAM3 /home/glenn/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3 1 Traceback (most recent call last): File &quot;/opt/ros/noetic/share/ros/core/rosbuild/bin/check_same_directories.py&quot;, line 48, in &lt;module&gt; raise Exception Exception CMake Error at /opt/ros/noetic/share/ros/core/rosbuild/private.cmake:99 (message): [rosbuild] rospack found package &quot;ORB_SLAM3&quot; at &quot;/home/glenn/ws/covins_ws/src/covins/orb_slam3/Examples/ROS/ORB_SLAM3&quot;, but the current directory is &quot;/home/glenn/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3&quot;. You should double-check your ROS_PACKAGE_PATH to ensure that packages are found in the correct precedence order. Call Stack (most recent call first): /opt/ros/noetic/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location) CMakeLists.txt:4 (rosbuild_init) </code></pre> <p>The error, as shown above, is because rospack find ORB_SLAM3 returns /home/glenn/ws/covins_ws/src/covins/orb_slam3/Examples/ROS/ORB_SLAM3 from package 1 above, even though I want it to find package 2.</p> <p><strong>My attempted solution:</strong></p> <p>Since I'm not currently using the first package, I choose not to source it (I used to have the line <code>source ~/ws/covins_ws/devel/setup.bash</code> in my .bashrc, but commented it out. ). The two lines I have in bashrc are to source my underlay and overlay (<code>source /opt/ros/noetic/setup.bash</code>, followed by <code>source /home/glenn/catkin_ws/devel/setup.bash</code>). Note, there are no ORB_SLAM3 packages in the catkin_ws folder. <a href="https://github.com/UZ-SLAMLab/ORB_SLAM3#7-ros-examples" rel="nofollow noreferrer">Per the instruction from ORB-SLAM3</a>, I also add the specfied path to the ROS_PACKAGE_PATH environment variable with the command <code>export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/glenn/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3</code> at the end of my bashrc (side note: the github says ORB_SLAM3/Examples, but the path to build ROS is actually in the Examples_old. I also modified the build script build_ros.sh to account for this).</p> <p>From here, when I type <code>echo $ROS_PACKAGE_PATH</code>, the output is:</p> <pre><code>/home/glenn/catkin_ws/src:/home/glenn/ws/covins_ws/src/catkin_simple:/home/glenn/ws/covins_ws/src/vision_opencv/cv_bridge:/home/glenn/ws/covins_ws/src/doxygen_catkin:/home/glenn/ws/covins_ws/src/eigen_catkin:/home/glenn/ws/covins_ws/src/gflags_catkin:/home/glenn/ws/covins_ws/src/glog_catkin:/home/glenn/ws/covins_ws/src/eigen_checks:/home/glenn/ws/covins_ws/src/minkindr/minkindr:/home/glenn/ws/covins_ws/src/opencv3_catkin:/home/glenn/ws/covins_ws/src/covins/covins_comm:/home/glenn/ws/covins_ws/src/covins/orb_slam3/Examples/ROS/ORB_SLAM3:/home/glenn/ws/covins_ws/src/covins/covins_frontend:/home/glenn/ws/covins_ws/src/opengv:/home/glenn/ws/covins_ws/src/protobuf_catkin:/home/glenn/ws/covins_ws/src/suitesparse/suitesparse:/home/glenn/ws/covins_ws/src/ceres_catkin:/home/glenn/ws/covins_ws/src/yaml_cpp_catkin:/home/glenn/ws/covins_ws/src/aslam_cv2/aslam_cv_common:/home/glenn/ws/covins_ws/src/aslam_cv2/aslam_cv_cameras:/home/glenn/ws/covins_ws/src/robopt_open:/home/glenn/ws/covins_ws/src/covins/covins_backend:/opt/ros/noetic/share:/home/glenn/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3 </code></pre> <p>where it shows home/glenn/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3 at the end, after /home/glenn/ws/covins_ws/src/covins/orb_slam3/Examples/ROS/ORB_SLAM3, thus it has a lower precedence, and when I type <code>rospack find ORB_SLAM3</code>, it returns the latter path.</p> <p>I then tried adding the path to the first package, after I echo the path to the second package in my bashrc with <code>export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/glenn/ws/covins_ws/src/covins/orb_slam3/Examples/ROS/ORB_SLAM3</code>.</p> <p>Now, the output of <code>echo $ROS_PACKAGE_PATH</code> is:</p> <pre><code>/home/glenn/catkin_ws/src:/home/glenn/ws/covins_ws/src/catkin_simple:/home/glenn/ws/covins_ws/src/vision_opencv/cv_bridge:/home/glenn/ws/covins_ws/src/doxygen_catkin:/home/glenn/ws/covins_ws/src/eigen_catkin:/home/glenn/ws/covins_ws/src/gflags_catkin:/home/glenn/ws/covins_ws/src/glog_catkin:/home/glenn/ws/covins_ws/src/eigen_checks:/home/glenn/ws/covins_ws/src/minkindr/minkindr:/home/glenn/ws/covins_ws/src/opencv3_catkin:/home/glenn/ws/covins_ws/src/covins/covins_comm:/home/glenn/ws/covins_ws/src/covins/orb_slam3/Examples/ROS/ORB_SLAM3:/home/glenn/ws/covins_ws/src/covins/covins_frontend:/home/glenn/ws/covins_ws/src/opengv:/home/glenn/ws/covins_ws/src/protobuf_catkin:/home/glenn/ws/covins_ws/src/suitesparse/suitesparse:/home/glenn/ws/covins_ws/src/ceres_catkin:/home/glenn/ws/covins_ws/src/yaml_cpp_catkin:/home/glenn/ws/covins_ws/src/aslam_cv2/aslam_cv_common:/home/glenn/ws/covins_ws/src/aslam_cv2/aslam_cv_cameras:/home/glenn/ws/covins_ws/src/robopt_open:/home/glenn/ws/covins_ws/src/covins/covins_backend:/opt/ros/noetic/share:/home/glenn/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3:/home/glenn/ws/covins_ws/src/covins/orb_slam3/Examples/ROS/ORB_SLAM3 </code></pre> <p>where it seems the order of precedence is correct. However, when I type <code>rospack find ORB_SLAM3</code>, it still returns /home/glenn/ws/covins_ws/src/covins/orb_slam3/Examples/ROS/ORB_SLAM3 as the path.</p> <p>Is there any way to fix this? Even when I don't source the setup.bash in the /ws/covins_ws folder, ROS still seems to be able to find this package and I can't get it to find the appropriate ORB_SLAM3 folder. Note, I have already built another ORB_SLAM3 package with a ros wrapper from <a href="https://github.com/zang09/ORB_SLAM3_ROS2" rel="nofollow noreferrer">here</a>, but due to some runtime issues with that one, I'm trying to run ROS from the original ORB_SLAM3 package.</p> <hr /> <p><a href="https://answers.ros.org/question/417812/issue-with-changing-the-precedence-order-of-ros_package_path/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/75377/gts_63/" rel="nofollow noreferrer">gts_63</a> on ROS Answers with karma: 15 on 2023-07-27</p> <p>Post score: 0</p>
Issue with changing the precedence order of ROS_PACKAGE_PATH
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Alright, turns out the problem was indeed easy. I was running my Jupyter Notebook from VS Code's built-in editor, which by default spawns its own Jupyter server.</p> <p>However, sourcing the colcon workspace overlay sets <code>$PYTHONPATH</code> such that Python can properly find colcon's packages. Starting the server from VS Code doesn't inherit that env var.</p> <p>It turns out the answer is simple: just start the notebook server from the terminal and have VS Code connect to it. Problem solved!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/166529/ari-reframe/" rel="nofollow noreferrer">ari-reframe</a> with karma: 21 on 2023-07-28</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103450
2023-07-27T15:55:16.000
|ros|colcon|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I've got a problem that I suspect is easy, but I absolutely can't figure out---any advice is much appreciated.</p> <p>Here's the situation: I have a standard ROS2/Colcon Python package (ie. basically fresh out of <code>ros2 pkg create</code>, built with <code>ament_python</code>). This package contains various Python files used in production.</p> <p>In addition, for prototyping purposes, I'd like to add a Jupyter notebook. I need the notebook to be able to import other files in the package and its dependencies. I don't care if the notebook is included in the build output or not. I don't mind running a build once (or if dependencies change), but I'd really like to avoid re-building every time I change the notebook or an imported file.</p> <p>I've tried various approaches involving modifications to <code>sys.path</code> inside the notebook, but I haven't been able to get anything to work. I think the <code>--symlink-install</code> flag to <code>colcon build</code> might also be helpful, but I'm not sure exactly how.</p> <hr /> <p><a href="https://answers.ros.org/question/417834/how-to-use-a-jupyter-notebook-with-colcon?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/166529/ari-reframe/" rel="nofollow noreferrer">ari-reframe</a> on ROS Answers with karma: 21 on 2023-07-27</p> <p>Post score: 1</p>
How to use a Jupyter Notebook with Colcon?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>There is a goal tolerance in the goal checker, that stops there because that's within tolerances of the goal as set so the task is considered complete.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-07-27</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/126519/kenloumixx/" rel="nofollow noreferrer">kenloumixx</a> on 2023-07-27</strong>:<br /> thank you for the response :) I modify the xy_goal_tolerance. In detail, I set it to 0.01 but it doesn't work and rather stops far before the goal with tolerance.</p>
103452
2023-07-27T20:56:30.000
|navigation|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I'm a newbie in robot field.</p> <p>I'm working with ROS2 humble's navigation2 package, and I'm running into the problem mentioned in title. I know that I can modify the xy_goal_tolerance parameter in the controller server and goal checker, but it doesn't work well.</p> <p>Thanks in advance :) Here is my parameter list:</p> <pre><code>amcl: ros__parameters: use_sim_time: True alpha1: 0.2 alpha2: 0.2 alpha3: 0.2 alpha4: 0.2 alpha5: 0.2 base_frame_id: &quot;base_footprint&quot; beam_skip_distance: 0.5 beam_skip_error_threshold: 0.9 beam_skip_threshold: 0.3 do_beamskip: false global_frame_id: &quot;map&quot; lambda_short: 0.1 laser_likelihood_max_dist: 2.0 laser_max_range: 100.0 laser_min_range: -1.0 laser_model_type: &quot;likelihood_field&quot; max_beams: 60 max_particles: 2000 min_particles: 500 odom_frame_id: &quot;odom&quot; pf_err: 0.05 pf_z: 0.99 recovery_alpha_fast: 0.0 recovery_alpha_slow: 0.0 resample_interval: 1 robot_model_type: &quot;nav2_amcl::DifferentialMotionModel&quot; save_pose_rate: 0.5 sigma_hit: 0.2 tf_broadcast: true transform_tolerance: 1.0 update_min_a: 0.2 update_min_d: 0.25 z_hit: 0.5 z_max: 0.05 z_rand: 0.5 z_short: 0.05 scan_topic: scan bt_navigator: ros__parameters: use_sim_time: True global_frame: map robot_base_frame: base_link odom_topic: /odom bt_loop_duration: 10 default_server_timeout: 60000 default_nav_to_pose_bt_xml: &quot;/workspace/src/a1_robot/params/follow_point_bt.xml&quot; # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. plugin_lib_names: - nav2_compute_path_to_pose_action_bt_node - nav2_compute_path_through_poses_action_bt_node - nav2_smooth_path_action_bt_node - nav2_follow_path_action_bt_node - nav2_spin_action_bt_node - nav2_wait_action_bt_node - nav2_assisted_teleop_action_bt_node - nav2_back_up_action_bt_node - nav2_drive_on_heading_bt_node - nav2_clear_costmap_service_bt_node - nav2_is_stuck_condition_bt_node - nav2_goal_reached_condition_bt_node - nav2_goal_updated_condition_bt_node - nav2_globally_updated_goal_condition_bt_node - nav2_is_path_valid_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_truncate_path_local_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_path_expiring_timer_condition - nav2_distance_traveled_condition_bt_node - nav2_single_trigger_bt_node - nav2_goal_updated_controller_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 - nav2_controller_cancel_bt_node - nav2_path_longer_on_approach_bt_node - nav2_wait_cancel_bt_node - nav2_spin_cancel_bt_node - nav2_back_up_cancel_bt_node - nav2_assisted_teleop_cancel_bt_node - nav2_drive_on_heading_cancel_bt_node bt_navigator_navigate_through_poses_rclcpp_node: ros__parameters: use_sim_time: True bt_navigator_navigate_to_pose_rclcpp_node: ros__parameters: use_sim_time: True controller_server: ros__parameters: use_sim_time: True controller_frequency: 5.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;general_goal_checker&quot;] # &quot;precise_goal_checker&quot; controller_plugins: [&quot;FollowPath&quot;] # Progress checker parameters progress_checker: plugin: &quot;nav2_controller::SimpleProgressChecker&quot; required_movement_radius: 0.5 movement_time_allowance: 10.0 # Goal checker parameters # precise_goal_checker: # plugin: &quot;nav2_controller::SimpleGoalChecker&quot; # xy_goal_tolerance: 1.0 # yaw_goal_tolerance: 0.25 # stateful: True general_goal_checker: stateful: True plugin: &quot;nav2_controller::SimpleGoalChecker&quot; xy_goal_tolerance: 0.01 yaw_goal_tolerance: 0.25 # DWB parameters FollowPath: plugin: &quot;dwb_core::DWBLocalPlanner&quot; debug_trajectory_details: True min_vel_x: 0.0 min_vel_y: 0.0 max_vel_x: 0.26 max_vel_y: 0.0 max_vel_theta: 1.0 min_speed_xy: 0.0 max_speed_xy: 0.26 min_speed_theta: 0.0 # Add high threshold velocity for turtlebot 3 issue. # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75 acc_lim_x: 2.5 acc_lim_y: 0.0 acc_lim_theta: 3.2 decel_lim_x: -2.5 decel_lim_y: 0.0 decel_lim_theta: -3.2 vx_samples: 20 vy_samples: 5 vtheta_samples: 20 sim_time: 1.7 linear_granularity: 0.05 angular_granularity: 0.025 transform_tolerance: 0.2 xy_goal_tolerance: 0.01 trans_stopped_velocity: 0.25 short_circuit_trajectory_evaluation: True stateful: True 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 local_costmap: local_costmap: ros__parameters: update_frequency: 5.0 publish_frequency: 2.0 global_frame: odom robot_base_frame: base_link use_sim_time: True rolling_window: true width: 3 height: 3 resolution: 0.05 robot_radius: 0.22 plugins: [&quot;obstacle_layer&quot;, &quot;inflation_layer&quot;] inflation_layer: plugin: &quot;nav2_costmap_2d::InflationLayer&quot; cost_scaling_factor: 3.0 inflation_radius: 0.55 obstacle_layer: plugin: &quot;nav2_costmap_2d::ObstacleLayer&quot; enabled: True observation_sources: scan scan: topic: /scan max_obstacle_height: 2.0 clearing: True marking: True data_type: &quot;LaserScan&quot; raytrace_max_range: 3.0 raytrace_min_range: 0.0 obstacle_max_range: 2.5 obstacle_min_range: 0.0 static_layer: plugin: &quot;nav2_costmap_2d::StaticLayer&quot; map_subscribe_transient_local: True always_send_full_costmap: True global_costmap: global_costmap: ros__parameters: update_frequency: 1.0 publish_frequency: 1.0 global_frame: map robot_base_frame: base_link use_sim_time: True robot_radius: 0.22 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: /scan max_obstacle_height: 2.0 clearing: True marking: True data_type: &quot;LaserScan&quot; raytrace_max_range: 3.0 raytrace_min_range: 0.0 obstacle_max_range: 2.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: 3.0 inflation_radius: 0.55 always_send_full_costmap: True map_server: ros__parameters: use_sim_time: True yaml_filename: &quot;a1_navigation.yaml&quot; map_saver: ros__parameters: use_sim_time: True save_map_timeout: 5.0 free_thresh_default: 0.25 occupied_thresh_default: 0.65 map_subscribe_transient_local: True planner_server: ros__parameters: expected_planner_frequency: 20.0 use_sim_time: True planner_plugins: [&quot;GridBased&quot;] GridBased: plugin: &quot;nav2_navfn_planner/NavfnPlanner&quot; tolerance: 0.5 use_astar: false allow_unknown: true smoother_server: ros__parameters: use_sim_time: True smoother_plugins: [&quot;simple_smoother&quot;] simple_smoother: plugin: &quot;nav2_smoother::SimpleSmoother&quot; tolerance: 1.0e-10 max_its: 1000 do_refinement: True behavior_server: ros__parameters: costmap_topic: local_costmap/costmap_raw footprint_topic: local_costmap/published_footprint cycle_frequency: 10.0 behavior_plugins: [&quot;spin&quot;, &quot;backup&quot;, &quot;drive_on_heading&quot;, &quot;assisted_teleop&quot;, &quot;wait&quot;] spin: plugin: &quot;nav2_behaviors/Spin&quot; backup: plugin: &quot;nav2_behaviors/BackUp&quot; drive_on_heading: plugin: &quot;nav2_behaviors/DriveOnHeading&quot; wait: plugin: &quot;nav2_behaviors/Wait&quot; assisted_teleop: plugin: &quot;nav2_behaviors/AssistedTeleop&quot; global_frame: odom robot_base_frame: base_link transform_tolerance: 0.1 use_sim_time: true simulate_ahead_time: 2.0 max_rotational_vel: 1.0 min_rotational_vel: 0.4 rotational_acc_lim: 3.2 robot_state_publisher: ros__parameters: use_sim_time: True waypoint_follower: ros__parameters: use_sim_time: True loop_rate: 20 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: use_sim_time: True smoothing_frequency: 20.0 scale_velocities: False feedback: &quot;OPEN_LOOP&quot; max_velocity: [0.26, 0.0, 1.0] min_velocity: [-0.26, 0.0, -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 deadband_velocity: [0.0, 0.0, 0.0] velocity_timeout: 1.0 </code></pre> <hr /> <p><a href="https://answers.ros.org/question/417841/navigation2" rel="nofollow noreferrer">Originally posted</a>-target-pose(5.0,-0.0)-but-robot-stops-at-(4.8,--0.56)-and-says-'reached-the-goal'/) by <a href="https://answers.ros.org/users/126519/kenloumixx/" rel="nofollow noreferrer">kenloumixx</a> on ROS Answers with karma: 7 on 2023-07-27</p> <p>Post score: 0</p>
navigation2) target pose(5.0, 0.0) but robot stops at (4.8, -0.56) and says 'reached the goal'
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The issue was related to the <code>~/.rviz2/default.rviz</code> file.</p> <p>I just moved the files out the <code>~/.rviz2</code> folder and it loaded fine</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3396/dcconner/" rel="nofollow noreferrer">dcconner</a> with karma: 476 on 2023-08-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/3396/dcconner/" rel="nofollow noreferrer">dcconner</a> on 2023-08-01</strong>:<br /> apparently some inconsistency with humble that is not caught on loading</p> <p><strong>Comment by <a href="https://answers.ros.org/users/3396/dcconner/" rel="nofollow noreferrer">dcconner</a> on 2023-08-01</strong>:<br /> I filed a ticket for future enhancement <a href="https://github.com/ros2/rviz/issues/1025" rel="nofollow noreferrer">https://github.com/ros2/rviz/issues/1025</a></p>
103454
2023-07-28T15:34:13.000
|rviz|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Today I installed and started testing ROS 2 Iron, but RViz is consistently crashing on start up.</p> <pre> $ rviz2 [INFO] [1690575860.534941980] [rviz2]: Stereo is NOT SUPPORTED [INFO] [1690575860.535036033] [rviz2]: OpenGl version: 4.6 (GLSL 4.6) [INFO] [1690575860.704326140] [rviz2]: Stereo is NOT SUPPORTED Segmentation fault (core dumped) </pre> <p>It was crashing with my launch files, so I tried standalone with same result.</p> <p>If I source <code>/opt/ros/humble</code> instead, then it works normally so I don't it does not seem to be OS or driver related. (Note that humble also shows two more <code>Stereo is NOT SUPPORTED</code> messages, and then works normally.</p> <p>Sourcing just <code>/opt/ros/iron/setup.bash</code> also crashes immediately on startup, so I don't think it is my setup.</p> <p>Using Ubuntu 22.04 with Nvidia driver and ROS 2 Iron</p> <pre> +-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.125.06 Driver Version: 525.125.06 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 Quadro K2200 Off | 00000000:03:00.0 On | N/A | | 43% 50C P0 3W / 39W | 885MiB / 4096MiB | 20% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ </pre> <p>Is anyone else seeing this crash and is there a fix?</p> <hr /> <p><a href="https://answers.ros.org/question/417874/rviz2-crashing-in-iron/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/3396/dcconner/" rel="nofollow noreferrer">dcconner</a> on ROS Answers with karma: 476 on 2023-07-28</p> <p>Post score: 0</p>
rviz2 crashing in iron
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Correct. In my install of Humble there is no 'tutorial_interfaces&quot;. In my Humble there is &quot;example_interfaces&quot; but there is no &quot;num.hpp&quot; there.</p> <p>Assuming you're on linux, the msg files can be found here <code>/opt/ros/humble</code></p> <p>I suggest you find the Humble version of what you're trying to do,, if it exists.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/26871/billy/" rel="nofollow noreferrer">billy</a> with karma: 1850 on 2023-07-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/166967/xudadi/" rel="nofollow noreferrer">xudadi</a> on 2023-07-30</strong>:<br /> yes, on linux, and I'm a beginner and I didn't find a better humble tutorial</p>
103456
2023-07-28T23:22:59.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This header file always fails to be referenced:</p> <pre><code>#include &quot;tutorial_interfaces/msg/num.hpp&quot; </code></pre> <p>I don’t know why. I am learning humble from Foxy’s tutorial. Is it because of version differences?</p> <hr /> <p><a href="https://answers.ros.org/question/417883/some-questions-about-c++-header-file-references-when-programming-ros2humble/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/166967/xudadi/" rel="nofollow noreferrer">xudadi</a> on ROS Answers with karma: 5 on 2023-07-28</p> <p>Post score: 0</p>
Some questions about C++ header file references when programming ROS2humble
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Take a look at the particular file in question <a href="https://github.com/ros-planning/moveit_task_constructor/blob/humble/core/include/moveit/task_constructor/solvers/cartesian_path.h" rel="nofollow noreferrer">here</a>: you will see that in the <code>humble</code> branch of the file, there is indeed the following section of code which is deprecated, as is indicated by your error message:</p> <pre><code>[[deprecated(&quot;Replace with setMaxVelocityScalingFactor&quot;)]] // clang-format off void setMaxVelocityScaling(double factor) { setMaxVelocityScalingFactor(factor); } [[deprecated(&quot;Replace with setMaxAccelerationScalingFactor&quot;)]] // clang-format off void setMaxAccelerationScaling(double factor) { setMaxAccelerationScalingFactor(factor); } </code></pre> <p>The simple fix would be to replace the calls to these deprecated functions in your code by the newer functions, namely - <code>setMaxVelocityScalingFactor(factor)</code> and <code>setMaxAccelerationScalingFactor(factor)</code>. This should solve the current set of problems you are facing.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/87884/sampreets3/" rel="nofollow noreferrer">sampreets3</a> with karma: 230 on 2023-08-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103458
2023-07-31T08:18:51.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The error happens in &quot;moveit_task_constructor&quot;. It seems the class names are wrong in that particular cpp file. This is the error message:</p> <pre><code>/home/failedmesh/ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/mtc_node.cpp: In member function ‘moveit::task_constructor::Task MTCTaskNode::createTask()’: /home/failedmesh/ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/mtc_node.cpp:122:43: warning: ‘void moveit::task_constructor::solvers::CartesianPath::setMaxVelocityScaling(double)’ is deprecated: Replace with setMaxVelocityScalingFactor [-Wdeprecated-declarations] 122 | cartesian_planner-&gt;setMaxVelocityScaling(1.0); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ In file included from /home/failedmesh/ws_moveit2/install/moveit_task_constructor_core/include/moveit/task_constructor/solvers.h:41, from /home/failedmesh/ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/mtc_node.cpp:5: /home/failedmesh/ws_moveit2/install/moveit_task_constructor_core/include/moveit/task_constructor/solvers/cartesian_path.h:60:14: note: declared here 60 | void setMaxVelocityScaling(double factor) { setMaxVelocityScalingFactor(factor); } | ^~~~~~~~~~~~~~~~~~~~~ /home/failedmesh/ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/mtc_node.cpp:123:47: warning: ‘void moveit::task_constructor::solvers::CartesianPath::setMaxAccelerationScaling(double)’ is deprecated: Replace with setMaxAccelerationScalingFactor [-Wdeprecated-declarations] 123 | cartesian_planner-&gt;setMaxAccelerationScaling(1.0); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ In file included from /home/failedmesh/ws_moveit2/install/moveit_task_constructor_core/include/moveit/task_constructor/solvers.h:41, from /home/failedmesh/ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/mtc_node.cpp:5: /home/failedmesh/ws_moveit2/install/moveit_task_constructor_core/include/moveit/task_constructor/solvers/cartesian_path.h:62:14: note: declared here 62 | void setMaxAccelerationScaling(double factor) { setMaxAccelerationScalingFactor(factor); } | ^~~~~~~~~~~~~~~~~~~~~~~~~ /home/failedmesh/ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/minimal.cpp: In member function ‘moveit::task_constructor::Task MTCTaskNode::createTask()’: /home/failedmesh/ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/minimal.cpp:127:43: warning: ‘void moveit::task_constructor::solvers::CartesianPath::setMaxVelocityScaling(double)’ is deprecated: Replace with setMaxVelocityScalingFactor [-Wdeprecated-declarations] 127 | cartesian_planner-&gt;setMaxVelocityScaling(1.0); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ In file included from /home/failedmesh/ws_moveit2/install/moveit_task_constructor_core/include/moveit/task_constructor/solvers.h:41, from /home/failedmesh/ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/minimal.cpp:5: /home/failedmesh/ws_moveit2/install/moveit_task_constructor_core/include/moveit/task_constructor/solvers/cartesian_path.h:60:14: note: declared here 60 | void setMaxVelocityScaling(double factor) { setMaxVelocityScalingFactor(factor); } | ^~~~~~~~~~~~~~~~~~~~~ /home/failedmesh/ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/minimal.cpp:128:47: warning: ‘void moveit::task_constructor::solvers::CartesianPath::setMaxAccelerationScaling(double)’ is deprecated: Replace with setMaxAccelerationScalingFactor [-Wdeprecated-declarations] 128 | cartesian_planner-&gt;setMaxAccelerationScaling(1.0); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ In file included from /home/failedmesh/ws_moveit2/install/moveit_task_constructor_core/include/moveit/task_constructor/solvers.h:41, from /home/failedmesh/ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/minimal.cpp:5: /home/failedmesh/ws_moveit2/install/moveit_task_constructor_core/include/moveit/task_constructor/solvers/cartesian_path.h:62:14: note: declared here 62 | void setMaxAccelerationScaling(double factor) { setMaxAccelerationScalingFactor(factor); } | ^~~~~~~~~~~~~~~~~~~~~~~~~ --- Finished &lt;&lt;&lt; moveit2_tutorials [30.6s] Summary: 55 packages finished [15min 10s] 9 packages had stderr output: launch_param_builder moveit2_tutorials moveit_configs_utils moveit_setup_srdf_plugins moveit_task_constructor_capabilities moveit_task_constructor_core moveit_task_constructor_demo moveit_task_constructor_msgs moveit_task_constructor_visualization </code></pre> <hr /> <p><a href="https://answers.ros.org/question/417957/deprecated-error-while-running-%22colcon-build---mixin-release%22-for-moveit2_tutorials-in-ros2-humble./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/167539/failedmesh/" rel="nofollow noreferrer">FailedMesh</a> on ROS Answers with karma: 3 on 2023-07-31</p> <p>Post score: 0</p>
Deprecated error while running "colcon build --mixin release" for moveit2_tutorials in ros2 humble
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Answering my own question : I found solution in <code>ros_gz/ros_gz_sim_demos/launch/gpu_lidar_bridge.launch.py</code></p> <p>In there, I read that plugin <code>gz-sim-sensors-system</code> was the one to use, I have had this clue somewhere, but can't make it worked.<br /> For the sensor itself it's almost the same i used, except the type which is 'gpu_lidar' (param value are also little differents, but I did not check yet how important this is).</p> <p>Note this publish on gz topics, not ROS2, I have to use a bridge to be able to use those data in ROS (but that is expected).</p> <pre><code>&lt;sensor name='gpu_lidar' type='gpu_lidar'&gt; &lt;pose&gt;0 0 0 0 0 0&lt;/pose&gt; &lt;topic&gt;lidar&lt;/topic&gt; </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/146607/s%C3%A9bastienl/" rel="nofollow noreferrer">SébastienL</a> with karma: 32 on 2023-08-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103460
2023-07-31T10:34:12.000
|ros2|lidar|plugin|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all,</p> <p>(note: I posted this question on gazebo forum, but it is seems to be a ros plugin, so I post here too)</p> <p>I'm trying to install a lidar on a drone (x500, model provided by PX4 repo). I found some examples, but all seems outdated.</p> <p>For the plugin, an example give the name of <code>libgazebo_ros_ray_sensor.so</code>, another <code>libgazebo_ros_laser.so</code>. Some doc points to &quot;https://github.com/ros-simulation/gazebo_ros_pkgs&quot; to get the plugin, but the list of available branch is huge, and I already installed libgz-sim7-plugins on my machine (which contains libgz-sensors7-lidar.so that &quot;does not export any plugins&quot;).</p> <p>Well I'm totally lost !<br /> Which plugin should I used ?</p> <p>I'm using gazebo garden on ubuntu 22.04. Here is part of my sdf file</p> <pre><code>&lt;sdf version=&quot;1.10&quot;&gt; &lt;model name=&quot;x500_lidar&quot;&gt; &lt;include&gt;&lt;uri&gt;model://x500&lt;/uri&gt;[...]&lt;/include&gt; &lt;!--add lidar--&gt; &lt;link name=&quot;hokuyo_link&quot;&gt; &lt;pose&gt;0 0 0 0 0 0&lt;/pose&gt; [...] &lt;sensor type=&quot;gpu_ray&quot; name=&quot;laser&quot;&gt; &lt;pose&gt;0 0 0.3 0 0 1.57&lt;/pose&gt; [...] &lt;plugin name=&quot;hokuyo_node&quot; filename=&quot;libgz-sensors7-lidar.so&quot;&gt; &lt;robotNamespace&gt;&lt;/robotNamespace&gt; &lt;topicName&gt;/spur/laser/scan&lt;/topicName&gt; &lt;frameName&gt;/hokuyo_sensor_link&lt;/frameName&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/link&gt; </code></pre> <hr /> <p><a href="https://answers.ros.org/question/417971/help-for-installing-lidar-on-a-drone/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/146607/s%C3%A9bastienl/" rel="nofollow noreferrer">SébastienL</a> on ROS Answers with karma: 32 on 2023-07-31</p> <p>Post score: 0</p>
help for installing lidar on a drone
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>All of robotics covers a very large number of technical areas (mechanical, electrical, software, algorithms), so I would say the decision to buy a robot with ros2 installed depends which aspects of robotics you are interested in right now. If you have a halfway decent desktop/laptop computer, you can definitely do most of your learning/exploring in the software simulator. It's not as satisfying as making a real object move, but the crashes are also less expensive.</p> <p>The difference between foxy and humble is that humble will have more features implemented and a lot of bugs fixed. However, <em>most</em> of the concepts &amp; software APIs in the two versions should be the same.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-08-03</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103462
2023-08-02T07:09:38.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I saw a smart cart for ROS2, which happens to be the direction I want to learn, so I want to buy it. However, the official system for the cart is ROS2foxy, and I am learning ROS2humble, which is causing me a lot of frustration. I would like some advice from you guys. Is there a big difference between foxy and humble, and should I buy it?</p> <hr /> <p><a href="https://answers.ros.org/question/418051/is-there-a-big-difference-between-ros2foxy-and-ros2humble?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/166967/xudadi/" rel="nofollow noreferrer">xudadi</a> on ROS Answers with karma: 5 on 2023-08-02</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-08-02</strong>:<br /> It would be better if the title of your post was the question you are asking. You can edit it using the little &quot;edit&quot; link just under the existing title.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/166967/xudadi/" rel="nofollow noreferrer">xudadi</a> on 2023-08-03</strong>:<br /> thank you!</p>
Is there a big difference between ros2foxy and ros2humble?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I figured it out, as iron only works on 22.04 I was not able to install that.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/168023/brijrajsinh-raolji/" rel="nofollow noreferrer">Brijrajsinh Raolji</a> with karma: 16 on 2023-08-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103465
2023-08-02T13:02:04.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am trying to install ros2, i first installed ros2 foxy but had some issues with gazebo bridge package and also as ros2 foxy went to end of life i decided to try ros2 iron and now during installing it through provided documentation, during installing ros-iron-desktop its ts showing me error that &quot;&quot;Unable to locate package ros-iron-desktop&quot;&quot; Please help me with it.</p> <hr /> <p><a href="https://answers.ros.org/question/418062/unable-to-locate-package-ros-iron-desktop/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/168023/brijrajsinh-raolji/" rel="nofollow noreferrer">Brijrajsinh Raolji</a> on ROS Answers with karma: 16 on 2023-08-02</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-08-03</strong>:<br /> Can you confirm you are running a supported OS? Iron only supports Ubuntu <code>22.04</code> (or <em>Jammy</em>).</p> <p>I ask because Foxy can't be installed on <code>22.04</code>, so if you didn't upgrade your OS, it would be expected to not be able to install Iron.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/168023/brijrajsinh-raolji/" rel="nofollow noreferrer">Brijrajsinh Raolji</a> on 2023-08-06</strong>:<br /> Yes that was the issue, I figured it out thanks for addressing though.</p>
unable to locate package ros-iron-desktop
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Printing the data on the screen is actually not &quot;nothing&quot;. It is more time consuming than several other operations that you could do, try storing it to a another variable and print all of them after the designated time. You should be able to receive the data at much higher rates with roscpp. Increasing the queue size should also help in case of sporadic transport fluctuations.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/72874/gaurav-gupta/" rel="nofollow noreferrer">Gaurav Gupta</a> with karma: 276 on 2023-08-04</p> <p>This answer was <strong>NOT ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/168067/zyt/" rel="nofollow noreferrer">zyt</a> on 2023-08-05</strong>:<br /> Thank you so much for your endless help!</p>
103467
2023-08-02T21:21:41.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, when I subscribed to nav_msgs/Odometry data which is published at a frequency of 100hz, the callback processed the data slowly and the data was lost. Even if it do nothing with the data, just print it to the screen. Here is my code, thanks. Details are below the code.</p> <blockquote> <p>subscriber.cpp</p> </blockquote> <pre><code>#include &quot;ros/ros.h&quot; #include &quot;nav_msgs/Odometry.h&quot; void Callback(const nav_msgs::Odometry::ConstPtr &amp;data) { ROS_INFO(&quot;x: %f&quot;, data-&gt;pose.pose.position.x); } int main(int argc, char *argv[]) { ros::init(argc, argv, &quot;sub&quot;); ros::NodeHandle nh; ros::Subscriber sub = nh.subscribe(&quot;data&quot;, 1, Callback); ros::spin(); return 0; } </code></pre> <blockquote> <p>publisher.cpp</p> </blockquote> <pre><code>#include &quot;ros/ros.h&quot; #include &quot;nav_msgs/Odometry.h&quot; int main(int argc, char *argv[]) { ros::init(argc, argv, &quot;pub&quot;); ros::NodeHandle nh; ros::Publisher pub = nh.advertise&lt;nav_msgs::Odometry&gt;(&quot;data&quot;, 1); nav_msgs::Odometry data; data.pose.pose.position.x = 0; data.pose.pose.position.y = 0; data.pose.pose.position.z = 0; data.twist.twist.linear.x = 0; data.twist.twist.linear.y = 0; data.twist.twist.linear.z = 0; ros::Rate rate(100); while (ros::ok()) { pub.publish(data); data.pose.pose.position.x += 1.0; rate.sleep(); ros::spinOnce(); } return 0; } </code></pre> <p>After i run the code, the info output by the callback like this. The difference between the data before and after 1 second is 100, which is correct, but the changes in the data are not continuous, about two-thirds of the data is lost, after I change the published and subscribed data to a simple int type, the info output by the callback was not lost. Could someone tell me why.</p> <pre><code>[ INFO] [1691025304.970631250]: x: 534.000000 [ INFO] [1691025305.014777988]: x: 538.000000 [ INFO] [1691025305.019294864]: x: 539.000000 [ INFO] [1691025305.029349545]: x: 540.000000 [ INFO] [1691025305.070614103]: x: 544.000000 [ INFO] [1691025305.114707116]: x: 548.000000 [ INFO] [1691025305.158679485]: x: 552.000000 [ INFO] [1691025305.202648991]: x: 557.000000 [ INFO] [1691025305.246669446]: x: 561.000000 [ INFO] [1691025305.249411401]: x: 562.000000 [ INFO] [1691025305.259341235]: x: 563.000000 [ INFO] [1691025305.302654749]: x: 567.000000 [ INFO] [1691025305.346705878]: x: 571.000000 [ INFO] [1691025305.390708431]: x: 576.000000 [ INFO] [1691025305.434621099]: x: 580.000000 [ INFO] [1691025305.439409861]: x: 581.000000 [ INFO] [1691025305.449302088]: x: 582.000000 [ INFO] [1691025305.490661031]: x: 586.000000 [ INFO] [1691025305.534639046]: x: 590.000000 [ INFO] [1691025305.582676911]: x: 595.000000 [ INFO] [1691025305.626683167]: x: 599.000000 [ INFO] [1691025305.629425701]: x: 600.000000 [ INFO] [1691025305.639365812]: x: 601.000000 [ INFO] [1691025305.682694151]: x: 605.000000 [ INFO] [1691025305.726678524]: x: 609.000000 [ INFO] [1691025305.770639589]: x: 613.000000 [ INFO] [1691025305.770734517]: x: 614.000000 [ INFO] [1691025305.814676002]: x: 617.000000 [ INFO] [1691025305.814776174]: x: 618.000000 [ INFO] [1691025305.819332395]: x: 619.000000 [ INFO] [1691025305.829267456]: x: 620.000000 [ INFO] [1691025305.870585413]: x: 623.000000 [ INFO] [1691025305.870677599]: x: 624.000000 [ INFO] [1691025305.914597913]: x: 628.000000 [ INFO] [1691025305.958604223]: x: 631.000000 [ INFO] [1691025305.958706574]: x: 632.000000 </code></pre> <hr /> <p><a href="https://answers.ros.org/question/418072/when-i-subscribed-to-nav_msgs/odometry-data-which-is-published-at-a-frequency-of-100hz,-the-callback-processed-the-data-slowly-and-the-data-was-lost,-thanks./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/168067/zyt/" rel="nofollow noreferrer">zyt</a> on ROS Answers with karma: 3 on 2023-08-02</p> <p>Post score: 0</p>
Slow Callback Processing for High-Frequency nav_msgs/Odometry Data
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This question has been solved by doing as suggested. The node for the control should be running on the desktop and not the Jetson Nano.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/143055/electricray/" rel="nofollow noreferrer">ElectricRay</a> with karma: 11 on 2023-08-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103470
2023-08-03T03:49:24.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I would like to control my robot remotely with a joystick. On a Jetson Nano I have running roscore and I'm able to connect from my desktop to the Jetson over WiFi. But when I plug in the joystick the Jetson doesn't see the Jostick outputs cause it looks to it's own USB ports.</p> <p>Is there a way that I plug in the joystick into my destop en send the joystick outputs over WiFi to the Jetson so it can be processed too control my motors?</p> <p>I'm using VMware with Ubuntu 20.04 and ROS Noetic on the Jetson Nano. With ROSSerial I send data to a Arduino which controls the motors.</p> <p>EDIT: I have tried to run the script on the VM when I run the script and joy_node on the VM I see with echo outputs from the joy_node. Als (for debugging) some print statements in the script. But the data that need to be published is not published. But the weird thing is like I wrote above it all works perfect when I connect the joystick to the Jetson Nano usb port.</p> <pre><code>import rospy import math from std_msgs.msg import Float32 from sensor_msgs.msg import Joy from r2g2.msg import Control_State # Global variables used for processing the input value from the joystick Xvelocity = 0 Yvelocity = 0 Zvelocity = 0 Max_Velocity = 100 # Max velocity in rpm # Global variables which will be published for left and right motor speed Left_Motor_Speed = 0 Right_Motor_Speed = 0 Rotation_Speed = 0 # Initialize control input node rospy.init_node(&quot;control_input&quot;, anonymous=True) # Callback funtion for the Control State of R2G2 depending on the value a different control will be accomplished def control_state_callback(data): rospy.loginfo(&quot;Current control state is: %d&quot;, data.control_state_value) print(data.control_state_value) def joystick_callback(data): # Get joystick values max scale from joystick is -1 to 1 for x, y and z axis axes = data.axes global Yvelocity # Y position joystick represents Forward and Backwards velocity global Xvelocity # X position joystick represents turn angle will be used for difference in motor speed #global Zvelocity # Z position joystick represents rotation around Bot axis #Zvelocity = axes[2] * Max_Velocity # Scale joystick value to rpm value Yvelocity = axes[1] * Max_Velocity # Scale joystick value to rpm value Xvelocity = axes[0] * Max_Velocity # Scale joystick value to rpm value process_velocities(Xvelocity, Yvelocity) def process_velocities(x_val, y_val): # First check if x and y values are not equal to zero if x_val == 0: # If the X position of the joystick is 0 than the bot drives straight and not further computation has to be done # Therefore both motors run equal speed. Left_Motor_Speed = y_val Right_Motor_Speed = y_val else: hyp = math.sqrt(x_val**2 + y_val**2) # Find the hypothenuse of the two vectors vel_factor = abs(y_val/hyp) # Compute the cosine and use it as a attenuation factor for one of the wheels if x_val &gt; 0: # If x pos joystick is &gt; 0, R2G2 needs to move to left, left motor turns slower as right motor Left_Motor_Speed = vel_factor * y_val Right_Motor_Speed = y_val else: # If x pos joystick is &lt; 0, R2G2 needs to move to right, right motor turns slower as left motor Left_Motor_Speed = y_val Right_Motor_Speed = vel_factor * y_val # Print values for troubleshooting print(&quot;Left speed: &quot;) print(Left_Motor_Speed) print(&quot;Right speed: &quot;) print(Right_Motor_Speed) # Publish the computed velocities for each motor left_vel_pub.publish(Left_Motor_Speed) right_vel_pub.publish(Right_Motor_Speed) # Create subscriber to Joystick node def joystick_subscriber(): rospy.Subscriber('joy', Joy, joystick_callback) rospy.spin() # Create Velocity publishers left_vel_pub = rospy.Publisher(&quot;/left_velocity&quot;, Float32, queue_size=5) right_vel_pub = rospy.Publisher(&quot;/right_velocity&quot;, Float32, queue_size=5) # rotation_vel_pub = rospy.Publisher(&quot;/rotation_velocity&quot;, Float32, queue_size=10 ) while not rospy.is_shutdown(): rospy.Subscriber(&quot;/control_state&quot;, Control_State, control_state_callback) joystick_subscriber() </code></pre> <hr /> <p><a href="https://answers.ros.org/question/418087/control-robot-remotely-with-a-joystick/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/143055/electricray/" rel="nofollow noreferrer">ElectricRay</a> on ROS Answers with karma: 11 on 2023-08-03</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/148408/timoth%C3%A9e/" rel="nofollow noreferrer">Timothée</a> on 2023-08-04</strong>:<br /> Do you have a node converting joystick input to ROS message on your nano ? If so you might want to put it on your virtual machine and ROS will handle the communication over WiFi</p> <p><strong>Comment by <a href="https://answers.ros.org/users/143055/electricray/" rel="nofollow noreferrer">ElectricRay</a> on 2023-08-04</strong>:<br /> Would I do that by just copy it to the VM and than in the terminal do a rosrun f the particular node?</p>
Control robot remotely with a joystick
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The package is available and is installable (if you look in the logs you point to you can see it being installed), however it has no content.</p> <p>You appear to have custom logic in your CMake to detect ROS 2 and ROS 1. However the build of event_camera_msgs is failing to detect the version of ROS and is not doing anything. I would recommend making sure that is an error case that will fail the build so you know it didn't work. But that looks like it means that nothing is built or installed. If that error should probably be a fatal error.</p> <p>From: <a href="https://build.ros2.org/job/Rbin_uJ64__event_camera_msgs__ubuntu_jammy_amd64__binary/1/console" rel="nofollow noreferrer">https://build.ros2.org/job/Rbin_uJ64__event_camera_msgs__ubuntu_jammy_amd64__binary/1/console</a></p> <pre><code>08:17:47 ERRORROS_VERSION environment variable is not set! </code></pre> <p>Which appears to come from here: <a href="https://github.com/ros-event-camera/event_camera_msgs/blob/3b56aa0bc13b5b521f2764495e0f3852b50bb8db/CMakeLists.txt#L28" rel="nofollow noreferrer">https://github.com/ros-event-camera/event_camera_msgs/blob/3b56aa0bc13b5b521f2764495e0f3852b50bb8db/CMakeLists.txt#L28</a></p> <p>If/since you need to rely on the <code>ROS_VERSION</code> environment variable being present you need a dependency on <a href="https://index.ros.org/p/ros_environment/#rolling" rel="nofollow noreferrer">the package <code>ros_environment</code></a> which provides that environment variable.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2023-08-03</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/53718/bernd-pfrommer/" rel="nofollow noreferrer">Bernd Pfrommer</a> on 2023-08-03</strong>:<br /> @tfoote Thanks for the prompt answer. Indeed that was the problem. My cmake file did not err out correctly, so the job status showed &quot;green&quot; and I assumed the package was built correctly. It was not!</p>
103472
2023-08-03T09:17:00.000
|rosdep|build|packages|rosdistro|dependencies|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>A <a href="https://github.com/ros-event-camera/metavision_driver/" rel="nofollow noreferrer">new driver</a> that is being added to rosdistro depends on a <a href="https://github.com/ros-event-camera/event_camera_msgs/" rel="nofollow noreferrer">new message package</a> that has just been added to rosdistro for distros Humble and Rolling. The driver and the messages live in different packages. Both have been successfully &quot;bloom released&quot;, and the message package builds successfully on the ROS2 build farms, but the driver does not. It fails to find the message package file (&quot;event_camera_msgs&quot;) although there is by now a Humble rosdep entry for event_camera_msgs, and the driver's package.xml file does have a dependency on event_camera_msgs. Here is the error I get from <a href="https://build.ros2.org/job/Rdev__metavision_driver__ubuntu_jammy_amd64/6/console" rel="nofollow noreferrer">the build log</a> of the driver:</p> <pre><code>09:13:35 -- Found rclcpp_components: 16.0.5 (/opt/ros/humble/share/rclcpp_components/cmake) 09:13:35 CMake Error at cmake/ROS2.cmake:53 (find_package): 09:13:35 By not providing &quot;Findevent_camera_msgs.cmake&quot; in CMAKE_MODULE_PATH this 09:13:35 project has asked CMake to find a package configuration file provided by 09:13:35 &quot;event_camera_msgs&quot;, but CMake did not find one. </code></pre> <p>Why is event_camera_msgs not available on the build farm? Admittedly there has not been a sync for Humble yet since the new event_camera_msgs package has been added. Is that the problem? If two new packages A and B get added to rosdistro, when can package A rely on package B being available on the build farm? Or am I missing some configuration to cause the messages package to be installed before the build starts? The build log shows no attempts to install the missing event_camera_msgs package.</p> <hr /> <p><a href="https://answers.ros.org/question/418104/when-is-new-package-available-on-the-ros2-build-farm?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/53718/bernd-pfrommer/" rel="nofollow noreferrer">Bernd Pfrommer</a> on ROS Answers with karma: 78 on 2023-08-03</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/53718/bernd-pfrommer/" rel="nofollow noreferrer">Bernd Pfrommer</a> on 2023-08-03</strong>:<br /> The error was due to the messages package not having been built correctly. Apparently even though a package is listed in the rosdep database, if its build fails, the building of the dependent package will fail with a cmake not finding the package. Once the message package was built, the driver build also progressed. There seems to be at most a few minutes (if any) delay for the built package to be available on the build farm.</p>
When is new package available on the ros2 build farm?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Thank you for all you answer.</p> <p>I finally find the problem. In fact previously I add a library in my catkin workspace build folder, the one I now build externally.</p> <p>When I source the devel/setup.sh, the library used was not the library located in /us/lib/ ... but the older library in catkin_ws.</p> <p>Thank you Mike Scheutzow and bluegiraffe-sc for your time.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/28095/xavier12358/" rel="nofollow noreferrer">xavier12358</a> with karma: 62 on 2023-08-08</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103474
2023-08-03T10:00:14.000
|ros|python3|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I create my own library with setuptools. When I run the command in terminal :</p> <pre><code>python3.8 </code></pre> <p>Then I import my library, it works properly.</p> <p>But if before starting python3.8, I run <strong>source /opt/ros/noetic/setup.sh</strong></p> <p>I get an error when I import the python library :</p> <pre><code>import vmpbcvt Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; ImportError: /usr/local/lib/python3.8/dist-packages/vmpbcvt-1.0-py3.8-linux-x86_64.egg/vmpbcvt.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN19VisionModuleManager15SetCurrentImageB5cxx11ERN2cv3MatEb </code></pre> <p>Can you explain me how it could be possible ?</p> <hr /> <p><a href="https://answers.ros.org/question/418106/undefined--symbol-after-source-ros/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/28095/xavier12358/" rel="nofollow noreferrer">xavier12358</a> on ROS Answers with karma: 62 on 2023-08-03</p> <p>Post score: 0</p>
Undefined symbol after source ros
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have figured out what went wrong. It were a couple of things all related to eachother. So as you can see in my question the IP address of the desktop and Jetson Nano were not in the same range. This creates issues, in order to fix this when using a Virtual Machine one needs to bridge the network card. As I was using WiFi on my destkop and have the free version of VMware I could not bridge the WiFi card. So what I did is connect my desktop with a LAN cable to my router and that bridge the network card.</p> <p>By doing this I am able to send between publishers and subscribers n both direction data messages.</p> <p>So problem solved</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/143055/electricray/" rel="nofollow noreferrer">ElectricRay</a> with karma: 11 on 2023-08-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-08-06</strong>:<br /> Please click on the checkmark in the gray circle to indicate you (the question author) accept this answer. The icon will turn green.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/143055/electricray/" rel="nofollow noreferrer">ElectricRay</a> on 2023-08-06</strong>:<br /> I tried to do so but I dont have enough points to do this</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-08-06</strong>:<br /> oh yeah, I forgot about that.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/143055/electricray/" rel="nofollow noreferrer">ElectricRay</a> on 2023-08-06</strong>:<br /> np, I don't know how I receive points I have two questions answered by myself because I fogured it out eventually and thought would be good to close them.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/26871/billy/" rel="nofollow noreferrer">billy</a> on 2023-08-08</strong>:<br /> I +1'd this post so maybe now you have the points needed.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/143055/electricray/" rel="nofollow noreferrer">ElectricRay</a> on 2023-08-08</strong>:<br /> Thanks! as you can see now I have the rights :)</p>
103476
2023-08-04T13:02:51.000
|linux|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>For some kind of reason I'm unable to get a good connection remotely with roscore. I have on my Jetson Nano roscore running and setup the ./bashrc file with ip address</p> <pre><code>export ROS_MASTER_URI=http://192.168.178.63:11311 export ROS_IP=192.168.178.63 </code></pre> <p>When I do a ifconfig on Ubuntu (running on VMware) I get as IP addres 192.168.204.128</p> <p>So on my Ubuntu VM is set in the ./bashrc file</p> <pre><code>export ROS_MASTER_URI=http://192.168.178.63:11311 export ROS_IP=192.168.204.128 </code></pre> <p>Now when I run a publisher on my Jetson Nano (e.g. Hello World) and can subscribe to the topic on the destkop Ubuntu machine and see the data comming in. But when I run a publisher on my desktop (e.g. Hello World) the Jetson doesn't see the data comming in. Although when I do a rostopic list it shows the topic.</p> <p>Does anybody knows how to fix this? I must do something wrong. I think t is the network settings but I cant change the IP addres of the VM, I tried to change it but it did give me the good results I was even unable to connect to roscore.</p> <p>Some help would be appreciated</p> <hr /> <p><a href="https://answers.ros.org/question/418141/can%27t-get-a-good-connection-remotle-with-roscore/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/143055/electricray/" rel="nofollow noreferrer">ElectricRay</a> on ROS Answers with karma: 11 on 2023-08-04</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/26871/billy/" rel="nofollow noreferrer">billy</a> on 2023-08-05</strong>:<br /> I will assume when you say &quot;the Jetson doesn't see the data&quot; you mean you have a subscriber running on the Jetson and the subscriber callback doesn't get entered. I have to ask, does it work if you the run both publisher and subscriber on the desktop? You're running same version of ROS on both machines?</p>
Can't get a good connection remotle with roscore
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>If you're using MoveIt, I think there is a default speed scaling of 10% that can be increased from a dialog box in the motion planning settings.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/37963/danzimmerman/" rel="nofollow noreferrer">danzimmerman</a> with karma: 337 on 2023-08-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103478
2023-08-05T09:58:11.000
|ros|universal-robot|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone,</p> <p>i’m simulating a ur10 in Gazabo. Unfortunately i don’t know hai to set its speed. The default one that is set when using the Description Pkg form UR and the Gazebo Sim PKG from UR is very slow.</p> <hr /> <p><a href="https://answers.ros.org/question/418160/speed-control-of-ur-in-simulation-and-reallife/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/151050/icon45/" rel="nofollow noreferrer">Icon45</a> on ROS Answers with karma: 5 on 2023-08-05</p> <p>Post score: 0</p>
Speed control of UR in Simulation and RealLife
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Here's an example that <a href="https://gist.github.com/jarvisschultz/7a886ed2714fac9f5226" rel="nofollow noreferrer">does work</a>. I'm guessing your problem is that in this chunk <code>data.data[i]=i;</code> you have not told the computer that the <code>data.data</code> vector should have 5 entries. So you are trying to access uninitialized memory. You should likely be using something like <code>push_back</code> or <code>data.data.resize(5);</code> before your <code>for</code> loop in the publisher.</p> <p>If you look at the example above, you'll see that I use <code>push_back</code> on <code>Float32MultiArray.layout</code> to set the size of that vector, and then I use <code>std::vector::resize</code> to resize a vector that will contain the data I'm trying to publish (which I eventually set equal to <code>Float32MultiArray.data</code>).</p> <p>Side note, I believe the <code>exit code -11</code> is coming from <a href="https://docs.python.org/3/library/subprocess.html#subprocess.Popen.returncode" rel="nofollow noreferrer">Python's subprocess poll</a> function which, according to that link, would indicate your program exiting due to a signal 11. Note, <code>roslaunch</code> is written in Python and uses the <code>subprocess</code> module to run nodes. <a href="https://man7.org/linux/man-pages/man7/signal.7.html" rel="nofollow noreferrer">This would correspond</a> to a <code>SIGSEGV</code> -- which is an invalid memory reference. This is consistent with my previous comment.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/1272/jarvisschultz/" rel="nofollow noreferrer">jarvisschultz</a> with karma: 9031 on 2023-08-09</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103480
2023-08-07T09:24:12.000
|ros|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello ROS people,</p> <p>so basically, I am simply trying to reproduce a simple C++ pub/sub example using the Float32MultiArray type. Here are the codes :</p> <p><strong>SUBSCRIBER</strong></p> <pre><code>#include &quot;ros/ros.h&quot; #include &quot;std_msgs/String.h&quot; #include &quot;std_msgs/Float32MultiArray.h&quot; void subscriberCallback(const std_msgs::Float32MultiArray::ConstPtr&amp; test) { for(int i=0; i&lt;5;i++){ ROS_INFO(&quot;I heard %d: %f\n&quot;, i, test-&gt;data[i]); }} int main(int argc, char **argv){ ros::init(argc, argv, &quot;subscriber&quot;); ros::NodeHandle n; ros::Subscriber sub = n.subscribe(&quot;subscriber_topic&quot;, 1000, subscriberCallback); ros::spin(); return 0; } </code></pre> <p><strong>PUBLISHER</strong></p> <pre><code>#include &lt;stdio.h&gt; #include &quot;ros/ros.h&quot; #include &quot;std_msgs/Float32MultiArray.h&quot; int main(int argc, char **argv){ ros::init(argc, argv, &quot;publisher&quot;); ros::NodeHandle n; ros::Publisher pub = n.advertise&lt;std_msgs::Float32MultiArray&gt;(&quot;subscriber_topic&quot;, 10); ros::Rate rate(10); while (ros::ok()){ std_msgs::Float32MultiArray data; for(int i=0;i&lt;5;i++){data.data[i]=i;} pub.publish(data); ros::spinOnce(); rate.sleep(); } return 0; } </code></pre> <p>1- The catkin_make build gives no error at all.</p> <p>2- If I launch the subscriber node and publish on the terminal to subscriber_topic F32MA data, everything goes fine, which means the problem is from the publisher side.</p> <p>3- When launching the publisher node, here is the error (exit code -11 ? searched and didn't find anything around that) - couldn't put a screen -</p> <pre><code>SUMMARY ======== PARAMETERS * /rosdistro: melodic * /rosversion: 1.14.13 NODES / publisher (publisher/publisher) ROS_MASTER_URI=http://localhost:11311 process[publisher-1]: started with pid [1332] [publisher-1] process has died [pid 1332, exit code -11, cmd /home/lilialkalee/f32ma/devel/lib/publisher/publisher __name:=publisher __log:=/home/lilialkalee/.ros/log/ab233984-352b-11ee-accc-00155dae808d/publisher-1.log]. log file: /home/lilialkalee/.ros/log/ab233984-352b-11ee-accc-00155dae808d/publisher-1*.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete done </code></pre> <p>Btw, when I look for the log given with the path <strong>/home/lilialkalee/.ros/log/ab233984-352b-11ee-accc-00155dae808d/publisher-1.log</strong>, the publisher-1.log cannot be found xD</p> <p>So, any clues ? and thanks in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/418216/float32multiarray-in-pub/sub-example/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/149103/lilipop/" rel="nofollow noreferrer">Lilipop</a> on ROS Answers with karma: 9 on 2023-08-07</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/1272/jarvisschultz/" rel="nofollow noreferrer">jarvisschultz</a> on 2023-08-07</strong>:<br /> Here's an example that <a href="https://gist.github.com/jarvisschultz/7a886ed2714fac9f5226" rel="nofollow noreferrer">does work</a>. I'm guessing your problem is that in this chunk <code>data.data[i]=i;</code> you have not told the computer that the <code>data.data</code> vector should have 5 entries. So you are trying to access uninitialized memory. You should likely be using something like <code>push_back</code> or <code>data.data.resize(5);</code> before your <code>for</code> loop in the publisher.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/1272/jarvisschultz/" rel="nofollow noreferrer">jarvisschultz</a> on 2023-08-07</strong>:<br /> If you look at the example above, you'll see that I use <code>push_back</code> on <code>Float32MultiArray.layout</code> to set the size of that vector, and then I use <code>std::vector::resize</code> to resize a vector that will contain the data I'm trying to publish (which I eventually set equal to <code>Float32MultiArray.data</code>).</p> <p>Side note, I believe the <code>exit code -11</code> is coming from <a href="https://docs.python.org/3/library/subprocess.html#subprocess.Popen.returncode" rel="nofollow noreferrer">Python's subprocess poll</a> function which, according to that link, would indicate your program exiting due to a signal 11. Note, <code>roslaunch</code> is written in Python and uses the <code>subprocess</code> module to run nodes. <a href="https://man7.org/linux/man-pages/man7/signal.7.html" rel="nofollow noreferrer">This would correspond</a> to a <code>SIGSEGV</code> -- which is an invalid memory reference. This is consistent with my previous comment.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/149103/lilipop/" rel="nofollow noreferrer">Lilipop</a> on 2023-08-08</strong>:<br /> Hey, thanks a lot for the detailed answer. With the resize function now, I am able to get a functionning publisher !</p> <p>Thanks again for your explanation :)</p> <p><strong>Comment by <a href="https://answers.ros.org/users/1272/jarvisschultz/" rel="nofollow noreferrer">jarvisschultz</a> on 2023-08-09</strong>:<br /> Cool. I'm going to convert these to an answer so that this shows up as answered. If you wouldn't mind accepting that would be helpful too.</p>
Float32MultiArray in pub/sub example
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>According to <a href="http://design.ros2.org/articles/changes.html" rel="nofollow noreferrer">this document</a>: &quot;The field has been deprecated for a long time and was not set consistently in ROS 1.&quot; In many cases the subscribers would ignore the sequence number, so it made sense to remove it to reduce overhead. Note that this header is shared across a large variety of messages, so removal does have an impact.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/53718/bernd-pfrommer/" rel="nofollow noreferrer">Bernd Pfrommer</a> with karma: 78 on 2023-08-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103482
2023-08-07T10:07:17.000
|ros|ros2|std-msgs|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I'm upgrading a ros1 package to ros2 and found that <code>std_msgs/Header</code> msg has changed.</p> <p>in ros1: <a href="https://github.com/ros/std_msgs/blob/kinetic-devel/msg/Header.msg" rel="nofollow noreferrer">https://github.com/ros/std_msgs/blob/kinetic-devel/msg/Header.msg</a></p> <pre><code># sequence ID: consecutively increasing ID uint32 seq </code></pre> <p>while in ros2: <a href="https://github.com/ros2/common_interfaces/blob/rolling/std_msgs/msg/Header.msg" rel="nofollow noreferrer">https://github.com/ros2/common_interfaces/blob/rolling/std_msgs/msg/Header.msg</a></p> <p><code>seq</code> is removed. Why?</p> <hr /> <p><a href="https://answers.ros.org/question/418217/why-ros2-std_msgs/header-removes-%60seq%60?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/120001/felixf4xu/" rel="nofollow noreferrer">felixf4xu</a> on ROS Answers with karma: 23 on 2023-08-07</p> <p>Post score: 0</p>
Why ros2 std_msgs/Header removes `seq`?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Make the controller asymmetric in its behavior so it has no preference for forward or reverse. While in French, this is an interesting talk showing it in action by Dexory <a href="https://indymotion.fr/w/mrZTsoJQeJH45jFdZ7sH1z" rel="nofollow noreferrer">https://indymotion.fr/w/mrZTsoJQeJH45jFdZ7sH1z</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-08-08</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/126519/kenloumixx/" rel="nofollow noreferrer">kenloumixx</a> on 2023-08-08</strong>:<br /> Thanks for sharing the interesting link! I followed your instructions and changed the parameter values ​​and it works fine! May I ask one question? To make the robot face front after reached the goal behind it, I should not set the yaw_goal_tolearance to 0.0, which makes the robot turn around. So I set the yaw_goal_tolerance to 3.14. Would you recommend me another way to solve this problem, please?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2023-08-09</strong>:<br /> You could use a goal checker that doesn't care about orientation -- or just set it to 2 Pi so that when it reaches the XY position that it ignores orientation as always being fulfilled.</p>
103484
2023-08-07T20:57:40.000
|navigation|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, I use ROS2 humble navigation2 package.</p> <p>I'd like to make the robot move like this: When the robot's goal is set behind it, it arrives at the goal behind it, instead of turning backward and heading toward the goal in the front direction.</p> <p>My navigation parameters are as below and I changed the min_vel_x to -0.5 but it didn't work.</p> <p>Thanks in advance :)</p> <pre><code>amcl: ros__parameters: use_sim_time: True alpha1: 0.2 alpha2: 0.2 alpha3: 0.2 alpha4: 0.2 alpha5: 0.2 base_frame_id: &quot;base_link&quot; beam_skip_distance: 0.5 beam_skip_error_threshold: 0.9 beam_skip_threshold: 0.3 do_beamskip: false global_frame_id: &quot;map&quot; lambda_short: 0.1 laser_likelihood_max_dist: 2.0 laser_max_range: 100.0 laser_min_range: 0.4 laser_model_type: &quot;likelihood_field&quot; max_beams: 60 max_particles: 2000 min_particles: 500 odom_frame_id: &quot;odom&quot; pf_err: 0.05 pf_z: 0.99 recovery_alpha_fast: 0.0 recovery_alpha_slow: 0.0 resample_interval: 1 robot_model_type: &quot;nav2_amcl::DifferentialMotionModel&quot; save_pose_rate: 0.5 sigma_hit: 0.2 tf_broadcast: true transform_tolerance: 1.0 update_min_a: 0.2 update_min_d: 0.25 z_hit: 0.5 z_max: 0.05 z_rand: 0.5 z_short: 0.05 set_initial_pose: True initial_pose: {x: -6.0, y: -1.0, z: 0.0, yaw: 0.0} amcl_map_client: ros__parameters: use_sim_time: True amcl_rclcpp_node: ros__parameters: use_sim_time: True bt_navigator: ros__parameters: use_sim_time: True global_frame: map robot_base_frame: base_link odom_topic: /odom default_server_timeout: 60000 default_nav_to_pose_bt_xml: &quot;/workspace/src/a1_robot/params/follow_point_bt.xml&quot; # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. plugin_lib_names: - nav2_compute_path_to_pose_action_bt_node - nav2_compute_path_through_poses_action_bt_node - nav2_smooth_path_action_bt_node - nav2_follow_path_action_bt_node - nav2_spin_action_bt_node - nav2_wait_action_bt_node - nav2_assisted_teleop_action_bt_node - nav2_back_up_action_bt_node - nav2_drive_on_heading_bt_node - nav2_clear_costmap_service_bt_node - nav2_is_stuck_condition_bt_node - nav2_goal_reached_condition_bt_node - nav2_goal_updated_condition_bt_node - nav2_globally_updated_goal_condition_bt_node - nav2_is_path_valid_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_truncate_path_local_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_path_expiring_timer_condition - nav2_distance_traveled_condition_bt_node - nav2_single_trigger_bt_node - nav2_goal_updated_controller_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 - nav2_controller_cancel_bt_node - nav2_path_longer_on_approach_bt_node - nav2_wait_cancel_bt_node - nav2_spin_cancel_bt_node - nav2_back_up_cancel_bt_node - nav2_assisted_teleop_cancel_bt_node - nav2_drive_on_heading_cancel_bt_node bt_navigator_navigate_through_poses_rclcpp_node: ros__parameters: use_sim_time: True bt_navigator_navigate_to_pose_rclcpp_node: ros__parameters: use_sim_time: True controller_server: ros__parameters: use_sim_time: True controller_frequency: 20.0 min_x_velocity_threshold: 0.001 min_y_velocity_threshold: 0.5 min_theta_velocity_threshold: 0.001 controller_plugins: [&quot;FollowPath&quot;] progress_checker_plugin: &quot;progress_checker&quot; goal_checker_plugins: [&quot;general_goal_checker&quot;] # &quot;precise_goal_checker&quot; controller_plugins: [&quot;FollowPath&quot;] # Progress checker parameters progress_checker: plugin: &quot;nav2_controller::SimpleProgressChecker&quot; required_movement_radius: 0.5 movement_time_allowance: 6000000.0 general_goal_checker: stateful: True plugin: &quot;nav2_controller::SimpleGoalChecker&quot; xy_goal_tolerance: 4.0 yaw_goal_tolerance: 0.0 # DWB parameters FollowPath: plugin: &quot;dwb_core::DWBLocalPlanner&quot; debug_trajectory_details: True min_vel_x: 0.0 min_vel_y: 0.0 max_vel_x: 0.5 max_vel_y: 0.0 max_vel_theta: 1.0 min_speed_xy: 0.0 max_speed_xy: 0.5 min_speed_theta: 0.0 acc_lim_x: 2.5 acc_lim_y: 0.0 acc_lim_theta: 3.2 decel_lim_x: -2.5 decel_lim_y: 0.0 decel_lim_theta: -3.2 vx_samples: 20 vy_samples: 5 vtheta_samples: 20 sim_time: 1.7 linear_granularity: 0.05 angular_granularity: 0.025 transform_tolerance: 0.2 xy_goal_tolerance: 4.0 trans_stopped_velocity: 0.25 short_circuit_trajectory_evaluation: True stateful: True 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 controller_server_rclcpp_node: ros__parameters: use_sim_time: True local_costmap: local_costmap: ros__parameters: update_frequency: 5.0 publish_frequency: 2.0 global_frame: odom robot_base_frame: base_link use_sim_time: True rolling_window: true width: 7 height: 7 resolution: 0.1 robot_radius: 0.36 plugin_names: [&quot;obstacle_layer&quot;, &quot;voxel_layer&quot;, &quot;inflation_layer&quot;] inflation_layer: plugin: &quot;nav2_costmap_2d::InflationLayer&quot; cost_scaling_factor: 0.4 inflation_radius: 0.32 obstacle_layer: plugin: &quot;nav2_costmap_2d::ObstacleLayer&quot; enabled: True observation_sources: scan scan: topic: /scan max_obstacle_height: 2.0 clearing: True marking: True data_type: &quot;LaserScan&quot; voxel_layer: plugin: &quot;nav2_costmap_2d::VoxelLayer&quot; enabled: True publish_voxel_map: True origin_z: 0.0 z_resolution: 0.05 z_voxels: 16 max_obstacle_height: 2.0 mark_threshold: 0 observation_sources: pointcloud pointcloud: topic: /point_cloud max_obstacle_height: 2.0 clearing: True marking: True data_type: &quot;PointCloud2&quot; static_layer: map_subscribe_transient_local: True always_send_full_costmap: True local_costmap_client: ros__parameters: use_sim_time: True local_costmap_rclcpp_node: ros__parameters: use_sim_time: True global_costmap: global_costmap: ros__parameters: update_frequency: 1.0 publsih_frequency: 1.0 global_frame: map robot_base_frame: base_link use_sim_time: True robot_radius: 0.36 resolution: 0.05 plugins: [&quot;static_layer&quot;, &quot;obstacle_layer&quot;, &quot;voxel_layer&quot;, &quot;inflation_layer&quot;] obstacle_layer: plugin: &quot;nav2_costmap_2d::ObstacleLayer&quot; enabled: True observation_sources: scan scan: topic: /scan max_obstacle_height: 2.0 clearing: True marking: True data_type: &quot;LaserScan&quot; voxel_layer: plugin: &quot;nav2_costmap_2d::VoxelLayer&quot; enabled: True publish_voxel_map: True origin_z: 0.0 z_resolution: 0.05 z_voxels: 16 max_obstacle_height: 2.0 mark_threshold: 0 observation_sources: pointcloud pointcloud: topic: /point_cloud max_obstacle_height: 2.0 clearing: True marking: True data_type: &quot;PointCloud2&quot; static_layer: plugin: &quot;nav2_costmap_2d::StaticLayer&quot; map_subscribe_transient_local: True inflation_layer: plugin: &quot;nav2_costmap_2d::InflationLayer&quot; always_send_full_costmap: True global_costmap_client: ros__parameters: use_sim_time: True global_costmap_rclcpp_node: ros__parameters: use_sim_time: True map_server: ros__parameters: use_sim_time: True yaml_filename: &quot;carter_warehouse_navigation.yaml&quot; map_saver: ros__parameters: use_sim_time: True save_map_timeout: 5000 free_thresh_default: 0.25 occupied_thresh_default: 0.65 planner_server: ros__parameters: expected_planner_frequency: 20.0 use_sim_time: True planner_plugins: [&quot;GridBased&quot;] GridBased: plugin: &quot;nav2_navfn_planner/NavfnPlanner&quot; tolerance: 0.5 use_astar: false allow_unknown: true planner_server_rclcpp_node: ros__parameters: use_sim_time: True smoother_server: ros__parameters: use_sim_time: True smoother_plugins: [&quot;simple_smoother&quot;] simple_smoother: plugin: &quot;nav2_smoother::SimpleSmoother&quot; tolerance: 1.0e-10 max_its: 1000 do_refinement: True behavior_server: ros__parameters: costmap_topic: local_costmap/costmap_raw footprint_topic: local_costmap/published_footprint cycle_frequency: 10.0 behavior_plugins: [&quot;spin&quot;, &quot;backup&quot;, &quot;drive_on_heading&quot;, &quot;assisted_teleop&quot;, &quot;wait&quot;] spin: plugin: &quot;nav2_behaviors/Spin&quot; backup: plugin: &quot;nav2_behaviors/BackUp&quot; drive_on_heading: plugin: &quot;nav2_behaviors/DriveOnHeading&quot; wait: plugin: &quot;nav2_behaviors/Wait&quot; assisted_teleop: plugin: &quot;nav2_behaviors/AssistedTeleop&quot; global_frame: odom robot_base_frame: base_link transform_tolerance: 0.1 use_sim_time: true simulate_ahead_time: 2.0 max_rotational_vel: 1.0 min_rotational_vel: 0.4 rotational_acc_lim: 3.2 robot_state_publisher: ros__parameters: use_sim_time: True waypoint_follower: ros__parameters: use_sim_time: True loop_rate: 20 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: use_sim_time: True smoothing_frequency: 20.0 scale_velocities: False feedback: &quot;OPEN_LOOP&quot; max_velocity: [0.26, 0.0, 1.0] min_velocity: [-0.26, 0.0, -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 deadband_velocity: [0.0, 0.0, 0.0] velocity_timeout: 1.0 recoveries_server: ros__parameters: costmap_topic: local_costmap/costmap_raw footprint_topic: local_costmap/published_footprint cycle_frequency: 10.0 recovery_plugins: [&quot;spin&quot;, &quot;backup&quot;, &quot;wait&quot;] spin: plugin: &quot;nav2_recoveries/Spin&quot; backup: plugin: &quot;nav2_recoveries/BackUp&quot; wait: plugin: &quot;nav2_recoveries/Wait&quot; global_frame: odom robot_base_frame: base_link transform_timeout: 0.1 use_sim_time: True simulate_ahead_time: 2.0 max_rotational_vel: 1.0 min_rotational_vel: 0.4 rotational_acc_lim: 3.2 </code></pre> <hr /> <p><a href="https://answers.ros.org/question/418243/nav2-how-to-make-robot-goes-backward/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/126519/kenloumixx/" rel="nofollow noreferrer">kenloumixx</a> on ROS Answers with karma: 7 on 2023-08-07</p> <p>Post score: 0</p>
Nav2 how to make robot goes backward
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Your code is not doing this correctly. Please look at section 2 of <a href="http://wiki.ros.org/rospy/Overview/Time" rel="nofollow noreferrer">http://wiki.ros.org/rospy/Overview/Time</a> for the proper way to construct a while/Rate loop in python.</p> <pre><code>while not R.is_shutdown: # &lt;- wrong print(t_o) pub.publish(t_o) R.Rate(10) # &lt;- wrong R.spin() # &lt;- wrong </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-08-08</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/168802/nongtuy/" rel="nofollow noreferrer">Nongtuy</a> on 2023-08-08</strong>:<br /> Oh silly me, I always forget to add () in definition. After I added that it works properly now Thank you Best regard, Tuy</p>
103486
2023-08-08T03:09:57.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm trying to make system consist of several sections, it must surely have at least 1 node doing 2 roles, both subscriber and publisher. and here it my codes.</p> <hr /> <p>##First section##</p> <pre><code>#!/usr/bin/env python3 import rospy as R from std_msgs.msg import Float64 def sender_3(): x = 0 y = float(input(&quot;Give us the float num: &quot;)) pub = R.Publisher(&quot;line3&quot;, Float64, queue_size=10) R.init_node(&quot;sender_3&quot;, anonymous=True) rate = R.Rate(10) while not R.is_shutdown() and x &lt; y: x += 0.1 t = x print(x) pub.publish(t) rate.sleep() if __name__ == &quot;__main__&quot;: try: sender_3() except R.ROSInterruptException: pass </code></pre> <hr /> <h2>Second section</h2> <pre><code>#!/usr/bin/env python3 import rospy as R from std_msgs.msg import Float64, String def callback(data): global r_data r_data = data.data R.loginfo(&quot;sawadee krub i've received as info: %f&quot;, data.data) global t_o t_o = str(r_data) R.loginfo(&quot;Applied num to chatGPT: %s&quot;, t_o) def receiver_2(): R.init_node(&quot;receiver_2&quot;, anonymous=10) R.Subscriber(&quot;line3&quot;, Float64, callback, queue_size=True) pub = R.Publisher(&quot;translne&quot;, String, queue_size=10) rate = R.Rate(10) while not R.is_shutdown: print(t_o) pub.publish(t_o) rate.sleep() R.spin() #def transporter(): # R.init_node(&quot;transporter send you&quot;, anonymous=10) # pub = R.Publisher(&quot;translne&quot;, String, queue_size=10) # while not R.is_shutdown: # print(receiver_2) # pub.publish(receiver_2) # R.Rate(10) if __name__ == &quot;__main__&quot;: receiver_2() </code></pre> <hr /> <h2>Last section</h2> <pre><code>#!/usr/bin/env python3 import rospy as R from std_msgs.msg import String def callback(data): R.loginfo(&quot;I've received an information: %s&quot;, data.data) def sub_receiver(): R.init_node(&quot;sub_receiver&quot;, anonymous=True) R.Subscriber(&quot;translne&quot;, String , callback, queue_size=10) R.spin() if __name__ == &quot;__main__&quot;: sub_receiver() </code></pre> <hr /> <p>My problem is during the transition between second and last section, it seems like last section didn't receive any information which is translated into String and published to last section, cause there's nothing appears even error. P.S I commented on third section for several previous tries. Edited: Mistakes have been fixed.</p> <p>Thank you in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/418256/trying-to-publish-information-from-subscriber-node./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/168802/nongtuy/" rel="nofollow noreferrer">Nongtuy</a> on ROS Answers with karma: 3 on 2023-08-08</p> <p>Post score: 0</p>
Trying to publish information from subscriber node
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In the end I've managed to do it like this:</p> <pre><code>TEST(SmokeTests, NodeStartingCorrectly) { char arg0[] = &quot;--ros-args&quot;; char arg1[] = &quot;--params-file&quot;; char arg2[] = &quot;test.yaml&quot;; char* argv[] = { &amp;arg0[0], &amp;arg1[0], &amp;arg2[0], NULL }; int argc = (int)(sizeof(argv) / sizeof(argv[0])) - 1; // Initialization rclcpp::init(argc, argv); // Instantiation rclcpp::Node::SharedPtr node = std::make_shared&lt;PelicanUnit&gt;(); rclcpp::executors::MultiThreadedExecutor executor; executor.add_node(node); std::thread t( [&amp;](){ ASSERT_NO_THROW(executor.spin();); } ); std::this_thread::sleep_for(std::chrono::seconds(5)); executor.cancel(); t.join(); // Wait for thread completion rclcpp::shutdown(); } </code></pre> <p>I have not found another way with <code>spin_some</code> or <code>spin_until_future_complete</code>, probably due to something related to these issues:</p> <ul> <li><a href="https://github.com/ros2/rclcpp/issues/1916" rel="nofollow noreferrer">https://github.com/ros2/rclcpp/issues/1916</a></li> <li><a href="https://github.com/ros2/rclpy/issues/585" rel="nofollow noreferrer">https://github.com/ros2/rclpy/issues/585</a></li> <li><a href="https://github.com/ros2/rclcpp/issues/1454" rel="nofollow noreferrer">https://github.com/ros2/rclcpp/issues/1454</a></li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/145981/slim71/" rel="nofollow noreferrer">slim71</a> with karma: 18 on 2023-08-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103488
2023-08-08T16:14:11.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I've been trying to write some tests for my package, but with not much success until now...</p> <p>I have a &quot;PelicanUnit&quot; node and in its constructor I require a path to a <em>.sdf</em> model: if that's not given, everything shuts down with a <strong>std::runtime_error</strong>. Now, using colcon test and <strong>Google Test</strong>, I've been trying to write sort of like smoketests for successful and unsuccessful launches. The failing case has been a little tricky, but in the end I've managed with this:</p> <pre><code>TEST(SmokeTests, ParseModelFailing) { // Initialize RCLCPP rclcpp::init(0, nullptr); EXPECT_THROW( { try { PelicanUnit pelican; } catch (const std::exception&amp; e) { EXPECT_STREQ(&quot;Agent model could not be parsed!&quot;, e.what()); throw; // Re-throw the exception for Google Test to catch } }, std::runtime_error); // Shutdown RCLCPP rclcpp::shutdown(); } </code></pre> <p>Unfortunately, I cannot find a way for the other test.</p> <p>Up until now I've tried:</p> <ul> <li><p>launching the node from the test itself but I could not pass the config file I normally use with the standard launch file</p> <pre><code> TEST(SmokeTests, Main) { // Useless, since the node itself does not parse arguments (?) char arg0[] = &quot;--params-file&quot;; char arg1[] = &quot;src/pelican/config/copter1.yaml&quot;; // TODO: use package share directory char* argv[] = { &amp;arg0[0], &amp;arg1[0], NULL }; int argc = (int)(sizeof(argv) / sizeof(argv[0])) - 1; // Initialization rclcpp::init(argc, argv); // Instantiation rclcpp::Node::SharedPtr node = std::make_shared&lt;PelicanUnit&gt;(); rclcpp::executors::MultiThreadedExecutor executor; executor.add_node(node); executor.spin(); rclcpp::shutdown(); } </code></pre> </li> <li><p>using a test launch_file, which has been somewhat almost good, but the config file used has not been found and, most importantly, I'm not sure I can use this as a proper test. I can only test that the command is launched, not that the node itself fires up smoothly...</p> <pre><code> TEST(SmokeTests, NodeStartingCorrectly) { // Set the launch file path and arguments const std::string pwd = &quot;source &quot;; const std::string launch_command = &quot;ros2 launch pelican test_launch.launch.py&quot;; // Run the launch command and check its exit status std::system(pwd.c_str()); int exit_status = std::system(launch_command.c_str()); ASSERT_EQ(exit_status, 0); } </code></pre> </li> </ul> <p>(launch file)</p> <pre><code>from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare from launch.substitutions import PathJoinSubstitution, ThisLaunchFileDir def generate_launch_description(): config_pkg_share = FindPackageShare('pelican') config_middleware = 'config/' ld = LaunchDescription() config_file = 'copter1.yaml' node = Node( package='pelican', executable='pelican_unit', ros_arguments=['--params-file', PathJoinSubstitution([config_pkg_share, config_middleware, config_file])] ) ld.add_action(node) return ld </code></pre> <p>Is there anyone that can provide some assistance or suggestions for this? Thank you!</p> <hr /> <p><a href="https://answers.ros.org/question/418284/%5Bros2%5D-testing-launch-of-node/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/145981/slim71/" rel="nofollow noreferrer">slim71</a> on ROS Answers with karma: 18 on 2023-08-08</p> <p>Post score: 0</p>
[ROS2] Testing launch of Node
<p>The detachable joint plugin can also attach two models (specifically, links from two different models) together with a fixed joint. Here's <a href="https://github.com/osrf/mbzirc/blob/ec66f35c1fc925f18565c03251bd5f12f5b6b4e3/mbzirc_ign/src/SuctionGripper.cc#L278-L283" rel="nofollow noreferrer">an example</a> of how that's done in code</p>
103499
2023-08-16T01:51:16.150
|robotic-arm|gazebo|
<p>I'm trying to attach a moving object with inertia to a robotic arm. I saw that there are plugins for detaching joints but is there a way to do the opposite and attach one model to another via a joint? preferably it would maintain its velocity and angular velocity till acted on by the arm. If not, then could 2 separate SDF models be designed one with the model attached, then swap one model for the other during simulation?</p>
Gazebo ignition (garden/fortress) attaching model to arm
<p>Adapting <code>test_flake8.py</code> like underneath reads a <code>flake8.ini</code> file in the Ros workspace folder. Perhaps there's a cleaner way to find the ini file, but at least this works.</p> <pre><code>@pytest.mark.flake8 @pytest.mark.linter def test_flake8(): # Find flake8.ini in Ros workspace folder config_path = Path(__file__).resolve().parent.parent.parent.parent / 'flake8.ini' rc, errors = main_with_errors(argv=['--config', str(config_path)]) assert rc == 0, \ f'Found {len(errors):d} code style errors / warnings:\n' + '\n'.join(errors) </code></pre>
103510
2023-08-16T10:24:13.407
|ros2|colcon|ros-humble|
<p>When creating a package Ros2 automatically generates these tests: <code>test_copyright.py</code>, <code>test_flake8.py</code>, <code>test_pep257.py</code>. Running <code>colcon test</code> invokes these tests and that's fine if I'd be able to configure flake8 and pep257. According to the (somewhat scarce) documentation you can add a configuration file <code>~/.config/flake8</code> with for instance:</p> <pre><code>[flake8] extend-ignore = E501 </code></pre> <p>Or you can add configurations to a Ros2 package's <code>setup.cfg</code> file with for instance:</p> <pre><code>[flake8] extend-ignore = E501 </code></pre> <p>However, both options don't seem to work. Does anyone have any ideas how to configure these tools when running with <code>colcon test</code>? Thanks in advance!</p>
How to configure Flake8 with colcon test
<p>Here is what I guess is going on. When you add the PointCloud2 viewer in RVIZ left panel, this viewer will create a subscriber, if you are not trying to view a PointCloud just remove the PointCloud message viewer from the left panel. Is there any node that you are trying to subscribe to?</p>
103512
2023-08-16T13:46:32.023
|ros2|rviz|markerarray|
<p>I'm publishing on a topic with message type <code>'visualization_msgs/msg/MarkerArray'</code>. However, rviz does not show these markers, because it subscribes to a <code>sensor_msgs/msg/PointCloud2</code> message. How can I solve this problem. The publishing node has following code:</p> <pre><code>import rclpy from rclpy.node import Node from rclpy.qos import QoSProfile, QoSReliabilityPolicy, QoSHistoryPolicy from visualization_msgs.msg import Marker from visualization_msgs.msg import MarkerArray from tum_msgs.msg import TUMDetectedObject from tum_msgs.msg import TUMDetectedObjects class MarkerMapping(Node): def __init__(self): super().__init__('marker_mapping') self.declare_parameter('target_frame', 'rear_axle_middle_ground') self.target_frame = self.get_parameter('target_frame').value self.declare_parameter('topic_parameter', 'clustering') self.topic_parameter = self.get_parameter('topic_parameter').value if self.topic_parameter == 'clustering': self.subscription = self.create_subscription(TUMDetectedObjects, '/mod_objects/DetectedObjectsClustering', self.callback, qos_profile = rclpy.qos.qos_profile_parameters) self.subscription self.bbox_publisher = self.create_publisher(MarkerArray, '/mod_objects/marker_mapping_bbox_clustering', qos_profile = rclpy.qos.qos_profile_parameters) # Remapped topics from baseline (&quot;old&quot;) algorithms if run in debug/comparison mode self.subscription_old = self.create_subscription(TUMDetectedObjects, '/old/mod_objects/DetectedObjectsClustering', self.callback_old, qos_profile = rclpy.qos.qos_profile_parameters) self.subscription_old self.bbox_publisher_old = self.create_publisher(MarkerArray, '/old/mod_objects/marker_mapping_bbox_clustering', qos_profile = rclpy.qos.qos_profile_parameters) elif self.topic_parameter == 'lidar': self.subscription = self.create_subscription(TUMDetectedObjects, 'mod_objects/DetectedObjectsLidar', self.callback, qos_profile = rclpy.qos.qos_profile_parameters) self.subscription self.bbox_publisher = self.create_publisher(MarkerArray, 'mod_objects/marker_mapping_bbox_detection', qos_profile = rclpy.qos.qos_profile_parameters) # Remapped topics from baseline (&quot;old&quot;) algorithms if run in debug/comparison mode and &quot;/old/...&quot; topics are published self.subscription_old = self.create_subscription(TUMDetectedObjects, 'old/mod_objects/DetectedObjectsLidar', self.callback_old, qos_profile = rclpy.qos.qos_profile_parameters) self.subscription_old self.bbox_publisher_old = self.create_publisher(MarkerArray, 'old/mod_objects/marker_mapping_bbox_lidar', qos_profile = rclpy.qos.qos_profile_parameters) elif self.topic_parameter == 'radar': self.subscription = self.create_subscription(TUMDetectedObjects, 'mod_objects/DetectedObjectsRadar', self.callback, qos_profile = rclpy.qos.qos_profile_parameters) self.subscription self.bbox_publisher = self.create_publisher(MarkerArray, 'mod_objects/marker_mapping_bbox_radar', qos_profile = rclpy.qos.qos_profile_parameters) # Remapped topics from baseline (&quot;old&quot;) algorithms if run in debug/comparison mode and &quot;/old/...&quot; topics are published self.subscription_old = self.create_subscription(TUMDetectedObjects, 'old/mod_objects/DetectedObjectsRadar', self.callback_old, qos_profile = rclpy.qos.qos_profile_parameters) self.subscription_old self.bbox_publisher_old = self.create_publisher(MarkerArray, 'old/mod_objects/marker_mapping_bbox_radar', qos_profile = rclpy.qos.qos_profile_parameters) def callback(self, msg): &quot;&quot;&quot; Creates bounding boxes for detected objects and publishes them as MarkerArrays. &quot;&quot;&quot; markerArray = MarkerArray() marker = Marker() marker.action = marker.DELETEALL markerArray.markers.append(marker) for idx, object in enumerate(msg.objects): marker = Marker() marker.header.frame_id = self.target_frame marker.id = idx marker.ns = str(idx) marker.type = marker.CUBE marker.action = marker.ADD marker.scale.x = 4.9 marker.scale.y = 1.8 marker.scale.z = 1.0 marker.color.a = 0.8 if self.topic_parameter == 'clustering': marker.color.r = 1.0 #r/255 marker.color.g = 0.0 #g/255 marker.color.b = 0.0 #b/255 elif self.topic_parameter == 'lidar': marker.color.r = 0.0 #r/255 marker.color.g = 1.0 #g/255 marker.color.b = 0.0 #b/255 elif self.topic_parameter == 'radar': marker.color.r = 0.0 #r/255 marker.color.g = 0.0 #g/255 marker.color.b = 1.0 #b/255 marker.pose.position.x = object.kinematics.pose.pose.position.x marker.pose.position.y = object.kinematics.pose.pose.position.y marker.pose.position.z = object.kinematics.pose.pose.position.z markerArray.markers.append(marker) self.bbox_publisher.publish(markerArray) def callback_old(self, msg): &quot;&quot;&quot; Creates bounding boxes for objects detected with the baseline algorithms and publishes them in less saturated colors as MarkerArrays. &quot;&quot;&quot; markerArray = MarkerArray() marker = Marker() marker.action = marker.DELETEALL markerArray.markers.append(marker) #self.get_logger().info('Callback old') for idx, object in enumerate(msg.objects): marker = Marker() marker.header.frame_id = self.target_frame marker.id = idx marker.ns = str(idx) marker.type = marker.CUBE marker.action = marker.ADD marker.scale.x = 4.9 marker.scale.y = 1.8 marker.scale.z = 1.0 marker.color.a = 1.0 if self.topic_parameter == 'clustering': marker.color.r = 1.0 #r/255 marker.color.g = 0.0 #g/255 marker.color.b = 0.0 #b/255 elif self.topic_parameter == 'lidar': marker.color.r = 0.0 #r/255 marker.color.g = 1.0 #g/255 marker.color.b = 0.0 #b/255 elif self.topic_parameter == 'radar': marker.color.r = 0.0 #r/255 marker.color.g = 0.0 #g/255 marker.color.b = 1.0 #b/255 marker.pose.position.x = object.kinematics.pose.pose.position.x marker.pose.position.y = object.kinematics.pose.pose.position.y marker.pose.position.z = object.kinematics.pose.pose.position.z markerArray.markers.append(marker) self.bbox_publisher_old.publish(markerArray) def main(args=None): rclpy.init(args=args) marker_mapper = MarkerMapping() rclpy.spin(marker_mapper) marker_mapper.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p>Here is the <code>topic info</code> output from the terminal:</p> <pre><code>ros2 topic info --verbose /old/mod_objects/marker_mapping_bbox_clustering Type: ['sensor_msgs/msg/PointCloud2', 'visualization_msgs/msg/MarkerArray'] Publisher count: 1 Node name: clustering_marker_mapping Node namespace: / Topic type: visualization_msgs/msg/MarkerArray Endpoint type: PUBLISHER GID: 01.10.ab.69.44.14.b7.be.8c.b0.1c.ac.00.00.17.03.00.00.00.00.00.00.00.00 QoS profile: Reliability: RELIABLE History (Depth): UNKNOWN Durability: VOLATILE Lifespan: Infinite Deadline: Infinite Liveliness: AUTOMATIC Liveliness lease duration: Infinite Subscription count: 2 Node name: rviz Node namespace: / Topic type: sensor_msgs/msg/PointCloud2 Endpoint type: SUBSCRIPTION GID: 01.0f.4a.f4.77.36.67.43.01.00.00.00.00.00.3e.04.00.00.00.00.00.00.00.00 QoS profile: Reliability: BEST_EFFORT History (Depth): UNKNOWN Durability: VOLATILE Lifespan: Infinite Deadline: Infinite Liveliness: AUTOMATIC Liveliness lease duration: Infinite Node name: _ros2cli_46973 Node namespace: / Topic type: sensor_msgs/msg/PointCloud2 Endpoint type: SUBSCRIPTION GID: 01.10.15.db.bb.df.5c.90.fd.9f.7b.fd.00.00.08.04.00.00.00.00.00.00.00.00 QoS profile: Reliability: BEST_EFFORT History (Depth): UNKNOWN Durability: VOLATILE Lifespan: Infinite Deadline: Infinite Liveliness: AUTOMATIC Liveliness lease duration: Infinite <span class="math-container">```</span> </code></pre>
ROS2 Rviz node subscribes to wrong message type
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I received my Euclid this week and I'm trying to understand the Intel Euclid aproach now. Seems to be easy to extent some basic behaviors for students.</p> <p>I've used an Intel NUC i5 (16 GB Memory, 256 GB SSD disk) with R200 before and I will give Euclid a first try now.</p> <p>I did not expect too much, but simple SLAM with my Roomba should work. This Eucid box is really comfortable and easy to handle. I expect for small projects, it's enough power and better than using a Raspi and a lot of additional own build modules for IMU, CAM and other IO modules.</p> <p>Cheers</p> <p>Chrimo</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/23415/chrimo/" rel="nofollow noreferrer">ChriMo</a> with karma: 476 on 2017-08-27</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/26871/billy/" rel="nofollow noreferrer">billy</a> on 2017-08-28</strong>:<br /> Please keep us updated. I have looked at it but it's a lot of money for a hobbyist. Is it stereo camera or projector and camera like kinect? It's not obvious on the website but they say it can be used outdoors.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/23415/chrimo/" rel="nofollow noreferrer">ChriMo</a> on 2017-09-03</strong>:<br /> <a href="https://www.clearpathrobotics.com/2017/08/clearpath-robotics-announces-turtlebot-euclid/" rel="nofollow noreferrer">https://www.clearpathrobotics.com/2017/08/clearpath-robotics-announces-turtlebot-euclid/</a></p> <p>I bet, this cooperation will give ros euclid users more informations for missing hw documentation and api.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/23415/chrimo/" rel="nofollow noreferrer">ChriMo</a> on 2017-09-03</strong>:<br /> Today, I'm tried the Euclid outdoors and I'm not very happy with the depth image... Small trees or plants are not detected or shown. Inside it is OK. I need to check it without direct sun later.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/23415/chrimo/" rel="nofollow noreferrer">ChriMo</a> on 2017-09-05</strong>:<br /> <a href="https://discourse.ros.org/t/intel-euclid-irobot-explorer/2569" rel="nofollow noreferrer">https://discourse.ros.org/t/intel-euclid-irobot-explorer/2569</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/23415/chrimo/" rel="nofollow noreferrer">ChriMo</a> on 2017-10-29</strong>:<br /> After 2 month of working with Euclid, I must say: Software and SDK are OK and have nice UI, but the hardware is unusable for real robots. Poor accu and charging capabilities, instable overheated board design and very poor ros support for new integrated sensors.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2017-10-29</strong>:<br /> Did it come with any 'promises' of 'ROS support' for the sensors?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/23415/chrimo/" rel="nofollow noreferrer">ChriMo</a> on 2017-11-11</strong>:<br /> no, still waiting for feedback... coming soon :-)</p>
103514
2017-08-15T00:48:15.000
|ros|realsense-camera|3dcamera|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am a software engineer working mainly on robotic systems. I am wondering if anybody has tried the Intel 3D depth camera for robotic platform? How about its performance? From its description by Intel, it seems quite powerful and compact, I am considering to try this.</p> <hr /> <p><a href="https://answers.ros.org/question/268825/anybody-tried-intel%C2%AE-euclid%E2%84%A2-development-kit/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/31579/uvuvwevwevwe-onyetenyevwe-ugwemuhwem-osas/" rel="nofollow noreferrer">uvuvwevwevwe onyetenyevwe ugwemuhwem osas</a> on ROS Answers with karma: 1 on 2017-08-15</p> <p>Post score: 0</p>
Anybody tried Intel® Euclid™ Development Kit
<p>Upgrade: ros-noetic-moveit-ros-visualization:amd64 (1.1.12-1focal.20230524.164446, 1.1.13-2focal.20230801.165224)</p> <p>solved my problem</p> <p><a href="https://github.com/ros-planning/moveit/commit/e6ef31811bc8354e61e247e1a4d5df7156584f38" rel="nofollow noreferrer">#3478</a></p>
103522
2023-08-17T10:51:37.540
|ros|rviz|moveit|motionplanning|
<p>I have a ros package called &quot;robot_arm_v4&quot; which works fine without rviz but after starting rviz and adding &quot;MotionPlanning&quot; a cpu issue occurs and fps starts to drop.</p> <p>If I disable &quot;MotionPlanning&quot;, this problem disappears.</p> <p>this problem does not happen in melodic (xubuntu 18.04) only noetic (xubuntu 20.04).</p>
ros noetic rviz motion planning fps drop, high cpu
<p>The port /dev/ttyACM0 will not exist if the Raspberry Pi is mounted as a thumb drive. This is common for transferring files to the device.</p> <p>Try unplugging/plugging the USB connector to get get out of the file xfer mode.</p>
103526
2023-08-17T12:16:37.190
|ros|turtlebot3|
<p>ubuntu 20.04, Noetic, turtlebot3</p> <p>Right now I'm doing below thing</p> <p><a href="https://emanual.robotis.com/docs/en/platform/turtlebot3/bringup/#bringup" rel="nofollow noreferrer">https://emanual.robotis.com/docs/en/platform/turtlebot3/bringup/#bringup</a></p> <p>The Problem is that my raspberry pi didn't cognize /dev/ttyACM0(ACM1)(Opencr). And I don't know why... I'm doing that All day long... I unplugged many times. and then I re-install ROS on raspberry. then It worked about 30 minuates.. And then ls: cannot access '/dev/ttyACM0': No such file or directory Again</p>
I don't know why Raspberry Pi didn't cognize /dev/ttyACM0
<p>To your question around the control math being valid, it appears to be mathematically OK, but it's not clear it will work in practice. Moves are usually profiled where you set an end point. Your math (a P-filter controller) will technically never reach the charger since it will slow down as it approaches and will never fully align with it for the same reason. Also the update rate on locating the charger will have to come in very quickly compared to the motion since theta will change as the robot starts moving.</p> <p>My thoughts are that you should line up the robot using theta (with either a PID filter or oscillate around the center point) and move towards the charger at a set (slow) speed until the robot hits the charger. Don't be fancy with velocity. Focus on steering and just move slowly.</p> <p>I have accomplished this with a camera that locates an LED on the charger and steers towards it with a slow set/steady forward speed. When the voltage on the charging pin appears, I stop forward motion. If it takes too long, it stops, backs up and tries again.</p> <p>You have more than one question so should probably break it up.</p>
103536
2023-08-17T20:39:42.173
|ros2|control|inverse-kinematics|path-planning|differential-drive|
<p>I am working on a diff-drive robot that needs to go and dock into a docking station to charge when the battery is low. The charging socket is on the back of the robot, like a vacuum cleaner, so this movement will have to be done in reverse, much like parking a car. I have a diagram that might help you understand the situation better:</p> <p><a href="https://i.stack.imgur.com/sBOxG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sBOxG.png" alt="Robot diagram" /></a></p> <p>From a ROS perspective, all related perception will be in the <code>base_link</code> frame, so that my robot will effectively be at <span class="math-container">$(0, 0, 0)$</span> at all times, and the docking station will be detected in this frame. Let's assume for now that the docking station is at <span class="math-container">$(x_g, y_g, \theta_g)$</span> as shown in the figure. In the ROS implementation, I'd be working with <code>geometry_msgs/PoseStamped</code> messages.</p> <p>I need to be able to write <code>geometry_msgs/Twist</code> messages to the <code>cmd_vel</code> topic in order to make the robot move. Because this is a diff-drive robot, I know that I can only control <code>linear.x</code> and <code>angular.z</code> fields of the particular Twist message.</p> <p><strong>I would like to know if the control law expressed below is valid or not</strong>:</p> <pre><code>/** * pose -&gt; The desired pose (geometry_msgs/PoseStamped) * command -&gt; the resulting joint commands (geometry_msgs/Twist) */ double lin_vel_gain = 0.3; double ang_vel_gain = 0.1; /* Find the linear error */ double linear_error = std::hypot(pose.position.x, pose.position.y); /* Find the angular error */ double angular_error = std::atan2(pose.position.y, pose.position.x); command.linear.x = lin_vel_gain * linear_error; command.angular.z = angular_vel_gain * angular_error; </code></pre> <p>I would also like to know how I can make this better, I was thinking of designing it according to a more classical path-planner, like this:</p> <p><a href="https://i.stack.imgur.com/xZjXv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xZjXv.png" alt="Path planner proposed architecture" /></a></p> <p><strong>How would I go about obtaining these intermediate poses?</strong></p> <p>Any help, including literature and code samples are greatly appreciated.</p> <p>Thanks!</p>
Steer to a pose for a differential drive robot
<p>(copying my <a href="https://github.com/ros2/ros2_documentation/issues/3838#issuecomment-1684068156" rel="nofollow noreferrer">comment</a> on the issue you opened over at <code>github.com/ros2/ros</code> here for visibility)</p> <p>The screenshot shows you're running <code>22.04</code> on an <code>ARMhf</code> platform.</p> <p>Only Ubuntu on <code>ARMv8</code> gets <code>.deb</code> packages (ie: packages you can install using <code>apt</code>). <code>ARMhf</code> (or <code>arm32</code>) users need to build ROS 2 from source.</p> <p>See also <a href="https://www.ros.org/reps/rep-2000.html#humble-hawksbill-may-2022-may-2027" rel="nofollow noreferrer">REP 2000: ROS 2 Releases and Target Platforms: Humble Hawksbill (May 2022 - May 2027)</a> (<code>ARMv8</code> is called <code>arm64</code> in that document).</p>
103537
2023-08-17T22:45:58.970
|ros|ubuntu|
<p>I am using ubuntu 22.04 and I am getting the error of unable to locate package when trying to install the ros 2 humble. I followed the <a href="https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html" rel="nofollow noreferrer">instructions on the ros.org page for humble</a>.</p> <p>The following commands were used to set up the sources.</p> <pre><code>sudo apt install software-properties-common sudo add-apt-repository universe sudo apt update &amp;&amp; sudo apt install curl -y sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg echo &quot;deb [arch=<span class="math-container">$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $</span>(. /etc/os-release &amp;&amp; echo $UBUNTU_CODENAME) main&quot; | sudo tee /etc/apt/sources.list.d/ros2.list &gt; /dev/null </code></pre> <p>This was all successful</p> <p>Then I proceeded to try and install the ros 2 packages</p> <pre><code>sudo apt update sudo apt upgrade </code></pre> <p><code>sudo apt install ros-humble-desktop</code> this part fails <code>sudo apt install ros-humble-ros-base</code> also fails</p> <p><a href="https://i.stack.imgur.com/5yEy2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5yEy2.jpg" alt="enter image description here" /></a></p> <p><a href="https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html" rel="nofollow noreferrer">here</a> is the link for the ros doc</p>
unable to locate package ros-humble-desktop ubuntu 22.04
<p>The <code>AddWorldForce</code> needs the entity to have a <code>WorldPose</code> component for it to work. The easiest way to create that component on the link is to call <code>Link::EnableVelocityChecks</code> at least one iteration before calling <code>AddWorldForce</code>.</p> <p>Note, this might not be required in future versions of Gazebo as changes in <a href="https://github.com/gazebosim/gz-sim/pull/2081" rel="nofollow noreferrer">this</a> PR, if merged, will make it possible to use <code>AddWorldForce</code> without calling <code>EnableVelocityChecks</code>.</p>
103543
2023-08-18T05:41:49.817
|gazebo|gazebo-plugin|
<p>My goal is to apply a force to a gazebo model when prompted via a topic.</p> <p>To do this I'm reading the force and then applying it to the link of that model via the <code>AddWorldForce</code> command in the <code>PreUpdate</code> step. I assume that calling <code>AddWorldForce</code> applies an acceleration to the link on that timestep, however, when I run this the object does not move.</p> <p>Am I misunderstanding the function? I assumed that the <code>AddWorldForce</code> function should work similarly to the <code>SetLinearVelocity</code>. However, I have tested my code by replacing the <code>AddWorldForce</code> function with <code>SetLinearVelocity</code> and it acts as I would expect.</p> <p>Below I've added my full <code>PreUpdate</code> function, any insights into what I'm misunderstanding would be great.</p> <pre class="lang-cpp prettyprint-override"><code>void ForceManager::PreUpdate(const gz::sim::UpdateInfo &amp;_info, gz::sim::EntityComponentManager &amp;_ecm) { if(_info.paused){return;} if(topic_msg){ auto model_entities = entitiesFromScopedName(_model_name,_ecm); for(auto model_entity : model_entities){ gz::sim::Model model(model_entity); if(!model.Valid(_ecm)){ gzerr &lt;&lt; &quot;found model [&quot;&lt;&lt;_model_name&lt;&lt;&quot;] but model not valid\n&quot;; } gz::sim::Link link(model.LinkByName(_ecm,_link_name)); if(!link.Valid(_ecm)){ gzmsg &lt;&lt; &quot;Link entity not valid\n&quot;; } else{ gzmsg &lt;&lt; &quot;link found with name[&quot;&lt;&lt;link.Name(_ecm).value_or(&quot;empty&quot;) &lt;&lt;&quot;]\n&quot;; gz::math::Vector3d forceVector(topic_msg-&gt;x(),topic_msg-&gt;y(),topic_msg-&gt;z()); gzmsg &lt;&lt; &quot;set force:\n&quot; &lt;&lt; forceVector &lt;&lt; &quot;\n&quot;; link.AddWorldForce(_ecm,forceVector); } } i++; if(i&gt;1000){ // this is just a temporary hack to get this code to run in the first 1000 simulation steps after the message has been sent topic_msg = std::nullopt; i=0; } // } } <span class="math-container">```</span> </code></pre>
Gazebo Garden applying force to model via AddWorldForce fuction not acting as expected
<p>Welcome to Robotics Stack Exchange!</p> <blockquote> <p>Is it possible to launch multiple ros2 Composable Nodes in a single launch file so that they run in parallel?</p> </blockquote> <p>Yes, there seem to be the following two ways:</p> <ol> <li><p>Multiple containers: The <code>LaunchDescription</code> takes a list of containers. So you can create more than one such container. Please see below a sample code:</p> <pre><code>def generate_launch_description(): &quot;&quot;&quot;Generate launch description with multiple components.&quot;&quot;&quot; container1 = ComposableNodeContainer( name='my_container1', namespace='', package='rclcpp_components', executable='component_container', composable_node_descriptions=[ ComposableNode( package='composition', plugin='composition::Talker1', name='talker1'), ComposableNode( package='composition', plugin='composition::Listener1', name='listener1') ], output='screen', ) container2 = ComposableNodeContainer( name='my_container2', namespace='', package='rclcpp_components', executable='component_container', composable_node_descriptions=[ ComposableNode( package='composition', plugin='composition::Talker2', name='talker2'), ComposableNode( package='composition', plugin='composition::Listener2', name='listener2') ], output='screen', ) return launch.LaunchDescription([container1, container2]) </code></pre> </li> <li><p>One container with multiple nodes: A container supports multiple nodes. Similar to containers, you can create more than one node. Please see below a sample code:</p> <pre><code>def generate_launch_description(): &quot;&quot;&quot;Generate launch description with multiple components.&quot;&quot;&quot; container = ComposableNodeContainer( name='my_container', namespace='', package='rclcpp_components', executable='component_container', composable_node_descriptions=[ ComposableNode( package='composition', plugin='composition::Talker', name='talker'), ComposableNode( package='composition', plugin='composition::Listener', name='listener') ], output='screen', ) return launch.LaunchDescription([container]) </code></pre> </li> </ol> <p>Please see an official demonstration <a href="https://github.com/ros2/demos/blob/7ecb54e14e1726d543f77c798bf41e19efc1b9b4/composition/launch/composition_demo_launch.py" rel="nofollow noreferrer">here</a>.</p>
103547
2023-08-18T08:31:11.850
|ros2|roslaunch|node|parallel|
<p>I have multiple composable nodes that I need to run in parallel using a single launch file, as it is a pipeline consisting of various components. Is it possible to do that in ROS 2? or should I use normal nodes?</p>
Multiple ROS 2 Composable Nodes in a single launch file
<p>You are correct in noticing that Def. 3.20 is important in the move from <span class="math-container">$[\mathcal{V}_s]$</span> to <span class="math-container">$\mathcal{V}_s$</span> in Eq. 5.6. Specifically I think it's important to recognize 3 points:</p> <ol> <li>The adjoint map of a transform <span class="math-container">$T \in SE(3)$</span> can transform a twist represented in one frame into another frame. That is basically what is stated in Def. 3.20 when it says <span class="math-container">$\mathcal{V}^\prime = \left[Ad_T\right]\mathcal{V}$</span>. This point is made even more explicitly just after Eq. 3.84 when it says:</li> </ol> <blockquote> <p><em>More generally, for any two frames <span class="math-container">$\{c\}$</span> and <span class="math-container">$\{d\}$</span>, a twist represented as <span class="math-container">$\mathcal{V}_c$</span> in <span class="math-container">$\{c\}$</span> is related to its representation <span class="math-container">$\mathcal{V}_d$</span> in <span class="math-container">$\{d\}$</span> by <span class="math-container">$\mathcal{V}_c = \left[Ad_{T_{cd}}\right]\mathcal{V}_d$</span></em></p> </blockquote> <ol start="2"> <li><p>At the end of Def. 3.20 they show an equivalent matrix expression for transforming a twist. So, the matrix form of <span class="math-container">$\mathcal{V}\in\mathbb{R}^6$</span> is <span class="math-container">$[\mathcal{V}]\in se(3)$</span> and the equivalent adjoint map expression is <span class="math-container">$$ \left[\mathcal{V}^\prime\right] = T[\mathcal{V}]T^{-1} $$</span></p> </li> <li><p>The exponential coordinates for a homogeneous transformation <span class="math-container">$T$</span> are <span class="math-container">$\mathcal{S}\theta \in \mathbb{R}^6$</span> and they are related through the matrix exponential.</p> </li> </ol> <p>When moving from the first line to Eq. 5.6 all three of these facts are used. Let's just look at the second term in the top expression (and drop the <span class="math-container">$\dot{\theta}_2$</span>); additionally, let's denote that term <span class="math-container">$\Gamma$</span> and use a <span class="math-container">$[\cdot]$</span> to denote that it is <span class="math-container">$\in se(3)$</span>: <span class="math-container">$$ \left[\Gamma\right] = e^{[\mathcal{S}_1]\theta_1}\left[\mathcal{S}_2\right]e^{-[\mathcal{S}_1]\theta_1} \in se(3) $$</span></p> <p>Looking at point (3) above we can recognize that <span class="math-container">$e^{[\mathcal{S}_1]\theta_1}$</span> and <span class="math-container">$e^{-[\mathcal{S}_1]\theta_1}$</span> are both <span class="math-container">$\in SE(3)$</span>, and remember that <span class="math-container">$\left(e^{A\theta}\right)^{-1}=e^{-A\theta}$</span>. So the expression above takes exactly the matrix form of the adjoint map from point (2) above. So we can move that expression back into the &quot;vector&quot; form of the adjoint map from point (1) above. <span class="math-container">$$ \Gamma = \left[Ad_{e^{[\mathcal{S}_1]\theta_1}}\right]\mathcal{S}_2 = Ad_{e^{[\mathcal{S}_1]\theta_1}}\left(\mathcal{S}_2\right) \in \mathbb{R}^6 $$</span> It can then easily be seen that <span class="math-container">$\Gamma = J_{s2}$</span> from Eq. 5.6. This same reasoning applies to all other <span class="math-container">$J_{s*}$</span> terms.</p>
103564
2023-08-19T03:06:59.040
|kinematics|jacobian|screw-theory|
<p>In section 5.1.1 of <strong>Modern Robotics</strong> by Park and Lynch (pg. 153 of 1st edition, pg. 177 of updated 1st edition), the following derivation is given for the Jacobian matrix.</p> <p><a href="https://i.stack.imgur.com/M8eCR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M8eCR.png" alt="Derivation" /></a></p> <p>I don't understand this derivation. On the first line, we have an expression for <span class="math-container">$[\mathcal{V_s}]$</span>, while in equation 5.6 have a very similar expression written for <span class="math-container">$\mathcal{V_s}$</span>. The relationship between the two equations is unclear to me.</p> <p>In &quot;Definition 3.20&quot; (pg. 85 of 1st edition, pg. 98 of updated 1st edition), there is some discussion of adjoint maps, and though I have reread it several times it does not clarify the issue for me. If anyone could provide more detailed steps that would be much appreciated.</p>
Adjoint representation of twists in the Jacobian derivation
<blockquote> <p>However, over time, the path tends to deviate.</p> </blockquote> <p>This is how open loop systems behave and the drift happens not only due to <strong>external</strong> factors but could be due to internal factors.</p> <blockquote> <p>if the deviation is too large, I plan to perform corrections</p> </blockquote> <p>This is where feedback and a close-loop system comes into picture. To know the deviation you will need to know the <strong>true state</strong> (ground truth) of the robot.</p> <blockquote> <p>I wonder if this approach is feasible</p> </blockquote> <p>This approach is feasible given that you have a means of finding out true state/ ground truth to calculate the deviation.</p> <h2>Shortcut</h2> <p>In ROS, you get the ground truth via a topic <strong>/gazebo/model_states</strong></p> <h2>Long answer</h2> <p>Finding the true position of the robot is known as the <strong>localization problem</strong> in robotics and it involves sensors. There is a multitude of approaches to solve the localization problem and many different types of sensors are involved. If you are interested, a good starting point would be <a href="http://www.probabilistic-robotics.org/" rel="nofollow noreferrer"><strong>Probabilistic Robotics</strong> <sup>S. Thrun </sup></a></p>
103567
2023-08-19T06:38:17.507
|ros|navigation|path-planning|
<p>When controlling robot movement using angular velocity and linear velocity, deviations from the expected path often occur due to external factors,for example To make a wheeled robot move in a circular path, I provide it with angular velocity and linear velocity. However, over time, the path tends to deviate. Therefore, I would like to inquire if there are packages available in ROS or other keywords to reference. Currently, I intend to subscribe to the 'odom' topic to monitor the robot's status, and if the deviation is too large, I plan to perform corrections. I wonder if this approach is feasible. I would appreciate any advice!</p>
How to Path correction in ROS1
<p>I modified the launch file to have the parameter before and outside of <code>&lt;node&gt;</code></p> <pre><code>&lt;launch&gt; &lt;include file=&quot;<span class="math-container">$(find gazebo_ros)/launch/empty_world.launch"/&gt; &lt;param name="robot_description" textfile="$</span>(find multi_robot)/src/turtlebot.urdf&quot;/&gt; &lt;node name=&quot;spawn_model&quot; pkg=&quot;gazebo_ros&quot; type=&quot;spawn_model&quot; output=&quot;screen&quot; args=&quot;-urdf -model turtlebot -param robot_description&quot;&gt; &lt;/node&gt; &lt;/launch&gt; </code></pre>
103578
2023-08-19T19:46:48.430
|gazebo|urdf|spawn|launch-file|gazebo-worlds|
<p>Running on vm, I created a simple launch file to launch Gazebo with the robot urdf, an error was shown.</p> <p>launch file Content:</p> <pre><code>&lt;launch&gt; &lt;include file=&quot;$(find gazebo_ros)/launch/empty_world.launch&quot;/&gt; &lt;node name=&quot;spawn_model&quot; pkg=&quot;gazebo_ros&quot; type=&quot;spawn_model&quot; output=&quot;screen&quot; args=&quot;-urdf -model turtlebot -param robot_description&quot;&gt; &lt;param name=&quot;robot_description&quot; textfile=&quot;$(find multi_robot)/src/turtlebot.urdf&quot;/&gt; &lt;/node&gt; &lt;/launch&gt; </code></pre> <p>urdf</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;robot name=&quot;turtlebot&quot;&gt; &lt;link name=&quot;base_link&quot;&gt; &lt;visual&gt; &lt;geometry&gt;&lt;box size=&quot;0.5 0.5 0.5&quot;/&gt;&lt;/geometry&gt; &lt;/visual&gt; &lt;/link&gt; &lt;/robot&gt; </code></pre> <p><strong>Attempted to solve the issue:</strong></p> <ul> <li>checked directory, path</li> <li>remove build and devel, source /opt/ros/noetic/setup.bash, ~/.bashrc and ws setup.bash, redo catkin_make</li> <li>checked gazebo_msgs, gazebo_ros to have all the packages, script, correct node name, dependencies</li> <li>rosdep update, sudo apt update, updated noetic, sudo rosdep fix-permissions</li> <li>reinstalled Gazebo</li> </ul> <p><strong>Persisted issue:</strong> Gazebo was unable to load urdf, robot model, world. But the insert function can manually add them.</p> <p>Error message:</p> <pre><code>[ INFO] [1692378515.995051190]: Finished loading Gazebo ROS API Plugin. [spawn_model-4] process has died /home/user/catkin_ws/devel/lib/gazebo_ros/spawn_model -urdf -model turtlebot -param robot_description __name:=spawn_model __log:=/home/user/.ros/log/dd4d5694-3de9-11ee-bbc9-ededcfbcc7ca/spawn_model-4.log]. log file: /home/user/.ros/log/dd4d5694-3de9-11ee-bbc9-ededcfbcc7ca/spawn_model-4*.log [ INFO] [1692378516.697968553]: waitForService: Service [/gazebo/set_physics_properties] is now available. [ INFO] [1692378516.735021098, 0.019000000]: Physics dynamic reconfigure ready. </code></pre> <p>spawn_mode-4.log</p> <pre><code>[rospy.client][INFO] 2023-08-18 17:08:35,621: init_node, name[/spawn_model], pid[64745] [xmlrpc] [INFO] 2023-08-18 17:08:35,621: XML-RPC server binding to 0.0.0.0:0 [xmlrpc] [INFO] 2023-08-18 17:08:35,622: Started XML-RPC server [http://a-vm:35987/] [rospy.init][INFO] 2023-08-18 17:08:35,622: ROS Slave URI: [http://a-vm:35987/] [rospy.impl.masterslave][INFO] 2023-08-18 17:08:35,622: _ready: hhttp://a-vm:35987/ [rospy.registration] [INFO] 2023-08-18 17:08:35,623: Registering with master node http://localhost:11311 [xmlrpc][INFO] 2023-08-18 17:08:35,623: xml rpc node: starting XML-RPC server [rospy.init] [INFO] 2023-08-18 17:08:35,723: registered with master [rospy.rosout] [INFO] 2023-08-18 17:08:35,723: initializing /rosout core topic [rospy.rosout] [INFO] 2023-08-18 17:08:35,729: connected to core topic /rosout [rospy.simtime] [INFO] 2023-08-18 17:08:35,730: initializing /clock core topic [rospy.simtime] [INFO] 2023-08-18 17:08:35,732: connected to core topic /clock [rosout] [INFO] 2023-08-18 17:08:35,734: Loading model XML from ros parameter robot_description [rospy.core][INFO] 2023-08-18 17:08:35,861: signal_shutdown [atexit] [rospy.impl.masterslave] [INFO] 2023-08-18 17:08:35,864: atexit </code></pre>
Gazebo didn’t launch with urdf
<p>Found on galactic branch of the <a href="https://github.com/gazebosim/ros_gz/tree/galactic" rel="nofollow noreferrer">ros_gz github repo</a> that I've to install using <code>sudo apt install ros-galactic-ros-ign</code></p>
103579
2023-08-20T03:01:53.527
|ros-galactic|gazebo-edifice|ubuntu-20.04|
<p>I am trying to install (ignition) Gazebo Edifice on my Ubuntu 20.04 system which already has ROS2 Galactic installed on it.</p> <p>I'm using the command <code>sudo apt-get install ros-galactic-ros-gz</code> as mentioned <a href="https://gazebosim.org/docs/garden/ros_installation#installing-gazebo-with-older-versions-of-ros" rel="nofollow noreferrer">here</a>. But <code>apt</code> says it's not able to find the binaries as shown below. <a href="https://i.stack.imgur.com/6AqvG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6AqvG.png" alt="enter image description here" /></a></p> <p>How should I go about this?</p>
E: Unable to locate package ros-galactic-ros-gz
<p>Thank you for the answers. We found the problem now and it is a bit embarassing. When checking the standard <em>navigate_through_poses_w_replanning_and_recovery.xml</em> more thoroughly, we saw that there are two more parameters we can set in the <em>remove_passed_goals</em> node. That is the <em>global_frame</em> and the <em>robot_base_frame</em>. Setting these and increasing the <em>RateController</em> Frequency to 10 Hz solved our problem.</p> <p>Thanks for taking the time to read the question and to comment</p>
103580
2023-08-20T14:37:13.330
|navigation|ros-humble|nav2|
<p>When sending a set of waypoints to the navigate_though_poses, the robot never reaches the first waypoint. This is how we got there</p> <ol> <li><p>We configured a Nav2 with the configurations in the end of the post. It starts up fine without errors. However there is a warning that states:</p> <p>[controller server-1] [WARN] [1692540613.343435163] [controller server]: No goal checker was specified in parameter 'current goal checker'. Server will use only plugin loaded general_goal_checker</p> </li> <li><p>Then a list of waypoints is sent to nav2_msgs::action::NavigateThroughPoses.</p> </li> <li><p>The data is accepted by the nav2 stack and a path is planned and followed.</p> </li> </ol> <p>So far so good. But at the very first waypoint it does not continue as it should but stops and tries to go forward and backward to hit the spot harder.</p> <p>What we tried so far:</p> <ul> <li>We set the xy_goal to 0.35 and the yaw_goal to 3.14 to make it irrelevant. But it did not change.</li> <li>We tried to set the parameter &quot;current_goal_checker&quot; but none of the syntax we tried prevented the warning. It is like there is no goal checker for this situation. But from what i understand from remove_passed_goals_action.cpp, no additional goal checker is required for the waypoints.</li> <li>We also tried the &quot;follow_waypoint&quot; and there the individual goals are reached but the movement is not as smooth as we hope the navigate_through_poses would be</li> </ul> <p>Can anyone help here.</p> <pre><code>controller_server: ros__parameters: use_sim_time: False controller_frequency: 10.0 min_x_velocity_threshold: 0.2 min_y_velocity_threshold: 0.5 min_theta_velocity_threshold: 0.001 progress_checker_plugins: [&quot;progress_checker&quot;] # progress_checker_plugin: &quot;progress_checker&quot; For Humble and older goal_checker_plugins: [&quot;general_goal_checker&quot;] current_goal_checker: [&quot;general_goal_checker&quot;] # &quot;precise_goal_checker&quot; controller_plugins: [&quot;FollowPath&quot;] progress_checker: plugin: &quot;nav2_controller::SimpleProgressChecker&quot; required_movement_radius: 0.5 movement_time_allowance: 30.0 general_goal_checker: stateful: True plugin: &quot;nav2_controller::SimpleGoalChecker&quot; xy_goal_tolerance: 0.35 yaw_goal_tolerance: 3.14 FollowPath: plugin: &quot;nav2_regulated_pure_pursuit_controller::RegulatedPurePursuitController&quot; desired_linear_vel: 0.8 use_velocity_scaled_lookahead_dist: true min_lookahead_dist: 2.0 max_lookahead_dist: 5.0 lookahead_time: 3.0 lookahead_dist: 2.0 transform_tolerance: 0.1 min_approach_linear_velocity: 0.3 approach_velocity_scaling_dist: 0.6 use_regulated_linear_velocity_scaling: true use_fixed_curvature_lookahead: false curvature_lookahead_dist: 1.5 regulated_linear_scaling_min_radius: 3.0 regulated_linear_scaling_min_speed: 0.4 use_interpolation: false allow_reversing: true use_rotate_to_heading: false rotate_to_heading_angular_vel: 1.0 rotate_to_heading_min_angle: 1.0 max_angular_accel: 1.0 max_robot_pose_search_dist: 10.0 use_cost_regulated_linear_velocity_scaling: false use_collision_detection: false max_allowed_time_to_collision_up_to_carrot: 1.0 planner_server: ros__parameters: planner_plugin_types: [&quot;nav2_theta_star_planner/ThetaStarPlanner&quot;] planner_plugin_ids: [&quot;GridBased&quot;] GridBased: how_many_corners: 8 w_euc_cost: 1.0 w_traversal_cost: 2.0 bt_navigator: ros__parameters: use_sim_time: False global_frame: map robot_base_frame: base_link odom_topic: /odometry/local bt_loop_duration: 10 default_server_timeout: 20 enable_groot_monitoring: True groot_zmq_publisher_port: 1666 groot_zmq_server_port: 1667 transform_tolerance: 0.5 default_nav_to_pose_bt_xml: /opt/ros/humble/share/nav2_bt_navigator/behavior_trees/navigate_to_pose_w_replanning_and_recovery.xml # or <span class="math-container">$(find-pkg-share my_package)/behavior_tree/my_nav_to_pose_bt.xml default_nav_through_poses_bt_xml: /opt/ros/humble/share/nav2_bt_navigator/behavior_trees/navigate_through_poses_w_replanning_and_recovery.xml # or $</span>(find-pkg-share my_package)/behavior_tree/my_nav_through_poses_bt.xml # goal_blackboard_id: goal # goals_blackboard_id: goals # path_blackboard_id: path navigators: ['navigate_to_pose', 'navigate_through_poses'] navigate_to_pose: plugin: &quot;nav2_bt_navigator/NavigateToPoseNavigator&quot; navigate_through_poses: plugin: &quot;nav2_bt_navigator/NavigateThroughPosesNavigator&quot; 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_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 waypoint_follower: ros__parameters: loop_rate: 20 stop_on_failure: true waypoint_task_executor_plugin: &quot;wait_at_waypoint&quot; wait_at_waypoint: plugin: &quot;nav2_waypoint_follower::WaitAtWaypoint&quot; enabled: True waypoint_pause_duration: 0 </code></pre>
Nav2 Navigate_through_poses never passes first pose
<p>As you guys suggested, i installed both ROS-noetic and ROS1-foxy in the same machine. The thing is, i have to make sure the source of what i am using currently. i.e., if i am using noetic i should source my workspace as</p> <pre><code>source /opt/ros/noetic/setup.bash </code></pre> <p>and if i am using foxy, i should source my workspace as</p> <pre><code>source /opt/ros/foxy/setup.bash </code></pre>
103584
2023-08-21T04:51:58.670
|ros|ros2|ros-noetic|ubuntu-20.04|
<p>I am using ROS Noetic on my machine running on Ubuntu 20.04. But I want to migrate to ROS 2. Can I install ROS 2 along with ROS 1 on the same machine? If I did, what and how will be the causes?</p>
Can we install ROS 1 and ROS 2 in the same system running on Ubuntu 20.04?
<p>Cancelling in action terms is when an external entity cancels the goal. This is a callback function that the cancelled state can be processed by the BT node in case it wants to populate / change the <code>BT::NodeStatus</code>. This is not called to cancel an action, but called once an action is already cancelled by an external agent (e.g. autonomy system or elsewhere in the BT using a cancel node) to potentially modify the BT status to send on the node's exit.</p> <p>Halt is not cancel. While halt will cancel a goal when a BT is ending, that cancel is not an external cancel but an internal cancel to put the BT back into a neutral state - so there's no need for you to worry about messing with the <code>BT::NodeStatus</code> because the status is already set to <code>idle</code> by the halt process -- so there's no need to trigger this function.</p>
103597
2023-08-21T13:22:20.370
|ros2|nav2|
<p>In NAV2, I defined my own <code>on_cancelled</code> for my <a href="https://github.com/ros-planning/navigation2/blob/humble/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp#L177" rel="nofollow noreferrer">bt_action_node</a>. Nevertheless, I realized it`s never called if <a href="https://github.com/ros-planning/navigation2/blob/humble/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp#L299" rel="nofollow noreferrer">halt</a> (the method that cancels the action) is called.</p> <p>The halt will set the tree to IDLE, but then the next <a href="https://github.com/ros-planning/navigation2/blob/humble/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp#L189" rel="nofollow noreferrer">tick</a> will send a new goal, instead of processing the previously <a href="https://github.com/ros-planning/navigation2/blob/humble/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp#L283" rel="nofollow noreferrer">cancelled</a> goal.</p> <p>How to make sure the on_cancelled is called in that case? Am I missing something here? Do I need to overrides the halt method as well to avoid the IDLE state before calling the <code>on_cancelled</code>?</p> <p>Thanks</p>
NAV2 cancel bt_action_node
<p>Unfortunately, one can use only a scalar double value per hardware interface. But this is only data storage location, so you have to export six interfaces and your floating joint is &quot;supported&quot;.</p> <p>Using joint_state_broadcaster/robot_state_publisher combination or gazebo_ros2_control, you'll need explicit serial 1-dof joints anyhow, see e.g. <a href="https://github.com/ros/robot_state_publisher/blob/9a50d7897d6437a63af1d9f8e602240105b35b2d/src/robot_state_publisher.cpp#L227-L229" rel="nofollow noreferrer">here</a>.</p>
103618
2023-08-22T09:57:48.587
|ros-control|hardware-interface|ros-foxy|
<p>In the URDF file for my robot I would like to use a floating joint (6DOF). I'm currently writing the hardware interface for ros2-control for this robot. Is there a way to export a state interface for a floating joint, or do I have to use a series of 3 revolute and 3 prismatic joints?</p> <p>So ideally i was looking for something like this:</p> <pre><code>state_interfaces.emplace_back(hardware_interface::StateInterface(6dof_joint.name, hardware_interface::HW_IF_POSITION, &amp;6dof_joint.pos)); </code></pre> <p>Where <code>6dof_joint.pos</code> would be a 6D vector or transformation matrix. But as far as I've seen <code>Hardware_interface::StateInterface</code> only accepts (1D) <code>double*</code> so I guess floating joint is not supported?</p>
Hardware interface for floating joint
<p>I meet the same problem, after a long time trying, I think that it may have a relationship with your CPU. If you use an ARM CPU, there is no package named as ros-humble-turtlebot3-gazebo, if you use an AMD CPU, you can get the package ros-humble-turtlebot3-gazebo easily. Maybe developers have not supply this package for system with ARM CPU</p>
103620
2023-08-22T11:15:27.053
|ubuntu|packages|
<p>I follow this one <a href="https://navigation.ros.org/getting_started/index.html" rel="nofollow noreferrer">https://navigation.ros.org/getting_started/index.html</a> but the gazebo package does not seem to exist for ROS2 humble on 22.04</p> <pre><code>pi@pi-ros-2:~<span class="math-container">$ sudo apt install ros-humble-turtlebot3-gazebo Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package ros-humble-turtlebot3-gazebo pi@pi-ros-2:~$</span> sudo apt install ros-humble-gazebo-ros-pkgs Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package ros-humble-gazebo-ros-pkgs pi@pi-ros-2:~$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION=&quot;Ubuntu 22.04.3 LTS&quot; </code></pre> <p>thanks for your help</p>
Cannot install ros-humble-turtlebot3-gazebo package
<p><a href="https://github.com/ros-planning/navigation2/issues/3766" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/issues/3766</a></p> <p>&quot;So there's a dependency missing in gazebo-land on ARM64 which is blocking everything from gazebo ros to turtlebot then to us. So unfortunately there's really nothing we can do about it here, but I'd recommend following up in that ticket if you wanted to help fix the issue. Else, building from source is your best bet. The issue isn't much to do with nav2_bringup as much as nothing in gazebo classic will work for you on ARM without compilation.&quot;</p>
103623
2023-08-22T12:18:53.547
|navigation|ros-humble|
<p>I am following this tutorial</p> <p><a href="https://roboticsbackend.com/ros2-nav2-tutorial/" rel="nofollow noreferrer">https://roboticsbackend.com/ros2-nav2-tutorial/</a></p> <p>Although I installed the required packages,</p> <pre><code>sudo apt install ros-humble-navigation2 ros-humble-nav2-bringup ros-humble-turtlebot3* </code></pre> <p>I get this error</p> <pre><code>ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py Package 'turtlebot3_gazebo' not found: &quot;package 'turtlebot3_gazebo' not found, searching: ['/opt/ros/humble']&quot; </code></pre> <p>here is an excerpt of my variables</p> <pre><code>ROS_HOSTNAME: rosmaster ROS_IP: 192.168.1.84 ROS_MASTER_URI: http://rosmaster:11311 ROS_DOMAIN_ID: 1 ROS_LOCALHOST_ONLY: 0 RMW_IMPLEMENTATION: TURTLEBOT3_MODEL: waffle GAZEBO_MODEL_PATH: :/opt/ros/humble/share/turtlebot3_gazebo/models ----------------------------------------- ROS_VERSION=2 SESSION_MANAGER=local/pi-ros-2:@/tmp/.ICE-unix/2303,unix/pi-ros-2:/tmp/.ICE-unix/2303 ROS_PYTHON_VERSION=3 ROS_DOMAIN_ID=1 ROS_IP=192.168.1.84 VNCDESKTOP=pi-ros-2:1 (pi) AMENT_PREFIX_PATH=/opt/ros/humble PYTHONPATH=/opt/ros/humble/lib/python3.10/site-packages:/opt/ros/humble/local/lib/python3.10/dist-packages ROS_MASTER_URI=http://rosmaster:11311 ROS_HOSTNAME=rosmaster LD_LIBRARY_PATH=/opt/ros/humble/opt/rviz_ogre_vendor/lib:/opt/ros/humble/lib/aarch64-linux-gnu:/opt/ros/humble/lib ROS_LOCALHOST_ONLY=0 GAZEBO_MODEL_PATH=:/opt/ros/humble/share/turtlebot3_gazebo/models PATH=/opt/ros/humble/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin ROS_DISTRO=humble </code></pre> <p>please help me out, this is quiet frustrating as a learning curve</p> <p>thanks</p> <p>[edit] from the video tutorial , I try to simply run gazebo, and it is just not there at all</p> <pre><code>pi@pi-ros2:~/WORK<span class="math-container">$ gazebo gazebo: command not found pi@pi-ros2:~/WORK$</span> sudo find / -name gazebo [sudo] password for pi: /opt/ros/humble/share/turtlebot3_manipulation_description/gazebo /home/pi/WORK/bookros2_ws/src/ThirdParty/tiago_robot/tiago_description/gazebo /home/pi/WORK/bookros2_ws/src/ThirdParty/pmb2_robot/pmb2_description/gazebo /home/pi/WORK/bookros2_ws/src/ThirdParty/pal_gripper/pal_gripper_description/gazebo /home/pi/WORK/bookros2_ws/src/ThirdParty/hey5_description/gazebo </code></pre> <p>[edit] I created an issue on github</p> <p><a href="https://github.com/ros-planning/navigation2/issues/3774" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/issues/3774</a></p> <p>I created another similar issue, as I follow tutorials from F.M Rico's book(Robot programming with ROS2)</p> <p><a href="https://github.com/fmrico/book_ros2/issues/23" rel="nofollow noreferrer">https://github.com/fmrico/book_ros2/issues/23</a></p> <p>is humble maintained for gazebo and navigation at all ???</p>
Cannot find turtlebot3_gazebo on ROS2 humble on 22.04
<p>Welcome to Robotics Stack Exchange!</p> <p>Please pay attention to the following error which you have reported above:</p> <pre><code> lcov not found! Aborting... </code></pre> <p>Therefore, please install <code>lcov</code> on your Ubuntu machine using the following command:</p> <pre><code>sudo apt install lcov </code></pre>
103650
2023-08-23T08:58:40.880
|ros2|
<p>I'm trying to install TrajOpt to intergrate with the ROS2. I have download the tesseract_ros2 and all its dependencies from <a href="https://github.com/tesseract-robotics/tesseract_ros2" rel="nofollow noreferrer">https://github.com/tesseract-robotics/tesseract_ros2</a> ,also the trajOpt_ros2 from <a href="https://github.com/Levi-Armstrong/trajopt_ros-2" rel="nofollow noreferrer">https://github.com/Levi-Armstrong/trajopt_ros-2</a>. But during building ,some error ocurr. See my terminal output below:</p> <pre><code>Starting &gt;&gt;&gt; tesseract_command_language --- stderr: tesseract_command_language CMake Warning at /home/xxx/ws_moveit2/install/ros_industrial_cmake_boilerplate/lib/cmake/ros_industrial_cmake_boilerplate/code_coverage.cmake:156 (message): Code coverage results with an optimized (non-Debug) build may be misleading Call Stack (most recent call first): CMakeLists.txt:30 (initialize_code_coverage) CMake Error at /home/xxx/ws_moveit2/install/ros_industrial_cmake_boilerplate/lib/cmake/ros_industrial_cmake_boilerplate/code_coverage.cmake:168 (message): lcov not found! Aborting... Call Stack (most recent call first): CMakeLists.txt:30 (initialize_code_coverage) --- Failed &lt;&lt;&lt; tesseract_command_language [0.12s, exited with code 1] Aborted &lt;&lt;&lt; trajopt_common [0.22s] Aborted &lt;&lt;&lt; trajopt_sco [1.30s] Aborted &lt;&lt;&lt; bullet [4min 26s]** </code></pre> <p>How can i fix it and proceed? Thank you in advance!</p>
ros_industrial_cmake_boilerplate/code_coverage.cmake:168 (message): lcov not found!
<p>You're gonna hate this answer, but: &quot;it depends&quot;, and on what you mean by &quot;real time&quot;.</p> <p>Yes, there's a disadvantage - python is slower than c++ (by a lot), and ros2's support for python is meh, and you have the GIL to contend with, and I don't think ros2's newest zero-copy stuff applies to python. But how much it impacts you depends on your usage.</p> <p>For instance - are you reading from, and controlling a robot, at 1Khz in a tight loop? Then I bet you'd notice a difference in latency.</p> <p>Are you doing computer vision at 20hz, and are spending all the time inside pytorch anyway? Then I bet you wouldn't notice a difference in latency.</p> <p>The only way to know is to profile.</p>
103656
2023-08-23T14:21:03.680
|ros2|python|roscpp|
<p>Is there a disadvantage in terms of real-time performance when using Python as opposed to C++ in ROS2? If so, how significant is this disadvantage?</p> <p>Thank you.</p>
Performance Comparison Between Python and C++ in ROS2 for Real-Time Applications
<p>Do not have this in the .zshrc:</p> <blockquote> <p><code>zstyle ':completion:*' use-compctl false</code></p> </blockquote> <p>Make it <code>true</code> or do not specify at all (<code>true</code> is the default value).</p> <p>After trying out a clean Oh-My-Zsh installation, I was surprised that the completion worked there. The problem lied within my own, custom <code>.zshrc</code> configuration. Apparently, having <code>use-compctl</code> set to <code>false</code> broke auto-completion just for the <code>ros*</code> commands and seemingly nothing else.</p>
103675
2023-08-24T11:50:42.503
|ros|ros-noetic|
<p>Having no tab-completion for <code>ros*</code> commands (i.e. <code>roslaunch</code>, <code>rosrun</code>) after sourcing a <code>setup.zsh</code> file. The <code>ros*</code> commands are available to call; there's simply no aid in auto-completing pkg's name, launch file, arguments, etc.</p> <p>Completion works within the <code>bash</code> shell after sourcing a <code>setup.bash</code> file.</p>
ros1 zsh completion
<p>I should have added <code>--as-root pip:false</code> as an extra argument to rosdep. This is described at <a href="https://github.com/ros2/ros2/issues/1478" rel="nofollow noreferrer">github</a>.</p>
103678
2023-08-24T13:19:33.737
|ros2|rosdep|
<p>I started with ROS2 for robotic development. As far as I understand one must specify the dependencies of the code in package.xml (for example all python imports) and rosdep will install these dependencies for you using sudo. Pip warns against this type of install saying that the installation may break.</p> <p>I use modules from Adafruit-Blinka (board). Blinka is specified in the &lt;exec-depend&gt; tag and it is recognized (it is in python.yaml). Rosdep install Adafruit-Blinka as root. Next I run the code and as soon as board is imported the code crashes with the following error: Module not found: 'hid' (full error message at the end).</p> <p>I can reproduce this problem with a simple python program containing one line: <code>import board</code>. It crashes in the same way as the ros program (Module not found: 'hid'). When I first <code>sudo pip uninstall Adafruit-Blinka</code> and next <code>pip install Adafruit_Blinka</code> (without sudo), I can <code>import board</code> without problems.</p> <p>Is it correct to assume that a sudo pip install causes module 'hid' not to be found? If so, is there a workaround so that rosdep does not install the modules as root?</p> <p>Full error message:</p> <pre><code>$ ros2 run sensor_vl53l1x talker Traceback (most recent call last): File &quot;/media/i-files/home/arnold/development/ros2/bottie/install/sensor_vl53l1x/lib/sensor_vl53l1x/talker&quot;, line 33, in &lt;module&gt; sys.exit(load_entry_point('sensor-vl53l1x==0.0.0', 'console_scripts', 'talker')()) File &quot;/media/i-files/home/arnold/development/ros2/bottie/install/sensor_vl53l1x/lib/sensor_vl53l1x/talker&quot;, line 25, in importlib_load_entry_point return next(matches).load() File &quot;/usr/lib/python3.10/importlib/metadata/__init__.py&quot;, line 171, in load module = import_module(match.group('module')) File &quot;/usr/lib/python3.10/importlib/__init__.py&quot;, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1050, in _gcd_import File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027, in _find_and_load File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006, in _find_and_load_unlocked File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688, in _load_unlocked File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883, in exec_module File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241, in _call_with_frames_removed File &quot;/media/i-files/home/arnold/development/ros2/bottie/install/sensor_vl53l1x/lib/python3.10/site-packages/sensor_vl53l1x/vl53l1x_publisher.py&quot;, line 5, in &lt;module&gt; import board File &quot;/usr/local/lib/python3.10/dist-packages/board.py&quot;, line 22, in &lt;module&gt; from adafruit_blinka.agnostic import board_id, detector File &quot;/usr/local/lib/python3.10/dist-packages/adafruit_blinka/agnostic/__init__.py&quot;, line 21, in &lt;module&gt; chip_id = detector.chip.id File &quot;/usr/local/lib/python3.10/dist-packages/adafruit_platformdetect/chip.py&quot;, line 90, in id import hid ModuleNotFoundError: No module named 'hid' [ros2run]: Process exited with failure 1 </code></pre>
Rosdep installing python dependencies as root seems to break the installation
<p>This is my solution, feel free to comment if there is a better way! Note that the code just lists the procedure, not out-of-the-box.</p> <pre><code> planning_interface::MotionPlanRequest req; planning_interface::MotionPlanResponse res; geometry_msgs::PoseStamped pose; std::vector&lt;double&gt; tolerance_position; std::vector&lt;double&gt; tolerance_angle; moveit_msgs::Constraints pose_goal = kinematic_constraints::constructGoalConstraints(&quot;end-effector&quot;, pose, tolerance_position, tolerance_angle); req.group_name = PLANNING_GROUP; req.goal_constraints.push_back(pose_goal); // set start state start_state.setJointGroupPositions(joint_model_group, start_joint_values); moveit_msgs::RobotState start_msgs; moveit::core::robotStateToRobotStateMsg(start_state, start_msgs); req.start_state = start_msgs; moveit_msgs::MoveGroupGoal move_group_goal; move_group_goal.request = req; move_group_goal.planning_options.plan_only = true; move_group_goal.planning_options.look_around = false; move_group_goal.planning_options.replan = false; move_group_goal.planning_options.planning_scene_diff.is_diff = true; move_group_goal.planning_options.planning_scene_diff.robot_state.is_diff = true; actionlib::SimpleActionClient&lt;moveit_msgs::MoveGroupAction&gt;&amp; move_action_client_custom = move_group_interface.getMoveGroupClient(); move_action_client_custom.sendGoal(move_group_goal); if (!move_action_client_custom.waitForResult()) { ROS_INFO_STREAM(&quot;MoveGroup action returned early&quot;); } if (move_action_client_custom.getState() == actionlib::SimpleClientGoalState::SUCCEEDED) { ROS_INFO_STREAM(&quot;MoveGroup has finished the plan successfully and costed &quot; &lt;&lt; move_action_client_custom.getResult()-&gt;planning_time &lt;&lt; &quot; seconds&quot;); } else { ROS_WARN_STREAM(&quot;Fail: &quot; &lt;&lt; move_action_client_custom.getState().toString() &lt;&lt; &quot;: &quot; &lt;&lt; move_action_client_custom.getState().getText()); } </code></pre>
103689
2023-08-25T08:40:01.000
|moveit|motion-planning|
<p>I'm following the <a href="https://ros-planning.github.io/moveit_tutorials/doc/planning_scene_ros_api/planning_scene_ros_api_tutorial.html" rel="nofollow noreferrer">tutorial</a> of MoveIt to add obstacles to the scene.</p> <p>Everything goes well and I can see obstacles in Rviz. However, the planned path seems to ignore the presence of obstacles and go through them.</p> <p>Here is the code snippet that is used to add obstacles:</p> <pre><code>moveit_msgs::PlanningScene planning_scene; planning_scene.world.collision_objects.push_back(attached_object.object); planning_scene.is_diff = true; planning_scene_diff_publisher.publish(planning_scene); </code></pre> <p>I follow <a href="https://ros-planning.github.io/moveit_tutorials/doc/motion_planning_api/motion_planning_api_tutorial.html" rel="nofollow noreferrer">this tutorial</a> to load the <code>OMPL</code> plugin.</p> <p>Actually, I know this problem could be solved with the <code>move group interface</code>, but its member function <code>setGoalOrientationTolerance</code> can't set orientation tolerance for different directions. So I refer to <a href="https://ros-planning.github.io/moveit_tutorials/doc/motion_planning_api/motion_planning_api_tutorial.html" rel="nofollow noreferrer">this procedure</a> to set the pose goal.</p> <p>Or if there is any way to utilize the <code>move group interface</code> to set a pose goal with different tolerances for different axes, I can skip the above hassle.</p> <p>Help would be appreciated! Thanks!</p>
How to activate the planning with obstacles after publishing the planning scene moveit message
<p>Welcome to Robotics Stack Exchange!</p> <p>Please install <code>PyQt v5.10.1</code> using the following command:</p> <pre><code>pip install PyQt5==5.10.1 </code></pre> <p>Source: <a href="https://stackoverflow.com/a/55794141">Stack Overflow</a></p>
103690
2023-08-25T09:01:53.450
|ros2|rqt|rqt-graph|rqt-gui|ros-galactic|
<p>I had this problem for a while now, and wasn't able to solve it despite all attempts, <code>rqt_graph</code> used to work just fine, but all the sudden (probably after i installed something or updated something) started giving me this Error:</p> <pre><code>anassq@anassq-ThinkPad:~$ rqt_graph Traceback (most recent call last): File &quot;/opt/ros/galactic/bin/rqt_graph&quot;, line 11, in &lt;module&gt; load_entry_point('rqt-graph==1.2.2', 'console_scripts', 'rqt_graph')() File &quot;/opt/ros/galactic/lib/python3.8/site-packages/rqt_graph/main.py&quot;, line 9, in main sys.exit(Main().main(sys.argv, standalone='rqt_graph.ros_graph.RosGraph')) File &quot;/opt/ros/galactic/lib/python3.8/site-packages/rqt_gui/main.py&quot;, line 57, in main return super( File &quot;/opt/ros/galactic/lib/python3.8/site-packages/qt_gui/main.py&quot;, line 408, in main from python_qt_binding import QT_BINDING File &quot;/opt/ros/galactic/lib/python3.8/site-packages/python_qt_binding/__init__.py&quot;, line 56, in &lt;module&gt; from python_qt_binding.binding_helper import loadUi # noqa: F401 File &quot;/opt/ros/galactic/lib/python3.8/site-packages/python_qt_binding/binding_helper.py&quot;, line 277, in &lt;module&gt; _select_qt_binding( File &quot;/opt/ros/galactic/lib/python3.8/site-packages/python_qt_binding/binding_helper.py&quot;, line 108, in _select_qt_binding QT_BINDING_VERSION = binding_loader(required_modules, optional_modules) File &quot;/opt/ros/galactic/lib/python3.8/site-packages/python_qt_binding/binding_helper.py&quot;, line 155, in _load_pyqt _named_optional_import('PyQt5.%s' % module_name) File &quot;/opt/ros/galactic/lib/python3.8/site-packages/python_qt_binding/binding_helper.py&quot;, line 142, in _named_optional_import _named_import(name) File &quot;/opt/ros/galactic/lib/python3.8/site-packages/python_qt_binding/binding_helper.py&quot;, line 133, in _named_import module = builtins.__import__(name) ValueError: PyCapsule_GetPointer called with incorrect name </code></pre> <p>I tried everything i can find, setting the <code>pyQt</code> by <code>sudo pip3 install pyqt5==5.15.5</code> didn't work removing and reinstalling package didn't work either.</p> <p>I hope someone here ran to a simular problem and found a solution, or can provide me with some suggestions.</p> <p>Thanks for the read!</p>
rqt_graph not working anymore on galactic
<p>If you are using simulation, the ros time is the 'number of seconds since simulation start'.</p> <p>However, the timestamp in your error message is much too large (&quot;time 1675148130.527&quot;) for that, which indicates you did not set the <code>use_sim_time</code> ros parameter in all of your ros nodes.</p>
103698
2023-08-25T11:26:43.653
|rviz|pointcloud|tf|
<p>I am simulating a quadrotor with a depth camera on Gazebo and I am trying to see the data published by the simulation on RViz2.</p> <p>The problem is that when I tried to visualize the point cloud of the camera from the fixed frame &quot;map&quot;: I got the error message</p> <pre><code>Message Filter dropping message: frame 'camera_link' at time 1675148130.527 for reason 'Unknown' </code></pre> <p>As far as I understood, this error message is associated with the inability of RViz to find the transformation from the static frame &quot;map&quot; to the frame &quot;camera_link&quot;. So, I started playing a bit around, trying to understand what was happening.</p> <p>I was publishing 3 transformations through a ROS2 node:</p> <ul> <li>&quot;map&quot; to &quot;odom&quot; (static tf)</li> <li>&quot;odom&quot; to &quot;drone&quot; (dynamic tf)</li> <li>&quot;drone&quot; to &quot;camera_link&quot; (static tf) All of them were being published simultaneously at the same timestamps.</li> </ul> <p>I was able to see all the transformations correctly published on the topics /tf_static and /tf through the command</p> <pre><code>ros2 topic echo &lt;topic_name&gt; </code></pre> <p>Moreover, I was able to visualize them in RViz2 using the TF tool, all of them connected in the three as reported in the above list. So RViz2 can correctly read them, and I was able to select each of the 4 four frames as the fixed frame. So I started changing the fixed frame to see if anything happened.</p> <p>When I selected either &quot;drone&quot; or &quot;camera_link&quot; as the fixed frame, I was able to visualize the point cloud of the camera. When I selected either &quot;map&quot; or &quot;odom&quot; I got the error message.</p> <p>My conclusion, for now, is that there could be some problems I am not aware of when using dynamic tf in RViz or when mixing static and dynamic tf.</p> <p>I was not able to find a solution looking on the web, so I hoped some of you could help me in debugging this issue.</p>
RViz2 seems to have problems with dynamic TF when visualizing sensor data
<p>The error states that:</p> <pre><code>AttributeError: module 'posixpath' has no attribute 'joint' </code></pre> <p><code>posixpath</code> is a part of the <a href="https://docs.python.org/3/library/pathlib.html" rel="nofollow noreferrer">pathlib</a> library. This error comes up when you attempt to access an attribute of a class or import that does not exist: in this case, you've done something like this:</p> <pre><code>p = Path('./path/to/something') p.joint </code></pre> <p><code>joint</code> is not a valid attribute to ask from <code>Path</code>, and so the error is presented.</p> <p>You are likely aiming to load the <em>contents</em> of a file at a path, but your code is actually only accessing the path. It's impossible to say exactly without seeing any code or your configuration, but you should take a closer look at how you are returning files: you likely want to return their parsed contents, but you're instead passing simply their path.</p> <p>EDIT now that the setup.py has been provided:</p> <p>The problem is in your setup.py, here:</p> <pre><code>os.path.joint('share', package_name) </code></pre> <p>and right below it:</p> <pre><code>os.path.joint('share', package_name) </code></pre> <p>Notice that you are calling the <code>path</code> module from <code>os</code>, and then you're expecting it to have the attribute <code>joint</code>. <code>path</code>, which in this case is <code>posixpath</code> because you're on a POSIX-compliant system, does not have that attribute.</p> <p>In short, the <code>module 'posixpath' has no attribute called 'joint'</code>.</p> <p>Perhaps you meant to call <code>os.path.join()</code> (no t) to <em>join</em> the paths?</p>
103699
2023-08-25T11:48:28.393
|ros2|python3|ros-foxy|
<p>I am trying to develop a simple bot using ROS 2. I created a package called my_rover. when I give</p> <pre><code>colcon build --packages-select my_rover </code></pre> <p>it gives this error which i cannot understand..</p> <pre><code>Starting &gt;&gt;&gt; my_rover Traceback (most recent call last):1.7s] File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt; File &quot;/usr/lib/python3.8/distutils/core.py&quot;, line 215, in run_setup exec(f.read(), g) File &quot;&lt;string&gt;&quot;, line 15, in &lt;module&gt; AttributeError: module 'posixpath' has no attribute 'joint' --- stderr: my_rover Traceback (most recent call last): File &quot;/usr/lib/python3/dist-packages/colcon_core/executor/__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;/usr/lib/python3/dist-packages/colcon_core/task/__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;/usr/lib/python3/dist-packages/colcon_ros/task/ament_python/build.py&quot;, line 51, in build setup_py_data = get_setup_data(self.context.pkg, env) File &quot;/usr/lib/python3/dist-packages/colcon_core/task/python/__init__.py&quot;, line 20, in get_setup_data return dict(pkg.metadata[key](env)) File &quot;/usr/lib/python3/dist-packages/colcon_ros/package_augmentation/ros_ament_python.py&quot;, line 57, in getter return get_setup_information( File &quot;/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py&quot;, line 241, in get_setup_information _setup_information_cache[hashable_env] = _get_setup_information( File &quot;/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py&quot;, line 288, in _get_setup_information result = subprocess.run( File &quot;/usr/lib/python3.8/subprocess.py&quot;, line 516, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/usr/bin/python3', '-c', 'import sys;from contextlib import suppress;exec(&quot;with suppress(ImportError): from setuptools.extern.packaging.specifiers import SpecifierSet&quot;);exec(&quot;with suppress(ImportError): from packaging.specifiers import SpecifierSet&quot;);from distutils.core import run_setup;dist = run_setup( \'setup.py\', script_args=(\'--dry-run\',), stop_after=\'config\');skip_keys = (\'cmdclass\', \'distclass\', \'ext_modules\', \'metadata\');data = { key: value for key, value in dist.__dict__.items() if ( not key.startswith(\'_\') and not callable(value) and key not in skip_keys and key not in dist.display_option_names )};data[\'metadata\'] = { k: v for k, v in dist.metadata.__dict__.items() if k not in (\'license_files\', \'provides_extras\')};sys.stdout.buffer.write(repr(data).encode(\'utf-8\'))']' returned non-zero exit status 1. --- Failed &lt;&lt;&lt; my_rover [1.91s, exited with code 1] Summary: 0 packages finished [3.25s] 1 package failed: my_rover 1 package had stderr output: my_rover Command '['/usr/bin/python3', '-c', 'import sys;from contextlib import suppress;exec(&quot;with suppress(ImportError): from setuptools.extern.packaging.specifiers import SpecifierSet&quot;);exec(&quot;with suppress(ImportError): from packaging.specifiers import SpecifierSet&quot;);from distutils.core import run_setup;dist = run_setup( \'setup.py\', script_args=(\'--dry-run\',), stop_after=\'config\');skip_keys = (\'cmdclass\', \'distclass\', \'ext_modules\', \'metadata\');data = { key: value for key, value in dist.__dict__.items() if ( not key.startswith(\'_\') and not callable(value) and key not in skip_keys and key not in dist.display_option_names )};data[\'metadata\'] = { k: v for k, v in dist.metadata.__dict__.items() if k not in (\'license_files\', \'provides_extras\')};sys.stdout.buffer.write(repr(data).encode(\'utf-8\'))']' returned non-zero exit status 1. </code></pre> <p>I have <code>python</code> version - 3.8.10 in my machine. How can I resolve this one?</p> <p>In my_rover package I have these below files</p> <p><code>rover.urdf</code></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;my_rover&quot;&gt; &lt;link name=&quot;chassis&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;box size=&quot;0.75 0.4 0.15&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;Orange&quot;&gt; &lt;color rgba=&quot;1.0 0.3 0.1 1.0&quot;/&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;geometry&gt; &lt;box size=&quot;0.75 0.4 0.15&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;2&quot;/&gt; &lt;inertia ixx=&quot;0.04&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.17&quot; iyz=&quot;0.0&quot; izz=&quot;0.25&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;link name=&quot;front_right_wheel&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://my_rover/meshes/right_tire.stl&quot; scale = &quot;0.005 0.005 0.005&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;Red&quot;&gt; &lt;color rgba=&quot;1.0 0.0 0.0 1.0&quot;/&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;geometry&gt; &lt;cylinder radius=&quot;0.15&quot; length=&quot;0.18&quot;/&gt; &lt;/geometry&gt; &lt;contact_coefficients mu = &quot;1&quot; kp = &quot;1e+13&quot; kd = &quot;1.0&quot;/&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;2&quot;/&gt; &lt;inertia ixx=&quot;1e-3&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;1e-3&quot; iyz=&quot;0.0&quot; izz=&quot;1e-3&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;front_right_wheel_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.2 0.24 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;parent link=&quot;chassis&quot;/&gt; &lt;child link=&quot;front_right_wheel&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;front_left_wheel&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://my_rover/meshes/left_tire.stl&quot; scale = &quot;0.005 0.005 0.005&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;Red&quot;&gt; &lt;color rgba=&quot;1.0 0.0 0.0 1.0&quot;/&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;geometry&gt; &lt;cylinder radius=&quot;0.15&quot; length=&quot;0.18&quot;/&gt; &lt;/geometry&gt; &lt;contact_coefficients mu = &quot;1&quot; kp = &quot;1e+13&quot; kd = &quot;1.0&quot;/&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;2&quot;/&gt; &lt;inertia ixx=&quot;1e-3&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;1e-3&quot; iyz=&quot;0.0&quot; izz=&quot;1e-3&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;front_left_wheel_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.2 -0.24 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;parent link=&quot;chassis&quot;/&gt; &lt;child link=&quot;front_left_wheel&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;back_right_wheel&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://my_rover/meshes/right_tire.stl&quot; scale = &quot;0.005 0.005 0.005&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;Red&quot;&gt; &lt;color rgba=&quot;1.0 0.0 0.0 1.0&quot;/&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;geometry&gt; &lt;cylinder radius=&quot;0.15&quot; length=&quot;0.18&quot;/&gt; &lt;/geometry&gt; &lt;contact_coefficients mu = &quot;1&quot; kp = &quot;1e+13&quot; kd = &quot;1.0&quot;/&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;2&quot;/&gt; &lt;inertia ixx=&quot;1e-3&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;1e-3&quot; iyz=&quot;0.0&quot; izz=&quot;1e-3&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;back_right_wheel_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-0.2 0.24 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;parent link=&quot;chassis&quot;/&gt; &lt;child link=&quot;back_right_wheel&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;back_left_wheel&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://my_rover/meshes/left_tire.stl&quot; scale = &quot;0.005 0.005 0.005&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;Red&quot;&gt; &lt;color rgba=&quot;1.0 0.0 0.0 1.0&quot;/&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;geometry&gt; &lt;cylinder radius=&quot;0.15&quot; length=&quot;0.18&quot;/&gt; &lt;/geometry&gt; &lt;contact_coefficients mu = &quot;1&quot; kp = &quot;1e+13&quot; kd = &quot;1.0&quot;/&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;2&quot;/&gt; &lt;inertia ixx=&quot;1e-3&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;1e-3&quot; iyz=&quot;0.0&quot; izz=&quot;1e-3&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;back_left_wheel_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-0.2 -0.24 0.0&quot; rpy=&quot;0.0 0.0 0.0&quot;/&gt; &lt;parent link=&quot;chassis&quot;/&gt; &lt;child link=&quot;back_left_wheel&quot;/&gt; &lt;axis xyz=&quot;0.0 1.0 0.0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;camera&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;box size=&quot;0.010 0.05 0.05&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;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;geometry&gt; &lt;box size=&quot;0.010 0.05 0.05&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;0.5&quot; /&gt; &lt;inertia ixx=&quot;0.01&quot; ixy=&quot;0.0&quot; ixz=&quot;0&quot; iyy=&quot;0.01&quot; iyz=&quot;0&quot; izz=&quot;0.01&quot; /&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;camera_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;chassis&quot;/&gt; &lt;child link=&quot;camera&quot;/&gt; &lt;origin xyz=&quot;0.375 0.0 0.15&quot; rpy=&quot;0.0 0.0 3.14&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;lidar&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://my_rover/meshes/lds.stl&quot; scale=&quot;0.002 0.002 0.002&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;LightGrey&quot;&gt; &lt;color rgba=&quot;0.7 0.7 0.7 1.0&quot;/&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;geometry&gt; &lt;cylinder radius=&quot;0.08&quot; length=&quot;0.1&quot;/&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;inertial&gt; &lt;mass value=&quot;0.5&quot;/&gt; &lt;inertia ixx=&quot;0.01&quot; ixy=&quot;0.0&quot; ixz=&quot;0.0&quot; iyy=&quot;0.01&quot; iyz=&quot;0.0&quot; izz=&quot;0.01&quot;/&gt; &lt;/inertial&gt; &lt;/link&gt; &lt;joint name=&quot;lodar_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;chassis&quot;/&gt; &lt;child link=&quot;lidar&quot;/&gt; &lt;origin xyz=&quot;0.2 0 0.25&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;/joint&gt; &lt;/robot&gt; </code></pre> <p>This my <code>1_rviz.lauunch.py</code> file</p> <pre><code>import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch_ros.actions import Node def generate_launch_description(): package_dir = get_package_share_directory('mr_rover') urdf = os.path.join(package_dir,'rover.urdf') return LaunchDescription([ Node( package='robot_state_publisher', executable='robot_state_publisher', name='robot_state_publisher', output='screen', arguments=[urdf]), Node( package='joint_state_publisher_gui', executable='joint_state_publisher_gui', name='joint_state_publisher_gui', arguments=[urdf]), Node( package='rviz2', executable='rviz2', name='rviz2', output='screen'), ]) </code></pre> <p>These are the two files I added after the package created.</p> <p>And this is <code>setup.py</code> file</p> <pre><code>from setuptools import setup import os from glob import glob package_name = 'my_rover' setup( name=package_name, version='0.0.0', packages=[package_name], data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), (os.path.joint('share', package_name), glob('launch/*.py')), (os.path.joint('share', package_name), glob('urdf/*')), ], install_requires=['setuptools'], zip_safe=True, maintainer='vasanth', maintainer_email='email@example.com', description='TODO: Package description', license='TODO: License declaration', tests_require=['pytest'], entry_points={ 'console_scripts': [ ], }, ) </code></pre>
AttributeError: module 'posixpath' has no attribute 'joint'
<p>The carrot planner is barely an &quot;algorithm&quot; - and so you won't find any references to an academic paper about it. The approach is described in detail on the ROS wiki (<a href="http://wiki.ros.org/carrot_planner" rel="nofollow noreferrer">http://wiki.ros.org/carrot_planner</a>):</p> <blockquote> <p>The planner takes a goal point from an external user, checks if the user-specified goal is in an obstacle, and if it is, it walks back along the vector between the user-specified goal and the robot until a goal point that is not in an obstacle is found&quot;</p> </blockquote> <p><a href="https://i.stack.imgur.com/so62C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/so62C.png" alt="enter image description here" /></a></p>
103701
2023-08-25T12:37:44.437
|navigation|ros-noetic|base-global-planner|carrot-planner|
<p>At first i've tried global planner for my project, just because i can use different algorithms for path planning. But then i found out that carrotPlanner is more suitable for my project although i cant find any documentation about which algorithm carrot planner use. I have to know cause i must mention it in my thesis.</p>
Carrot_planner what algorithm it use
<p>This is not a <code>colcon</code> option, but Gazebo libraries have a cmake flag for disabling documentation. You'd pass it through colcon via <code>--cmake-args -DBUILD_DOCS=OFF</code>. <a href="https://github.com/gazebosim/gz-cmake/blob/gz-cmake3/tutorials/developing_with_gz-cmake.md" rel="nofollow noreferrer">This</a> is a good tutorial to look through for this and other flags.</p>
103705
2023-08-25T13:21:54.623
|colcon|
<p>I noticed upon building Gazebo Garden that it runs doxygen. This takes a significant time. Is there a way to disable this?</p>
How to ensure colcon does not run doxygen
<p>ROS Humble is a ROS2 distro therefore it uses colcon to build packages instead of catkin tools.</p> <p>See <a href="https://docs.ros.org/en/humble/How-To-Guides/Migrating-from-ROS1/Migrating-CPP-Packages.html" rel="nofollow noreferrer">Migrating C++ Packages</a> - <a href="https://docs.ros.org/en/humble/How-To-Guides/Migrating-from-ROS1/Migrating-CPP-Packages.html#build-system" rel="nofollow noreferrer">Build system</a>:</p> <blockquote> <p>The build system in ROS 2 is called <a href="https://design.ros2.org/articles/ament.html" rel="nofollow noreferrer">ament</a>. Ament is built on CMake: <code>ament_cmake</code> provides CMake functions to make writing <code>CMakeLists.txt</code> files easier.</p> </blockquote>
103707
2023-08-25T15:33:23.907
|ros|ros2|catkin|ubuntu|ros-humble|
<p>I have Ubuntu 22.04 installed and corresponding to that have ROS Humble installed, I am trying to create a workspace with Catkin but have run into an issue:</p> <pre class="lang-none prettyprint-override"><code>engineer@vmubuntu:~/catkin_workspace/src$ catkin_init_workspace Command 'catkin_init_workspace' not found, but can be installed with: sudo apt install catkin </code></pre> <p>Have tried to get the GitHub project and use 'catkin_make' but get error</p> <p>Could not find any updated document stating this cannot be done or if it is, could not find anything to make this work.</p> <p>I tried installing Catkin but run into this issue:</p> <pre class="lang-none prettyprint-override"><code>engineer@vmubuntu:~/catkin_workspace$ sudo apt install catkin Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies. python3-catkin-pkg : Conflicts: catkin but 0.8.10-7 is to be installed python3-catkin-pkg-modules : Conflicts: catkin but 0.8.10-7 is to be installed E: Unable to correct problems, you have held broken packages. </code></pre>
using catkin win Ubuntu Humble with ROS2 Humble
<p>Can something like this be what you are looking for?</p> <p><a href="https://i.stack.imgur.com/GY2hm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GY2hm.png" alt="enter image description here" /></a></p> <p>This picture is from MoveIt basic tutorial: <a href="https://moveit.picknik.ai/humble/doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial.html" rel="nofollow noreferrer">https://moveit.picknik.ai/humble/doc/tutorials/quickstart_in_rviz/quickstart_in_rviz_tutorial.html</a></p> <p>As you can see, you can set Robot Alpha value, as well as trail step size to a value that is acceptable for you. You can also add a &quot;Trajectory&quot; item in RViz</p>
103715
2023-08-25T22:08:56.210
|ros2|rviz|moveit|trajectory|
<p>I would like to show the path planned by moveit2 as a figure in a paper I'm writing. I've seen figures with multiple semi-transparent manipulator arms showing various stages of a certain trajectory, (kind of like a flipbook) before. How do I go about generating such an representation of my trajectory?</p> <p><a href="https://www.google.com/imgres?imgurl=https%3A%2F%2Fwww.researchgate.net%2Fpublication%2F342498175%2Ffigure%2Ffig3%2FAS%3A907037701599233%401593266048086%2FRobotic-arm-correctly-moving-along-a-generic-trajectory-from-a-point-A-to-a-point-B.png&amp;tbnid=XOdLMOYM5XEVqM&amp;vet=12ahUKEwi5koim6PiAAxUjmycCHTilAzkQMygHegQIARBp..i&amp;imgrefurl=https%3A%2F%2Fwww.researchgate.net%2Ffigure%2FRobotic-arm-correctly-moving-along-a-generic-trajectory-from-a-point-A-to-a-point-B_fig3_342498175&amp;docid=QKxITTFAYxxbvM&amp;w=524&amp;h=441&amp;itg=1&amp;q=robot%20arm%20trajectory&amp;ved=2ahUKEwi5koim6PiAAxUjmycCHTilAzkQMygHegQIARBp" rel="nofollow noreferrer">This</a> is the look I'm going for, though 3D and with a model of a FE Panda arm.</p> <p><a href="https://www.smashingrobotics.com/wp-content/uploads/2012/07/432wef22s.png" rel="nofollow noreferrer">This</a> representation would also be acceptable if its easier to generate.</p>
Save robot trajectory as a single figure/image
<p>Which version of ros2_controllers are you using?</p> <p>rqt_graph also shows that robot_state_publisher publishs tf, are you sure it is coming from diff_drive_controller?</p> <p>My suggestion: Try to remap the topics in the launch file and introspect with <code>ros2 topic info tf</code></p> <p>Regarding rviz and odometry: This is a completely different topic/information. The robot model display uses tf, odometry is a different display type showing the calculated position+velocity by arrows. The two odometry topics are namespaced acc. to your graph, but have a look with <code>ros2 topic info /diff_cont/odom</code> or <code>ros2 topic info /odometry/filtered</code></p>
103728
2023-08-27T03:50:29.497
|odometry|sensor-fusion|diff-drive-controller|ros2-control|ros2-controllers|
<p>I have 2 wheels diff_drive robot that use diff_drive_controller from ros2_control,so this first work as diff_cont (diff_drive_controller name) publish transform from odom to base_link on /tf.</p> <p>Now I want to add IMU with robot_localization package,so this will receive odom data from diff_cont and imu data from IMU and publish on /tf odom to base_link.</p> <p>The problem is it seems like that ekf_node publish on /tf and diff_cont publish on /tf too cause the robot to jiggle between odometry from efk_node and diff_cont node(My apology if this confuse you.I'm trying to say that when I open Rviz2 with Odometry, there are 2 odometry topics)</p> <p>How can this be fix? I set the parameter <code>enable_odom_tf: false</code> but diff_cont still publish on /tf,I even check that after I launch the robot <code>enable_odom_tf</code> is False by <code>ros2 get /diff_cont enable_odom_tf</code>.</p> <p>This is my params file my_controllers.yaml</p> <pre class="lang-yaml prettyprint-override"><code>controller_manager: ros__parameters: update_rate: 30 #use_sim_time: true diff_cont: type: diff_drive_controller/DiffDriveController joint_broad: type: joint_state_broadcaster/JointStateBroadcaster diff_cont: ros__parameters: publish_rate: 30.0 base_frame_id: base_link left_wheel_names: ['left_wheel_joint'] right_wheel_names: ['right_wheel_joint'] wheel_separation: 0.335 wheel_radius: 0.06 use_stamped_vel: false enable_odom_tf: false # open_loop: false # wheels_per_side: x # wheel_separation_multiplier: x # left_wheel_radius_multiplier: x # right_wheel_radius_multiplier: x # odom_frame_id: x # pose_covariance_diagonal: x # twist_covariance_diagonal: x # open_loop: x # cmd_vel_timeout: x # publish_limited_velocity: x # velocity_rolling_window_size: x # linear.x.has_velocity_limits: false # linear.x.has_acceleration_limits: false # linear.x.has_jerk_limits: false # linear.x.max_velocity: NAN # linear.x.min_velocity: NAN # linear.x.max_acceleration: NAN # linear.x.min_acceleration: NAN # linear.x.max_jerk: NAN # linear.x.min_jerk: NAN # angular.z.has_velocity_limits: false # angular.z.has_acceleration_limits: false # angular.z.has_jerk_limits: false # angular.z.max_velocity: NAN # angular.z.min_velocity: NAN # angular.z.max_acceleration: NAN # angular.z.min_acceleration: NAN # angular.z.max_jerk: NAN # angular.z.min_jerk: NAN # joint_broad: # ros__parameters: </code></pre> <p>launch file</p> <pre class="lang-python prettyprint-override"><code>import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare def generate_launch_description(): # Include the robot_state_publisher launch file, provided by our own package. Force sim time to be enabled package_name='robo2023' pkg_share = FindPackageShare(package=package_name).find(package_name) rsp = IncludeLaunchDescription( PythonLaunchDescriptionSource([os.path.join( get_package_share_directory(package_name),'launch','rsp.launch.py' )]), launch_arguments={'use_sim_time': 'true', 'use_ros2_control': 'true'}.items() ) twist_mux_params = os.path.join(get_package_share_directory(package_name),'config','twist_mux.yaml') twist_mux = Node( package=&quot;twist_mux&quot;, executable=&quot;twist_mux&quot;, parameters=[twist_mux_params], remappings=[('/cmd_vel_out','/diff_cont/cmd_vel_unstamped')] ) robot_localization_file_path = os.path.join(pkg_share, 'config/ekf.yaml') # Include the Gazebo launch file, provided by the gazebo_ros package gazebo = IncludeLaunchDescription( PythonLaunchDescriptionSource([os.path.join( get_package_share_directory('gazebo_ros'), 'launch', 'gazebo.launch.py')]), ) start_robot_localization_cmd = Node( package='robot_localization', executable='ekf_node', name='ekf_filter_node', output='screen', parameters=[robot_localization_file_path, {'use_sim_time': True}]) # Run the spawner node from the gazebo_ros package. The entity name doesn't really matter if you only have a single robot. spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py', arguments=['-topic', 'robot_description', '-entity', 'my_bot'], output='screen') diff_drive_spawner = Node( package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[&quot;diff_cont&quot;], ) joint_broad_spawner = Node( package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[&quot;joint_broad&quot;], ) # Launch them all! return LaunchDescription([ rsp, twist_mux, gazebo, start_robot_localization_cmd, spawn_entity, diff_drive_spawner, joint_broad_spawner ]) </code></pre> <p>rqt_graph <a href="https://i.stack.imgur.com/VNkV0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VNkV0.png" alt="enter image description here" /></a></p> <p>UPDATE : add ekf.yaml</p> <pre class="lang-yaml prettyprint-override"><code>### ekf config file ### ekf_filter_node: ros__parameters: use_sim_time: true # The frequency, in Hz, at which the filter will output a position estimate. Note that the filter will not begin # computation until it receives at least one message from one of the inputs. It will then run continuously at the # frequency specified here, regardless of whether it receives more measurements. Defaults to 30 if unspecified. frequency: 30.0 # The period, in seconds, after which we consider a sensor to have timed out. In this event, we carry out a predict # cycle on the EKF without correcting it. This parameter can be thought of as the minimum frequency with which the # filter will generate new output. Defaults to 1 / frequency if not specified. sensor_timeout: 0.1 # ekf_localization_node and ukf_localization_node both use a 3D omnidirectional motion model. If this parameter is # set to true, no 3D information will be used in your state estimate. Use this if you are operating in a planar # environment and want to ignore the effect of small variations in the ground plane that might otherwise be detected # by, for example, an IMU. Defaults to false if unspecified. two_d_mode: true # Use this parameter to provide an offset to the transform generated by ekf_localization_node. This can be used for # future dating the transform, which is required for interaction with some other packages. Defaults to 0.0 if # unspecified. transform_time_offset: 0.0 # Use this parameter to provide specify how long the tf listener should wait for a transform to become available. # Defaults to 0.0 if unspecified. transform_timeout: 0.0 # If you're having trouble, try setting this to true, and then echo the /diagnostics_agg topic to see if the node is # unhappy with any settings or data. print_diagnostics: true # Debug settings. Not for the faint of heart. Outputs a ludicrous amount of information to the file specified by # debug_out_file. I hope you like matrices! Please note that setting this to true will have strongly deleterious # effects on the performance of the node. Defaults to false if unspecified. debug: false # Defaults to &quot;robot_localization_debug.txt&quot; if unspecified. Please specify the full path. debug_out_file: /path/to/debug/file.txt # Whether to broadcast the transformation over the /tf topic. Defaults to true if unspecified. publish_tf: true # Whether to publish the acceleration state. Defaults to false if unspecified. publish_acceleration: false # If the filter sees a jump back in time, the filter is reset (convenient for testing with rosbags!) reset_on_time_jump: true # REP-105 (http://www.ros.org/reps/rep-0105.html) specifies four principal coordinate frames: base_link, odom, map, and # earth. base_link is the coordinate frame that is affixed to the robot. Both odom and map are world-fixed frames. # The robot's position in the odom frame will drift over time, but is accurate in the short term and should be # continuous. The odom frame is therefore the best frame for executing local motion plans. The map frame, like the odom # frame, is a world-fixed coordinate frame, and while it contains the most globally accurate position estimate for your # robot, it is subject to discrete jumps, e.g., due to the fusion of GPS data or a correction from a map-based # localization node. The earth frame is used to relate multiple map frames by giving them a common reference frame. # ekf_localization_node and ukf_localization_node are not concerned with the earth frame. # Here is how to use the following settings: # 1. Set the map_frame, odom_frame, and base_link frames to the appropriate frame names for your system. # 1a. If your system does not have a map_frame, just remove it, and make sure &quot;world_frame&quot; is set to the value of # odom_frame. # 2. If you are fusing continuous position data such as wheel encoder odometry, visual odometry, or IMU data, set # &quot;world_frame&quot; to your odom_frame value. This is the default behavior for robot_localization's state estimation nodes. # 3. If you are fusing global absolute position data that is subject to discrete jumps (e.g., GPS or position updates # from landmark observations) then: # 3a. Set your &quot;world_frame&quot; to your map_frame value # 3b. MAKE SURE something else is generating the odom-&gt;base_link transform. Note that this can even be another state # estimation node from robot_localization! However, that instance should *not* fuse the global data. #map_frame: map # Defaults to &quot;map&quot; if unspecified odom_frame: odom # Defaults to &quot;odom&quot; if unspecified base_link_frame: base_link # Defaults to &quot;base_link&quot; if unspecified world_frame: odom # Defaults to the value of odom_frame if unspecified # The filter accepts an arbitrary number of inputs from each input message type (nav_msgs/Odometry, # geometry_msgs/PoseWithCovarianceStamped, geometry_msgs/TwistWithCovarianceStamped, # sensor_msgs/Imu). To add an input, simply append the next number in the sequence to its &quot;base&quot; name, e.g., odom0, # odom1, twist0, twist1, imu0, imu1, imu2, etc. The value should be the topic name. These parameters obviously have no # default values, and must be specified. odom0: diff_cont/odom # Each sensor reading updates some or all of the filter's state. These options give you greater control over which # values from each measurement are fed to the filter. For example, if you have an odometry message as input, but only # want to use its Z position value, then set the entire vector to false, except for the third entry. The order of the # values is x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az. Note that not some message types # do not provide some of the state variables estimated by the filter. For example, a TwistWithCovarianceStamped message # has no pose information, so the first six values would be meaningless in that case. Each vector defaults to all false # if unspecified, effectively making this parameter required for each sensor. odom0_config: [true, true, true, false, false, false, true, true, true, false, false, true, false, false, false] # [x_pos , y_pos , z_pos, # roll , pitch , yaw, # x_vel , y_vel , z_vel, # roll_vel, pitch_vel, yaw_vel, # x_accel , y_accel , z_accel] # If you have high-frequency data or are running with a low frequency parameter value, then you may want to increase # the size of the subscription queue so that more measurements are fused. odom0_queue_size: 2 # [ADVANCED] Large messages in ROS can exhibit strange behavior when they arrive at a high frequency. This is a result # of Nagle's algorithm. This option tells the ROS subscriber to use the tcpNoDelay option, which disables Nagle's # algorithm. odom0_nodelay: false # [ADVANCED] When measuring one pose variable with two sensors, a situation can arise in which both sensors under- # report their covariances. This can lead to the filter rapidly jumping back and forth between each measurement as they # arrive. In these cases, it often makes sense to (a) correct the measurement covariances, or (b) if velocity is also # measured by one of the sensors, let one sensor measure pose, and the other velocity. However, doing (a) or (b) isn't # always feasible, and so we expose the differential parameter. When differential mode is enabled, all absolute pose # data is converted to velocity data by differentiating the absolute pose measurements. These velocities are then # integrated as usual. NOTE: this only applies to sensors that provide pose measurements; setting differential to true # for twist measurements has no effect. odom0_differential: false # [ADVANCED] When the node starts, if this parameter is true, then the first measurement is treated as a &quot;zero point&quot; # for all future measurements. While you can achieve the same effect with the differential paremeter, the key # difference is that the relative parameter doesn't cause the measurement to be converted to a velocity before # integrating it. If you simply want your measurements to start at 0 for a given sensor, set this to true. odom0_relative: false # [ADVANCED] If your data is subject to outliers, use these threshold settings, expressed as Mahalanobis distances, to # control how far away from the current vehicle state a sensor measurement is permitted to be. Each defaults to # numeric_limits&lt;double&gt;::max() if unspecified. It is strongly recommended that these parameters be removed if not # required. Data is specified at the level of pose and twist variables, rather than for each variable in isolation. # For messages that have both pose and twist data, the parameter specifies to which part of the message we are applying # the thresholds. odom0_pose_rejection_threshold: 5.0 odom0_twist_rejection_threshold: 1.0 imu0: imu/data imu0_config: [false, false, false, true, true, true, false, false, false, true, true, true, true, true, true] # [x_pos , y_pos , z_pos, # roll , pitch , yaw, # x_vel , y_vel , z_vel, # roll_vel, pitch_vel, yaw_vel, # x_accel , y_accel , z_accel] imu0_nodelay: false imu0_differential: false imu0_relative: true imu0_queue_size: 7 imu0_pose_rejection_threshold: 0.8 # Note the difference in parameter names imu0_twist_rejection_threshold: 0.8 # imu0_linear_acceleration_rejection_threshold: 0.8 # # [ADVANCED] Some IMUs automatically remove acceleration due to gravity, and others don't. If yours doesn't, please set # this to true, and *make sure* your data conforms to REP-103, specifically, that the data is in ENU frame. imu0_remove_gravitational_acceleration: true # [ADVANCED] The EKF and UKF models follow a standard predict/correct cycle. During prediction, if there is no # acceleration reference, the velocity at time t+1 is simply predicted to be the same as the velocity at time t. During # correction, this predicted value is fused with the measured value to produce the new velocity estimate. This can be # problematic, as the final velocity will effectively be a weighted average of the old velocity and the new one. When # this velocity is the integrated into a new pose, the result can be sluggish covergence. This effect is especially # noticeable with LIDAR data during rotations. To get around it, users can try inflating the process_noise_covariance # for the velocity variable in question, or decrease the variance of the variable in question in the measurement # itself. In addition, users can also take advantage of the control command being issued to the robot at the time we # make the prediction. If control is used, it will get converted into an acceleration term, which will be used during # predicition. Note that if an acceleration measurement for the variable in question is available from one of the # inputs, the control term will be ignored. # Whether or not we use the control input during predicition. Defaults to false. use_control: false # Whether the input (assumed to be cmd_vel) is a geometry_msgs/Twist or geometry_msgs/TwistStamped message. Defaults to # false. stamped_control: false # The last issued control command will be used in prediction for this period. Defaults to 0.2. control_timeout: 0.2 # Which velocities are being controlled. Order is vx, vy, vz, vroll, vpitch, vyaw. control_config: [true, false, false, false, false, true] # Places limits on how large the acceleration term will be. Should match your robot's kinematics. acceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 3.4] # Acceleration and deceleration limits are not always the same for robots. deceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 4.5] # If your robot cannot instantaneously reach its acceleration limit, the permitted change can be controlled with these # gains acceleration_gains: [0.8, 0.0, 0.0, 0.0, 0.0, 0.9] # If your robot cannot instantaneously reach its deceleration limit, the permitted change can be controlled with these # gains deceleration_gains: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0] # [ADVANCED] The process noise covariance matrix can be difficult to tune, and can vary for each application, so it is # exposed as a configuration parameter. This matrix represents the noise we add to the total error after each # prediction step. The better the omnidirectional motion model matches your system, the smaller these values can be. # However, if users find that a given variable is slow to converge, one approach is to increase the # process_noise_covariance diagonal value for the variable in question, which will cause the filter's predicted error # to be larger, which will cause the filter to trust the incoming measurement more during correction. The values are # ordered as x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az. Defaults to the matrix below if # unspecified. process_noise_covariance: [0.05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.04, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.02, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.015] # [ADVANCED] This represents the initial value for the state estimate error covariance matrix. Setting a diagonal # value (variance) to a large value will result in rapid convergence for initial measurements of the variable in # question. Users should take care not to use large values for variables that will not be measured directly. The values # are ordered as x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az. Defaults to the matrix below #if unspecified. initial_estimate_covariance: [1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-9] </code></pre>
Differential Drive Controller 'enable_odom_tf: false' doesn't work
<p>Found a solution for my particular problem.</p> <p>I just <strong>commented &quot;if&quot; condition</strong> for the <strong>INS</strong> publishing part of the C++ script, see the screenshot below.</p> <p><a href="https://i.stack.imgur.com/RwUGq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RwUGq.png" alt="enter image description here" /></a></p> <p>*talking about ROS <a href="https://github.com/dawonn/vectornav" rel="nofollow noreferrer">driver for VectorNAV</a></p> <p>In the file <strong>/vectornav/src/main.cpp</strong> I've commented <strong>lines 814-816 and 820</strong></p> <p>So, basically, I just <strong>removed an if condition</strong> for the INS part. Seems like for some reason it doesn't get &quot;True&quot; and the publishing INS part of the code just skipped.</p> <p>I didn't try it before, because it is absolutely the same condition as for <strong>IMU</strong> data, or <strong>temperature</strong> data. Maybe because these are (IMU and temperature) default ROS messages, publishing IMU/temperature data didn't have the same problem as INS publishing (which is processed data I believe, so it is not raw data, like IMU for instance)</p>
103734
2023-08-27T14:46:32.397
|ros|ros-melodic|ubuntu|c++|imu|
<p>I've already posted the same question on the <strong>GitHub page</strong> of the <strong>VectorNAV</strong> driver: github.com/dawonn/vectornav/issues/128 But no luck, noone gets back to me, looks like the branch isn't in much support right now.</p> <p>My system is <strong>Ubuntu 18.04, ROS1 Melodic</strong> (trying to get INS messages on x86 computer now, but final goal is Nvidia TX2, which is ARM computer if it matters)</p> <p>First, I wanted to make my own node, using <strong>Python 3</strong>, because <strong>VectorNAV</strong> provides <strong>Python 3.4+</strong> libraries and they are super easy to use for me. But, as I mentioned above, my system is using <strong>ROS1</strong> and it has <strong>Python 2.7</strong> as a default. I know, that it is possible to change default version for the <strong>ROS1</strong> to <strong>Python 3x</strong>, but I have a lot of nodes, which were built based on <strong>Python 2.7</strong> libraries.</p> <p>I've asked <strong>VectorNAV</strong> support do they have <strong>Python 2</strong> libraries, they answered negative and redirected me to the <strong>ROS1</strong> VectorNAV driver which is already exists: github.com/dawonn/vectornav Which is based on <strong>C++</strong> script. After that I've downloaded this driver, built it in my <strong>catkin space</strong> and tried to use.</p> <p>The problem is that I can't see the messages with <strong>&quot;roll&quot; &quot;pitch&quot;</strong> and <strong>&quot;yaw&quot;</strong> angles information (in degrees, as i says in <strong>msg/Ins.msg file</strong>)</p> <p>My device is <strong>VN100</strong> according to this I've modified <strong>/launch/vectornav.launch</strong> file to: <a href="https://i.stack.imgur.com/plcBb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/plcBb.png" alt="vectornav.launch" /></a></p> <p>After running the commands:</p> <pre><code>sudo chmod a+rw /dev/ttyUSB0 </code></pre> <p>and</p> <pre><code>roscore </code></pre> <p>and after that</p> <pre><code>roslaunch vectornav vectornav.launch </code></pre> <p>Using <code>rostopic list</code> I can see the following topics:</p> <pre><code>~/catkin_ws$ rostopic list /rosout /rosout_agg /vectornav/GPS /vectornav/IMU /vectornav/INS /vectornav/Mag /vectornav/Odom /vectornav/Pres /vectornav/Temp </code></pre> <p>and most of them works and shows me the messages: IMU for example:</p> <p><a href="https://i.stack.imgur.com/pj2NB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pj2NB.png" alt="enter image description here" /></a></p> <p>or temperature:</p> <p><a href="https://i.stack.imgur.com/amh1h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/amh1h.png" alt="enter image description here" /></a></p> <p>But the only one I need, with <strong>pitch, roll</strong> and <strong>yaw</strong> information, as I understand, should be in <code>/vectornav/INS</code> topic</p> <p>and when I run the command:</p> <pre><code>rostopic echo /vectornav/INS </code></pre> <p>it just give me nothing:</p> <p><a href="https://i.stack.imgur.com/yE4GH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yE4GH.png" alt="enter image description here" /></a></p> <p>I've found one problem, that <strong>Ins.msg</strong> which you can see in the package:</p> <p><a href="https://i.stack.imgur.com/jOrBN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jOrBN.png" alt="enter image description here" /></a></p> <p>weren't build at first, but now I've modified the <strong>package.xml</strong> and <strong>CMakeLists.txt</strong> and using command</p> <pre><code>rosmsg list show </code></pre> <p>I can see <code>vectornav</code> messages</p> <p>which should contain <strong>yaw, roll</strong> and <strong>pitch</strong> information:</p> <p><a href="https://i.stack.imgur.com/zyDyJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zyDyJ.png" alt="enter image description here" /></a></p> <p>But, again, as I mention above, command</p> <pre><code>rostopic echo /vectornav/Ins </code></pre> <p>gives me nothing:</p> <p><a href="https://i.stack.imgur.com/YgKBj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YgKBj.png" alt="enter image description here" /></a></p> <p>Looks like the only things which works (publishing working) are the standard std messages, such as <strong>/sensor_msg/temperature</strong> or <strong>/std_msg/IMU</strong></p> <p><a href="https://i.stack.imgur.com/6UETH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6UETH.png" alt="enter image description here" /></a></p> <p>And logically to think that the problem with building the custom messages.. But I see now that they were succesfully built as I showed above.</p> <p>Anyone has any advise? Or maybe someone faced with the similar problem using VectorNAV <em><strong>VN100</strong></em>?</p> <p>Best, Andrey</p>
IMU sensor Vectornav VN100 driver doesn't post any INS messages
<p>Without your URDF it is hard to answer. What type of hardware_component are you using? Simulation or custom plugin? If you don't have one: Have a look at the <a href="https://control.ros.org/master/doc/ros2_control_demos/doc/index.html" rel="nofollow noreferrer">demos</a> how to setup your ros2_control framework.</p> <p>(Edit) Summary: Have a look in the output of the controller_manager (where you launched gazebo.launch.py):</p> <pre><code>[gzserver-1] Exception thrown during init stage with message: parameter 'joints' has invalid type: expected [string_array] got [string] </code></pre> <p>This comes from a wrong syntax in your yaml, you have to add a space between the dashes and strings, e.g. <code>- joint_1</code> instead of <code>-joint_1</code> –</p>
103737
2023-08-27T16:11:25.773
|ros-control|ros-humble|controller-manager|
<p>I'm trying to use spawner for the custom controller to use different controllers like the joint trajectory controller and the forward command controller in a launch file.</p> <p><em><strong>This is controller.yaml file:</strong></em></p> <pre class="lang-yaml prettyprint-override"><code>controller_manager: ros__parameters: update_rate: 10 arm_controller: type: joint_trajectory_controller/JointTrajectoryController # gripper_controller: # type: joint_trajectory_controller/JointTrajectoryController gripper_controller: type: forward_command_controller/ForwardCommandController joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster arm_controller: ros__parameters: joints: -joint_1 -joint_2 -joint_3 command_interfaces: -position state_interfaces: -position open_loop_control: true allow_integration_in_goal_trajectories: true gripper_controller: ros__parameters: joints: -joint_4 interface_name: position # command_interfaces: # -position # state_interfaces: # -position # open_loop_control: true # allow_integration_in_goal_trajectories: true </code></pre> <p><em><strong>This is my launch file:</strong></em></p> <pre class="lang-python prettyprint-override"><code>from launch import LaunchDescription from launch_ros.actions import Node from launch_ros.parameter_descriptions import ParameterValue from launch.actions import DeclareLaunchArgument from launch.substitutions import Command, LaunchConfiguration import os from ament_index_python.packages import get_package_share_directory def generate_launch_description(): robot_description = ParameterValue(Command(['xacro ', os.path.join(get_package_share_directory(&quot;robot_description&quot;),&quot;urdf&quot;,&quot;robot_des.urdf.xacro&quot;)]), value_type=str) robot_state_publisher_node = Node( package='robot_state_publisher', executable='robot_state_publisher', parameters=[{'robot_description': robot_description}] ) joint_state_broadcaster_node = Node( package='controller_manager', executable='spawner', arguments=['joint_state_broadcaster', &quot;--controller-manager&quot;,&quot;/controller_manager&quot;] ) arm_controller_spawner = Node( package='controller_manager', executable='spawner', arguments=['arm_controller', &quot;--controller-manager&quot;,&quot;/controller_manager&quot;] ) gripper_controller_spawner = Node( package='controller_manager', executable='spawner', arguments=['gripper_controller', &quot;--controller-manager&quot;,&quot;/controller_manager&quot;] ) return LaunchDescription([ robot_state_publisher_node, joint_state_broadcaster_node, arm_controller_spawner, gripper_controller_spawner ]) </code></pre> <p><strong>This is my terminal output when I'm trying to launch the controller using above launch file</strong></p> <pre class="lang-log prettyprint-override"><code>ubuntu@instance-20230806-0136:~/ros2motion$ ros2 launch arm_robot_control controller.launch.py [INFO] [launch]: All log files can be found below /home/ubuntu/.ros/log/2023-08-27-15-50-24-736711-instance-20230806-0136-257488 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [257498] [INFO] [spawner-2]: process started with pid [257500] [INFO] [spawner-3]: process started with pid [257502] [INFO] [spawner-4]: process started with pid [257505] [robot_state_publisher-1] [INFO] [1693151425.672522283] [robot_state_publisher]: got segment base_link [robot_state_publisher-1] [INFO] [1693151425.675259673] [robot_state_publisher]: got segment base_plate [robot_state_publisher-1] [INFO] [1693151425.675883014] [robot_state_publisher]: got segment claw_support [robot_state_publisher-1] [INFO] [1693151425.687073843] [robot_state_publisher]: got segment forward_drive_arm [robot_state_publisher-1] [INFO] [1693151425.687625598] [robot_state_publisher]: got segment gripper_left [robot_state_publisher-1] [INFO] [1693151425.688204315] [robot_state_publisher]: got segment gripper_right [robot_state_publisher-1] [INFO] [1693151425.694970715] [robot_state_publisher]: got segment horizontal_arm [robot_state_publisher-1] [INFO] [1693151425.695374865] [robot_state_publisher]: got segment world [spawner-2] [INFO] [1693151427.513446324] [spawner_joint_state_broadcaster]: Loaded joint_state_broadcaster [spawner-4] [FATAL] [1693151427.606168788] [spawner_gripper_controller]: Failed loading controller gripper_controller [spawner-3] [FATAL] [1693151427.724714084] [spawner_arm_controller]: Failed loading controller arm_controller [ERROR] [spawner-4]: process has died [pid 257505, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner gripper_controller --controller-manager /controller_manager --ros-args']. [ERROR] [spawner-3]: process has died [pid 257502, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner arm_controller --controller-manager /controller_manager --ros-args']. [spawner-2] [INFO] [1693151428.065387725] [spawner_joint_state_broadcaster]: Configured and activated joint_state_broadcaster [INFO] [spawner-2]: process has finished cleanly [pid 257500] </code></pre> <p><em><strong>URDF control file</strong></em></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;arm_robot&quot;&gt; &lt;xacro:property name=&quot;PI&quot; value=&quot;3.14159&quot;/&gt; &lt;ros2_control name=&quot;RobotSystem&quot; type=&quot;system&quot;&gt; &lt;hardware&gt; &lt;plugin&gt;gazebo_ros2_control/GazeboSystem&lt;/plugin&gt; &lt;/hardware&gt; &lt;joint name=&quot;joint_1&quot;&gt; &lt;command_interface name=&quot;position&quot;&gt; &lt;params name=&quot;min&quot;&gt;-<span class="math-container">${PI/2}&lt;/params&gt; &lt;params name="mav"&gt;$</span>{PI/2}&lt;/params&gt; &lt;/command_interface&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;joint_2&quot;&gt; &lt;command_interface name=&quot;position&quot;&gt; &lt;params name=&quot;min&quot;&gt;-<span class="math-container">${PI/2}&lt;/params&gt; &lt;params name="mav"&gt;$</span>{PI/2}&lt;/params&gt; &lt;/command_interface&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;joint_3&quot;&gt; &lt;command_interface name=&quot;position&quot;&gt; &lt;params name=&quot;min&quot;&gt;-<span class="math-container">${PI/2}&lt;/params&gt; &lt;params name="mav"&gt;$</span>{PI/2}&lt;/params&gt; &lt;/command_interface&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;joint_4&quot;&gt; &lt;command_interface name=&quot;position&quot;&gt; &lt;params name=&quot;min&quot;&gt;-${PI/2}&lt;/params&gt; &lt;params name=&quot;mav&quot;&gt;0.0&lt;/params&gt; &lt;/command_interface&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;joint_5&quot;&gt; &lt;param name=&quot;mimic&quot;&gt;joint_4&lt;/param&gt; &lt;param name=&quot;multiplier&quot;&gt;-1&lt;/param&gt; &lt;command_interface name=&quot;position&quot;&gt; &lt;params name=&quot;min&quot;&gt;0.0&lt;/params&gt; &lt;params name=&quot;mav&quot;&gt;${PI/2}&lt;/params&gt; &lt;/command_interface&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;/joint&gt; &lt;/ros2_control&gt; &lt;/robot&gt; </code></pre> <p><em><strong>Gazebo URDF file:</strong></em></p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;robot xmlns:xacro=&quot;http://www.ros.org/wiki/xacro&quot;&gt; &lt;gazebo&gt; &lt;plugin filename=&quot;libgazebo_ros2_control.so&quot; name=&quot;gazebo_ros2_control&quot;&gt; &lt;robot_param&gt;robot_description&lt;/robot_param&gt; &lt;robot_param_node&gt;robot_state_publisher&lt;/robot_param_node&gt; &lt;parameters&gt;$(find arm_robot_control)/config/arm_robot_controllers.yaml&lt;/parameters&gt; &lt;/plugin&gt; &lt;/gazebo&gt; &lt;/robot&gt; </code></pre> <p>Can someone please help me fix the problem fail to the load controller?</p>
how to fix failed loading controller in controller manager
<p>The <code>angular.z</code> field is the body-fixed frame angular velocity, not the steering angle / velocity wrt how Nav2 treats the <code>Twist</code> message. That is no different or unique from any other type of robot platform. It sounds like you need to shim the <code>cmd_vel</code> topic to the input of your hardware controller to convert body-fixed frame (e.g. base_link) to your steering angle knowing your robot's kinematics.</p> <p>That's more or less what any and all robots have to do in this case. Its just that differential / omnidirectional kinematics are more trivial. You need to convert the base_link motion into something your motors / motor controllers can understand (e.g. spin at this velocity with this angle).</p>
103741
2023-08-28T02:18:59.640
|navigation|ros-humble|nav2|
<p>So far, I have been always dealing with Ackermann-based robots and I have had good success using the Nav2 stack (thank you to all the contributors to this awesome stack).</p> <p>I have always been using the Twist command to drive the robot and my hardware controller interprets <code>twist.angular.z</code> as a steering angle. This is conceptually wrong since, I think, the right way to use a Twist command for an Ackermann based robot would be to derive a steering angle from the angular.z instead of just using it as a steering angle directly.<br /> The problem with this approach is that, especially for non-zero turn radius robots, commands with <code>twist.angular.z != 0</code> &amp; <code>twist.linear.x = 0</code> are not achievable.</p> <p>What is the right way to control Ackermann-based robots within the Nav2 stack, using the currently available controllers?</p>
Nav2, controllers, and Twist commands for ackermann robots
<p>There isn't really a word for this: you're looking to attach some kind of actuator to a door, and there are many ways to go about that. Here's a few that might help in your searching:</p> <ul> <li>Linear Actuator: this allows you to apply motion (actuate) in a line (linear). This could be mounted to some door mechanism in place of a piston.</li> <li>Servo motor: with a lever arm this could be mounted to the door to provide an opening mechanism.</li> <li>Stepper motor: as above.</li> </ul>
103747
2023-08-28T07:13:04.443
|robotic-arm|
<p>I would like to make a wildlife feeder that would be something like this:</p> <p><a href="https://www.pinterest.com/pin/68746358372/" rel="nofollow noreferrer">https://www.pinterest.com/pin/68746358372/</a></p> <p>but I would want to have an arm / lever of some kind that would be able to open the top. I searched alibaba for &quot;door arm&quot; and some other terms but get a lot of junk like full size door openers that are not what I'm looking for. I don't know the right term for the arm apparatus that would be ideal for this.</p> <p>Another design might be a 55 gallon lengthwise horizontal with arms to open 1/4 size doors. What is the technical or common term for what I'm after?</p> <p>This is sort of what I'd like to accomplish, but it looks like a piston of some kind:</p> <p><a href="https://tectonic-usa.com/" rel="nofollow noreferrer">https://tectonic-usa.com/</a></p>
What is the right tem for automated arm for door open / close
<p>This pb is not ros2 related.<br /> cf explanations here : <a href="https://realpython.com/python-lambda/#evaluation-time" rel="nofollow noreferrer">https://realpython.com/python-lambda/#evaluation-time</a></p> <p>They propose this nice solution :</p> <pre><code>lambda msg, v=my_value: self.callback(msg, v) </code></pre>
103765
2023-08-28T15:27:47.810
|ros2|python|callback|ros-humble|
<p>I use a lambda function to add a parameter to my callback function, but this new parameter does not have the value expected. Here a code to reproduce my pb:</p> <pre class="lang-py prettyprint-override"><code> class MyNode(Node): def __init__(self, ): super().__init__(__class__.__name__, namespace='lambda_pb') for my_value in range(5): self.create_subscription( String, f&quot;/ns_{my_value}/lambda_pb&quot;, lambda msg: self.callback(msg, my_value), 10 ) def callback(self, msg, value): self.get_logger().info(f&quot;value is {value} for {msg.data}&quot;) </code></pre> <p>Then I publish manually on the topics.</p> <p>This code simply subscribe to several topics, with a callback that should take a parameter. And on each publication, I expect &quot;my_value&quot; to change on each for topic. Here is the output :</p> <pre><code>ros2 topic pub --once /ns_0/lambda_pb std_msgs/msg/String 'data: whatever' calling through main [INFO] [1693326294.275137937] [lambda_pb.MyNode]: value is 4 for whatever </code></pre> <p>Value is '4' where I expect it to be '0'.</p> <p>is this a python or a ROS2 behaviour ?<br /> Does anyone have an idea on how to achieve my goal ? =&gt; Found one.</p> <p>==========</p> <p>I found a way to fix this. I replaced the lambda call with <code>partial(self.callback, value=my_value)</code>.<br /> <code>partial</code> is from functools module.</p>
If i use a lambda function when creating a subscription, when it will be evaluated?
<blockquote> <p>Is it possible to add a header with a timestamp to a <code>numpy_msg</code></p> </blockquote> <p>In short, yes, I think you just need to call <code>numpy_msg()</code> on a stamped message.</p> <p><code>numpy_msg()</code> isn't a message type, it's a conversion function that creates and returns a new type based on an existing ROS message type, see <a href="https://github.com/ros/ros_comm/blob/noetic-devel/clients/rospy/src/rospy/numpy_msg.py#L83" rel="nofollow noreferrer">here</a>.</p> <p>I have not used this myself, but it looks to me like it should work with any ROS message type that implements <code>serialize_numpy</code> and <code>deserialize_numpy</code> methods (see <a href="https://github.com/ros/ros_comm/blob/noetic-devel/clients/rospy/src/rospy/numpy_msg.py#L87" rel="nofollow noreferrer">here</a>). Furthermore, it appears that these two methods are auto-generated by the message generation system, and so I think you can call <code>numpy_msg()</code> on any ROS message, built-in or custom, including messages that include headers.</p> <p>There's some more information here:</p> <p><a href="https://ros-users.narkive.com/2VzlEDxg/fast-methods-to-go-between-ros-pointcloud-and-numpy" rel="nofollow noreferrer">https://ros-users.narkive.com/2VzlEDxg/fast-methods-to-go-between-ros-pointcloud-and-numpy</a></p> <p>As far as I can tell you should be able to simply replace your <code>rospy_tutorials/Floats</code> message with a suitable existing message or your own <a href="http://wiki.ros.org/ROS/Tutorials/CreatingMsgAndSrv#Using_msg" rel="nofollow noreferrer">custom message</a> that includes a header and a floating point array type.</p> <p>The use of generic numeric arrays to pass data is discouraged, as discussed here: <a href="https://robotics.stackexchange.com/questions/31038/stamped-std-msgs">Stamped std_msgs</a>, so as far as I know there's no built-in stamped generic floating-point array. You could define one, but it'd be better to define a message where the array has a meaningful name.</p> <p>Curiously, the Numpy serialization and deserialization code for many built-in messages doesn't actually use Numpy, I think because a philosophy of meaningful, well-named fields tends to favor single floating-point numbers with individual names.</p> <p>I found <a href="https://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/LaserScan.html" rel="nofollow noreferrer"><code>sensor_msgs/LaserScan</code></a> as one example of a stamped message that does contain array fields. Corresponding (old) autogenerated Python code for that message is <a href="http://docs.ros.org/en/diamondback/api/sensor_msgs/html/__LaserScan_8py_source.html#l00213" rel="nofollow noreferrer">here</a>. This code uses <code>ndarray.tostring()</code> and <code>numpy.frombuffer()</code> for serialization and deserialization of the <code>ranges</code> and <code>intensities</code> fields.</p> <p>A similar simpler message with a <code>Header</code> and a <code>float32[]</code> or <code>float64[]</code> array should work with <code>numpy_msg()</code> and give you the timestamp you need.</p> <blockquote> <p>listener that uses an <code>ApproximateTimeSynchronizer</code>. However, I receive an error when I try to instantiate the listener</p> </blockquote> <p>Depending on what you're trying to accomplish, maybe you don't need accurate timestamps from the publisher. Then I think you could also try:</p> <pre class="lang-py prettyprint-override"><code>ats = ApproximateTimeSynchronizer( [l_lines_sub, r_lines_sub], queue_size=5, slop=0.015, allow_headerless=True) </code></pre> <p>From <a href="http://wiki.ros.org/message_filters#ApproximateTime_Policy" rel="nofollow noreferrer">the <code>message_filters</code> wiki</a>:</p> <blockquote> <p>If some messages are of a type that doesn't contain the header field, <code>ApproximateTimeSynchronizer</code> refuses by default adding such messages. However, its Python version can be constructed with <code>allow_headerless=True</code>, which uses current ROS time in place of any missing <code>header.stamp</code> field</p> </blockquote>
103774
2023-08-28T23:32:26.120
|ros|rospy|message|message-filters|
<p>I am using the rospy with numpy <a href="http://wiki.ros.org/rospy_tutorials/Tutorials/numpy" rel="nofollow noreferrer">tutorial</a> to create a publisher and subscriber that send numpy arrays to listener that uses an <a href="http://wiki.ros.org/message_filters" rel="nofollow noreferrer">ApproximateTimeSynchronizer</a>. However, I receive an error when I try to instantiate the listener:</p> <pre><code>[WARN] [1693265081.824595]: Cannot use message filters with non-stamped messages. Use the 'allow_headerless' constructor option to auto-assign ROS time to headerless messages. </code></pre> <p>So my understanding is that my message must contain a header with a time stamp. Is it possible to add a header with a timestamp to a <code>numpy_msg</code>? And if so, how do I this?</p> <p>My message publisher construction:</p> <pre><code>from rospy_tutorials.msg import Floats from rospy.numpy_msg import numpy_msg l_lines_pub = rospy.Publisher('/l_lines_output', numpy_msg(Floats), queue_size=10) r_lines_pub = rospy.Publisher('/r_lines_output', numpy_msg(Floats), queue_size=10) l_lines_msg = np.asarray(ARRAY1) r_lines_msg = np.asarray(ARRAY2) l_lines_pub.publish(l_lines_msg) r_lines_pub.publish(r_lines_msg) </code></pre> <p>And my subscriber looks like:</p> <pre><code>l_lines_sub = Subscriber('/l_lines_output', numpy_msg(Floats)) r_lines_sub = Subscriber('/r_lines_output', numpy_msg(Floats)) ats = ApproximateTimeSynchronizer([l_lines_sub, r_lines_sub], queue_size=5, slop=0.015) ats.registerCallback(gotData) </code></pre> <p>Thanks!</p>
How to add a header with timestamp to numpy_msg?
<p>The Answer is, Spin is getting input from blackboard at the time of initialization only, to make Spin to get input on Running we need to update the on_tick function of Spin Action.</p> <pre><code> void SpinAction::on_tick() { double dist; getInput(&quot;spin_dist&quot;, dist); RCLCPP_WARN(node_-&gt;get_logger(), &quot;Angle from spin action %.2f&quot;, dist); double time_allowance; getInput(&quot;time_allowance&quot;, time_allowance); goal_.target_yaw = dist; goal_.time_allowance = rclcpp::Duration::from_seconds(time_allowance); getInput(&quot;is_recovery&quot;, is_recovery_); if (is_recovery_) { increment_recovery_count(); } } </code></pre>
103782
2023-08-29T09:37:27.010
|ros2|spin|nav2|
<p>In ros2 behavior server Spin Action is not accepting spin_dist as a blackboard variable, the variable will be an Output port of another behavior tree node. Check the code below,</p> <pre><code>&lt;MyNode input=&quot;something&quot; output=&quot;<span class="math-container">${angle_to_rotate}"/&gt; &lt;Spin spin_dist="$</span>{angle_to_rotate}&quot; server_name=&quot;spin&quot; /&gt; </code></pre> <p>Here Spin Node is getting initialized with 0 as spin_dist at once, not taking input from blackboard variable while ticking the Node at Run Time.</p>
Spin not taking blackboard value instead it always taking 0
<p>Just in case somebody has the same problem. It turned out that the problem was the fact that 2 seperate topics were publishing on /odom topic. Namely, rtabmap (the one we want) and diff_drive_controller. Just disabling /tf publishing for it solved the issue.</p>
103783
2023-08-29T09:40:37.323
|rviz|rtabmap|rtabmap-ros|ros-humble|rtabmap-odometry|
<p>I'm using the LEO rover gazebo simulator, to simulate the robot on Marsian terain. I'm running rtabmap, to map the world around the rover. The problem I'm running into, is that rtabmap sometimes finds loop closures in wrong locations, which than means, that the map is, on some points wrong, as in, multiple layers and levels,.. <a href="https://i.stack.imgur.com/idUuA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/idUuA.png" alt="Uneven and wrong multiple layer terain" /></a></p> <p>I can also see on the rtabmap graph view, that the robot, on some points, jump to wrong locations for a brief moment.</p> <p><a href="https://i.stack.imgur.com/qmtuk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qmtuk.png" alt="Jumping on graph" /></a></p> <p>Are there any parameters, that you think could help with this problem, or which parameters should I start with tuning? Maybe, &quot;max distance between points&quot;, so that there are no sudden jumps? I was looking at the output of &quot;rtabmap --params&quot;, and I couldn't find any that would help.</p> <p>So far, I have tried: without much success. The output seemed similar to before.</p> <pre><code>&quot;Odom/FilteringStrategy&quot;: &quot;1&quot;, (0=No filtering 1=Kalman filtering 2=Particle filtering.) &quot;Odom/GuessSmoothingDelay&quot;: &quot;2&quot;, &quot;Optimizer/Robust&quot;: &quot;true&quot;, &quot;RGBD/MaxLoopClosureDistance&quot;: &quot;1.0&quot;, </code></pre> <p>Another problem, that is maybe connected to this: In Rviz2, the robot is mapping the world, however, sometimes it goes under the map, As in, the map is generated, and when I drive it over there, it goes under it (it is generated too high). This happens mostly when the robot drives down (in a crater).</p> <p>Thanks for your help!</p>
Rtabmap has a few jumps in odometry
<p>Welcome to Robotics Stack Exchange!</p> <p>It is a warning coming from the colcon-core module of ROS 2. Please ignore it as it does not affect any functionality of ROS. Feel free to read more at <a href="https://github.com/colcon/colcon-core/issues/552" rel="nofollow noreferrer">https://github.com/colcon/colcon-core/issues/552</a></p>
103798
2023-08-30T08:17:07.027
|ros2|nvidia|jetson|ros-foxy|
<p>I am working on a project where a remote in a Jetson Nano on an RC-Car from my Laptop to run ROS2 Nodes. So far everything is working fine despite of this warning, but i'm wondering if it can lead to problems later on.</p> <p>Below is the demo talker node:</p> <pre><code>anassq@anassq-ThinkPad:-<span class="math-container">$ ros2 run demo_nodes_cpp talker [INFO] [1693382772.600519335] [talker]: Publishing: 'Hello World: 1' [INFO] [1693382773.600493124] [talker]: Publishing: 'Hello World: 2' [INFO] [1693382774.600495367] [talker]: Publishing: 'Hello World: 3' ^C[INFO] [1693382775.563863256] [rcicpp]: signal_handler(signal_value=2) anassq@anassq-ThinkPad:-$</span> </code></pre> <p>Below is the demo listener node:</p> <pre><code>jetson@nano:—<span class="math-container">$ ros2 run demo_nodes_cpp listener /opt/ros/foxy/bin/ros2:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html from pkg_resources import load_entry_point [INFO] [1693382772.604064646] [listener]: I heard: [Hello World: 1] [INFO] [1693382773.596332466] [listener]: I heard: [Hello World: 2] [INFO] [1693382774.595766385] [listener]: I heard: [Hello World: 3] ^C[INFO] [1693382891.440914460] [rcicpp]: signal_handler(signal_value=2) jetson@nano:—$</span> </code></pre> <p><strong>Please Note:</strong> The Ubuntu image i flashed on the jetson-nano comes with already installer python and many other packages. Here is the source of that image: <a href="https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image" rel="nofollow noreferrer">https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image</a></p> <p>I tried updating the system and the rosdep, but it didn't work. Does anyone have a suggestion to how this could be solved ?</p> <p>Thanks a lot for the read</p>
DeprecationWarning in ROS 2 Foxy