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>Afaik, &quot;nothing has changed&quot; wrt the best / accepted practices in <code>ros2_control</code> vs <code>ros_control</code>. See #q375296 for a previous Q&amp;A which discussed a similar topic (related: <a href="https://github.com/ros-controls/ros2_control/issues/740" rel="nofollow noreferrer">ros-controls/ros2_control#740</a>, although that issue asks whether using pub-sub for interaction with the actual hw would be acceptable/ok -- it links to the ROS Answers Q&amp;A though).</p> <p>Summarising: the cleanest way to publish the kinds of information you mention would be from <code>ros2_control</code> <em>broadcasters</em> (used to be called <em>controllers</em>, but they only published information, so the name was (finally) changed).</p> <p>You could take a look at <a href="https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver" rel="nofollow noreferrer">UniversalRobots/Universal_Robots_ROS2_Driver</a> which follows that recommendation for things like GPIO and some other status information.</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-04-05</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/144264/rick95/" rel="nofollow noreferrer">rick95</a> on 2023-04-05</strong>:<br /> Thanks for your answer! So, if I understand it right, I need to add additional state interfaces (<code>hardware_interface::StateInterface</code>) for the additional state information. Then the <code>joint_state_broadcaster</code> publishes the additional state information on a topic.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-04-05</strong>:<br /> Almost.</p> <p>You'd add your own custom hardware interfaces, for which you then would need to implement your own custom broadcasters.</p> <p>The default <code>joint_state_broadcaster</code> would only &quot;know&quot; how to publish <code>JointState</code> messages. It can't do anything with your custom state information.</p> <blockquote> <p>I used a publisher to publish additional information like the current controller temperature, limit switches status etc.</p> </blockquote> <p>for limit switches specifically, you might be able to reuse the GPIO infrastructure in <code>ros2_control</code>. That is, if you don't necessarily need any higher level semantics for that (ie: instead of &quot;pin 3 is high&quot;, you'd want &quot;limit switch of motor/joint 'elbow' is high&quot;).</p>
103161
2023-04-04T03:44:39.000
|ros|ros2|hardware-interface|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I am transferring my robot hardware interface to ROS2. In my ROS1 hardware interface, I used a publisher to publish additional information like the current controller temperature, limit switches status etc. However, in ROS2, I could not find a way to access the node from the hardware interface plugin, so creating a publisher is not possible anymore.</p> <p>Is it possible to get access to the node in a hardware interface plugin? Or, if not, what is the preferred way to communicating additional hardware state information in ROS2?</p> <p>Thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/414029/access-ros-node-in-hardware_interface/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/144264/rick95/" rel="nofollow noreferrer">rick95</a> on ROS Answers with karma: 3 on 2023-04-04</p> <p>Post score: 0</p>
Access ROS node in hardware_interface
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>For some reason, if I don't remove the node which launches the <strong>guide of joint_state_publisher.</strong> This node will interfere in the transformation of Odom to base_link and raise the error above. Then just comment out this block of code, which allowed me to get the transform properly.</p> <p>My launch file below:</p> <pre><code>import launch from launch.substitutions import Command, LaunchConfiguration import launch_ros import os def generate_launch_description(): pkg_share = launch_ros.substitutions.FindPackageShare(package='sam_bot_description').find('sam_bot_description') default_model_path = os.path.join(pkg_share, 'src/description/aroc_truck_description.urdf') default_rviz_config_path = os.path.join(pkg_share, 'rviz/urdf_config.rviz') world_path=os.path.join(pkg_share, 'world/my_world.sdf') robot_state_publisher_node = launch_ros.actions.Node( package='robot_state_publisher', executable='robot_state_publisher', parameters=[{'robot_description': Command(['xacro ', LaunchConfiguration('model')])}] ) joint_state_publisher_node = launch_ros.actions.Node( package='joint_state_publisher', executable='joint_state_publisher', name='joint_state_publisher', condition=launch.conditions.UnlessCondition(LaunchConfiguration('gui')) ) # joint_state_publisher_gui_node = launch_ros.actions.Node( # package='joint_state_publisher_gui', # executable='joint_state_publisher_gui', # name='joint_state_publisher_gui', # condition=launch.conditions.IfCondition(LaunchConfiguration('gui')) # ) rviz_node = launch_ros.actions.Node( package='rviz2', executable='rviz2', name='rviz2', output='screen', arguments=['-d', LaunchConfiguration('rvizconfig')], ) spawn_entity = launch_ros.actions.Node( package='gazebo_ros', executable='spawn_entity.py', arguments=['-entity', 'sam_bot', '-topic', 'robot_description'], output='screen' ) robot_localization_node = launch_ros.actions.Node( package='robot_localization', executable='ekf_node', name='ekf_filter_node', output='screen', parameters=[os.path.join(pkg_share, 'config/ekf.yaml'), {'use_sim_time': LaunchConfiguration('use_sim_time')}] ) return launch.LaunchDescription([ launch.actions.DeclareLaunchArgument(name='gui', default_value='True', description='Flag to enable joint_state_publisher_gui'), launch.actions.DeclareLaunchArgument(name='model', default_value=default_model_path, description='Absolute path to robot urdf file'), launch.actions.DeclareLaunchArgument(name='rvizconfig', default_value=default_rviz_config_path, description='Absolute path to rviz config file'), launch.actions.DeclareLaunchArgument(name='use_sim_time', default_value='True', description='Flag to enable use_sim_time'), launch.actions.ExecuteProcess(cmd=['gazebo', '--verbose', '-s', 'libgazebo_ros_init.so', '-s', 'libgazebo_ros_factory.so'], output='screen'), joint_state_publisher_node, #joint_state_publisher_gui_node, robot_state_publisher_node, spawn_entity, robot_localization_node, rviz_node ]) </code></pre> <p>After this got the expected result:</p> <p>$ ros2 run tf2_ros tf2_echo odom base_link</p> <p>**</p> <pre><code>[INFO] [1681154384.590858888] [tf2_echo]: Waiting for transform odom -&gt; base_link: Invalid frame ID &quot;odom&quot; passed to canTransform argument target_frame - frame does not exist At time 2.1000000 - Translation: [-0.000, -0.022, 0.900] - Rotation: in Quaternion [0.000, 0.000, 0.001, 1.000] At time 3.1000000 - Translation: [-0.001, -0.023, 0.900] - Rotation: in Quaternion [0.000, 0.000, 0.001, 1.000] At time 4.1000000 - Translation: [-0.001, -0.023, 0.900] - Rotation: in Quaternion [0.000, 0.000, 0.001, 1.000] ^C[INFO] [1681154388.348508517] [rclcpp]: signal_handler(signal_value=2) </code></pre> <p>**</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-04-10</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103163
2023-04-04T15:47:01.000
|ros|transform|tf2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi I am doing this nav2 tutorial <a href="https://navigation.ros.org/setup_guides/odom/setup_odom.html#odometry-introduction" rel="nofollow noreferrer">https://navigation.ros.org/setup_guides/odom/setup_odom.html#odometry-introduction</a> However instead of a differential drive robot, I am using a car-like robot (Ackermann kinematics). It also published odometry message as well as imu. These are my topics being published:</p> <pre><code> /accel/filtered /clock /demo/cmd_vel /demo/distance /demo/imu /demo/odom /diagnostics /joint_states /odometry/filtered /parameter_events /performance_metrics /robot_description /rosout /set_pose /tf /tf_static </code></pre> <p>My issue is that when I run the command:</p> <pre><code>ros2 run tf2_ros tf2_echo odom base_link </code></pre> <p>I do not receive the transform data as I should (as below):</p> <pre><code>At time 8.842000000 - Translation: [0.003, -0.000, 0.127] - Rotation: in Quaternion [-0.000, 0.092, 0.003, 0.996] At time 9.842000000 - Translation: [0.002, -0.000, 0.127] - Rotation: in Quaternion [-0.000, 0.092, 0.003, 0.996 </code></pre> <p>Instead, I get this error message when launching <strong>just rviz</strong>:</p> <pre><code> [INFO] [1680639826.322243365] [tf2_echo]: Waiting for transform odom -&gt; base_link: Invalid frame ID &quot;odom&quot; passed to canTransform argument target_frame - frame does not exist [INFO] [1680639826.322243365] [tf2_echo]: Waiting for transform odom -&gt; base_link: Invalid frame ID &quot;odom&quot; passed to canTransform argument target_frame - frame does not exist </code></pre> <p>If i include to launch Gazebo on my launch file I get this error message:</p> <pre><code>[INFO] [1680639826.322243365] [tf2_echo]: Waiting for transform odom -&gt; base_link: Invalid frame ID &quot;odom&quot; passed to canTransform argument target_frame - frame does not exist Warning: TF_OLD_DATA ignoring data from the past for frame front_right_wheel_link at time 30.685000 according to authority Authority undetectable Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained at line 355 in /tmp/binarydeb/ros-galactic-tf2-0.17.5/src/buffer_core.cpp Warning: TF_OLD_DATA ignoring data from the past for frame front_left_wheel_link at time 30.685000 according to authority Authority undetectable Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained at line 355 in /tmp/binarydeb/ros-galactic-tf2-0.17.5/src/buffer_core.cpp Warning: TF_OLD_DATA ignoring data from the past for frame rear_second_right_wheel_link at time 30.685000 according to authority Authority undetectable Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained at line 355 in /tmp/binarydeb/ros-galactic-tf2-0.17.5/src/buffer_core.cpp Warning: TF_OLD_DATA ignoring data from the past for frame rear_second_left_wheel_link at time 30.685000 according to authority Authority undetectable Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained at line 355 in /tmp/binarydeb/ros-galactic-tf2-0.17.5/src/buffer_core.cpp Warning: TF_OLD_DATA ignoring data from the past for frame front_right_axle_link at time 30.685000 according to authority Authority undetectable </code></pre> <p>Does it seem that my TF2 publisher is delayed? I don't understand why because I am using a very powerful computer (NUC). Some expert suggestions?</p> <p>My robot xacro file: <a href="https://pastebin.com/mPwLQhCi" rel="nofollow noreferrer">urdf</a> My launch file: <a href="https://pastebin.com/nxL9GVLa" rel="nofollow noreferrer">dispaly.launch.py</a> localization configuration file: <a href="https://pastebin.com/bitztap6" rel="nofollow noreferrer">ekf.yaml</a></p> <hr /> <p><a href="https://answers.ros.org/question/414049/localization-issue:-waiting-for-transform-odom--%3E-base_link/" 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-04-04</p> <p>Post score: 0</p>
Localization issue: Waiting for Transform odom -> base_link
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Do you call <code>self.send_request</code> at some point? I can't see that you do. I also believe you should <code>rclpy.spin</code> rather than <code>rclpy.spin_once</code> in <code>main</code>.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/79869/per-edwardsson/" rel="nofollow noreferrer">Per Edwardsson</a> with karma: 501 on 2023-04-05</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/123880/alna_perera/" rel="nofollow noreferrer">ALNA_Perera</a> on 2023-04-05</strong>:<br /> Turns out, I didn't have to call rclpy.spin(). You were right about me not calling self.send_request, calling it solved the problem. Thanks!</p>
103165
2023-04-05T01:23:20.000
|ros|ros2|service|rclpy|call-service|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I am trying to call an existing service (/reinitialise_global_localization from AMCL). I tried creating a client node, but the client gets to request and hangs. I am not sure what is wrong.</p> <p>The code is given below. It prints '1', then '2', and then, nothing. There are no errors.</p> <p>If possible, I would like to find a solution like <a href="https://answers.ros.org/question/201617/how-to-call-a-service-inside-a-node/" rel="nofollow noreferrer">https://answers.ros.org/question/201617/how-to-call-a-service-inside-a-node/</a> but I can't seem to translate that to ros2 either.</p> <p>Thanks</p> <pre><code> import rclpy from rclpy.node import Node from std_srvs.srv import Empty class MinimalClientAsync(Node): def __init__(self): print(&quot;1&quot;) super().__init__('minimal_client_async') self.cli = self.create_client(Empty, 'reinitialize_global_localization') while not self.cli.wait_for_service(timeout_sec=1.0): self.get_logger().info('service not available, waiting again...') print(&quot;2&quot;) self.req = Empty.Request() def send_request(self): print(&quot;3&quot;) self.future = self.cli.call_async(self.req) rclpy.spin_until_future_complete(self, self.future) return self.future.result() def main(args=None): rclpy.init(args=args) minimal_client = MinimalClientAsync() rclpy.spin_once(minimal_client) print (&quot;4&quot;) # Destroy the node explicitly # (optional - otherwise it will be done automatically # when the garbage collector destroys the node object) minimal_client.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <hr /> <p><a href="https://answers.ros.org/question/414057/service-call-from-python-hangs/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/123880/alna_perera/" rel="nofollow noreferrer">ALNA_Perera</a> on ROS Answers with karma: 33 on 2023-04-05</p> <p>Post score: 0</p>
Service call from python hangs
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The <code>depthimage_to_laserscan</code> node does not know your robot's height. The doc says it reads a single pixel row of the rectangular depth image (the middle row in the y-dimension.) But you can configure the node to read additional rows from the depth image.</p> <p><a href="http://wiki.ros.org/depthimage_to_laserscan#Parameters" rel="nofollow noreferrer">http://wiki.ros.org/depthimage_to_laserscan#Parameters</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-04-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/144606/furkan_/" rel="nofollow noreferrer">furkan_</a> on 2023-04-10</strong>:<br /> Thank you. I was able to solve the problem with the &quot;scan_height&quot; parameter. But the smallest points from the camera also appear as costmaps. Do you have any suggestions on this subject?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-04-11</strong>:<br /> Only the obvious: write a filter to remove points from the pointcloud. I have no suggestion for an existing filter to do this for you.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/144606/furkan_/" rel="nofollow noreferrer">furkan_</a> on 2023-04-11</strong>:<br /> Thank you.</p>
103167
2023-04-06T06:01:08.000
|ros|rviz|2dlaserscan|pointcloud|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, Using the depthimage_to_laserscan package, I can convert pointcloud data from the depth camera into laser data and display them in the rviz environment. In the same way, I can create a costmap. But pointcloud data doesn't show obstacles higher than the robot's own size as a costmap. Like lidar data, it only takes into account its own axes. And when that happens, my robot crashes into that object. Is there a way to set this in the package I'm using? I want it to take the minimum value from the Z axis and return it and reflect it as laser data. Or do I have to write code myself? Thank you.</p> <p>ROS: Noetic System: Ubuntu 20.04</p> <hr /> <p><a href="https://answers.ros.org/question/414098/mirroring-pointcloud-data-as-laserscan-data/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/144606/furkan_/" rel="nofollow noreferrer">furkan_</a> on ROS Answers with karma: 3 on 2023-04-06</p> <p>Post score: 0</p>
Mirroring PointCloud data as laserScan data
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Turns out the external control program stopped when doing other stuff in Polyscope. Fixed by leaving it be after pressing &quot;play&quot;. Thanks to danzimmerman!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/144791/pelle/" rel="nofollow noreferrer">Pelle</a> with karma: 21 on 2023-04-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103169
2023-04-07T11:46:46.000
|ros|ros2|moveit|ur5|ur-driver|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Please let me know if there is any additional information you may need.</p> <p>Hello! I am new here and was hoping to get some help getting started, I have spent two weeks trying to get up and running but am not getting anywhere. I am using ur_robot_driver and the installation of ros2 humble and the driver went great. Afterwards I pulled the docker image for the simulation from here ( <a href="https://hub.docker.com/r/universalrobots/ursim_e-series" rel="nofollow noreferrer">https://hub.docker.com/r/universalrobots/ursim_e-series</a> ) and promptly ran it and checked if URcap was there (and it was).</p> <p>I started the URsim with</p> <blockquote> <p>ros2 run ur_robot_driver start_ursim.sh -m ur5</p> </blockquote> <p>as their site suggests. It loaded polyscope and it all works fine. Ran the driver with</p> <blockquote> <p>ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5 robot_ip:=192.168.56.101</p> </blockquote> <p>and it mirrored in rviz! I tried moving it a little in polyscope and it is indeed publishing the joint state data. What happens next feels like a road block to me. The &quot;scaled_joint_trajectory_controller&quot; is there when running</p> <blockquote> <p>ros2 node list</p> </blockquote> <p>but it isn't active so I have to activate it manually (which is fine). I then end it with running the trajectory controller to test things out</p> <blockquote> <p>ros2 run rqt_joint_trajectory_controller rqt_joint_trajectory_controller</p> </blockquote> <p>But when touching the sliders nothing is reflected in the URsim robot. Of course if I skip the URsim part entirely and run the driver with fake hardware, the joint_trajectory_controller is active from the get go (not scaled) and touching the sliders make the arm move in rviz.</p> <p>It is really a struggle but I must assume it has to do with that the controller isnt starting by itself properly? After all, when running the driver it does say configured and activated but yet I gotta do it manually afterwards anyway. With moveit attached it can plan and send the trajectory to the scaled_joint_trajectory_controller but nothing happens. I am at my wits end and help is massivly appreciated. I just want it to move so I know the workspace is ready for real hardware.</p> <blockquote> <p>[spawner-10] [INFO] [1680884526.935139591] [spawner_scaled_joint_trajectory_controller]: Configured and activated scaled_joint_trajectory_controller</p> <p>ROS_VERSION=2 ROS_PYTHON_VERSION=3 ROS_DOMAIN_ID=0 ROS_LOCALHOST_ONLY=0 ROS_DISTRO=humble</p> </blockquote> <p>I was following this <a href="https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html#usage-with-official-ur-simulator" rel="nofollow noreferrer">https://docs.ros.org/en/ros2_packages/rolling/api/ur_robot_driver/usage.html#usage-with-official-ur-simulator</a></p> <p>many, many thanks even for tiny ideas</p> <hr /> <p><a href="https://answers.ros.org/question/414149/simulated-real-hardware-not-updating-position-ros2,-moveit,-rviz/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/144791/pelle/" rel="nofollow noreferrer">Pelle</a> on ROS Answers with karma: 21 on 2023-04-07</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/37963/danzimmerman/" rel="nofollow noreferrer">danzimmerman</a> on 2023-04-10</strong>:<br /> Did you make a Polyscope program that used the node from the external control URCap and then run that program?</p> <p>URSim will publish joint data from boot, but it won't respond to external control commands without a running program with the external control node. I don't remember if that's set up out of the box, I think I had to configure the URCap and write the simple program that just consists of the External Control node. Touching anything in Polyscope like the robot jog will also stop the program from running and require that you hit &quot;play&quot; again to resume external control.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/144791/pelle/" rel="nofollow noreferrer">Pelle</a> on 2023-04-11</strong>:<br /> You are a saint! I did all the external program things but I guess it must have exited itself when I was shifting around in Polyscope. It works now if I just leave it after pressing &quot;play&quot;. Thank you so much!</p>
Simulated real hardware not updating position ros2, moveit, rviz
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I got an answer from the <a href="https://github.com/ros2/ros2/issues/1407" rel="nofollow noreferrer">Url</a>. It should be written as</p> <blockquote> <p>tf_broadcaster_ = std::make_unique&lt;tf2_ros::TransformBroadcaster&gt;(node_topics_handle, tf2_ros::DynamicBroadcasterQoS(), rclcpp::PublisherOptions());</p> </blockquote> <p>Any additions or suggestions are very welcome. Thanks, anyway.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/98868/bluebird/" rel="nofollow noreferrer">BlueBird</a> with karma: 20 on 2023-04-14</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103171
2023-04-08T01:57:03.000
|ros|ros2|rclcpp|tf2|transform|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have posted an issue on <a href="https://github.com/ros2/rclcpp/issues/2161" rel="nofollow noreferrer">GitHub</a>; however, no one responds to it. So I start to wonder if it is my own mistake. It begins from one day when I transform a piece of ROS foxy code into the Humble environment.</p> <blockquote> <p>rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr node_topics_handle = this-&gt;get_node_topics_interface();</p> </blockquote> <blockquote> <p>std::unique_ptr*&lt;<em>tf2_ros::TransformBroadcaster</em>&gt;* tf_broadcaster_ = nullptr;</p> </blockquote> <blockquote> <p>tf_broadcaster_ = std::make_unique*&lt;<em>tf2_ros::TransformBroadcaster</em>&gt;*(node_topics_handle);</p> </blockquote> <p>It will give you an error. &quot;<em><strong>passed non-default qos overriding options without providing a parameters interface</strong>.</em>&quot;</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16809361624546039.png" alt="image description" /></p> <p>You may wonder why you want to write it like this. Why not use 'this' directly. It is because by using <em><strong>node_topics_handle</strong></em>, I can isolate different functions in different classes without passing the shared printer node everywhere.</p> <p>Please, tell me how to publish dynamic TF with <em><strong>node_topics_handle</strong></em>.</p> <p>Thanks.</p> <p>Operating System: Ubuntu 22.04.2 LTS Installation type: binaries Version or commit hash: ROS humble DDS implementation: Fast-RTPS Client library (if applicable): rclcpp</p> <hr /> <p><a href="https://answers.ros.org/question/414157/publish-dynamic-tf-with-this-%3Eget_node_topics_interface()-works-in-foxy-but-not-in-humble.-(passed-non-default-qos-overriding-options-without-providing-a-parameters-interface)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/98868/bluebird/" rel="nofollow noreferrer">BlueBird</a> on ROS Answers with karma: 20 on 2023-04-08</p> <p>Post score: 0</p>
Dynamic TF Publishing Discrepancy Between Foxy and Humble
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The cause is most likely that your <code>odom-&gt;base_link</code> transform is inaccurate (i.e. it is accumulating error.) So when rviz tries to determine the current robot pose by looking up <code>map-&gt;odom-&gt;base_link</code>, it gets the wrong answer. The cones appear to move in the costmap because their position is calculated relative to the incorrect robot pose.</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-04-12</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/144954/kaladaku/" rel="nofollow noreferrer">KalaDaku</a> on 2023-04-12</strong>:<br /> How do i correct it? Do i need to make changes to urdf? I am new to ROS.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-04-13</strong>:<br /> The first step is to understand how odometry is being calculated in your simulation. What are the inputs? Is a filter being used?</p> <p>This is not a trivial problem to solve. The solution depends heavily on what sensor data is available and how accurate that data is. You could begin with a web search for terms <code>odometry</code> and <code>odometry drift</code>.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/144954/kaladaku/" rel="nofollow noreferrer">KalaDaku</a> on 2023-04-13</strong>:<br /> Feels like I need to explore Transforms a bit deeper. Thanks for the assistance.</p>
103173
2023-04-08T22:39:01.000
|gazebo|rviz|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello. I am working on a differential drive robot. When the robot collide with an object, the <strong>robot stops in Gazebo but keeps moving in rviz.</strong> I am expecting the robot to stop as it <strong>does not have enough mass to make the cone(object) move.</strong> I tried laser scan in rviz to find out if there is really any map being recognized by rviz and yes it is showing red dots representing the cones(obstacle). When i run over them, the red dots shifts (keeps moving ) in the direction of motion of the bot. Any Solutions?</p> <hr /> <p><a href="https://answers.ros.org/question/414176/rviz--is-not-in-sync-with-gazebo./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/144954/kaladaku/" rel="nofollow noreferrer">KalaDaku</a> on ROS Answers with karma: 3 on 2023-04-08</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-04-10</strong>:<br /> You have not told us what you think should happen. It is not surprising to me that if the robot hits an object, the object moves. You can edit your existing description using the &quot;edit&quot; button near the end of the text.</p>
Rviz is not in sync with Gazebo
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Please correct me if I'm wrong, but my understanding is that you want to modify and rebuild a specific package that you presumably installed as a debian binary (<code>apt install ...</code> or similar) since it is on <code>/opt/ros/...</code>.</p> <p>The source code is not packaged with C++ debians, only the headers. So you would need to clone the package in question to a <a href="https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html#background" rel="nofollow noreferrer">workspace that you could then overlay</a> on top of your binary install.</p> <p>Bear in mind that this would require you to also rebuild any packages that depend on the package that you modified (e.g. I believe you would also need to rebuild the various <code>ros2_controllers</code> that depend on the <code>controller_interface</code></p> <p>Putting that into practice could look like:</p> <pre><code># create a source workspace mkdir -p ~/control_ws/src # go to your src folder and clone the repo/branch that you will be modifying cd ~/control_ws/src # optionally fork the repo first to track your independent changes and be able to make a pull request later on git clone https://github.com/ros-controls/ros2_control.git -b foxy git clone https://github.com/ros-controls/ros2_controllers.git -b foxy # git clone ... for any other packages that depend on controller_interfaces # make your changes to any of the files # build the workspace cd ~/control_ws colcon build --symlink-install # source the workspace - this step is crucial to make it so that you're system will actually use the modified packages rather than the original debs # you can optionally add this step to your ~/.bashrc to &quot;permanently&quot; overlay this over your binary installation source install/setup.bash # Optional but appreciated - if you think the community would benefit from your changes, make a Pull Request to propose your changes be added upstream </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/69938/shonigmann/" rel="nofollow noreferrer">shonigmann</a> with karma: 1567 on 2023-04-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/40088/emersonknapp/" rel="nofollow noreferrer">emersonknapp</a> on 2023-04-12</strong>:<br /> I'm not sure what exact change OP wants to make to the code, but: If you're adding new API or breaking the ABI then yes, you will need to rebuild everything downstream. But if you just change functionality inside the library then you should be able to rebuild the single package in the overlay workspace, and if the setup paths are working correctly then the new shared library will be loaded at runtime instead of the old installed one.</p> <p>Although, due to <a href="https://github.com/ros2/ros2/issues/1150" rel="nofollow noreferrer">https://github.com/ros2/ros2/issues/1150</a> it may not be trivial to overlay the Foxy core libraries properly, not sure.</p> <p>Note: one could always build the whole thing from source - it takes a little time but it's not so bad.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on 2023-04-26</strong>:<br /> @shonigmann, thank you. Yes, you understanded me correctly and thank for your detailed answer. Sorry, that I react on your help only now.</p> <p>@emersonknapp, thank you too for your comment. I'll keep that in mind.</p>
103175
2023-04-11T07:48:14.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi. Sorry for all mistakes, English is not my native language. Is there a way to recompile package inside a distro folder. I have a small problem with Foxy controller_interface, to be more specific, I need the CallbackReturn method inside it. I suppose that, it is better to change my code, that change original code of the ros packages, but still it I'd like to give it a try. Appreciate any help.</p> <hr /> <p><a href="https://answers.ros.org/question/414225/is-there-a-way-to-rebuild-packages-inside-/opt/ros/%3Cdistro%3E-folder?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/119522/edvard/" rel="nofollow noreferrer">Edvard</a> on ROS Answers with karma: 95 on 2023-04-11</p> <p>Post score: 0</p>
Is there a way to rebuild packages inside /opt/ros/<distro> folder?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It's possible you're seeing Nagle's algorithm at work.</p> <p>See #q360038 for a Q&amp;A which discusses the various transport hint options you could use to disable it.</p> <blockquote> <p>It seems like when a delayed TCP packet has not been sent yet, ROS just packs another message onto the packet in the delay queue.</p> </blockquote> <p>from what you describe: this is not ROS, but your TCP/IP network stack.</p> <p>ROS just asks the OS to take care of handling the network side of things. There's nothing special here.</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-04-12</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/144269/phikre/" rel="nofollow noreferrer">phikre</a> on 2023-04-12</strong>:<br /> Thanks a lot for the quick help, this was exactly the issue! I was spending quite some time to figure this out. In rospy, the solution is to set tcp_nodelay=True when creating the subscriber, which deactivates Nagle's algo.</p>
103177
2023-04-12T02:26:54.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi!</p> <p>I have a setup using Noetic where I want to emulate network delay with netimpair (which in itsself utilizes tc and netem) between two nodes.</p> <p>A talker publishes current time at a rate of 10 and a subscribing listener calculates the delay. Additionally, for debugging purposes, I print the time periode since the last reception (last message callback) to the console. Netimpair is acting to the publishing side of the setup, I checked the port using rosnode info.</p> <p>Everything works as expected until I set the delay to a value &gt; 1/rate (i.e. 100 ms). When I set the delay to, e.g., 110 ms, the following can be observed:</p> <ul> <li>The measured delay increases periodically in steps of 10 ms from message to message until it resets at 200 ms (110; 120; 130; ... 200; 110; ...).</li> <li>The delay between receptions of the 200 ms and 110 ms messages is close to zero, meaning that two messages are received at the same time.</li> <li>The delay between any other msg receptions is 110 ms (which is slower than the messages are actually sent, but on average with the zero-delay message, this corresponds to a rate of 10)</li> <li>No messages are lost if the queue is not set to 1</li> </ul> <p>I am suspecting that the behavior stems from the way rostcp is handling messages, but so far I lag deeper understanding and can't explain this unexpected behavior. It seems like when a delayed TCP packet has not been sent yet, ROS just packs another message onto the packet in the delay queue.</p> <p>Can somebody explain this or, even more appreciated, give a hint on how to achieve the expected delay independently of the rosrate? Thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/414248/adding-network-delay-larger-than-ros-rate-periode?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/144269/phikre/" rel="nofollow noreferrer">phikre</a> on ROS Answers with karma: 3 on 2023-04-12</p> <p>Post score: 0</p>
Adding network delay larger than ROS-rate periode?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This roscpp subscriber callback compiles just fine in noetic:</p> <pre><code>void VelocityCallback(const std_msgs::Float64::ConstPtr&amp; velocity_cmd_msg) { } </code></pre> <p>In c++, this code is not going to do what you want it to do:</p> <pre><code>velocity_msg = velocity_msg; velocity_type = velocity_type; </code></pre> <p>If the same compile error continues to happen after you fix the code, you should also try doing a clean build (if using catkin_make, delete the top-level <code>build</code> and <code>devel</code> directories in your catkin_ws.)</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-04-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/145231/duffrumkins/" rel="nofollow noreferrer">DuffRumkins</a> on 2023-04-16</strong>:<br /> This naming issue was indeed a problem that I completely looked over. Thanks!</p> <p>I managed to get my code to build by changing this, but I also had to remove the <code>&lt;std_msgs::Float64&gt;</code> from where I defined <code>velocitySubscriber</code> as a subscriber. I think the fact that I was defining the type as <code>Float64</code> there while using <code>Float64::ConstPtr</code> in the callback function was causing a mismatch error.</p> <p>Thanks again for your help!</p>
103179
2023-04-12T08:22:52.000
|c++|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have created a class that contains a ROS subscriber and the callback function. I have done this following the ROS <a href="http://wiki.ros.org/roscpp_tutorials/Tutorials/UsingClassMethodsAsCallbacks" rel="nofollow noreferrer">tutorial</a> and according to other answers that I have found (for example <a href="https://answers.ros.org/question/108551/using-subscribercallback-function-inside-of-a-class-c/" rel="nofollow noreferrer">here</a>).</p> <p>I have included a snippet of my code below:</p> <pre><code>class VelocityCommandSubscriber{ public: geometry_msgs::Twist velocity_msg; std::string velocity_type; VelocityCommandSubscriber(geometry_msgs::Twist velocity_msg, std::string velocity_type) { velocity_msg = velocity_msg; velocity_type = velocity_type; velocitySubscriber = nH.subscribe&lt;std_msgs::Float64&gt;(&quot;/command_velocity_&quot;+velocity_type,10, &amp;VelocityCommandSubscriber::VelocityCallback, this); } void VelocityCallback(std_msgs::Float64::ConstPtr&amp; velocity_cmd_msg) { //Callback code here } protected: ros::NodeHandle nH; ros::Subscriber velocitySubscriber; }; </code></pre> <p>However, whenever I run this code I get the following error</p> <pre><code>error: no matching function for call to ‘ros::NodeHandle::subscribe&lt;std_msgs::Float64&gt;(std::__cxx11::basic_string&lt;char&gt;, int, void (VelocityCommandSubscriber::*)(std_msgs::Float64_&lt;std::allocator&lt;void&gt; &gt;::ConstPtr&amp;), VelocityCommandSubscriber*)’ 81 | velocitySubscriber = nH.subscribe&lt;std_msgs::Float64&gt;(&quot;/command_velocity_&quot;+velocity_type,10, &amp;VelocityCommandSubscriber::VelocityCallback, this); | </code></pre> <p>Does anyone know what am I doing wrong? I am using ROS noetic and am relatively new to ROS and c++ so I may very well be reading over something simple.</p> <p>Thanks for your help!</p> <hr /> <p><a href="https://answers.ros.org/question/414261/subscriber-callback-inside-class-not-recognized-c++/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/145231/duffrumkins/" rel="nofollow noreferrer">DuffRumkins</a> on ROS Answers with karma: 3 on 2023-04-12</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2023-04-12</strong>:<br /> Your callback argument looks different from the example from the ROS Answers, can you try it with normal <code>const</code> instead of <code>ConstrPtr</code>? Or use the suggested <code>boost::bind</code>?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/145231/duffrumkins/" rel="nofollow noreferrer">DuffRumkins</a> on 2023-04-12</strong>:<br /> I tried it with <code>const</code> and I get the exact same error. I also tried boost::bind, but that just gave me another similar error. Is this maybe new in noetic since the other answers would have been for an older ROS version?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/145231/duffrumkins/" rel="nofollow noreferrer">DuffRumkins</a> on 2023-04-16</strong>:<br /> @ljaniec , I think you may have been correct. As I said in a reply to the answer I think defining the type in the subscriber template was causing mismatch errors. Thanks for your help!</p>
Subscriber callback inside class not recognized C++
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I haven't solved this entirely BUT I am closer now that I have discovered the costmap parameters file which I was unaware of prior to my post. You can find info <a href="https://navigation.ros.org/configuration/packages/configuring-costmaps.html" rel="nofollow noreferrer">here</a> and the code <a href="https://github.com/ros-planning/navigation2/blob/main/nav2_costmap_2d/launch/example_params.yaml" rel="nofollow noreferrer">here</a>.</p> <p>I had originally installed the nav2 stack using <code>apt</code> which made it inconvenient to access this file, so I <code>apt remove</code>d all of the packages and then reinstalled by cloning from the nav2 repository (guide <a href="https://navigation.ros.org/build_instructions/index.html#for-released-distributions:%7E:text=mkdir%20%2Dp%20%7E/nav2_ws/src%0Acd%20%7E/nav2_ws/src%0Agit%20clone%20https%3A//github.com/ros%2Dplanning/navigation2.git%20%2D%2Dbranch%20%3Cros2%2Ddistro%3E%2Ddevel%0Acd%20%7E/nav2_ws%0Arosdep%20install%20%2Dy%20%2Dr%20%2Dq%20%2D%2Dfrom%2Dpaths%20src%20%2D%2Dignore%2Dsrc%20%2D%2Drosdistro%20%3Cros2%2Ddistro%3E%0Acolcon%20build%20%2D%2Dsymlink%2Dinstall" rel="nofollow noreferrer">here</a>) to a dedicated nav2_ws and editing / building from there.</p> <p>By playing with the following values I am slowly but surely improving my robot's mobility through turns and doorways:</p> <ul> <li><code>footprint_padding</code></li> <li><code>inflation_radius</code></li> <li><code>cost_scaling_factor</code></li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/117662/coatwolf/" rel="nofollow noreferrer">coatwolf</a> with karma: 13 on 2023-04-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/110678/hunterlineage1/" rel="nofollow noreferrer">hunterlineage1</a> on 2023-04-16</strong>:<br /> This is right, I had to adjust <code>inflation_radius</code> and it worked.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/117662/coatwolf/" rel="nofollow noreferrer">coatwolf</a> on 2023-04-16</strong>:<br /> Thanks for the reply! Was it simply a matter of reducing the radius?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/110678/hunterlineage1/" rel="nofollow noreferrer">hunterlineage1</a> on 2023-04-16</strong>:<br /> Yes, but you might still have to tune the footprint_padding and cost_scaling_factor.</p>
103181
2023-04-12T09:36:46.000
|ros|ros2|differential-drive|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hey folks!</p> <p>I'm working on a differential drive SLAM <a href="https://github.com/avielbr/aspen-3" rel="nofollow noreferrer">robot</a> and I have things working pretty well. I'm able to:</p> <ul> <li>Create a map of my apartment using slam_toolbox</li> <li>Navigate from room to room using Nav2 and Goal Poses on RViz2</li> </ul> <p>First off a big thanks to Steve Macenski and all the folks who maintain these open source packages. I've really been enjoying using them so far.</p> <p>I'm having a problem where my robot is getting &quot;stuck&quot; in doorways that are plenty big for it to navigate through. It doesn't happen every time, and I'd say 50% of the time the robot just breezes through and passes to the next room with no problem. The other 50% though the robot will stop at the threshhold, start rotating to and fro in a confused manner, and sometimes it works itself out after 30sec or so, but most of the time it ends up getting totally stuck until I give it a little help with the joystick.</p> <p>I have noticed that this happens more often when moving to a room that is positioned a U-turn away from the current room. For instance, the robot can usually handle these paths with <strong>no problem</strong>:</p> <p><img src="https://i.imgur.com/xBxAK9e.png" alt="image description" /></p> <p><img src="https://i.imgur.com/DKnoTCV.png" alt="image description" /></p> <p>Whereas it almost <strong>ALWAYS</strong> gets stuck moving between these two rooms:</p> <p><img src="https://i.imgur.com/US3JnLg.png" alt="image description" /></p> <p>It doesn't like something about that turn radius, even though practically there is plenty of room to pass (sometimes it manages to).</p> <p><strong>What I have tried:</strong></p> <ul> <li>Confirming the URDF descriptions are accurate to the robot's physical dimensions</li> <li>Playing with the wheel separation multiplier in the <a href="https://github.com/avielbr/aspen-3/blob/587727bac2fb2b8e1bd46c0d1420a04be5056cc3/aspen_bringup/config/diffbot_controllers.yaml#L20" rel="nofollow noreferrer">controller configuration file</a></li> </ul> <p>But can't seem to shake this issue. Perhaps there is some setting in Nav2 related to the costmap that I can finetune to get this working? Thanks in advance for any suggestions!</p> <hr /> <p><a href="https://answers.ros.org/question/414264/helping-diff.-drive-robot-get-through-doorways/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/117662/coatwolf/" rel="nofollow noreferrer">coatwolf</a> on ROS Answers with karma: 13 on 2023-04-12</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-04-13</strong>:<br /> Have you installed the plugin in rviz to display the Local Costmap? If you have &quot;fake&quot; obstacles in the Local Costmap, the Local Planner may be unable to find an open path.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/117662/coatwolf/" rel="nofollow noreferrer">coatwolf</a> on 2023-04-16</strong>:<br /> Yes you can see in the images in my post that I have the costmap displayed in rviz2. Unless you meant something else. I have made some progress (see my response in a comment below).</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-04-16</strong>:<br /> The Global Costmap is different from the Local Costmap. It would benefit you to understand the difference.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/117662/coatwolf/" rel="nofollow noreferrer">coatwolf</a> on 2023-04-16</strong>:<br /> Apologies, I missed the &quot;Local&quot; keyword. Yes I have viewed the local costmap as well and there doesn't seem to be an issue of phantom obstacles. Thanks for the reply.</p>
Helping diff. drive robot get through doorways
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You need to Install the rpi_ws281x library on the Raspberry Pi.</p> <blockquote> <p>pip install rpi-ws281x==1.1.1</p> </blockquote> <p>And write a ROS 2 node in Python that imports the rpi_ws281x library and controls the WS2812B LED lights in response to ROS 2 messages.</p> <pre><code>import rclpy from std_msgs.msg import ColorRGBA from rpi_ws281x import Adafruit_NeoPixel, Color # Define the number of WS2812B LED lights and the pin they are connected to NUM_LEDS = 30 # Number of LED LED_PIN = 18 # 0- number will form a color # Initialize the WS2812B LED lights strip = Adafruit_NeoPixel(NUM_LEDS, LED_PIN) strip.begin() strip.show() # Callback function for the color message def color_callback(msg): # Set the color of all the WS2812B LED lights for i in range(NUM_LEDS): strip.setPixelColor(i, Color(int(msg.r * 255), int(msg.g * 255), int(msg.b * 255))) strip.show() def main(args=None): rclpy.init(args=args) node = rclpy.create_node('minimal_subscriber') subscription = node.create_subscription(ColorRGBA, 'color', color_callback, 10) subscription # prevent unused variable warning rclpy.spin(node) node.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p>I hope it helps, fell free to drop a comment in case of questions.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2023-04-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-04-13</strong>:<br /> <code>rospy</code> would be ROS 1, no?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-04-13</strong>:<br /> @gvdhoorn , thanks for pointing that out. I will correct this code asap.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75773/dragon_58/" rel="nofollow noreferrer">Dragon_58</a> on 2023-04-13</strong>:<br /> Thank you so much for the suggestion.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-04-14</strong>:<br /> Tick the answer if you think it is relevant or correct.</p> <p>Thanks,</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75773/dragon_58/" rel="nofollow noreferrer">Dragon_58</a> on 2023-04-18</strong>:<br /> Hello Whenever i use rpi_ws281x library with ros2 , then i'm not able to list out the node running on the system using 'ros2 node list' or even topic using 'ros2 topic list'. If you provide any input on this it would be great help. Thank you</p>
103183
2023-04-13T08:54:21.000
|python|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello everyone,</p> <p>I am trying to control a WS2812B LED strip with a Raspberry Pi using ROS 2. I have looked for ROS 2 packages and Python libraries that can be used for this purpose, but I haven't been able to find anything that works well.</p> <p>I came across the rpi_ws281x library, which seems to be a popular choice for controlling WS2812B LED strips with a Raspberry Pi. However, I am not sure how to integrate this library with a ROS 2 node.</p> <p>Can anyone provide some guidance on how to use the rpi_ws281x library with a ROS 2 node? Specifically, how to subscribe to a ROS 2 topic for color messages and set the colors of the LEDs on the strip.</p> <p>Thank you for your help.</p> <hr /> <p><a href="https://answers.ros.org/question/414293/how-to-use-ws2812b-led-lights-with-ros-2-node/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/75773/dragon_58/" rel="nofollow noreferrer">Dragon_58</a> on ROS Answers with karma: 3 on 2023-04-13</p> <p>Post score: 0</p>
How to use WS2812B LED lights with ROS 2 node
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You have to write your own code for this.</p> <p>As far as I know, neither the OMPL planners nor the urdf syntax support closed-chain kinematics. However, there are discussions on this site of some special-case tricks that rely on symmetry to succeed e.g.</p> <p><a href="https://answers.ros.org/question/240463/path-planning-using-moveit-with-a-closed-loop-chain/" rel="nofollow noreferrer">https://answers.ros.org/question/240463/path-planning-using-moveit-with-a-closed-loop-chain/</a></p> <p>Do a search with these keywords to find others: closed chain kinematics</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-04-15</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103185
2023-04-13T10:28:42.000
|ros|motion-planning|moveit|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I would like to perform a dual-arm robot pick-and-place task, using Moveit to plan trajectories for both arms. e.g. dual arm carrying a large box from a start configuration to target configuration, while avoiding possible collisions.</p> <p>I found a possible solution <a href="https://github.com/pablomalvido/Advanced_manipulation_moveit" rel="nofollow noreferrer">here</a>, where dual-arm robot could perform synchronized movements and keep the distance of their end effector poses constant. However, the code uses <code>compute_cartesian_path</code> to plan both arms, which means it probably cannot give a good solution when there are obstacles in the workspace.</p> <p>So, is there a existing function or plugin in Moveit for dual arm closed kinematic chain planning, while considering possible obstacles in the workspace? or do I have to write my own code to complete the task?</p> <hr /> <p><a href="https://answers.ros.org/question/414298/dual-arm-closed-kinematic-chain-planning-in-moveit/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/145281/kango/" rel="nofollow noreferrer">kango</a> on ROS Answers with karma: 3 on 2023-04-13</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-04-15</strong>:<br /> It is poorly documented, but <code>compute_cartesian_path()</code> does much less than you might think. All it does is linearly interpolate between eef waypoints that you provide to it. Determining good waypoints is the difficult task. If the function encounters an obstacle in its path, it simply aborts. This is discussed in #q411915.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/145281/kango/" rel="nofollow noreferrer">kango</a> on 2023-05-12</strong>:<br /> OMPL supports <a href="https://ompl.kavrakilab.org/constrainedPlanning.html" rel="nofollow noreferrer">constrained planning</a>, in which constraints are given in the form of a constraint function <span class="math-container">$f(q)=0$</span>. Projection (by Newton-Raphson method or some other ways) is used during sampling and local planning to ensure the planned path is within the constraint manifold. That is a common way to solve the closed chain planning problem. In Moveit, however, constraints are given in the form of <code>moveit_msgs/Constraints</code>, which does not support constraint function as far as I know. I'm still trying to learn how to use constraint function and projection method in Moveit...</p> <p><strong>Comment by <a href="https://answers.ros.org/users/145281/kango/" rel="nofollow noreferrer">kango</a> on 2023-05-12</strong>:<br /> <em>In addition</em>: There is a <a href="https://moveit.picknik.ai/main/doc/how_to_guides/using_ompl_constrained_planning/ompl_constrained_planning.html" rel="nofollow noreferrer">Moveit2 tutorial</a> on how to use OMPL’s Constrained planning capabilities. However it has nothing to do with constraint function, and still doesn't support closed chains.</p>
dual arm closed kinematic chain planning in Moveit
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I found out that older versions can be easily accessed through github commits. So I just simply installed an older version and solved the problem.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/145315/zenuri5482/" rel="nofollow noreferrer">zenuri5482</a> with karma: 16 on 2023-04-14</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103187
2023-04-14T07:06:35.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello. I have done a school project modifying and applying <a href="https://github.com/ethz-asl/rovio" rel="nofollow noreferrer">rovio</a> to run with our data a few years ago. Now I have left school and I am trying to reproduce the same experiment on my local machine.</p> <p>However, when I play our rosbag, i got this error</p> <pre><code>Client [/rovio] wants topic /novatel/oem7/bestpos to have datatype/md5sum [novatel_oem7_msgs/BESTPOS/cbda32531630d034a4a2332c885a856e], but our version has [novatel_oem7_msgs/BESTPOS/6d32934a60a2791025b60e069cbfca8d]. Dropping connection. </code></pre> <p>I did some research on similar issues. Apparently the md5sum version of /novatel/oem7/bestpos in my rosbag (outdated version) does not match the version I compiled rovio with.</p> <p>Is there a way to make the two versions match? I have left school so I don't have access to equipment to record a new rosbag to play with.</p> <p>Setup: Ubuntu 20.04, ROS Noetic</p> <hr /> <p><a href="https://answers.ros.org/question/414331/is-there-a-workaround-for-different-md5sum-versions-between-nodes?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/145315/zenuri5482/" rel="nofollow noreferrer">zenuri5482</a> on ROS Answers with karma: 16 on 2023-04-14</p> <p>Post score: 0</p>
Is there a workaround for different MD5sum versions between nodes?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Yes it is possible. The most important thing to remember is namespaces. <a href="https://answers.ros.org/question/41433/multiple-robots-simulation-and-navigation/" rel="nofollow noreferrer">Check out Multiple robots simulation and navigation</a>.</p> <p>Here is an example launch file with 3 turtlebot3 robots in gazebo. You will have to visualize your RViz topics.</p> <pre><code>&lt;launch&gt; &lt;!-- &lt;param name=&quot;/use_sim_time&quot; value=&quot;true&quot;/&gt; --&gt; &lt;arg name=&quot;model&quot; default=&quot;$(env TURTLEBOT3_MODEL)&quot; doc=&quot;model type [burger, waffle, waffle_pi]&quot;/&gt; &lt;arg name=&quot;first_tb3&quot; default=&quot;tb3_0&quot;/&gt; &lt;arg name=&quot;second_tb3&quot; default=&quot;tb3_1&quot;/&gt; &lt;arg name=&quot;third_tb3&quot; default=&quot;tb3_2&quot;/&gt; &lt;!-- 3 in the same room: --&gt; &lt;arg name=&quot;first_tb3_x_pos&quot; default=&quot;3.0&quot;/&gt; &lt;arg name=&quot;first_tb3_y_pos&quot; default=&quot;4.0&quot;/&gt; &lt;arg name=&quot;first_tb3_z_pos&quot; default=&quot; 0.0&quot;/&gt; &lt;arg name=&quot;first_tb3_yaw&quot; default=&quot; 0.0&quot;/&gt; &lt;arg name=&quot;second_tb3_x_pos&quot; default=&quot; 3.0&quot;/&gt; &lt;arg name=&quot;second_tb3_y_pos&quot; default=&quot;1.0&quot;/&gt; &lt;arg name=&quot;second_tb3_z_pos&quot; default=&quot; 0.0&quot;/&gt; &lt;arg name=&quot;second_tb3_yaw&quot; default=&quot; 0.0&quot;/&gt; &lt;arg name=&quot;third_tb3_x_pos&quot; default=&quot; 3.0&quot;/&gt; &lt;arg name=&quot;third_tb3_y_pos&quot; default=&quot; 3.0&quot;/&gt; &lt;arg name=&quot;third_tb3_z_pos&quot; default=&quot; 0.0&quot;/&gt; &lt;arg name=&quot;third_tb3_yaw&quot; default=&quot; 0.0&quot;/&gt; &lt;include file=&quot;<span class="math-container">$(find gazebo_ros)/launch/empty_world.launch"&gt; &lt;arg name="world_name" value="$</span>(find turtlebot3_gazebo)/worlds/turtlebot3_house.world&quot;/&gt; &lt;arg name=&quot;paused&quot; value=&quot;false&quot;/&gt; &lt;arg name=&quot;use_sim_time&quot; value=&quot;true&quot;/&gt; &lt;!-- &lt;arg name=&quot;gui&quot; value=&quot;false&quot;/&gt; --&gt; &lt;arg name=&quot;gui&quot; value=&quot;true&quot;/&gt; &lt;arg name=&quot;headless&quot; value=&quot;false&quot;/&gt; &lt;arg name=&quot;debug&quot; value=&quot;false&quot;/&gt; &lt;/include&gt; &lt;group ns = &quot;<span class="math-container">$(arg first_tb3)"&gt; &lt;param name="robot_description" command="$</span>(find xacro)/xacro <span class="math-container">$(find turtlebot3_description)/urdf/turtlebot3_$</span>(arg model).urdf.xacro&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;param name=&quot;publish_frequency&quot; type=&quot;double&quot; value=&quot;50.0&quot; /&gt; &lt;param name=&quot;tf_prefix&quot; value=&quot;$(arg first_tb3)&quot; /&gt; &lt;/node&gt; &lt;node name=&quot;spawn_urdf&quot; pkg=&quot;gazebo_ros&quot; type=&quot;spawn_model&quot; args=&quot;-urdf -model <span class="math-container">$(arg first_tb3) -x $</span>(arg first_tb3_x_pos) -y <span class="math-container">$(arg first_tb3_y_pos) -z $</span>(arg first_tb3_z_pos) -Y $(arg first_tb3_yaw) -param robot_description&quot; /&gt; &lt;/group&gt; &lt;group ns = &quot;<span class="math-container">$(arg second_tb3)"&gt; &lt;param name="robot_description" command="$</span>(find xacro)/xacro <span class="math-container">$(find turtlebot3_description)/urdf/turtlebot3_$</span>(arg model).urdf.xacro&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;param name=&quot;publish_frequency&quot; type=&quot;double&quot; value=&quot;50.0&quot; /&gt; &lt;param name=&quot;tf_prefix&quot; value=&quot;$(arg second_tb3)&quot; /&gt; &lt;/node&gt; &lt;node name=&quot;spawn_urdf&quot; pkg=&quot;gazebo_ros&quot; type=&quot;spawn_model&quot; args=&quot;-urdf -model <span class="math-container">$(arg second_tb3) -x $</span>(arg second_tb3_x_pos) -y <span class="math-container">$(arg second_tb3_y_pos) -z $</span>(arg second_tb3_z_pos) -Y $(arg second_tb3_yaw) -param robot_description&quot; /&gt; &lt;/group&gt; &lt;group ns = &quot;<span class="math-container">$(arg third_tb3)"&gt; &lt;param name="robot_description" command="$</span>(find xacro)/xacro <span class="math-container">$(find turtlebot3_description)/urdf/turtlebot3_$</span>(arg model).urdf.xacro&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;param name=&quot;publish_frequency&quot; type=&quot;double&quot; value=&quot;50.0&quot; /&gt; &lt;param name=&quot;tf_prefix&quot; value=&quot;$(arg third_tb3)&quot; /&gt; &lt;/node&gt; &lt;node name=&quot;spawn_urdf&quot; pkg=&quot;gazebo_ros&quot; type=&quot;spawn_model&quot; args=&quot;-urdf -model <span class="math-container">$(arg third_tb3) -x $</span>(arg third_tb3_x_pos) -y <span class="math-container">$(arg third_tb3_y_pos) -z $</span>(arg third_tb3_z_pos) -Y $(arg third_tb3_yaw) -param robot_description&quot; /&gt; &lt;/group&gt; &lt;/launch&gt; </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/110678/hunterlineage1/" rel="nofollow noreferrer">hunterlineage1</a> with karma: 24 on 2023-04-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103189
2023-04-15T04:06:29.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I tried to find a way to do this but every guide is about Gazebo, not Rviz. Any help will be appreciated.</p> <hr /> <p><a href="https://answers.ros.org/question/414365/is-it-possible-to-visualize-two-robot-models-in-rviz?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/135054/denizitu/" rel="nofollow noreferrer">denizitu</a> on ROS Answers with karma: 11 on 2023-04-15</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-04-15</strong>:<br /> Your question has not enough information. Are these 2 wheeled-robots on a map, or are they 2 robot arms? What exactly do you want to visualize?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/135054/denizitu/" rel="nofollow noreferrer">denizitu</a> on 2023-06-17</strong>:<br /> wheeled robots.</p>
Is it possible to visualize two robot models in RViz?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, try removing the '-' before &quot;publish_rate:=100.0&quot;</p> <pre><code>gazebo -s libgazebo_ros_init.so --ros-args -p publish_rate:=100.0 </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/145214/then_ck/" rel="nofollow noreferrer">Then_CK</a> with karma: 26 on 2023-04-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103191
2023-04-15T20:00:36.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm trying to launch gazebo with a specific rate with the following</p> <pre><code>gazebo -s libgazebo_ros_init.so --ros-args -p -publish_rate:=100.0 </code></pre> <p>But I get the following error:</p> <pre><code>[ERROR] [1681606330.311154028] [rcl]: Failed to parse global arguments terminate called after throwing an instance of 'rclcpp::exceptions::RCLInvalidROSArgsError' what(): failed to initialize rcl: Couldn't parse parameter override rule: '-p -publish_rate:=100.0'. Error: Expecting token or wildcard, at /tmp/binarydeb/ros-foxy-rcl-1.1.14/src/rcl/arguments.c:1138, at /tmp/binarydeb/ros-foxy-rcl-1.1.14/src/rcl/arguments.c:325 </code></pre> <p>I'm not sure if this is ROS or Gazebo related but I sure don't have a clue how to fix it (after a lot of internet searches) Any help will be very appreciated</p> <hr /> <p><a href="https://answers.ros.org/question/414390/failed-to-initialize-rcl:-couldn%27t-parse-parameter-override-rule/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/145435/guidout/" rel="nofollow noreferrer">guidout</a> on ROS Answers with karma: 25 on 2023-04-15</p> <p>Post score: 1</p>
failed to initialize rcl: Couldn't parse parameter override rule
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>you can create parent link on the top of base_link( as a child) name realsense_camera_link, and you can add that to robot arm, that's also a good practice if you are working with multiple sensors.</p> <p>OR</p> <p>I would suggest picking a (Parent link)base link. All child link transformations will be derived form the parent.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2023-04-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on 2023-04-21</strong>:<br /> Got it, thanks so much!</p>
103193
2023-04-17T10:47:48.000
|ros|rviz|moveit|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to add realsense d455 model and its tf to an existing robot arm urdf. What link should I add to my robot arm urdf ?</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16818117354932028.jpg" alt="image description" /></p> <hr /> <p><a href="https://answers.ros.org/question/414460/what-link-of-realsense-d455-should-i-put-inside-an-existing-robot-arm-urdf-file?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on ROS Answers with karma: 39 on 2023-04-17</p> <p>Post score: 0</p>
What link of realsense D455 should I put inside an existing robot arm urdf file?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>I am a first time user of ROS and I wanted to know if i could install the ROS platform on a windows PC?</p> </blockquote> <p>As I wrote in #q414656, if you're just starting out (and it seems you are just starting with ROS), I would <em>not</em> recommend trying to use Windows with ROS 1.</p> <p>If this is ROS 2, you have a somewhat bigger chance of getting things working, but realistically, I would probably still recommend you get started using Ubuntu.</p> <p>While it would require installing Linux on a PC/laptop, you will have a <em>much</em> smoother experience and a (very) large community to help you out if you post questions.</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-04-22</p> <p>This answer was <strong>NOT ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103198
2023-04-20T09:38:57.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am a first time user of ROS and I wanted to know if i could install the ROS platform on a windows PC? I have never used ROS and I don't have Linux in my pc. What should I do? What do you recomend? Thanks for your input. Herman.</p> <hr /> <p><a href="https://answers.ros.org/question/414590/can-you-install-a-ros-distro-on-a-windows-pc?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/145802/hermanator/" rel="nofollow noreferrer">Hermanator</a> on ROS Answers with karma: 1 on 2023-04-20</p> <p>Post score: 0</p>
can you install a ROS distro on a windows pc?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I wouldn't try to save it from rqt_plots, save it into a rosbag and then you can convert it into a csv (I think I used <a href="https://github.com/AtsushiSakai/rosbag_to_csv" rel="nofollow noreferrer">this library before</a>).</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/142993/sreed23/" rel="nofollow noreferrer">sreed23</a> with karma: 26 on 2023-04-21</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103201
2023-04-20T15:58:22.000
|rqt|rqt-plot|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have ros a topic <code>/uav1/aerodynamics/wrench</code> having multiple param. Such as fore:x,y,z and torque:x,y,z data. I want to plot it <code>rqr_plot</code> and save the simulation data as CSV file. How can I do that</p> <hr /> <p><a href="https://answers.ros.org/question/414601/saving-rqt-plot-data-as-csv/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/85455/mubashir-alam/" rel="nofollow noreferrer">Mubashir alam</a> on ROS Answers with karma: 13 on 2023-04-20</p> <p>Post score: 0</p>
saving rqt plot data as csv
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><a href="http://docs.ros.org/en/lunar/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a6430022f7709b989857af33b1a128563" rel="nofollow noreferrer">getCurrentPose (C++)</a>/ <a href="https://github.com/ros-planning/moveit/blob/master/moveit_commander/src/moveit_commander/move_group.py#L125" rel="nofollow noreferrer">get_current_pose (Python)</a> reports the pose of the end effector link. The frame it is referenced to can be read from the header of PoseStamped.</p> <p>For looking up arbitrary links you could just use tfs. If it's a link on your robots kinematic chain you could also reset the end effector link before getting the pose.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/30604/pcoenen/" rel="nofollow noreferrer">pcoenen</a> with karma: 249 on 2023-04-21</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on 2023-04-22</strong>:<br /> I tried to print the output of PointStamped with <code>print(geometry_msgs.msg.PoseStamped())</code> and got the following output :</p> <p>position: x: 2.891971438201711e-07 y: -0.24444999999999026 z: 0.8917000428590904 orientation: x: 0.7071065501076503 y: 1.1553940595954334e-07 z: 1.1553948151418447e-07 w: 0.7071070122653501 header: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: '' pose: position: x: 0.0 y: 0.0 z: 0.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 0.0</p> <p>why is it blank below the header?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on 2023-04-22</strong>:<br /> and do you know how to set which link I want to control with set pose target ? I'm quite new to ROS and moveit sorry.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on 2023-04-22</strong>:<br /> is these position and orientation tool0's position or is it already being transformed relative to the base? should I publish a tf between tool0 to base? how? <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1682150695614296.jpg" alt="image description" /></p> <p>(sorry to write it as answer to be able to send image, I'll change it once I got the real answer)</p> <p><strong>Comment by <a href="https://answers.ros.org/users/30604/pcoenen/" rel="nofollow noreferrer">pcoenen</a> on 2023-04-24</strong>:<br /> Did you print the return value of get_current_pose (which is of type PoseStamped) or <code>print(geometry_msgs.msg.PoseStamped())</code>, because the zeroed position looks like you did the latter.</p> <ul> <li>and do you know how to set which link I want to control with set pose target ?</li> </ul> <p>If you look through the move_group_commander code on github (linked above) you will also find a set_end_effector_link function.</p> <ul> <li>is these position and orientation tool0's position or is it already being transformed relative to the base?</li> </ul> <p>I believe the pose is relative to the global frame set in rviz. The tf from base to tool0 should already exist. You can use <code>rosrun rqt_tf_tree rqt_tf_tree</code> to check which frames are available.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on 2023-04-24</strong>:<br /> Got it, thankyou so much ! this is enough and really helpful !</p>
103203
2023-04-21T00:55:47.000
|ros|python|pose|moveit|movegroup|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have a Techman robot arm and I write a python script to read the current pose (pos : xyz, quar:xyzw) but I don't know if it's the base or end effector link that the position corresponds to. Anyone know how to check the link it corresponds to ? how to set which link I want to read ?</p> <hr /> <p><a href="https://answers.ros.org/question/414610/what-link-move_group-get-current-pose-refers-to?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on ROS Answers with karma: 39 on 2023-04-21</p> <p>Post score: 0</p>
What link move_group get current pose refers to?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Thanks for your help guys. This was in the end a simple fix: I was not subscribing to the correct topic in Rviz. I needed to subscribe to topic &quot;Image&quot; rather than &quot;Camera&quot; so this was an amateur mistake on my behalf. Cheers</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/73566/jdgre1/" rel="nofollow noreferrer">jdgre1</a> with karma: 16 on 2023-04-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103205
2023-04-22T00:10:18.000
|ros|gazebo|rviz|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, Could someone please provide a hint as to why I might not be able to display an image in rviz?</p> <ul> <li>I have added a camera in gazebo and am able to see what the robot is seeing. Secondly a call to rostopic echo /camera/color/image_raw returns data. However <code>rostopic echo /camera/color/camera_info</code> results in:</li> </ul> <blockquote> <p>&quot;WARNING: no messages received and simulated time is active. Is /clock being published?&quot;</p> </blockquote> <ul> <li><p>I am publishing a tf from camera_link_optical to map via the following in my roslaunch file: &lt;<code>node pkg=&quot;tf&quot; type=&quot;static_transform_publisher&quot; name=&quot;camera_link_optical_to_map&quot; args=&quot;0.0 0.0 0.0 0.0 0.0 0.0 map camera_link_optical 100&quot;/</code>&gt; but I am unsure if this is correct. This was the solution based on this link <a href="https://answers.ros.org/question/221329/rviz-fixed-frame-map-does-not-exist/?answer=221357#post-id-221357" rel="nofollow noreferrer">here</a>.</p> </li> <li><p>In rviz I have added a camera, set the &quot;Fixed Frame&quot; to camera_link_optical receive the following message &quot;'n' messages received&quot; but also obtain the warning &quot;No CameraInfo received on [/camera/color/camera_info]. Topic may not exist.&quot; I am not sure if this is causing the issue.</p> </li> <li><p>Essentially it is clear data is being published from rostopic echo as mentioned above and the image is clearly viewable in my gazebo simulation. I am not sure why there is however no image in rviz. I have added a snippet of code from my xacro file which is included by the launchfile below. This is largely based off the blog-post from Articulated Robotics <a href="https://articulatedrobotics.xyz/mobile-robot-9-camera/" rel="nofollow noreferrer">here</a>.</p> </li> </ul> <p>Hopefully I have made the issue clear enough. Thank-you for your help.</p> <pre><code>&lt;joint name=&quot;camera_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;base_link&quot;/&gt; &lt;child link=&quot;camera_link&quot;/&gt; &lt;!-- Rotates camera here --&gt; &lt;origin xyz=&quot;<span class="math-container">${-base_len/2 - camera_box_dim / 2 - camera_offset} 0 $</span>{vehicle_box_height/2}&quot; rpy=&quot;<span class="math-container">${-pi/2} 0 $</span>{-pi/2}&quot;/&gt; &lt;!-- &lt;origin xyz=&quot;<span class="math-container">${-base_len/2 - camera_box_dim / 2 - camera_offset} 0 $</span>{vehicle_box_height/2}&quot; rpy=&quot;0 ${pi/2} 0&quot;/&gt; --&gt; &lt;/joint&gt; &lt;link name=&quot;camera_link&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;box size=&quot;<span class="math-container">${camera_box_dim} $</span>{camera_box_dim} ${camera_box_dim}&quot;/&gt; &lt;/geometry&gt; &lt;material name=&quot;red&quot;/&gt; &lt;/visual&gt; &lt;/link&gt; &lt;joint name=&quot;camera_optical_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;camera_link&quot;/&gt; &lt;child link=&quot;camera_link_optical&quot;/&gt; &lt;!-- &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;<span class="math-container">${-pi/2} 0 $</span>{-pi/2}&quot;/&gt; --&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;camera_link_optical&quot;&gt;&lt;/link&gt; &lt;!-- &lt;gazebo reference=&quot;camera_link&quot;&gt; &lt;material&gt;Gazebo/Red&lt;/material&gt; &lt;/gazebo&gt; --&gt; &lt;gazebo reference=&quot;camera_link&quot;&gt; &lt;material&gt;Gazebo/Red&lt;/material&gt; &lt;sensor name=&quot;camera&quot; type=&quot;camera&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;camera&gt; &lt;horizontal_fov&gt;1.089&lt;/horizontal_fov&gt; &lt;image&gt; &lt;format&gt;R8G8B8&lt;/format&gt; &lt;width&gt;640&lt;/width&gt; &lt;height&gt;480&lt;/height&gt; &lt;/image&gt; &lt;clip&gt; &lt;near&gt;0.001&lt;/near&gt; &lt;far&gt;8&lt;/far&gt; &lt;/clip&gt; &lt;/camera&gt; &lt;plugin name=&quot;camera_controller&quot; filename=&quot;libgazebo_ros_camera.so&quot;&gt; &lt;cameraName&gt;camera&lt;/cameraName&gt; &lt;always_on&gt;true&lt;/always_on&gt; &lt;imageTopicName&gt;/camera/color/image_raw&lt;/imageTopicName&gt; &lt;cameraInfoTopicName&gt;camera_info&lt;/cameraInfoTopicName&gt; &lt;frameName&gt;camera_link_optical&lt;/frameName&gt; &lt;focalLength&gt;0.0&lt;/focalLength&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;/gazebo&gt; </code></pre> <hr /> <p><a href="https://answers.ros.org/question/414660/rviz-receiving-image-from-gazebo-but-not-displaying-it./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/73566/jdgre1/" rel="nofollow noreferrer">jdgre1</a> on ROS Answers with karma: 16 on 2023-04-22</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/103873/davies-ogunsina/" rel="nofollow noreferrer">Davies Ogunsina</a> on 2023-04-22</strong>:<br /> Do you have a tf from the base_link to camera link frame ?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-04-22</strong>:<br /> There are many examples of working gazebo camera configurations on this site e.g. #q210695.</p>
Rviz receiving image from gazebo but not displaying it
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>To anybody interested, <strong>I gave up</strong>. <br> Getting everything set up on Windows is such a pain, and gives no benefits.</p> <p>I've found a SSD drive empty and setup a detachable dual-boot with Ubuntu there.</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-05-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103207
2023-04-22T08:59:03.000
|ros|gazebo|ros2|windows10|nvidia|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone! I'm trying to understand the best way to setup my environment for ROS2+Gazebo.</p> <p>Up until now I was using an Ubuntu 22.04 VM with Virtualbox to get simple exercises up and running in ROS2, with no major problem. Since I have to go up a step and start a more complex system, plus I'll need Gazebo for simulations, I thought about how to improve the environment, given that there is always some kind of performance issue using VMs. It seems my options are:</p> <ul> <li>dual boot</li> <li>Docker</li> <li>Git Bash from CMD, as if I was actually on Unix</li> </ul> <p>Since for simplicity of use, <em>budget</em> (can't get another laptop) and <em>resources</em> (my laptop's SDD is not that big) the dual boot is not an option, I moved to Docker. I set up the container (osrf/ros), I installed <strong>XLaunch</strong> for the GUI and successfully integrated <strong>Docker</strong> with <strong>WSL2</strong>. Everything following <a href="https://medium.com/htc-research-engineering-blog/nvidia-docker-on-wsl2-f891dfe34ab" rel="nofollow noreferrer">this guide</a></p> <p>However, I can't seem to use my Nvidia graphic card. I've tried launching the <em>turtlesim</em> node + teleop, but it's laggy and slow and Task Manager does not show the process as executing with the Nvidia card.</p> <p>Has anyone managed to successfully setup a similar environment? Or is there any other option that is <em><strong>actually better</strong></em> than this?</p> <p>Thanks in advance!</p> <hr /> <p><a href="https://answers.ros.org/question/414679/ros2-on-windows-with-nvidia-gpu/" 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-04-22</p> <p>Post score: 0</p>
ROS2 on Windows with NVidia GPU
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In general, the packages that rely on a later version of ROS are not downgradable to anything below it. You will need to change the source code to make it compile and work in the same way, which might be complex or even impossible.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/79869/per-edwardsson/" rel="nofollow noreferrer">Per Edwardsson</a> with karma: 501 on 2023-04-24</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/143866/nartmangnourt/" rel="nofollow noreferrer">Nartmangnourt</a> on 2023-04-24</strong>:<br /> Hey Per Edwardsson,</p> <p>thanks a lot for your answer. I believe i will just use the planner and controller which are available for ros2 foxy.</p> <p>I really appreciate your help ;)</p>
103209
2023-04-23T13:29:04.000
|ros|ros2|global-planner|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hey Community,</p> <p>currently i using ROS2 Foxy and ROS1 Noetic on the same PC. In the beginning I wanted to use Humble but it only supports Ubuntu 22.04. In order to use ROS1 noetic and ROS2 distribution, i have to use foxy. Now i have noticed that ros2 foxy only smac planner</p> <p>My question:</p> <p>I downloaded the ros2 nav2 stack in my underlay directory /opt/ros/foxy/. So i assume that it is not enough just to download the packages (Controller and planner), add them to the share folder and make changes to the package.xml and cmakelist right? For instance, the folders are named different (Example: Humble -&gt; nav2_smac_planner &amp;&amp; Foxy -&gt;smac_planner). Also i think i have to create a overlay workspace for the ros2 nav2.</p> <p>--&gt;In general, can i add the planners and controllers in my ros2 foxy system or are they only supported for humble?&lt;--</p> <p>Thank you very much !</p> <hr /> <p><a href="https://answers.ros.org/question/414709/can-i-mix-packages-from-foxy-and-humble?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/143866/nartmangnourt/" rel="nofollow noreferrer">Nartmangnourt</a> on ROS Answers with karma: 13 on 2023-04-23</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-07</strong>:<br /> I edited your title to make it more specific.</p>
Can I mix packages from foxy and humble?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>From the description of the scenario, the problem may arise from the fact that you are giving a point <em>inside</em> the object as final goal of for the end-effector. If the robot is building an occupancy map of the environment with the camera you mentioned, it will consider everything as an obstacle (including your object), if not instructed differently.</p> <p>You could verify if this is the case by setting a similar goal, but in a non-occupied spot (e.g. 0.5m above the position you would have defined). Does the solver return you a solution in this case?</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-05-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/146276/rowbot/" rel="nofollow noreferrer">RowBot</a> on 2023-05-23</strong>:<br /> Hey thanks for answering, I have tried the suggested before and it does not work. But I notice that my object detection coordinates from my camera is different from my end-effector position at the object.</p> <p>Here is an example: Camera Object Detection Coordinates: (x: -1.3414, y: -0.0301, z: 0.4340), End-effector Position at the object: (x: 0.3146, y: 0.0702, z: 0.0157)</p> <p>I have been following <a href="https://answers.ros.org/question/367829/converting-image-pixel-coordinates-2dx-y-to-3d-world-coordinatequaternion/" rel="nofollow noreferrer">this</a> as a guide.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> on 2023-05-29</strong>:<br /> Sorry, I try to figure out the situation. You mean that:</p> <ul> <li>if you print the <code>target_pose</code>, you get <code>(x: -1.3414, y: -0.0301, z: 0.4340)</code></li> <li>if you (manually?) move the end-effector to the desired position, and print its position, you get <code>(x: 0.3146, y: 0.0702, z: 0.0157)</code></li> </ul> <p>If the above is correct, you are missing a transformation between reference frames (RF). You have the coordinates of the object in the camera RF (typically Z forward, X right, and Y down), but your planner is expecting to receive a target in a RF aligned with the base of the robot, e.g. <code>base_link</code> (usually, X forward, Y right, and Z up).</p> <p>As per the <a href="http://docs.ros.org/en/jade/api/moveit_core/html/classmoveit_1_1core_1_1RobotState.html" rel="nofollow noreferrer">documentation</a> of the method you are trying to use, <em>The pose is assumed to be in the reference frame of the kinematic model.</em> You should use <a href="http://wiki.ros.org/tf2" rel="nofollow noreferrer">tf2</a> to convert the position you get from the camera RF to the relevant RF.</p>
103211
2023-04-24T23:01:06.000
|ros|moveit|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am working on a robotics project using Ubuntu 18.04 and ROS Melodic, and I am using an Intel RealSense D435 camera to detect objects. I have been trying to use object pose estimation to pick up an object using Moveit, but I am encountering issues when using the 3D coordinates (x, y, z) set as a pose_target, the IK solver is unable to find a solution.</p> <p>Specifically, I have tried getting the object's 2D center pixel values and converting them into a 3D coordinate with depth involved. However, when I set the 3D coordinates to a geometry_msgs::Pose target_pose and pass it to setFromIK(joint_model_group, target_pose), the IK solver is unable to find a solution. I suspect that my conversions may be incorrect. How can I properly convert the 2D pixel coordinates to 3D coordinates, and why is the IK solver unable to find a solution with the target_pose that I have provided?</p> <pre><code>/* Convert pixel to 3d coordinate */ ray = model_.projectPixelTo3dRay(cv::Point2d(p_2d.x, p_2d.y)); // Coordinates affected due to depth double alpha = depth_value/ray.z; projected_dl.center.x = -ray.y*alpha; projected_dl.center.y = -ray.x*alpha; projected_dl.center.z = ray.z*alpha; /* ============================= */ geometry_msgs::Pose target_pose; target_pose.position.x = projected_dl.center.x; target_pose.position.y = projected_dl.center.y ; target_pose.position.z = projected_dl.center.z; bool found_ik = kinematic_state-&gt;setFromIK(joint_model_group, target_pose); // Now, we can print out the IK solution (if found): if (found_ik) { kinematic_state-&gt;copyJointGroupPositions(joint_model_group, joint_values); for (std::size_t i = 0; i &lt; joint_names.size(); ++i) { ROS_INFO(&quot;Joint %s: %f&quot;, joint_names[i].c_str(), joint_values[i]); } } else { ROS_INFO(&quot;Did not find IK solution&quot;); } </code></pre> <hr /> <p><a href="https://answers.ros.org/question/414756/how-can-i-use-object-pose-estimation-to-pick-up-an-object-in-moveit?/" 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-04-24</p> <p>Post score: 2</p>
How can I use object pose estimation to pick up an object in Moveit?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>If anyone is interested I succeed with this launch :</p> <pre><code> # gazebo world - executable: cmd: gz sim -v 1 -r my_world.sdf </code></pre> <p>If anyone knows where to find the full doc of the yml launch file, I'm still interested</p> <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-05-02</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103213
2023-04-28T08:41:46.000
|ros|ros2|roslaunch|yaml|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I'd like to start 'gz sim' from my yaml launch-file, I read <a href="https://answers.ros.org/question/374976/ros2-launch-gazebolaunchpy-from-my-own-launch-file/" rel="nofollow noreferrer">here</a> that it's easy in python with the ExecuteProcess class. But when I tried to use</p> <pre><code> # gazebo world - ExecuteProcess: cmd: </code></pre> <p>I got the error <code>[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [yml]: Unrecognized entity of the type: ExecuteProcess</code> when I launched the file with <code>ros2 launch my_file.yml</code></p> <p>I did not found either a doc that help translate from Python class to Yaml.</p> <p>Linux version 5.19.0-40-generic, Ubuntu 11.3.0-1ubuntu1~22.04</p> <hr /> <p><a href="https://answers.ros.org/question/414845/how-to-start-%27gz-sim%27-from-a-yaml-launch-file-?/" 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-04-28</p> <p>Post score: 0</p>
How to start 'gz sim' from a yaml launch file?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Assuming that I got your question correct.</p> <p>You can record the poses at a low frequency (or down-sample later) and create an adjacency matrix for the entire sequence - adjacent poses will be connected and others won't be. Post that you can run any graph search algorithm across any two given poses and come up with a global plan. Then you can feed this plan to the move_base.</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-04-29</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/56348/saurabh-rahatekar/" rel="nofollow noreferrer">Saurabh Rahatekar</a> on 2023-05-02</strong>:<br /> Thank you so much for responding. I came across the move_base_flex. I am trying to use the exec_path. As you suggested, I will use the search algorithm and feed it to exec_path.</p>
103215
2023-04-29T01:12:28.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello everyone. I m working on an AGV for material handling in warehouses. I want to develop a planning algorithm that will use a prerecorded path and will calculate the shortest path to and from various stations in that path. To do that, I will record the amcl_poses in a yaml file and publish those coordinates on nav_msgs/path msg. Whenever a goal will be given, this planner will be called and calculate the path between the current pose and the goal pose. then the move_base will use that path to generate local_path and velocities. But I don't know how to achieve this. Please suggest ways to develop this.</p> <hr /> <p><a href="https://answers.ros.org/question/414859/path-planning-on-a-prerecorded-global-path/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/56348/saurabh-rahatekar/" rel="nofollow noreferrer">Saurabh Rahatekar</a> on ROS Answers with karma: 45 on 2023-04-29</p> <p>Post score: 1</p>
Path planning on a prerecorded global path
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I answered this for you on the github page. Please don't cross post</p> <p><a href="https://github.com/ros-planning/navigation2/issues/3549" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/issues/3549</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-04-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103217
2023-04-29T06:53:34.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm trying to install the nav2-smac-planner package on Foxy but apt install can't find it. Is it not available?</p> <p>Here seem to indicate it's available on Foxy both source and debian. <a href="https://github.com/ros-planning/navigation2" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2</a></p> <p>Thank you in advance</p> <hr /> <p><a href="https://answers.ros.org/question/414864/nav2-smac-planner-package-not-available-on-foxy/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/145435/guidout/" rel="nofollow noreferrer">guidout</a> on ROS Answers with karma: 25 on 2023-04-29</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/143866/nartmangnourt/" rel="nofollow noreferrer">Nartmangnourt</a> on 2023-04-29</strong>:<br /> nav2_smac_planner is available for humble but not for foxy i believe. Foxy have a smac_planner package without (SmacPlannerHybrid, SmacPlannerLattice).</p> <p><strong>Comment by <a href="https://answers.ros.org/users/145435/guidout/" rel="nofollow noreferrer">guidout</a> on 2023-04-29</strong>:<br /> that's what I thought but in the github page of navigation2 in the build status table it looks like it should be available for foxy</p>
nav2-smac-planner package not available on foxy
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The naming are the library names in cmake <a href="https://github.com/ros-planning/navigation2/blob/main/nav2_behavior_tree/CMakeLists.txt#L54" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/blob/main/nav2_behavior_tree/CMakeLists.txt#L54</a> which are trying to be found by the BT.CPP library's dynamic library loader module. You can name yours however you like as long as its matching the exported cmake library names to the yaml file.</p> <p>To include your BT nodes into the tree, you have to create your own custom behvaior tree XML file for the BT Navigator and load it in your action request or as the default BT to use when none are specified in the action request. This is where that default is set / grabbed <a href="https://github.com/ros-planning/navigation2/blob/main/nav2_bt_navigator/src/navigators/navigate_to_pose.cpp#L63" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/blob/main/nav2_bt_navigator/src/navigators/navigate_to_pose.cpp#L63</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-05-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103219
2023-04-30T09:51:20.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>#Premise</p> <p>The version of ROS is Humble. I'm trying to implement a behavior tree plugin for an action that moves an omnidirectional robot in 2D mantaining a fixed direction. I'd like to extend a navigation2 move_to_pose_with_replanning_and_recovery behaviour tree in such a way that the last approach is executed using my custom action. The action works normally when called by an action client or with a goal action message from CLI.</p> <p>I'm fairly new with C++ but I think I understand most of the nav2_behavior_tree source code.</p> <p>I created the two files of the wait action example in a separate library, one contains the .hpp code for the plugin, one the .cpp code. The library has the same setup as the nav2_behavior_tree:</p> <pre><code>- planar_move -planar_move - ... (action definition code) - planar_node (where the bt plugin is defined) -include/plugins -planar_move_action.hpp -plugins -planar_move_action.hpp -cmake -plugin_palette.xml (defines the custom action plugin) -custom_bt.xml (defines the custom behavior tree to use with nav to pose) -package.xml </code></pre> <p>this is the planar_move_aciton.cpp code that implements the behavior tree plugin:</p> <pre><code>#include &lt;memory&gt; #include &lt;string&gt; #include &quot;planar_move_interfaces/plugins/action/planar_move.hpp&quot; namespace its_behaviour_tree { PlanarMoveActionNode::PlanarMoveActionNode( const std::string &amp; xml_tag_name, const std::string &amp; action_name, const BT::NodeConfiguration &amp; conf) : BtActionNode&lt;Action&gt;(xml_tag_name, action_name, conf) { } void PlanarMoveActionNode::on_tick() { if (!getInput(&quot;goal&quot;, goal_.pose)) { RCLCPP_ERROR( node_-&gt;get_logger(), &quot;NavigateToPoseAction: goal not provided&quot;); return; } } BT::NodeStatus PlanarMoveActionNode::on_success() { // Set empty error code, action was successful setOutput(&quot;error_code_id&quot;, ActionGoal::NONE); return BT::NodeStatus::SUCCESS; } BT::NodeStatus PlanarMoveActionNode::on_aborted() { setOutput(&quot;error_code_id&quot;, result_.result-&gt;error_code); return BT::NodeStatus::FAILURE; } BT::NodeStatus PlanarMoveActionNode::on_cancelled() { setOutput(&quot;error_code_id&quot;, ActionGoal::NONE); return BT::NodeStatus::SUCCESS; } } // namespace its_behaviour_tree #include &quot;behaviortree_cpp_v3/bt_factory.h&quot; BT_REGISTER_NODES(factory) { BT::NodeBuilder builder = [](const std::string &amp; name, const BT::NodeConfiguration &amp; config) { return std::make_unique&lt;its_behaviour_tree::PlanarMoveActionNode&gt;( name, &quot;planar_move&quot;, config); }; factory.registerBuilder&lt;its_behaviour_tree::PlanarMoveActionNode&gt;( &quot;PlanarMove&quot;, builder); } </code></pre> <p>This it the planar_move_action.hpp code:</p> <pre><code>#ifndef PLANAR_MOVE_ACTION_HPP_ #define PLANAR_MOVE_ACTION_HPP_ #include &lt;string&gt; #include &quot;planar_move_interfaces/action/planar_move.hpp&quot; #include &quot;nav_msgs/msg/path.h&quot; #include &quot;nav2_behavior_tree/bt_action_node.hpp&quot; class PlanarMoveActionNode : public BtActionNode&lt;planar_move_interfaces::action::PlanarMove&gt; { using Action = nav2_msgs::action::PlanarMove; using ActionResult = Action::Result; using ActionGoal = Action::Goal; public: /** * @brief A constructor for nav2_behavior_tree::PlanarMoveActionNode * @param xml_tag_name Name for the XML tag for this node * @param action_name Action name this node creates a client for * @param conf BT node configuration */ PlanarMoveActionNode( const std::string &amp; xml_tag_name, const std::string &amp; action_name, const BT::NodeConfiguration &amp; conf); /** * @brief Function to perform some user-defined operation on tick */ void on_tick() override; /** * @brief Function to perform some user-defined operation upon successful completion of the action */ BT::NodeStatus on_success() override; /** * @brief Function to perform some user-defined operation upon abortion of the action */ BT::NodeStatus on_aborted() override; /** * @brief Function to perform some user-defined operation upon cancellation of the action */ BT::NodeStatus on_cancelled() override; /** * @brief Creates list of BT ports * @return BT::PortsList Containing basic ports along with node-specific ports */ static BT::PortsList providedPorts() { return providedBasicPorts( { BT::InputPort&lt;geometry_msgs::msg::PoseStamped&gt;(&quot;goal&quot;, &quot;Destination to plan to&quot;), }); } }; } // namespace nav2_behavior_tree #endif // PLANAR_MOVE_ACTION_HPP_ </code></pre> <h1>Problem</h1> <p>I'm unsure on how to utilize the custom behavior tree with the navigation2 stack and how to include the plugin into nav2. From what I have seen from the tutorials, I should add the default behavior tree to use with the nav to pose action and the custom plugin into the configuration .yaml file. This is what I did:</p> <pre><code>default_nav_to_pose_bt_xml: &quot;home/user/project/src/planar_move/planar_node/first_try_tree.xml&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_planar_move_action_bt_node </code></pre> <p>The current naming pattern does not work since the plugin does not get found by nav2 stack and this leads to a malfunction of the code. Also, despite using the absolute path, the code can't find the custom behaviour tree. My suspicion is that the custom bt uses the custom action which is also not found by the code, not sure though.</p> <p>I wanted to know how to correctly name the plugin in order for it to be found at runtime by the nav2 stack, I can't seem to understand the naming pattern used for the other plugins as it is not specified anywhere in the documentation. I also couldn't find where in the code the plugin name is specified.<br /> I supposed this was done in the factory builder but I don't see any part relevant to the naming.</p> <p>For example: all the current plugins come from <code>nav2</code> and are <code>action_bt_nodes</code> so it makes sense that the naming pattern would be <code>nav2_&lt;plugin_name&gt;_action_bt_node</code>. But my plugin comes from a different library (planar_node) and naming it <code>planar_node_planar_move_action_bt_node</code> does not seem to work. I tried using the namespace as well <code>its_behavior_tree_planar_move_bt_action</code> but it lead to nothing</p> <p>I could just git clone the whole repo, modify the navigation behavior tree by adding my plugin and build nav2 from there but I think it would not be optimal.</p> <p>Thanks in advance for any kind of help or direction :)</p> <hr /> <p><a href="https://answers.ros.org/question/414891/behavior-tree-plugin-naming-convention-in-.yaml-config-file/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/122559/filippo.guarda/" rel="nofollow noreferrer">filippo.guarda</a> on ROS Answers with karma: 13 on 2023-04-30</p> <p>Post score: 0</p>
Behavior tree plugin naming convention in .yaml config file
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi!</p> <p>I completely agree with you that testing software in ROS2 is not so straightforward as we wish. There's just a little point that is not clear from your question. Are you referring to testing some library (ROS2 indipendent) or the ROS2 interface for that library?</p> <p>As far as I've understood is more the latter. In such case I wouldn't suggest (in my opinion) to unit testing your ROS2 interface, but rather using integration testing, since your goal is to verify the communication of your node. Also doing this has some level of complexity. In practice I know there are just a couple of ways to do that:</p> <ul> <li><a href="https://index.ros.org/p/launch_testing_ros/#humble-questions" rel="nofollow noreferrer">launch_testing_ros</a></li> <li>Apex IA testing framework (I've never had the chance to try it)</li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/148516/vince/" rel="nofollow noreferrer">Vince</a> with karma: 16 on 2023-05-12</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/44457/bernat-gaston/" rel="nofollow noreferrer">Bernat Gaston</a> on 2023-05-14</strong>:<br /> Thanks for the answer. We were not using testing at all so I wanted to start testing our code and I thought unit testing would be the best starting point. My first objective was to test our code without the ROS2 dependencies, specially the class node. I agree that integration testing is probably a must have in some near future. Answering your question, as an example, I have a function that I want to test. This function, at the end of its logic, calls a class ROS2 publisher.publish to publish a message. All I want to test is my function and maybe the fact that it calls the publisher, but I am not worried about the fact that this message is actually published, since I trust ros2 to do the job. If I do this function in python I can mock it easily because the mock library is very flexible and it allows you to basically mock everything. But in C++ that's much more difficult since the mocks are not that flexible.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/148516/vince/" rel="nofollow noreferrer">Vince</a> on 2023-05-14</strong>:<br /> My bad, I thought you wanted to test the ROS2 communication. In the case of unit testing your logic class then as you correctly said you need to make it indipendent from ROS2. This means that your logic class shoud not rely on any ROS2 functionality. Then the question is how to enable ROS2. An answer I've found (but there could be others) is through composition.</p> <p>For C++ in practice, you'll have</p> <ul> <li><p>a logic class: a classic C++ class that implements your logic, withouth any ROS publisher, ecc...</p> </li> <li><p>a ROS2 interface class: a class that inherits rclpcpp::Node and instanciates an object of your logic class, as well as initializating all the ROS2 objects needed.</p> </li> </ul> <p>In this way you can perform unit testing on your logic class without involving ROS2. Another adantage is that the lifecycle of the object is handled enterily by the ROS2 interface class.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/44457/bernat-gaston/" rel="nofollow noreferrer">Bernat Gaston</a> on 2023-05-15</strong>:<br /> That makes a lot of sense. Thanks!</p>
103221
2023-05-02T07:19:01.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all,</p> <p>Some time ago I used to be responsible of the testing framework of some software products outside of ROS. It's been some time that I am working in ROS now (lately in ROS2) and there are aspects on the testing design of ROS2 that I still don't understand. Specifically, I am talking about unit testing and the fact that many ROS2 functionalities are designed to use rclcpp:Node in an inheritance mode.</p> <p>As far as I'm concerned in unit testing, you want to test (ideally one) aspect of you own code. This is why many libraries are using Dependency Injection instead of inheritance, to help developers test only their code. Hence, when you want to test, instead of the main library, you inject a mock and you can test your function without the need to call the library.</p> <p>However, I see that the main code of ros2 and also the tests included use rclcpp:Node directly (without using mocks) and test multiple things (actually it seems that tests are most of the times integration ones and not unit ones). For example</p> <p><a href="https://github.com/ros2/rclcpp/blob/b812790ee301d9aa536c79b9636736471701d1c3/rclcpp/test/rclcpp/test_add_callback_groups_to_executor.cpp#L99" rel="nofollow noreferrer">https://github.com/ros2/rclcpp/blob/b812790ee301d9aa536c79b9636736471701d1c3/rclcpp/test/rclcpp/test_add_callback_groups_to_executor.cpp#L99</a></p> <p>Also, I tend to find the tests very long and difficult to follow, so I am a bit lost here. I assume I am not understanding something of the idea behind the testing architecture of ROS2. Why so inheritance based? Why testing so many things in a single function?</p> <p>I have searched for a &quot;testing guideline&quot; or something like that but I am unable to find it. Can anybody enlighten this?</p> <p>Many thanks</p> <hr /> <p><a href="https://answers.ros.org/question/414927/about-unit-testing-in-ros2---di,-wrappers-and-code-structure./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/44457/bernat-gaston/" rel="nofollow noreferrer">Bernat Gaston</a> on ROS Answers with karma: 119 on 2023-05-02</p> <p>Post score: 4</p>
About unit testing in ROS2 - DI, wrappers and code structure
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The problem was that the so files were not being named correctly. I added a bbappend file with the following fix:</p> <p>do_install:append() { install -d <span class="math-container">${D}$</span>{PYTHON_SITEPACKAGES_DIR} for f in <span class="math-container">$(find $</span>{D}<span class="math-container">${PYTHON_SITEPACKAGES_DIR} -name "*x86_64*"); do mv $</span>f <span class="math-container">$(echo $</span>f | sed 's/x86_64/aarch64/') done }</p> <p>This renames all of the *.cpython-310-x86_64-linux-gnu.so files to *.cpython-310-aarch64-linux-gnu.so. Now ros2 bag finds the modules correctly.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/147401/eburley/" rel="nofollow noreferrer">eburley</a> with karma: 16 on 2023-05-02</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103223
2023-05-02T12:53:19.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am compiling ROS2 galactic through Yocto for an imx8qm. The only thing that doesn't work is rosbag2-py. When I run ros2 bag on the device, I get the error: Failed to load entry point 'play' : No module named 'rosbag2_py._reader'. In the /usr/lib/python3.10/site-packages/rosbag2-py folder, all of the files end in 'cpython-310-x86_64-linux-gnu.so'. I would expect them to be 'cpython-310-aarch64-linux-gnu.so', so it looks like Yocto isn't cross-compiling them. How do I change the yocto recipe so that the python libraries are cross-compiled?</p> <p>Update: file I run the 'file' command on the librarys, I can see that the files are being built for ARM aarch64, even though they are named '..x86_64..'. The problem seems to be that ros2 bag isn't finding them properly.</p> <hr /> <p><a href="https://answers.ros.org/question/414938/can%27t-run-rosbag2-py-on-imx8/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/147401/eburley/" rel="nofollow noreferrer">eburley</a> on ROS Answers with karma: 16 on 2023-05-02</p> <p>Post score: 0</p>
Can't run rosbag2-py on imx8
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Based on our discussion in the comments, it seems like your configuration was all good.</p> <p>It may be that the power supply for the raspberry pi was undersized. If you find that the rplidar startup is still unreliable, you should try 1) using a powered usb hub, or 2) to plug the rplidar directly into the raspberry pi board (so it doesn't have to share power with another device.)</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-05-04</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103225
2023-05-02T13:08:04.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello Everyone.</p> <p>I have installed ROS noetic on both Pi 3 and my workstation. The target is to send Lidar data over to workstation where I will visualize it via Rviz.</p> <p>The issue is: the lidar works fine when connected to laptop; however when I connect it to pi and run the following: roslaunch rplidar_ros rplidar.launch</p> <p>Here is the rplidar.launch file:</p> <pre><code>&lt;launch&gt; &lt;node name=&quot;rplidarNode&quot; pkg=&quot;rplidar_ros&quot; type=&quot;rplidarNode&quot; output=&quot;screen&quot;&gt; &lt;param name=&quot;serial_port&quot; type=&quot;string&quot; value=&quot;/dev/ttyUSB0&quot;/&gt; &lt;param name=&quot;serial_baudrate&quot; type=&quot;int&quot; value=&quot;115200&quot;/&gt;&lt;!--A1/A2 --&gt; &lt;!--param name=&quot;serial_baudrate&quot; type=&quot;int&quot; value=&quot;256000&quot;--&gt;&lt;!--A3 --&gt; &lt;param name=&quot;frame_id&quot; type=&quot;string&quot; value=&quot;laser&quot;/&gt; &lt;param name=&quot;inverted&quot; type=&quot;bool&quot; value=&quot;false&quot;/&gt; &lt;param name=&quot;angle_compensate&quot; type=&quot;bool&quot; value=&quot;true&quot;/&gt; &lt;/node&gt; &lt;/launch&gt; </code></pre> <p>here is the output of lsusb:</p> <pre><code>Bus 001 Device 005: ID 10c4:ea60 Silicon Labs CP210x UART Bridge Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub </code></pre> <p>I get this:</p> <p>&quot;[ERROR] [1683048712.103957025]: Error, operation time out. RESULT_OPERATION_TIMEOUT! [rplidarNode-1] process has died [pid 3196, exit code 255, cmd /home/ubuntu/catkin_ws/devel/lib/rplidar_ros/rplidarNode __name:=rplidarNode __log:=/home/ubuntu/.ros/log/690e8cb0-e90e-11ed-8367-b827ebea13cf/rplidarNode-1.log]. log file: /home/ubuntu/.ros/log/690e8cb0-e90e-11ed-8367-b827ebea13cf/rplidarNode-1*.log&quot;</p> <p>Sometimes I get this:</p> <p>&quot;[ERROR] [1683050360.490752221]: Error, cannot retrieve rplidar health code: 80008002 [rplidarNode-1] process has died [pid 1607, exit code 255, cmd /home/ubuntu/catkin_ws/devel/lib/rplidar_ros/rplidarNode __name:=rplidarNode __log:=/home/ubuntu/.ros/log/0aea9212-e910-11ed-a08d-69187ab6f95b/rplidarNode-1.log]. log file: /home/ubuntu/.ros/log/0aea9212-e910-11ed-a08d-69187ab6f95b/rplidarNode-1*.log &quot;</p> <p>Note: The pi and workstation are connected as I can see a list of topics on my workstation. I have sourced the environment as well.</p> <p>I do not know where is the issue. I have tried my best. Please help.</p> <hr /> <p><a href="https://answers.ros.org/question/414939/rplidar-a1m8-works-when-connected-to-laptop-but-does-not-work-on-rapsberry-pi-3/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/140790/kowais915/" rel="nofollow noreferrer">kowais915</a> on ROS Answers with karma: 3 on 2023-05-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-05-03</strong>:<br /> What serial device name is the rplidar using on your raspberry pi? Here is what mine looks like:</p> <pre><code>$ ls -ld /dev/rp* /dev/ttyUSB* lrwxrwxrwx 1 root root 7 Apr 20 14:52 /dev/rplidar -&gt; ttyUSB0 crw-rw---- 1 root dialout 188, 0 Apr 20 14:52 /dev/ttyUSB0 </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/140790/kowais915/" rel="nofollow noreferrer">kowais915</a> on 2023-05-04</strong>:<br /> Mine is ttyUSB0 too. I have given all the rwx permissions too. I tried powering the pi using a powerbank as well but I am still getting the same error.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-04</strong>:<br /> Which machine are you running that <code>roslaunch</code> command on?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/140790/kowais915/" rel="nofollow noreferrer">kowais915</a> on 2023-05-04</strong>:<br /> The lidar is connected to raspberry pi 3 Model B+ that has ROS noetic installed. I have connected to the pi via ssh from another machine that has ROS noetic running as well. I have installed Ubuntu 20.04 via WSL2.</p> <p>So I am technically running the roslaunch command on PI but via SSH on another machine.</p> <p>I have been searching for everything. At this point, I am so frustrated.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-04</strong>:<br /> Using ssh in that way should be fine. The error message indicates that your ros node (rplidarNode) finds <em>some</em> device on the serial port, but the node is either unable to read from the device, or the values do not match the rplidar model it is looking for.</p> <p>Please edit your description and copy/paste the output of the <code>lsusb</code> command (please do not give me a screenshot.) You edit using the &quot;edit&quot; button near the end of the description.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/140790/kowais915/" rel="nofollow noreferrer">kowais915</a> on 2023-05-04</strong>:<br /> Thank you so much already for help. I have added the output to the description please check.</p> <p>Furthermore, I only get the first error message now: The TImeout Error.</p> <p>&quot;[ERROR] [1683048712.103957025]: Error, operation time out. RESULT_OPERATION_TIMEOUT! [rplidarNode-1] process has died [pid 3196, exit code 255, cmd /home/ubuntu/catkin_ws/devel/lib/rplidar_ros/rplidarNode __name:=rplidarNode __log:=/home/ubuntu/.ros/log/690e8cb0-e90e-11ed-8367-b827ebea13cf/rplidarNode-1.log]. log file: /home/ubuntu/.ros/log/690e8cb0-e90e-11ed-8367-b827ebea13cf/rplidarNode-1*.log&quot;</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-04</strong>:\</p> <blockquote> <p>Silicon Labs CP210x UART Bridge</p> </blockquote> <p>This is the expected usb device label for an rplidar, so this line looks good. You will get a timeout error if something else already has the /dev/ttyUSB0 device open. Could you be launching the ros node twice?</p> <p>Please edit your description and show us your complete rplidar launch file. To preserve newlines, highlight all the new text and format it by clicking the 101010 button once.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-04</strong>:<br /> In your systemd journal, do you find a line similar to this? Do a search for: <code>ttyUSB0</code></p> <pre><code>Apr 20 14:52:49 batmobile kernel: usb 1-5: cp210x converter now attached to ttyUSB0 </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/140790/kowais915/" rel="nofollow noreferrer">kowais915</a> on 2023-05-04</strong>:<br /> When I ran <code>ls -l /dev/ttyUSB*</code></p> <p>It returned the following:</p> <pre><code>crwxrwxrwx 1 root dialout 188, 0 May 4 14:52 /dev/ttyUSB0 </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/140790/kowais915/" rel="nofollow noreferrer">kowais915</a> on 2023-05-04</strong>:<br /> I have updated the description with rplidar.launch file. Please have a look. I don't I am running it twice since there is no topic listed related to rplidar when I run <code>rostopic list</code></p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-04</strong>:\</p> <blockquote> <p>I have updated the description with rplidar.launch file</p> </blockquote> <p>Your launch file looks OK to me. Please tell me if your systemd journal has that line (3 comments up.) Run the command:</p> <pre><code>sudo journalctl -b 0 | grep ttyUSB0 </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/140790/kowais915/" rel="nofollow noreferrer">kowais915</a> on 2023-05-04</strong>:<br /> Yes, it does have that line:</p> <pre><code>May 04 11:14:28 bee kernel: usb 1-1.5: cp210x converter now attached to ttyUSB0 May 04 14:51:47 bee kernel: cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0 May 04 14:52:02 bee kernel: usb 1-1.3: cp210x converter now attached to ttyUSB0 May 04 16:30:09 bee sudo[1608]: ubuntu : TTY=pts/0 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/usr/bin/chmod 777 /dev/ttyUSB0 </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/140790/kowais915/" rel="nofollow noreferrer">kowais915</a> on 2023-05-04</strong>:<br /> Just tried plugging it out and then in again. From the output of the command you sent above, it seems that the lidar is attached to ttyUSB0:</p> <pre><code>May 04 17:22:07 bee kernel: usb 1-1.5: cp210x converter now attached to ttyUSB0 </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-04</strong>:<br /> OK, good. We are running out of things to investigate here.</p> <p>Are you using an separate usb hub? If so, is it a powered hub (i.e. has its own separate power input)?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/140790/kowais915/" rel="nofollow noreferrer">kowais915</a> on 2023-05-04</strong>:<br /> I just tried powering the pi using another cable and 20000mah power bank and it worked!!! I can see the scan data on my workstation which is great!!!!</p> <p>Now, the issue is that I am having trouble visualizing through Rviz. I added a laserScan visualization type. There are green checks in front of Topic, Points but there is an error in front of Transform [sender=unknown_publisher].</p> <p>I ran the following command but when I did so the terminal did not output anything, the cursor just keeps on blinking.</p> <pre><code>rosrun tf static_transform_publisher 0 0 0 0 0 0 world laser 100 </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-04</strong>:<br /> It's normal for static_transform_publisher to not print anything to stdout. As a test, in rviz, try setting your &quot;Fixed Frame&quot; to &quot;laser&quot;. Once that works, you can change it to &quot;world&quot; (which should be listed.)</p> <p>To see the scan outline more easily, you should increase the &quot;dot&quot; size (point size?) in the laserScan plugin. You also need to make sure that both machines have an accurate time-of-day clock, because rviz will discard stale data.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/140790/kowais915/" rel="nofollow noreferrer">kowais915</a> on 2023-05-04</strong>:<br /> Thank you so much @Mike Scheutzow. It seems like the problem was the cable. Now that my pi is powered up correctly it works. I have made my way through the hector slam where I have encountered another issue. If possible, I would very much appreciate your help. I am making another post for that issue.</p>
RPlidar A1M8 works when connected to laptop but does not work on Rapsberry pi 3
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>From this:</p> <blockquote> <pre><code>E: The repository 'http://packages.ros.org/ros/ubuntu jammy Release' does not have a Release file. </code></pre> </blockquote> <p>it looks like you're trying to use the ROS 1 package repositories on Ubuntu Jammy.</p> <p>The ROS 2 package repository would be <code>http://packages.ros.org/ros2/ubuntu</code> (note the <code>ros2</code> in the URL).</p> <p>ROS 1 does not support Ubuntu Jammy, so the <code>apt</code> error is correct: there is no release file it can download.</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-05-03</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103227
2023-05-02T20:57:29.000
|ros|ros2|installation|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Please find below the error I am getting...</p> <pre><code>$ sudo apt update Hit:1 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Ign:2 http://packages.ros.org/ros/ubuntu jammy InRelease Hit:3 http://archive.ubuntu.com/ubuntu jammy InRelease Err:4 http://packages.ros.org/ros/ubuntu jammy Release 404 Not Found [IP: 64.50.236.52 80] Hit:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Hit:6 http://archive.ubuntu.com/ubuntu jammy-security InRelease Reading package lists... Done E: The repository 'http://packages.ros.org/ros/ubuntu jammy Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. </code></pre> <hr /> <p><a href="https://answers.ros.org/question/414948/apt:-no-release-file-%5Bubuntu-jammy%5D/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/147435/saintofinternet/" rel="nofollow noreferrer">saintofinternet</a> on ROS Answers with karma: 1 on 2023-05-02</p> <p>Post score: 0</p>
apt: no release file [ubuntu jammy]
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It seems that I forgot to run a node that allows the dynamic storage of the target_pose_from_cam in points. As a result, the transform remains constant. Here is the link to the code for my frame transformation: <a href="https://season-cloak-2a7.notion.site/Code-aaa1e37398844affa8007739183ceef4" rel="nofollow noreferrer">Code</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/146276/rowbot/" rel="nofollow noreferrer">RowBot</a> with karma: 35 on 2023-06-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103229
2023-05-03T02:24:52.000
|ros|moveit|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hey everyone, I would like to convert my object detection pose estimation coordinates to world coordinates so that I can send a pose_target msg to my robotic arm in Moveit. But I do not know what is the first step I should take to perform the task.</p> <p>I'm running ubuntu 18.04 ros-melodic using an intel realsense D435 depth camera for object detection and pose estimation.</p> <hr /> <p><a href="https://answers.ros.org/question/414952/how-do-i-convert-camera-coordinates-to-world-coordinates-in-moveit-using-tf2?/" 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-05-03</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> on 2023-05-22</strong>:<br /> You should use the <a href="http://wiki.ros.org/tf2/Tutorials" rel="nofollow noreferrer"><code>tf2</code></a> package, that can help you managing the transformation between reference frames.</p> <p>Is your camera already integrated in ROS, or that is your question?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/146276/rowbot/" rel="nofollow noreferrer">RowBot</a> on 2023-05-23</strong>:<br /> Yes my camera is already integrated in ROS, I have a object detection topic /aricc_dl_detection/dlObjectDetection/dl_output which gives me the position of the object detected as a geometry_msgs/Point. I notice my target_pose_from_req.pose will always give the same coordinates.</p> <p>Here is what I did using the tf2 package:</p> <pre><code> // Construct a PoseStamped message using the detected object's position geometry_msgs::PoseStamped target_pose_from_cam; target_pose_from_cam.header.frame_id = &quot;camera_frame&quot;; target_pose_from_cam.pose.position.x = point.x; target_pose_from_cam.pose.position.y = point.y; target_pose_from_cam.pose.position.z = point.z; // Transform the PoseStamped message to the base frame geometry_msgs::PoseStamped target_pose_from_req = buffer_.transform( target_pose_from_cam, req.base_frame); // Return the transformed pose in the service response res.pose = target_pose_from_req.pose </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> on 2023-05-29</strong>:<br /> Sorry for the late response. What do you mean by <em>&quot;always the same coordinates&quot;</em>? Is <code>target_pose_from_req.pose</code> always giving you a set of values, regardless of changes in the scenario? If so, which are these values? Or do you mean that it is returning the same values you have in <code>target_pose_from_cam</code>?</p> <p>I think that posting or linking the full script (or a larger part of it, at least) might help.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/146276/rowbot/" rel="nofollow noreferrer">RowBot</a> on 2023-05-29</strong>:<br /> Apologies for the confusion. It seems that I forgot to run a node that allows the dynamic storage of the target_pose_from_cam in points. As a result, the transform remains constant. Here is the link to the code for my frame transformation: <a href="https://season-cloak-2a7.notion.site/Code-aaa1e37398844affa8007739183ceef4" rel="nofollow noreferrer">Code</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> on 2023-05-31</strong>:<br /> Glad you solved!</p> <p>Maybe you should add the actual problem as an answer, rather than a comment.</p>
How do I convert camera coordinates to world coordinates in Moveit using tf2?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>All positions are measured relative to some reference frame. I believe that the rviz display is showing the position compared to your configured 'world' frame setting. And the position relative to the parent.</p> <p>If you call <code>lookupTransform(parent_link, child_link, Time(0))</code> You're explicitly asking for the transform between <code>parent</code> and <code>child</code>.</p> <p>You wan to use <code>lookupTransform(world_frame, child_link, TIme(0))</code> to get the latest transform from the world frame to the child link which I think is what you're considering non-relative position. You have to pick your reference to be able to do that.</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-05-03</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 3</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on 2023-05-09</strong>:<br /> Got it thanks so much !</p>
103231
2023-05-03T07:20:48.000
|rviz|moveit|transform|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>How to get the position of the tf frame (child frame in rviz) , when I use <code>tf.TransformListener().lookupTransform(parent_link, child_link, rospy.Time())</code> I get the relative position and relative orientation and not position and orientation, how to get the position and orientation using python script?</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16831164177259992.jpg" alt="image description" /></p> <hr /> <p><a href="https://answers.ros.org/question/414962/how-to-get-the-position-of-tf-frame/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on ROS Answers with karma: 39 on 2023-05-03</p> <p>Post score: 2</p>
How to get the position of tf frame
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I believe it should get and validate relevant parameters from the node (<a href="https://github.com/ros-planning/moveit2/blob/humble/moveit_ros/moveit_servo/src/servo_parameters.cpp#L464" rel="nofollow noreferrer">see here</a>). Those <code>get()</code>and <code>validate()</code> methods are defined further up in the file: <a href="https://github.com/ros-planning/moveit2/blob/humble/moveit_ros/moveit_servo/src/servo_parameters.cpp#L267" rel="nofollow noreferrer">here</a> and <a href="https://github.com/ros-planning/moveit2/blob/humble/moveit_ros/moveit_servo/src/servo_parameters.cpp#L354" rel="nofollow noreferrer">here</a>.</p> <p>It seems like the parameter files passed to the node are hard-coded in the pose tracking example launch file <a href="https://github.com/ros-planning/moveit2/blob/humble/moveit_ros/moveit_servo/launch/pose_tracking_example.launch.py#L18" rel="nofollow noreferrer">here</a> but I think those YAML files are what you need to change.</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-05-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/2166/mcevoyandy/" rel="nofollow noreferrer">mcevoyandy</a> on 2023-05-04</strong>:<br /> I have customized those two yamls and use them just fine following along with the other examples (twist and joint cmd ones), but the pose tracking example seems to overwrite my yaml values with the values hard-coded in the struct...</p> <p><strong>Comment by <a href="https://answers.ros.org/users/37963/danzimmerman/" rel="nofollow noreferrer">danzimmerman</a> on 2023-05-04</strong>:<br /> I'll try it out and reproduce if I get a chance. I had a Servo+UR pose tracking setup working on Humble, but now that I think about it, I probably didn't use the <code>PoseTracking</code> class because I wanted to be able to use it with an existing, running Servo node.</p> <p>I think maybe I just followed along to implement similar functionality.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/37963/danzimmerman/" rel="nofollow noreferrer">danzimmerman</a> on 2023-05-06</strong>:<br /> I got the stock pose tracking demo executable working with the UR robots here: <a href="https://github.com/danzimmerman/servo_ur_pose_tracking_demo" rel="nofollow noreferrer">https://github.com/danzimmerman/servo_ur_pose_tracking_demo</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/21281/andyze/" rel="nofollow noreferrer">AndyZe</a> on 2023-05-07</strong>:<br /> Thanks Dan!</p> <p>The pose tracking functionality is likely to change after Humble. A Google Summer of Code project is working on improvements so the PID gains of PoseTracking aren't required. Instead it will work like this:</p> <p>provide target pose --&gt; get IK solution --&gt; move toward that solution as quickly as possible (bounded by vel/accel limits)</p> <p><strong>Comment by <a href="https://answers.ros.org/users/2166/mcevoyandy/" rel="nofollow noreferrer">mcevoyandy</a> on 2023-05-08</strong>:<br /> Thanks Dan, I am still unable to get this working on actual hardware or the docker simulator but I don't have the errors regarding panda parameters anymore...</p> <p><strong>Comment by <a href="https://answers.ros.org/users/37963/danzimmerman/" rel="nofollow noreferrer">danzimmerman</a> on 2023-05-08</strong>:<br /> I was working on adding the UR robot driver launch to try getting the demo executable to work with URSim as an option in addition to fake hardware. However, the pose target update loop <a href="https://github.com/ros-planning/moveit2/blob/humble/moveit_ros/moveit_servo/src/cpp_interface_demo/pose_tracking_demo.cpp#L172" rel="nofollow noreferrer">here</a> doesn't run for very long, so I didn't think I could get External Control running on the &quot;robot&quot; before the demo node terminated.</p> <p>I guess I could skip launching the ROS 2 Control nodes for real hardware/URSim, assuming that the driver, &quot;robot&quot; and ROS2 controller are all already up and running and ready to respond to joint position commands.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/37963/danzimmerman/" rel="nofollow noreferrer">danzimmerman</a> on 2023-05-08</strong>:<br /> Andy M, I updated the repo so that if you pass <code>use_fake_hardware:=false</code> it should work with a robot driver that's already running and connected. Tested with URSim here: <a href="https://youtu.be/qYzdJA60K7w" rel="nofollow noreferrer">https://youtu.be/qYzdJA60K7w</a></p> <p>I loaded <code>forward_position_controller</code> and had the External Control program already running in URSim so when I ran launched the example launch file from my repo, the robot was ready to accept commands from the pose tracker.</p>
103233
2023-05-03T13:38:46.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm trying to follow along with the pose tracking example provided in moveit_servo on a UR10e and am having difficulty in understanding how to use this with an arm other than the panda arm.</p> <p>Looking at the example, <code>moveit_servo::PoseTracking</code> takes a <code>moveit_servo::ServoParameters</code> object as a parameter(<a href="https://github.com/ros-planning/moveit2/blob/humble/moveit_ros/moveit_servo/src/cpp_interface_demo/pose_tracking_demo.cpp#L128" rel="nofollow noreferrer">ref</a>). It seems this object can only be made with <code>moveit_servo::ServoParameters::makeServoParameters</code>(<a href="https://github.com/ros-planning/moveit2/blob/humble/moveit_ros/moveit_servo/include/moveit_servo/servo_parameters.h#L121" rel="nofollow noreferrer">ref</a>) which makes all the parameters constant...</p> <p>So how do I go about using this example with UR10e? Do I need to recompile <code>moveit_servo</code> to change <code>ServoParameters</code>? There are multiple parameters in this struct hardcoded to &quot;panda&quot; and I'd rather not compile from source.</p> <p>Thanks for the help.</p> <hr /> <p><a href="https://answers.ros.org/question/414977/moveit_servo-pose-tracking-only-works-with-panda-arm?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/2166/mcevoyandy/" rel="nofollow noreferrer">mcevoyandy</a> on ROS Answers with karma: 235 on 2023-05-03</p> <p>Post score: 1</p>
moveit_servo pose tracking only works with Panda arm?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>One of the &quot;core&quot; rqt tools, <code>rqt_image_view</code> is mainly C++, then <a href="https://github.com/ros-visualization/rqt_image_view/tree/rolling-devel" rel="nofollow noreferrer">rolling-devel</a> branch seems to be ROS2-tified (interestingly <code>humble-devel</code> branch, likely the branch for the latest released ROS2, still uses Catkin so not fully ROS2 yet).</p> <p><strong>UPDATE</strong> Apparently for <a href="https://index.ros.org/search/?term=rqt_image_view" rel="nofollow noreferrer">some/many ROS2 releases, rqt_image_view has already been released (index.ros.org)</a> so the branch may be of little concern even though some are still using Catkin as the build system at the time of writing). Try <code>humble-devel</code>? If you still see issues you should report at <a href="https://github.com/ros-visualization/rqt_image_view/issues" rel="nofollow noreferrer">the repository</a>.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/875/130s/" rel="nofollow noreferrer">130s</a> with karma: 10937 on 2023-05-10</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/147527/tupinambis/" rel="nofollow noreferrer">Tupinambis</a> on 2023-05-10</strong>:<br /> Thanks, I believe this is just what I was looking for!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/147527/tupinambis/" rel="nofollow noreferrer">Tupinambis</a> on 2023-05-10</strong>:<br /> When running this plugin I get the following log messages:</p> <p>munmap_chunk(): invalid pointer</p> <p>Everything I've found related to this refers to misuse of alloc functions which aren't used anywhere in the plugin codebase. Does anyone have any idea what might be wrong?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/875/130s/" rel="nofollow noreferrer">130s</a> on 2023-05-10</strong>:<br /> @Tupinambis I've updated my post.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/147527/tupinambis/" rel="nofollow noreferrer">Tupinambis</a> on 2023-05-10</strong>:<br /> After starting off from a fresh rolling container that error no longer occurs. I wish I could say what the root cause is, but oh well. Thanks again for your help.</p>
103235
2023-05-03T21:46:40.000
|ros2|c++|rqt|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>So far, I've only found ROS 2 rqt plugins ported over from ROS 1 that were written in Python. The docs (<a href="https://docs.ros.org/en/rolling/Concepts/About-RQt.html" rel="nofollow noreferrer">https://docs.ros.org/en/rolling/Concepts/About-RQt.html</a>) mention writing custom plugins in both Python and C++, and I also see that rqt_gui_cpp exists on the rolling branch of the rqt github repos. I haven't been able to get a C++ rqt plugin build to work correctly without an example to work off of.</p> <hr /> <p><a href="https://answers.ros.org/question/414984/where-can-i-find-an-example-of-a-c++-ros-2-rqt-plugin?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/147527/tupinambis/" rel="nofollow noreferrer">Tupinambis</a> on ROS Answers with karma: 3 on 2023-05-03</p> <p>Post score: 0</p>
Where can I find an example of a C++ ROS 2 rqt plugin?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Ok got it from <a href="https://github.com/gazebosim/ros_gz/issues/365" rel="nofollow noreferrer">https://github.com/gazebosim/ros_gz/issues/365</a></p> <p>I have to <code>export GZ_VERSION=garden</code> before compiling.</p> <pre><code>$ gz topic --info -t /chatter Publishers [Address, Message Type]: tcp://127.0.0.1:39363, gz.msgs.StringMsg </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-05-04</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103237
2023-05-04T03:23:38.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, I have a pb with ros_gz_bridge, I use ROS2-Humble, Gazebo-Garden, get <strong>ros_gz from source</strong>, branche humble and after compilation (and source my env in each shell) in a new workspace I tried exemple from ros_gz_bridge. (changing <em>ignition</em> for <em>gz</em> in commands)</p> <ul> <li>Example 1a: communication gz -&gt; ROS2 =&gt; KO nothing is received in ROS2 topic</li> <li>Example 1b: communication ROS2 -&gt; gz =&gt; OK</li> </ul> <p>I can't understand what's going wrong.</p> <pre><code># shell A $ ros2 run ros_gz_bridge parameter_bridge /chatter@std_msgs/msg/String@gz.msgs.StringMsg [INFO] [1683186627.556779317] [ros_gz_bridge]: Creating GZ-&gt;ROS Bridge: [/chatter (gz.msgs.StringMsg) -&gt; /chatter (std_msgs/msg/String)] (Lazy 0) [INFO] [1683186627.558527086] [ros_gz_bridge]: Creating ROS-&gt;GZ Bridge: [/chatter (std_msgs/msg/String) -&gt; /chatter (gz.msgs.StringMsg)] (Lazy 0) # shell B $ ros2 topic echo /chatter # nothing # shell C $ gz topic -t /chatter -m gz.msgs.StringMsg -p 'data:&quot;Hello&quot;' # shell D (to control msg is really sent) $ gz topic --echo -t /chatter data: &quot;Hello&quot; </code></pre> <p>As far as I understand, it is probably a pb with message type.</p> <pre><code>$ ros2 topic type /chatter std_msgs/msg/String $ gz topic -t /chatter --info Publishers [Address, Message Type]: tcp://192.168.21.112:37511, ignition.msgs.StringMsg </code></pre> <p>This ignition message is suspicious to me.</p> <hr /> <p><a href="https://answers.ros.org/question/414988/communication-gz-%3Eros2-doesn%27t-work,-how-to-debug-?/" 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-05-04</p> <p>Post score: 0</p>
communication gz->ROS2 doesn't work, how to debug?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>We found out that the prohibition areas plugin were consuming too much of our robot, removing them stopped that problem. (Prohibition areas made our Raspberry CPU go to 100%, while without it it wont go past 25%..). Probably sometimes it would freeze and not compute its odometry correctly, therefore thinking that it was seeing a wall when it wasn't.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/146828/grunthorin/" rel="nofollow noreferrer">Grunthorin</a> with karma: 26 on 2023-05-31</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103239
2023-05-04T09:18:58.000
|ros|rviz|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16832095085619778.png" alt="image description" /></p> <p>As seen in the image, the robot is detecting a curved wall in front of it and is stopping the route. However there isn't any wall in that position, just the ones on the sides, as seen on the map. What could it be?</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1683212469517568.png" alt="image description" /></p> <p>Again, there is nothing in front of the robot, but it is seeing a wall</p> <p>I'm also receiving these warnings:</p> <pre><code>[WARN] [1683209662.283217847]: Map update loop missed its desired rat e of 5.0000Hz... the loop actually took 0.2276 seconds. [WARN] [1683209662.457042787]: Control loop missed its desired rate o f 5.0000Hz... the loop actually took 0.2017 seconds. </code></pre> <p>I don't know if it has something to do with it, as I have been receiving this warnings way before this problem.</p> <hr /> <p><a href="https://answers.ros.org/question/415008/local_planner-seeing-invisible-wall/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/146828/grunthorin/" rel="nofollow noreferrer">Grunthorin</a> on ROS Answers with karma: 26 on 2023-05-04</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-05-04</strong>:<br /> Please do not post screenshots of text. Instead, copy/paste the text into the description and format it with the 101010 button.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/146828/grunthorin/" rel="nofollow noreferrer">Grunthorin</a> on 2023-05-04</strong>:<br /> Thanks for the headsup! It's fixed now.</p>
local_planner seeing invisible wall
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>After an extensive investigation involving adjusting various parameters in<strong>nav2_params.yaml</strong> and experimenting with different positions and orientations of the LiDAR sensor, I discovered that the issue was not related to the sensor's range, pose, FOV, or any other related factors.</p> <p>The root of the problem lies in the configuration of the<strong>slam-toolbox</strong> package. For some reason, it was misconfigured and did not work properly with the local costmap and voxel layer.</p> <p>When running a <strong>static</strong> transform publisher (map --&gt; odom):</p> <pre><code>ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 map odom </code></pre> <p>Both local and global costmaps are generated, but the map itself is not produced:</p> <p>image description</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1683323029397796.png" alt="image description" /></p> <p>Adjustments were made to the Voxel map range (width, height), and the raytrace range was increased to better suit the robot's dimensions and the environment's size.</p> <p>However, when running the slam <strong>dynamic</strong> transform (map --&gt; odom) using :</p> <pre><code>ros2 launch slam_toolbox online_sync_launch.py </code></pre> <p>The map and global costmap are generated, but the <strong>local costmap</strong> is not (even for the TurtleBot3 Waffle tutorial example or for my robot):</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16833231523326758.png" alt="image description" /></p> <p>A closer examination of the /tf topic reveals differences between the transforms when using the slam-toolbox async node and the static transform.</p> <ol> <li><p>slam-toolbox async node:</p> <p>transforms:</p> <ul> <li>header: stamp: sec: 47 nanosec: 381000000 frame_id: map child_frame_id: odom transform: translation: x: 3.4662790218048424e-06 y: -2.2171464780663484e-07 z: -0.400019324960254 rotation: x: -2.7712992106286824e-07 y: -4.332639404341957e-06 z: 1.1986118037611005e-12 w: 0.9999999999905756</li> </ul> </li> <li><p>static transform:</p> <hr /> <p>transforms:</p> <ul> <li>header: stamp: sec: 33 nanosec: 92000000 frame_id: odom child_frame_id: base_link transform: translation: x: -0.02042282951343617 y: -0.014272684253787292 z: 0.8999813856701359 rotation: x: 3.8079219550742497e-08 y: 3.443628320324917e-06 z: -0.0021973022911122857 w: 0.9999975859224768</li> </ul> </li> </ol> <p>When using the <strong>static transform,</strong> there is no periodic transform published between the map and odom frames. I suspect that the local costmap plugin might rely on this transform (although I'm not certain), and when using the slam mapping node, the periodic transform between the odom and map frames may interfere or overlap with the static transform, potentially causing conflicts.</p> <p>It's unclear how the <a href="https://github.com/ros-planning/navigation2/blob/galactic/nav2_costmap_2d/plugins/voxel_layer.cpp" rel="nofollow noreferrer">Voxel grid plugin</a> code is integrated with the slam-toolbox and how it affects the local costmap generation. Further investigation into the interplay between these components is needed to pinpoint the exact cause of the issue.</p> <p>In summary, the problem seems to stem from the slam-toolbox configuration and its interaction with the local costmap and voxel layer. A thorough investigation of the relevant components and their interdependencies could potentially reveal the root cause and offer a more permanent solution.</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-05-05</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103242
2023-05-04T17:57:48.000
|ros|2dcostmap|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi I am at this step <a href="https://navigation.ros.org/setup_guides/footprint/setup_footprint.html" rel="nofollow noreferrer">footprint</a> step of tutorial of NAV2. However I am configuring for my specific robot. Given that I have different dimensions, range for lidar and map size, I have configured different values for <a href="https://pastebin.com/8nCnbUdN" rel="nofollow noreferrer">mapping</a> (mapper_params_online_async.yaml) and for the <a href="https://pastebin.com/HbnDw0yA" rel="nofollow noreferrer">costmaps</a> (nav2_params.yaml)</p> <p>1 - I launch my <strong>display.launch</strong> file, Rviz and Gazebo is opened properly with the lidar set correctly (at least in terms of Transform and subscribing /scan messages)</p> <p>2- Secondly I launch the <strong>online_async_launch.py</strong> launch file and get no errors:</p> <pre><code>INFO] [launch]: All log files can be found below /home/rota/.ros/log/2023-05-04-19-40-07-815644-NUC-21912 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [async_slam_toolbox_node-1]: process started with pid [21914] [async_slam_toolbox_node-1] [INFO] [1683240007.920155126] [slam_toolbox]: Node using stack size 40000000 [async_slam_toolbox_node-1] [INFO] [1683240008.344782676] [slam_toolbox]: Using solver plugin solver_plugins::CeresSolver [async_slam_toolbox_node-1] [INFO] [1683240008.345652180] [slam_toolbox]: CeresSolver: Using SCHUR_JACOBI preconditioner. INFO] [launch]: All log files can be found below /home/rota/.ros/log/2023-05-04-19-40-07-815644-NUC-21912 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [async_slam_toolbox_node-1]: process started with pid [21914] [async_slam_toolbox_node-1] [INFO] [1683240007.920155126] [slam_toolbox]: Node using stack size 40000000 [async_slam_toolbox_node-1] [INFO] [1683240008.344782676] [slam_toolbox]: Using solver plugin solver_plugins::CeresSolver [async_slam_toolbox_node-1] [INFO] [1683240008.345652180] [slam_toolbox]: CeresSolver: Using SCHUR_JACOBI preconditioner. [async_slam_toolbox_node-1] Registering sensor: [Custom Described Lidar] [async_slam_toolbox_node-1] Registering sensor: [Custom Described Lidar] </code></pre> <p>3- I launched the <strong>navigation_launch.py</strong> . Unfortunately in this step the error is raised:</p> <p><strong>[planner_server-2] [WARN] [1683239305.550661960] [nav2_costmap_2d]: Robot is out of bounds of the costmap! [controller_server-1] [WARN] [1683239305.598894226] [local_costmap.local_costmap]: Sensor origin at (-4.23, 0.02 3.09) is out of map bounds (25.74, 29.99, 3.86) to (-15.05, -15.05, 0.00). The costmap cannot raytrace for it.</strong></p> <p>I checked that this error raises from the costmap voxel plugin function (rows 318-328) : <a href="https://github.com/ros-planning/navigation2/blob/galactic/nav2_costmap_2d/plugins/voxel_layer.cpp" rel="nofollow noreferrer">voxel_layer.cpp</a></p> <p>I have already changed the following parameters:</p> <ul> <li>Map size</li> <li>Laser Range (from 15 to 100)</li> <li>Global and Local Costmap values (resolution, width, height, origin_x, origin_y, maximum height, etc)</li> </ul> <p>I wonder if this costmap error is raised because my lidar is <strong>pitched to the ground</strong> (<strong>Lidar Orientation, Position)</strong>, so the range in x direction is smaller than at y direction, or is it my Lidar in a too high spot ? over truck's cabin...</p> <p>Gazebo <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16832408257206914.png" alt="image description" /></p> <p>Rviz2</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16832409913385312.png" alt="image description" /></p> <p>As you can check the global costmap is drawed properly and its footprint as well</p> <p>However the <strong>local costmap</strong> is not generated and its respective footprint also not! In this way the path planner won't work well (at least the obstacle avoidance)...since I don't have the local costmap</p> <p>What can be leading to this error?</p> <p>Thanks in advance</p> <hr /> <p><a href="https://answers.ros.org/question/415039/robot-and-sensor-are-out-of-map-bounds-(local-costmap--voxel-layer)/" 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-05-04</p> <p>Post score: 0</p>
Robot and sensor are out of map bounds (Local Costmap- Voxel Layer)
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I believe the way you have multiple hardware interfaces is just to have multiple <code>ros2_control</code> tags like so:</p> <pre><code>&lt;ros2_control name=&quot;SteeringHarware&quot; type=&quot;system&quot;&gt; &lt;hardware&gt; &lt;plugin&gt;steering_hardware/SteeringHardware&lt;/plugin&gt; &lt;/hardware&gt; &lt;joint name=&quot;steering_joint&quot;&gt; &lt;command_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;/joint&gt; &lt;/ros2_control&gt; &lt;ros2_control name=&quot;WingHarware&quot; type=&quot;system&quot;&gt; &lt;hardware&gt; &lt;plugin&gt;wing_hardware/WingHardware&lt;/plugin&gt; &lt;/hardware&gt; &lt;joint name=&quot;wing_joint&quot;&gt; &lt;command_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;/joint&gt; &lt;/ros2_control&gt; </code></pre> <p>This works for me, but if anybody sees an issue with this, please comment.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/145435/guidout/" rel="nofollow noreferrer">guidout</a> with karma: 25 on 2023-05-05</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103244
2023-05-05T07:45:53.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm not sure how to define multiple hardware interfaces and assign the right joints. Does this work?</p> <pre><code>&lt;ros2_control name=&quot;RealRobot&quot; type=&quot;system&quot;&gt; &lt;hardware&gt; &lt;plugin&gt;steering_hardware/SteeringHardware&lt;/plugin&gt; &lt;/hardware&gt; &lt;joint name=&quot;steering_joint&quot;&gt; &lt;command_interface name=&quot;position&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;/joint&gt; &lt;hardware&gt; &lt;plugin&gt;wing_hardware/WingHardware&lt;/plugin&gt; &lt;/hardware&gt; &lt;joint name=&quot;wing_joint&quot;&gt; &lt;command_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;velocity&quot;/&gt; &lt;state_interface name=&quot;position&quot;/&gt; &lt;/joint&gt; &lt;/ros2_control&gt; </code></pre> <p>I'm getting an error when launching the controller manager but I don't know if it's related to this, so I want to make sure this piece is correct at least.</p> <p>Thanks</p> <hr /> <p><a href="https://answers.ros.org/question/415049/how-to-define-multiple-hardware-interfaces-for-ros2-control-in-the-xacro/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/145435/guidout/" rel="nofollow noreferrer">guidout</a> on ROS Answers with karma: 25 on 2023-05-05</p> <p>Post score: 0</p>
How to define multiple hardware interfaces for ros2 control in the xacro
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><code>use_sim_time</code> should typically only be set to <code>true</code> if you are using a simulator/simulation environment, and your ROS nodes interface (ie: get their data, and send their data) with that simulator/simulation environment.</p> <p>There are some situations in which more 'advanced' usage of it could be used to run partial systems on simulated time, but I would suggest to not do that if you're just starting out.</p> <blockquote> <p>Thus, I am wondering if my understanding below is correct? I should only turn on 'use_sim_time' to be true for any code that is not related to any physical hardware, such as GPS, IMU, .. And for those nodes involving interacting with the physical component of the robot, should I set 'use_sim_time' to false?</p> </blockquote> <p>Driver nodes (what you describe as &quot;nodes involving interacting with the physical component of the robot&quot; can typically not be used with simulated hardware (ie: a robot in Gazebo), so they are typically not started in such situations.</p> <p>I've always considered Gazebo sensor and actuator <em>plugins</em> the equivalent of ROS drivers for real hw.</p> <p>So, no, I don't believe what you write is correct.</p> <p>I would suggest the following rule of thumb:</p> <ul> <li>using a simulation? Set <code>use_sim_time</code> to <code>true</code> for all nodes you start</li> <li>otherwise: set <code>use_sim_time</code> to <code>false</code> (or: don't set the parameter at all, as <code>false</code> is the default)</li> </ul> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-05-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/136984/scoeerg/" rel="nofollow noreferrer">scoeerg</a> on 2023-07-26</strong>:<br /> That's all fair, and intuitively correct. But what exactly changes when the flag is toggled? I've had some real Hardware (Sensors) running just fine with <code>use_sim_time</code> <code>True</code> and vice versa some gazebo simulation + Nav2 Nodes running fine with <code>False.</code></p>
103246
2023-05-06T17:28:51.000
|ros|ros2|use-sim-time|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello all,</p> <p>I am currently a little bit confused by when should I set the 'use_sim_time' parameter in my node to be true? Because from looking at the example in some projects, such as Nav2, all their node launch with 'use_sim_time' to be true.</p> <p>But then, when I looked at other projects, such as nmea, and imu_filter, they did not have use_sim_time to be true initially.</p> <p>Thus, I am wondering if my understanding below is correct? I should only turn on 'use_sim_time' to be true for any code that is not related to any physical hardware, such as GPS, IMU, .. And for those nodes involving interacting with the physical component of the robot, should I set 'use_sim_time' to false?</p> <p>I guess my question is, for what kind of node should I set 'use_sim_time' to be false or true?</p> <p>Thanks in advance!</p> <hr /> <p><a href="https://answers.ros.org/question/415092/when-should-you-set-use_sim_time-to-true/" 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-05-06</p> <p>Post score: 0</p>
When should you set use_sim_time to true
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Yes, it will be available in binaries shortly. For now, you don't need to compile all of Nav2 to compile MPPI. You can just compile that one and use the binaries for the rest of Nav2. Its an algorithm plugin so its totally independent from the framework to be compiled separately without an issue.</p> <p>The Humble syncs only happen every so often and I've been a little lacking in releases on Humble the last ~2 months for reasons I'm not able to discuss here. June 2nd is my next scheduled release cutting date, but I may be able to fast forward that a week.</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-05-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/147985/gislers/" rel="nofollow noreferrer">gislers</a> on 2023-05-10</strong>:<br /> Ah yes, thanks a lot! For some reason I assumed that the MPPI controller has tighter dependencies on the rest of nav2. With this, I was able to build now in about 20 minutes using the following command:</p> <pre><code>export MAKEFLAGS=&quot;-j 1&quot; colcon build --packages-select nav2_mppi_controller </code></pre> <p>This will utilize only one core preventing the Raspberry Pi to freeze due to insufficient RAM. Parallelization is also nicely explained in this thread here if anyone runs into similar issues: <a href="https://answers.ros.org/question/368249/colcon-build-number-of-threads/" rel="nofollow noreferrer">#q368249</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2023-05-16</strong>:<br /> Yeah, its quite the package to compile even on a developer machine. Next to Smac Planner, its the second longest run-time package to compile.</p>
103248
2023-05-07T17:08:11.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all</p> <p>I'm working with ROS Humble and I wanted to try and test the new nav2 MPPI controller. I was able to build from source on my dev machine as the code has been backported to the nav2 humble branch here: <a href="https://github.com/ros-planning/navigation2/commit/ff5308f95d805a0a0895fc136323addde027c262" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/commit/ff5308f95d805a0a0895fc136323addde027c262</a></p> <p>My question is if this nav2 MPPI controller package will also be available as binaries from <a href="http://packages.ros.org/ros2/ubuntu/" rel="nofollow noreferrer">http://packages.ros.org/ros2/ubuntu/</a>? I'm confused because on ROS Index the distro humble is listed as supported: <a href="https://index.ros.org/p/nav2_mppi_controller/github-ros-planning-navigation2/#humble-overview" rel="nofollow noreferrer">https://index.ros.org/p/nav2_mppi_controller/github-ros-planning-navigation2/#humble-overview</a></p> <p>The reason I'm asking is the following: My target system is a Raspberry Pi 4 at the moment running nav2. I didn't manage to build directly on the pi because it simply breaks down when trying to build the full nav2. I have a task in the backlog to cross compile for arm64 on my dev machine. However, this is currently not my top priority. So it would really be helpful if arm64 binaries would be available from the official ros2 repository.</p> <p>Thanks for any advice!</p> <hr /> <p><a href="https://answers.ros.org/question/415104/will-binaries-for-nav2-mppi-controller-be-available-in-ros-humble?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/147985/gislers/" rel="nofollow noreferrer">gislers</a> on ROS Answers with karma: 3 on 2023-05-07</p> <p>Post score: 0</p>
Will binaries for nav2 MPPI Controller be available in ROS Humble?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Each callback is getting called with every message published on <code>image_topic</code> after the callback is created, so cam_callback gets all the images and overwrites img1.jpep repeatedly, then a second later cam_callback2 becomes active and starts overwriting img2.jpeg repeatedly, then both callbacks are overwriting the two different files with the same image repeatedly until the node exits.</p> <p>Try putting loginfos in the callbacks to see this more clearly:</p> <pre><code>import rospy from std_msgs.msg import Float32 def callback1(msg): rospy.loginfo(f&quot;callback1: {msg}&quot;) def callback2(msg): rospy.loginfo(f&quot;callback2: {msg}&quot;) rospy.init_node(&quot;dual_callbacks&quot;) rospy.Subscriber(&quot;test&quot;, Float32, callback1) rospy.sleep(3.0) rospy.Subscriber(&quot;test&quot;, Float32, callback2) rospy.sleep(1.0) </code></pre> <p>run that node, then run this one:</p> <pre><code>import rospy from std_msgs.msg import Float32 rospy.init_node(&quot;increment&quot;) pub = rospy.Publisher(&quot;test&quot;, Float32, queue_size=2) rate = rospy.Rate(3.0) value = 0.0 while not rospy.is_shutdown(): pub.publish(Float32(value)) value += 1.0 rate.sleep() </code></pre> <p>and you'll see output like this from the callback node:</p> <pre><code>[I] [1683550340.629]: callback1: data: 11.0 [I] [1683550340.962]: callback1: data: 12.0 [I] [1683550341.295]: callback1: data: 13.0 [I] [1683550341.628]: callback1: data: 14.0 [I] [1683550341.629]: callback2: data: 14.0 [I] [1683550341.961]: callback1: data: 15.0 [I] [1683550341.962]: callback2: data: 15.0 [I] [1683550342.294]: callback1: data: 16.0 [I] [1683550342.295]: callback2: data: 16.0 </code></pre> <p>If the callbacks were unregistered or ignored later messages after receiving a message the first time you would get the desired effect:</p> <pre><code>import rospy from std_msgs.msg import Float32 def callback1(msg): rospy.loginfo(f&quot;callback1: {msg}&quot;) sub1.unregister() def callback2(msg): rospy.loginfo(f&quot;callback2: {msg}&quot;) sub2.unregister() rospy.init_node(&quot;dual_callbacks&quot;) sub1 = rospy.Subscriber(&quot;test&quot;, Float32, callback1) rospy.sleep(3.0) sub2 = rospy.Subscriber(&quot;test&quot;, Float32, callback2) rospy.sleep(1.0) </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/120/lucasw/" rel="nofollow noreferrer">lucasw</a> with karma: 8729 on 2023-05-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/148054/furki/" rel="nofollow noreferrer">Furki</a> on 2023-05-08</strong>:<br /> Thank you :)</p>
103250
2023-05-08T02:20:48.000
|ros|rospy|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, I am trying to read two consecutive images from my rostopic using rospy.Subscriber to compare the orientation between these pictures but using the code below, I found out two images I get are the same every time so I am trying to find out if there is a way to get the two images with delay, more specifically, getting the second image 3 seconds after I get the first image. I tried putting time.sleep() between functions but it wouldn't work out.</p> <pre><code>import cv2 import numpy as np import rospy import time import os from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError def cam_callback(msg): path = '/home/furki/img' try: # Converting ROS Image message to OpenCV2 cv2_img1 = bridge1.imgmsg_to_cv2(msg,&quot;bgr8&quot;) except CvBridgeError as e: print(e) else: # Save your OpenCV2 image as a jpeg img1 = cv2.imwrite(os.path.join(path, f'img1.jpeg'), cv2_img1) def cam_callback2(msg): path = '/home/furki/img' try: # Converting ROS Image message to OpenCV2 cv2_img2 = bridge.imgmsg_to_cv2(msg,&quot;bgr8&quot;) except CvBridgeError as e: print(e) else: # Save your OpenCV2 image as a jpeg img2 = cv2.imwrite(os.path.join(path, f'img2.jpeg'), cv2_img2) rospy.init_node(&quot;orientation_feature_detection_py&quot;) image_topic = '/s500/usb_cam/image_raw' rate = rospy.Rate(1) rospy.Subscriber(image_topic, Image, cam_callback) rate.sleep() rospy.Subscriber(image_topic, Image, cam_callback2) rate.sleep() # Reading the two images img1 = cv2.imread('/home/furki/img/img1.jpeg') img2 = cv2.imread('/home/furki/img/img2.jpeg') </code></pre> <hr /> <p><a href="https://answers.ros.org/question/415117/how-to-get-consecutive-images-with-3-seconds-delay/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/148054/furki/" rel="nofollow noreferrer">Furki</a> on ROS Answers with karma: 3 on 2023-05-08</p> <p>Post score: 0</p>
How to get consecutive images with 3 seconds delay
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Nevermind, was able to fix the problem with the bugfix from <a href="https://github.com/ros-drivers/joystick_drivers/pull/232" rel="nofollow noreferrer">https://github.com/ros-drivers/joystick_drivers/pull/232</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/148069/lisa313/" rel="nofollow noreferrer">lisa313</a> with karma: 16 on 2023-05-09</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-09</strong>:<br /> I'm glad you figured it out. Please use this as an answer , and then click the checkmark inside the gray circle.</p>
103252
2023-05-08T08:36:16.000
|ros|ros2|ros-kinetic|joy-node|joy|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, I'm currently working on a project that requires the use of multiple joystick-like devices. I can find them with</p> <pre><code>ros2 run joy joy_enumerate_devices </code></pre> <p>that returns</p> <pre><code>Joystick Device ID : Joystick Device Name 0 : Logitech G29 Driving Force Racing Wheel 1 : Logitech Logitech Flight Quadrant </code></pre> <p>The problem is, that joy_node just finds the device with ID 0. If i set the parameter &quot;device_id&quot; to 1, the node starts running but returns no &quot;Opened Joystick...&quot; Message. If I set the parameter &quot;device_name&quot; to 'Logitech Logitech Flight Quadrant' the result is the same. Any other names like /device/input/js1 result in the error</p> <pre><code>Could not get joystick with name /dev/input/js1: Haptic: Unable to get device's features: Invalid argument </code></pre> <p>I'm pretty sure it's not an access right issue with the usb ports, becauce if I plug out the Racing Wheel (ID 0), the second device is found as expected.</p> <p>I hope you can tell me how to get the second device when the other one is plugged in. Thank you!</p> <hr /> <p><a href="https://answers.ros.org/question/415126/how-to-get-second-joystick-with-joy_node?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/148069/lisa313/" rel="nofollow noreferrer">lisa313</a> on ROS Answers with karma: 16 on 2023-05-08</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-08</strong>:<br /> After you use the <code>device_id</code> parameter, how many joy_nodes do you see running? Did you assign a different ros node name to the 2nd instance of joy_node?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/148069/lisa313/" rel="nofollow noreferrer">lisa313</a> on 2023-05-09</strong>:<br /> Yes i assigned a different ros node. But the problem appears also with just one node. It can't get any device with device id not 0.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-09</strong>:<br /> Which release of ros2 are you using? Which version of the joy package? Are you using apt repository or building the package yourself? Also, please show us the exact command line you are using to start the node.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/160601/indy_03/" rel="nofollow noreferrer">Indy_03</a> on 2023-07-10</strong>:<br /> I am new to ROS here with the same issue. How does the fix exactly work? Do I need to change the source code of Joy_node??</p>
How to get second joystick with joy_node?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It is not necessary to store a reference to a Subscriber (but you can!). It will keep working even after that the <code>__init__</code> has been completed (of course as long as an instance of <code>SomeClass</code> is defined and the node is running).</p> <p>As for the Publisher, in general, yes you should store a reference to it. In this way, you can publish also from outside the function in which you have defined it.</p> <p>I hope that this example can help you:</p> <pre><code>class SomeClass: def __init__(self): # Defined Subscriber without reference rospy.Subscriber(&quot;/some/topic1&quot;, SomeMessageType, self.some_topic1_callback) # Defined Publisher with reference self.my_pub = rospy.Publisher(&quot;/some/topic2&quot;, SomeMessageType, queue_size=1) def some_topic1_callback(self, msg): # Do something with your message new_msg = self.great_function_doing_stuff(msg) # Publish the result self.my_pub.publish(new_msg) </code></pre> <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-05-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
103254
2023-05-10T03:54:59.000
|ros|rospy|publisher|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Do I need to store a reference to rospy subscribers and publishers to avoid these objects to be garbage collected?</p> <pre><code>class SomeClass: def __init__(self): # option 1, without reference rospy.Subscriber(&quot;/some/topic1&quot;, SomeMessageType, self.some_topic1_callback) # option 2, with reference self.my_subscriber = rospy.Subscriber(&quot;/some/topic2&quot;, SomeMessageType, self.some_topic2_callback) </code></pre> <hr /> <p><a href="https://answers.ros.org/question/415196/rospy-and-subscriber/publisher-garbage-collection/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/29756/knxa/" rel="nofollow noreferrer">knxa</a> on ROS Answers with karma: 811 on 2023-05-10</p> <p>Post score: 0</p>
rospy and Subscriber/Publisher garbage collection
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You should look into a move_group feature called &quot;orientation constraint&quot;. The idea is that you add restrictions on the pose of a specific arm link relative to some frame.</p> <p>This feature performs these extra checks on the solution proposed by the OMPL planner, and it rejects solutions which are not compatible. I have not tried to use this feature myself, but comments on this website say you may have to increase the amount of time allowed for planning for it to find a workable solution.</p> <p>I believe you will specify your constraint using a <code>moveit_msgs::OrientationConstraint</code> object.</p> <p>Update: I found <a href="https://moveit.ros.org/moveit/2020/09/10/ompl-constrained-planning-gsoc.html" rel="nofollow noreferrer">https://moveit.ros.org/moveit/2020/09/10/ompl-constrained-planning-gsoc.html</a> which looks like an improved implementation of certain OMPL planners. I don't know if this improvement has been merged to any ros release.</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-05-13</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/45833/omeranar1/" rel="nofollow noreferrer">omeranar1</a> on 2023-05-16</strong>:<br /> thank you so much, problem has been solved</p>
103256
2023-05-11T01:33:32.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 trying to make a pick and place application.<br> My goal is to move 4 boxes from one point to another.<br> while doing this I saw the boxes turn upside down and the arm carries the boxes with longer movements, sometimes it follows a nice path but sometimes it draws a longer path and turns the boxes upside down.<br> If I want to carry a tray, the glasses on the tray will spill.<br> <br> Although I made the first joint and the last joint continuous, it was not solved, so I saw that the problem was not in the limit angles.<br></p> <p>Here is a video explaining the situation.</p> <p><a href="https://streamable.com/05xts3" rel="nofollow noreferrer">Video (38sec)</a></p> <hr /> <p><a href="https://answers.ros.org/question/415234/pick-and-place-prevent-box-flip/" 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-05-11</p> <p>Post score: 0</p>
pick and place prevent box flip
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>No, what you propose will not work. rviz has no way to decode a video stream, and it has no way to analyze video to turn it into a map.</p> <p>The algorithms to create a 2D map from data are called &quot;SLAM&quot;, in particular &quot;Visual SLAM&quot; if the input data is camera images. There are many existing SLAM implementations for you to chose from. Start with a web search.</p> <p>Be aware that nearly all of these implementations want the robot to frequently report its estimated position (&quot;odometry&quot;), so you're going to need a way to obtain that data.</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-05-12</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/148543/lakofe8746/" rel="nofollow noreferrer">lakofe8746</a> on 2023-05-17</strong>:<br /> Thank you for your response, since I'm a newbie, I really need some guidance here. I have another question. As far as I understand, ROS consists of modules. I mentioned that we will transfer video to another computer with Raspberry Pi, which ROS module would be sufficient for this? Would ros-noetic-rosbridge-server is enough for that task? We will install the module containing RViz on the other computer.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-18</strong>:\</p> <blockquote> <p>we will transfer video to another computer</p> </blockquote> <p>There is no standard ros package I know of that provides a <strong>good</strong> way to transfer video. Nearly everyone creates their own video solution using non-ros apps like gstreamer.</p> <blockquote> <p>Would ros-noetic-rosbridge-server is enough for that task?</p> </blockquote> <p>You are aware that every ros package has a wiki page on wiki.ros.org that describes it in detail, right? Do a web search and append <code>site:ros.org</code> after your search terms. That said, I believe <code>rosbridge</code> relies on json: that's not going to handle large binary messages very efficiently.</p>
103258
2023-05-11T19:30:45.000
|rviz|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>For our term project, we need to make a robot that can map the places it travels. We are thinking of using Rviz for this, but we want to install ROS on the computer to which the robot will be connected, not on the Raspberry Pi on the robot. If we broadcast with ffmpeg from the robot camera, can we listen to this broadcast with Rviz and create the map? How possible is this?</p> <hr /> <p><a href="https://answers.ros.org/question/415264/is-it-possible-to-connect-to-a-video-stream-with-rviz?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/148543/lakofe8746/" rel="nofollow noreferrer">lakofe8746</a> on ROS Answers with karma: 3 on 2023-05-11</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/875/130s/" rel="nofollow noreferrer">130s</a> on 2023-05-17</strong>:<br /> Potentially a duplicate of <a href="https://answers.ros.org/question/66988/rviz-video-recording/" rel="nofollow noreferrer">https://answers.ros.org/question/66988/rviz-video-recording/</a> where there are multiple answers posted?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/148543/lakofe8746/" rel="nofollow noreferrer">lakofe8746</a> on 2023-05-17</strong>:<br /> I don't think this question is a duplicate. There are answers about screen recording and I asked about video streaming.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/875/130s/" rel="nofollow noreferrer">130s</a> on 2023-05-17</strong>:<br /> My bad, I took your question wrong.</p>
Is it possible to connect to a video stream with Rviz?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>No, it won't. You'll just end up dropping messages at the subscriber.</p> <p>If you write another subscriber which runs at a faster rate, it'll receive most/all messages (depending on ROS1/ROS2, and QoS settings)</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-05-13</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
103260
2023-05-12T10:12:25.000
|ros-kinetic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>If the publisher rate is set higher than the subscriber rate, will the message rate of the publisher slow down to match the subscriber rate?</p> <hr /> <p><a href="https://answers.ros.org/question/415300/publish-rate-higher-than-subscriber-rate/" 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-05-12</p> <p>Post score: 0</p>
Publish rate higher than subscriber rate
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It's possible/likely the &quot;dummy links&quot; you've seen were included to avoid the well known</p> <blockquote> <p>The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.</p> </blockquote> <p>See #q192817 for an example (but there are many more).</p> <p>This is printed by <a href="https://github.com/ros/kdl_parser/blob/74d4ee3bc6938de8ae40a700997baef06114ea1b/kdl_parser_py/kdl_parser_py/urdf.py#L106-L128" rel="nofollow noreferrer">treeFromUrdfModel(..)</a> in <code>kdl_parser_py/kdl_parser_py/urdf.py</code>:</p> <blockquote> <pre><code>def treeFromUrdfModel(robot_model, quiet=False): </code></pre> </blockquote> <pre><code> &quot;&quot;&quot; Construct a PyKDL.Tree from an URDF model from urdf_parser_python. </code></pre> <blockquote> </blockquote> <pre><code> :param robot_model: URDF xml string, ``str`` :param quiet: If true suppress messages to stdout, ``bool`` &quot;&quot;&quot; </code></pre> <blockquote> </blockquote> <pre><code> root = robot_model.link_map[robot_model.get_root()] </code></pre> <blockquote> </blockquote> <pre><code> if root.inertial and not quiet: print(&quot;The root link %s has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.&quot; % root.name); ... </code></pre> <p>As you can see, the warning suggests to add a &quot;dummy link&quot; (with an identity transform between it and the actual root of your urdf), which you would use to specify dynamics properties (such as the inertia).</p> <p>But we can't really know for sure, as such a &quot;dummy link&quot; is not standard practice necessarily. Anyone is free to use the name for whatever they want/need, so it could be the dummy links you've seen are used for something else entirely.</p> <p>And note:</p> <blockquote> <p>I've seen that often URDF models have a dummy link (almost always called base_link) [..]</p> </blockquote> <p><code>base_link</code> would <em>not</em> be the dummy link here. <code>base_link</code> would be the root of the URDF's kinematic chain/tree. The dummy would be either <em>before</em> or <em>after</em> <code>base_link</code> in the tree.</p> <hr /> <p>Edit:</p> <blockquote> <p>OK, so in general:</p> <ul> <li>the <em>dummy link</em> is to avoid the warning (or for other purposes)</li> <li>the <em>base_link</em> is the first link of the robot chain/tree (hence the name &quot;base&quot;)</li> </ul> </blockquote> <p>Yes, that seems to be correct.</p> <p>Although again: that's just one possible use of a &quot;dummy link&quot;.</p> <blockquote> <p>I'm building a mobile robot (simple car-like stuff with a caster wheel), and of course if I don't include the first &quot;empty&quot; link I get the warning you've mentioned, since the chassis (first link) has inertia. So then I've introduced a <em>base_link</em> and a fixed joint between that and the chassis to get rid of the warning.</p> <p><strong>Doesn't this make the two purposes mix?</strong> I've kinda introduced a dummy base, in a sense, right?</p> </blockquote> <p>Whenever I wanted to get rid of the warning (<em>wanted</em>, as depending on what you use a KDL URDF parser for, it doesn't really always affect anything important), I've used the following structure:</p> <pre><code>base_link └ some_dummy_link └ &lt;rest of my tree/chain&gt; </code></pre> <p>With an identity transform, <code>fixed</code> <code>joint</code> between <code>base_link</code> and <code>some_dummy_link</code> and the dynamics properties specified on <code>some_dummy_link</code>.</p> <p>This keeps <code>base_link</code> the root of the tree, avoids the KDL-related warning, and keeps the tree relatively 'clean'.</p> <blockquote> <p>I've kinda introduced a dummy base, in a sense, right?</p> </blockquote> <p>not if you do it as I show above.</p> <blockquote> <p>I'm building a mobile robot</p> </blockquote> <p>note that in the case of a mobile base, you'd typically also want to add a <code>base_footprint</code> <code>link</code> (#q208051). This is also mentioned <a href="https://automaticaddison.com/coordinate-frames-and-transforms-for-ros-based-mobile-robots/" rel="nofollow noreferrer">here</a>, which also comments on some other frames. Another good overview would be <a href="http://wiki.ros.org/hector_slam/Tutorials/SettingUpForYourRobot" rel="nofollow noreferrer">wiki/hector_slam/Tutorials/SettingUpForYourRobot</a>.</p> <blockquote> <p>Then I also have the problem that my robot is not moving, but if I'm getting this correctly it might be because I've used a fixed joint (floating are not supported, it seems).... But I guess that's for another topic!</p> </blockquote> <p>I'd recommend reviewing documents like <a href="https://www.ros.org/reps/rep-0105.html" rel="nofollow noreferrer">REP 105: Coordinate Frames for Mobile Platforms</a> and some of the links I've included above. There's a well-defined hierarchy of frames for mobile bases, and getting that in place should make things 'easier' to get to work.</p> <p>But depending on what UI you're looking at, please keep in mind #q382149 (ie: in tools like RViz, 'motion' is purely virtual. There is no ground, or floor, nor is there anything simulated. It's all just visualisation. So 'motion' depends on incrementally increasing the distance to some fixed reference point. If that point isn't configured correctly, &quot;nothing moves&quot;. But it's all just transforms, and there is no real motion).</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-05-13</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/145981/slim71/" rel="nofollow noreferrer">slim71</a> on 2023-05-13</strong>:<br /> OK, so in general:</p> <ul> <li>the <em>dummy link</em> is to avoid the warning (or for other purposes)</li> <li>the <em>base_link</em> is the first link of the robot chain/tree (hence the name &quot;base&quot;)</li> </ul> <p>But then this comes to mind: I'm building a mobile robot (simple car-like stuff with a caster wheel), and of course if I don't include the first &quot;empty&quot; link I get the warning you've mentioned, since the chassis (first link) has inertia. So then I've introduced a <em>base_link</em> and a fixed joint between that and the chassis to get rid of the warning.</p> <p><strong>Doesn't this make the two purposes mix?</strong> I've kinda introduced a dummy base, in a sense, right?</p> <p>Then I also have the problem that my robot is not moving, but if I'm getting this correctly it might be because I've used a fixed joint (floating are not supported, it seems).... But I guess that's for another topic!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/145981/slim71/" rel="nofollow noreferrer">slim71</a> on 2023-05-13</strong>:<br /> Airght, I've reviewed what you linked in your edit and it is clearer to me now. Now then, I only have to figure out why the robot isn't moving in Fortress even if messages seem to be bridged correctly...</p> <p>Thank you very much for the details and the useful links!!</p> <p><strong>Comment by <a href="https://answers.ros.org/users/145981/slim71/" rel="nofollow noreferrer">slim71</a> on 2023-05-13</strong>:<br /> it wasn't the main topic here, but in case someone needing this comes here:</p> <p>I've found out that the <strong>diff_drive plugin wasn't being included</strong> in the SDF during the <em>xacro-&gt;URDF-&gt;SDF</em> conversion (I've checked doing it manually). In the end, that was because the <code>plugin</code> tag wasn't inside a <code>gazebo</code> tag with no &quot;reference&quot;!</p>
103262
2023-05-12T13:02:18.000
|ros2|urdf|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I'm trying to learn as bet as possible ROS2, Gazebo and of course SDF and URDF files. I'm currently following some tutorials (a bit troublesome, given the different version of Gazebo/Ignition and the confusion about the name) on how to build robot models.</p> <p>I've seen that often <strong>URDF</strong> models have a <em><strong>dummy link</strong></em> (almost always called <em>base_link</em>) which is empty and does nothing more than provide a &quot;mounting point&quot; of the robot to the world/ground, so to speak.</p> <p>I'm failing to understand when and why this is needed, and I think this is giving me issues for the test model I'm building. Could someone please let me in on this?</p> <p>Thanks! :D</p> <p>EDIT: an example of what I'm referencing:</p> <pre><code>&lt;link name=&quot;dummy&quot;/&gt; &lt;joint name=&quot;dummy_to_base_link=&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;dummy&quot;/&gt; &lt;child link=&quot;base_link&quot;/&gt; &lt; /joint&gt; </code></pre> <hr /> <p><a href="https://answers.ros.org/question/415304/%5Burdf%5D-what-is-a-dummy-link-needed-for?/" 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-05-12</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-03</strong>:<br /> This seems to be a cross-post of <a href="https://www.reddit.com/r/ROS/comments/13fv0h0/dummy_link_in_urdf/" rel="nofollow noreferrer">Dummy link in URDF</a> on Reddit.</p>
[URDF] What is a dummy link needed for?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>will ros2 be available soon on ubuntu 23</p> </blockquote> <p>Both Rolling and Iron Irwini <a href="https://www.ros.org/reps/rep-2000.html#iron-irwini-may-2023-november-2024" rel="nofollow noreferrer">only support Ubuntu Jammy</a>.</p> <p>I'm not aware of any ROS 2 release which has plans to support Ubuntu <code>23.x</code>.</p> <blockquote> <p>is it worth to install still 22?</p> </blockquote> <p>Ubuntu Jammy is an LTS release. According to <a href="https://ubuntu.com/about/release-cycle" rel="nofollow noreferrer">The Ubuntu lifecycle and release cadence</a>, it will be supported until (at least) 2032. That's about 9 years from now.</p> <p>We can't know your requirements, but at least from the perspective of &quot;would Ubuntu 22 be supported long enough?&quot;, I'd say, <em>yes</em>.</p> <p>ROS 2 Humble (first ROS 2 release to support Jammy) is also LTS, and <a href="https://www.ros.org/reps/rep-2000.html#humble-hawksbill-may-2022-may-2027" rel="nofollow noreferrer">will be supported until 2027</a>.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-05-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/148730/drunkenrobot/" rel="nofollow noreferrer">DrunkenRobot</a> on 2023-05-13</strong>:<br /> Thank you for the feedback. I have no special reason, i just did a new setup for a ros development machine and picked the latest version ... not realizing that ros is bound to a distro (more or less)</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-05-13</strong>:\</p> <blockquote> <p>not realizing that ros is bound to a distro (more or less)</p> </blockquote> <p>well .. in general that's only really true if you want to be able to install binary packages.</p> <p>YMMV, but I've had good success building ROS on all sorts of Linux distributions -- provided the base dependencies are available.</p>
103264
2023-05-13T04:04:24.000
|ros2|ubuntu|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, will ros2 be available soon on ubuntu 23 or is it worth to install still 22?</p> <p>I am currently trying with ubuntu 23 and ros2 rolling, but get issues with</p> <p>command:</p> <pre><code>rosdep install --from-paths src --ignore-src -y --skip-keys &quot;fastcdr rti-connext-dds-6.0.1 urdfdom_headers&quot; --os=ubuntu:jammy </code></pre> <p>-&gt;</p> <pre><code>ERROR: the following rosdeps failed to install apt: command [sudo -H apt-get install -y python3-catkin-pkg-modules] failed </code></pre> <p>Thank you D</p> <hr /> <p><a href="https://answers.ros.org/question/415326/ros2-ubuntu-23/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/148730/drunkenrobot/" rel="nofollow noreferrer">DrunkenRobot</a> on ROS Answers with karma: 13 on 2023-05-13</p> <p>Post score: 1</p>
ROS Answers SE migration: ros2 ubuntu 23
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Solved it. The include should be</p> <pre><code>#include &quot;std_msgs/msg/float32.hpp&quot; </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/123880/alna_perera/" rel="nofollow noreferrer">ALNA_Perera</a> with karma: 33 on 2023-05-15</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103266
2023-05-15T21:38:46.000
|ros|ros2|std-msgs|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I am relatively new to trying to do anything with c++ in ros, so I'm sorry if this is a stupid question.</p> <p>I am trying to get AMCL to publish max weight. The plan is to publish it to a float 32 message for now when it's publishing amcl_pose, as amcl_pose checks for the particle with the maximum weight anyway. To do that, I need a float 32 message working, which is where I'm stuck. Error message:</p> <pre><code>Starting &gt;&gt;&gt; nav2_amcl_1 --- stderr: nav2_amcl_1 /home/_/Projects/nav2_amcl_1/src/amcl_node.cpp:45:10: fatal error: std_msgs/Float32.h: No such file or directory 45 | #include &lt;std_msgs/Float32.h&gt; | ^~~~~~~~~~~~~~~~~~~~ compilation terminated. gmake[2]: *** [CMakeFiles/amcl_1_core.dir/build.make:76: CMakeFiles/amcl_1_core.dir/src/amcl_node.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:241: CMakeFiles/amcl_1_core.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2 --- Failed &lt;&lt;&lt; nav2_amcl_1 [0.42s, exited with code 2] Summary: 0 packages finished [0.62s] 1 package failed: nav2_amcl_1 1 package had stderr output: nav2_amcl_1 </code></pre> <p>I have added std_msgs as a dependancy to CMakeLists.txt, and I have added it to amcl_node.hpp as well, but nothing seems to solve the problem.</p> <p>Thank you in advance.</p> <hr /> <p><a href="https://answers.ros.org/question/415420/std_msgs/float32.h-not-found/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/123880/alna_perera/" rel="nofollow noreferrer">ALNA_Perera</a> on ROS Answers with karma: 33 on 2023-05-15</p> <p>Post score: 0</p>
std_msgs/Float32.h not found
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Solved by uninstalling ros2 humble completely and reinstalled, now the problem solved. First time maybe ros2 humble not installed properly.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/65370/vignesht.tech/" rel="nofollow noreferrer">Vignesht.tech</a> with karma: 16 on 2023-05-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103268
2023-05-16T01:51:29.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In ubuntu 22, in ros2 humble, i am building RMF from sources, when i ran colcon build i got the error from rmf_fleet_msgs package Unknown CMake command 'get_executable_path'</p> <hr /> <p><a href="https://answers.ros.org/question/415427/unknown-cmake-command-%27get_executable_path%27/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/65370/vignesht.tech/" rel="nofollow noreferrer">Vignesht.tech</a> on ROS Answers with karma: 16 on 2023-05-16</p> <p>Post score: 0</p>
Unknown CMake command 'get_executable_path'
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>would it be possible to use that as an input to the robot's navigation algorithm?</p> </blockquote> <p>Yes, using global localization as a component of navigation is very common. You will either use the value directly (if it is frequent enough), or you use it to fine-tune the robot's odometry data when it becomes available. if your robot's transform tree looks like this:</p> <p><code>map -&gt; odom -&gt; base_link</code></p> <p>then you use the new data to calculate a new <code>map-&gt;odom</code> transform. You ask specifically about &quot;SLAM Navigation&quot;: what I describe here is relevant only to the &quot;Localization&quot; portion of SLAM.</p> <p>Update: What you describe is 99% not a &quot;nav2&quot; problem, it's a image processing problem. You need to find an object within an image, and estimate the location of the object relative to the camera lens. There is not a standard ros package that does this for you (because the simplifying assumptions are different for each environment.) A web search should give you a large number of hits of other people doing this, but make sure you understand what assumptions they made.</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-05-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/79961/theodoro-cardoso/" rel="nofollow noreferrer">Theodoro Cardoso</a> on 2023-05-16</strong>:<br /> Sounds good!</p> <p>Are there any specific packages (e.g. 'robot_localization') or other resources/tutorials that come to mind when we talk about using global localization in concert with nav2?</p> <p>If it helps to narrow it down, the application consists of an indoor environment (mapped in advance) with dynamic obstacles like people and boxes and multiple outboard cameras that see the robot when it's not occluded.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-18</strong>:\</p> <blockquote> <p>the application consists of an indoor environment (mapped in advance)</p> </blockquote> <p>Let's review: you put &quot;SLAM&quot; in the question when you're not doing SLAM, and you included an outdoor image in your question when the application is indoor. Got it.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/79961/theodoro-cardoso/" rel="nofollow noreferrer">Theodoro Cardoso</a> on 2023-05-18</strong>:<br /> Well, I'm sure I could have done a better job explaining it and I apologize for the lack of clarity.</p> <p>I believed that updating the base map with obstacles would turn the localization-only problem into SLAM but that's apparently not the case.</p> <p>The point of this loosely formulated question was to get a better understanding of how to use sensors that are not in the robot to aid navigation results, hopefully getting a hint on where to start (packages, repositories, or any helpful material on the topic)</p>
103270
2023-05-16T05:13:09.000
|ros|slam|navigation|ros2|sensor-fusion|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone!</p> <p>If this question has been asked somewhere else, please point me there.</p> <p>Consider the following challenge: onboard navigation is not accurate enough. We'd like to enhance it using outboard cameras (fixed in the environment)</p> <p>Given the external camera transform to a global frame is known and we can estimate with some variance the transform from the camera to the robot, would it be possible to use that as an input to the robot's navigation algorithm?</p> <p>For illustration purposes, let's imagine the image below was obtained by the external camera and we're interested in navigating a single robot...</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1684230894930740.png" alt="aruco_robots" /></p> <p>How one would go about integrating that on nav2? Any hints or resources would be appreciated.</p> <hr /> <p><a href="https://answers.ros.org/question/415436/external-camera-as-slam-sensor/input-for-navigation/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/79961/theodoro-cardoso/" rel="nofollow noreferrer">Theodoro Cardoso</a> on ROS Answers with karma: 20 on 2023-05-16</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-05-16</strong>:\</p> <ol> <li>Do you understand how the Transform Tree is used to keep track of the pose of a robot?</li> <li>Are you familiar with how odometry drift-correction is implemented (for example, by AMCL)?</li> </ol> <p><strong>Comment by <a href="https://answers.ros.org/users/79961/theodoro-cardoso/" rel="nofollow noreferrer">Theodoro Cardoso</a> on 2023-05-16</strong>:<br /> Mike, thanks for your comment.</p> <ol> <li><p>My understanding is that you can find the robot's pose in any arbitrary frame given there's a connection between them in the Transform Tree.</p> </li> <li><p>I'm familiar with the motion, sensing, and resampling loop on the MCL algorithm, but not how it is implemented in ROS.</p> </li> </ol>
External camera as SLAM sensor/input for navigation
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all,</p> <p>As an update I managed to solve the problem. I've added a custom command in the CMake to copy the dll to the correct location after building and this seems to have corrected the process. The modified section of the CMake is updated below.</p> <pre><code>FIND_LIBRARY(ETHERNET_LIBRARY NAMES EthernetScanner PATHS ${CMAKE_CURRENT_SOURCE_DIR}/lib) add_custom_command(TARGET sensoor_node POST_BUILD COMMAND <span class="math-container">${CMAKE_COMMAND} -E copy $</span>{CMAKE_CURRENT_SOURCE_DIR}/lib/EthernetScanner.dll <span class="math-container">${CMAKE_INSTALL_PREFIX}/lib/$</span>{PROJECT_NAME}/EthernetScanner.dll) target_link_libraries(sensor_node ${ETHERNET_LIBRARY}) </code></pre> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/149306/lawsey/" rel="nofollow noreferrer">Lawsey</a> with karma: 26 on 2023-05-17</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103272
2023-05-16T08:56:02.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all,</p> <p>I am trying to build a ROS wrapper on a Windows 11 install of ROS2-foxy for some laser profilometry sensors from Wenglor. These sensors come with an array of libraries linked <a href="https://www.wenglor.com/medias/__secure__?mediaPK=9060281450526&amp;attachment=true" rel="nofollow noreferrer">here</a> for both linux and windows.</p> <p>The key library files are:</p> <ul> <li>EthernetScanner.dll</li> <li>EthernetScanner.lib</li> <li>EthernetScannerSDK.h</li> <li>EthernetScannerSDKDefine.h</li> </ul> <p>My sensor pkg contains the library files in a lib/ folder and the sensor_node.cpp in a src/ folder. The CMakeList and package are naturally in the root of the sensor folder.</p> <p>The package.xml is as follows:</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;?xml-model href=&quot;http://download.ros.org/schema/package_format3.xsd&quot; schematypens=&quot;http://www.w3.org/2001/XMLSchema&quot;?&gt; &lt;package format=&quot;3&quot;&gt; &lt;name&gt;sensor&lt;/name&gt; &lt;version&gt;0.0.0&lt;/version&gt; &lt;description&gt;TODO: Package description&lt;/description&gt; &lt;maintainer email=&quot;XYZ.com&quot;&gt;XYZ&lt;/maintainer&gt; &lt;license&gt;TODO: License declaration&lt;/license&gt; &lt;buildtool_depend&gt;ament_cmake&lt;/buildtool_depend&gt; &lt;depend&gt;gaf_msgs&lt;/depend&gt; &lt;test_depend&gt;ament_lint_auto&lt;/test_depend&gt; &lt;test_depend&gt;ament_lint_common&lt;/test_depend&gt; &lt;export&gt; &lt;build_type&gt;ament_cmake&lt;/build_type&gt; &lt;/export&gt; &lt;/package&gt; </code></pre> <p>And the CMakeList is as follows:</p> <pre><code>cmake_minimum_required(VERSION 3.5) project(sensor) # Default to C99 if(NOT CMAKE_C_STANDARD) set(CMAKE_C_STANDARD 99) endif() # Default to C++14 if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 14) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES &quot;Clang&quot;) add_compile_options(-Wall -Wextra -Wpedantic) endif() # find dependencies find_package(ament_cmake REQUIRED) find_package(gaf_msgs REQUIRED) find_package(rclcpp REQUIRED) find_package(rosidl_default_generators REQUIRED) add_executable(sensor_node src/sensor_node.cpp) ament_target_dependencies(sensor_node rclcpp gaf_msgs) target_include_directories(sensor_node PUBLIC <span class="math-container">$&lt;BUILD_INTERFACE:$</span>{CMAKE_CURRENT_SOURCE_DIR}/include&gt; <span class="math-container">$&lt;INSTALL_INTERFACE:include&gt; $</span>&lt;BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib&gt;) FIND_LIBRARY(ETHERNET NAMES EthernetScanner.dll PATHS ${CMAKE_CURRENT_SOURCE_DIR}/lib) target_link_libraries(sensor_node ${ETHERNET}) install(TARGETS sensor_node DESTINATION lib/${PROJECT_NAME}) ament_package() </code></pre> <p>The package builds fine. However, after running the install.bat, when running the ros2 run sensor sensor_node I get the following error.</p> <blockquote> <p>The code execution cannot proced because EthernetScanner.dll was not found. Reinstalling the program may fix the problem.</p> </blockquote> <p>Naturally I tried reinstalling the package but the same error occurs. I'm suspect it's to do with how I am linking the library to the node file but I am not sure how to make sure the library can be found after building.</p> <p>Any help would be greatly appreciated.</p> <p>Lawsey</p> <hr /> <p><a href="https://answers.ros.org/question/415447/code-execution-cannot-proceed-because-ext_lib.dll-not-found./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/149306/lawsey/" rel="nofollow noreferrer">Lawsey</a> on ROS Answers with karma: 26 on 2023-05-16</p> <p>Post score: 0</p>
Code Execution cannot proceed because ext_lib.dll not found
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This behaviour is perfectly normal according to the axis convention specified in <a href="https://www.ros.org/reps/rep-0103.html" rel="nofollow noreferrer">REP 103</a>.<br/> The correction for camera optical transforms is <code>-90°, 0°, -90°</code> in the roll, pitch and yaw rotations specified in the <a href="https://www.ros.org/reps/rep-0103.html#suffix-frames" rel="nofollow noreferrer">Suffix Frames</a> section.</p> <ul> <li><p>First, publish a transform from <code>/world</code> to your Kinect ( say <code>/camera_link</code>):</p> <pre><code> &lt;!-- publish tf from world to the kinect_camera (camera_link) --&gt; &lt;node name=&quot;kinect_static_transform_publisher&quot; pkg=&quot;tf&quot; type=&quot;static_transform_publisher&quot; args=&quot;1.274070 -0.011558 1.961223 -3.121294 0.611102 0.021866 world camera_link 100&quot; /&gt; </code></pre> </li> <li><p>Finally, publish the correct optical transform from <code>/camera_link</code> to <code>camera_rgb_optical_frame</code>:</p> <pre><code> &lt;!-- publish tf from camera_link to camera_rgb_optical_frame --&gt; &lt;node name=&quot;kinect_optical_transform&quot; pkg=&quot;tf&quot; type=&quot;static_transform_publisher&quot; args=&quot;0 0 0 -1.5707 0 -1.5707 camera_link camera_rgb_optical_frame 100&quot; /&gt; </code></pre> </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-05-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/44804/anubhav-singh/" rel="nofollow noreferrer">Anubhav Singh</a> on 2023-05-18</strong>:<br /> Thanks for the help.</p>
103274
2023-05-18T03:11:59.000
|gazebo|rviz|transform|pointcloud|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hey, I am trying to correctly orient the pointcloud data coming from a Kinect 3D camera sensor Gazebo model into the Rviz, but it's not working.</p> <p>In Gazebo, a <strong>Pose</strong> is of the form:</p> <pre><code>&lt;pose&gt; x y z roll pitch yaw &lt;/pose&gt; </code></pre> <p>But, input to the <strong>static_transform_publisher</strong> node is of the form:</p> <pre><code>static_transform_publisher x y z yaw pitch roll frame_id child_frame_id period_in_ms </code></pre> <p>I tried both the forms, but the pointcloud orientation is still incorrect. I have attached the output of both the versions below.</p> <p><strong>Kinect's Gazebo model</strong></p> <pre><code>&lt;model name=&quot;kinect&quot;&gt; &lt;static&gt;true&lt;/static&gt; &lt;pose&gt;1.274070 -0.011558 1.961223 0.021866 0.611102 -3.121294&lt;/pose&gt; &lt;link name=&quot;link&quot;&gt; &lt;inertial&gt; &lt;mass&gt;0.1&lt;/mass&gt; &lt;/inertial&gt; &lt;collision name=&quot;collision&quot;&gt; &lt;geometry&gt; &lt;box&gt; &lt;size&gt;0.073000 0.276000 0.072000&lt;/size&gt; &lt;/box&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;visual name=&quot;visual&quot;&gt; &lt;geometry&gt; &lt;mesh&gt; &lt;uri&gt;model://kinect/meshes/kinect.dae&lt;/uri&gt; &lt;/mesh&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;sensor name='camera' type='depth'&gt; &lt;update_rate&gt;20&lt;/update_rate&gt; &lt;camera name='__default__'&gt; &lt;horizontal_fov&gt;1.0472&lt;/horizontal_fov&gt; &lt;image&gt; &lt;width&gt;640&lt;/width&gt; &lt;height&gt;480&lt;/height&gt; &lt;format&gt;R8G8B8&lt;/format&gt; &lt;/image&gt; &lt;clip&gt; &lt;near&gt;0.05&lt;/near&gt; &lt;far&gt;3&lt;/far&gt; &lt;/clip&gt; &lt;/camera&gt; &lt;plugin name=&quot;kinect_camera_controller&quot; filename=&quot;libgazebo_ros_openni_kinect.so&quot;&gt; &lt;baseline&gt;0.1&lt;/baseline&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;updateRate&gt;15.0&lt;/updateRate&gt; &lt;cameraName&gt;camera&lt;/cameraName&gt; &lt;imageTopicName&gt;/camera/rgb/image_raw&lt;/imageTopicName&gt; &lt;cameraInfoTopicName&gt;/camera/rgb/camera_info&lt;/cameraInfoTopicName&gt; &lt;depthImageTopicName&gt;/camera/depth_registered/image_raw&lt;/depthImageTopicName&gt; &lt;depthImageCameraInfoTopicName&gt;/camera/depth_registered/camera_info&lt;/depthImageCameraInfoTopicName&gt; &lt;pointCloudTopicName&gt;/camera/depth_registered/points&lt;/pointCloudTopicName&gt; &lt;frameName&gt;camera_rgb_optical_frame&lt;/frameName&gt; &lt;distortion_k1&gt;0.00000001&lt;/distortion_k1&gt; &lt;distortion_k2&gt;0.00000001&lt;/distortion_k2&gt; &lt;distortion_k3&gt;0.00000001&lt;/distortion_k3&gt; &lt;distortion_t1&gt;0.00000001&lt;/distortion_t1&gt; &lt;distortion_t2&gt;0.00000001&lt;/distortion_t2&gt; &lt;pointCloudCutoff&gt;0.35&lt;/pointCloudCutoff&gt; &lt;pointCloudCutoffMax&gt;4.5&lt;/pointCloudCutoffMax&gt; &lt;CxPrime&gt;0&lt;/CxPrime&gt; &lt;Cx&gt;0&lt;/Cx&gt; &lt;Cy&gt;0&lt;/Cy&gt; &lt;focalLength&gt;0&lt;/focalLength&gt; &lt;hackBaseline&gt;0&lt;/hackBaseline&gt; &lt;/plugin&gt; &lt;/sensor&gt; &lt;self_collide&gt;0&lt;/self_collide&gt; &lt;kinematic&gt;0&lt;/kinematic&gt; &lt;/link&gt; &lt;/model&gt; </code></pre> <p><strong>World to camera_rgb_optical_frame transform using TF</strong></p> <pre><code>&lt;node name=&quot;kinect_static_transform_publisher&quot; pkg=&quot;tf&quot; type=&quot;static_transform_publisher&quot; args=&quot;1.274070 -0.011558 1.961223 0.021866 0.611102 -3.121294 world camera_rgb_optical_frame 100&quot;/&gt; </code></pre> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16843961541890163.png" alt="image description" /></p> <pre><code>&lt;node name=&quot;kinect_static_transform_publisher&quot; pkg=&quot;tf&quot; type=&quot;static_transform_publisher&quot; args=&quot;1.274070 -0.011558 1.961223 -3.121294 0.611102 0.021866 world camera_rgb_optical_frame 100&quot;/&gt; </code></pre> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16843961665669765.png" alt="image description" /></p> <p>I would really appreciate some help/guidance on this issue.</p> <hr /> <p><a href="https://answers.ros.org/question/415533/wrong-pointcloud-orientation-in-rviz/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/44804/anubhav-singh/" rel="nofollow noreferrer">Anubhav Singh</a> on ROS Answers with karma: 67 on 2023-05-18</p> <p>Post score: 0</p>
Wrong Pointcloud Orientation in Rviz
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Look at Nav2 + Lifecycle Manager, that is a professionally maintained and commercially deployed system that has checks on deadlocked or crashed servers to handle respawn and lifecycle management to bring down the system into a safe state until the fault is handled, when that fault is internal to Nav2.</p> <p>It is however still on the application developer for higher level failures to put the system into a safe state, but we make it as easy as possible with tooling and the infrastructure to support Nav2 safe state setting once your application detects the problem to require it.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-05-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103276
2023-05-18T10:49:32.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Most <strong>good</strong> examples of ROS systems I've seen on Github make strong use of launch files, and keep a good separation between nodes.</p> <p>What I have not seen is how a complete robot system handles node faults. For example if a node goes down while the robot is running, there are probably several potential courses of action:</p> <ol> <li>try to relaunch the node</li> <li>if after 3 attempts the node does not come back, log or report this to some notification system</li> </ol> <p>While that seems self-explanatory, I am curious if anyone has an example of the implementation of this?</p> <p>My primary issue with ros2 has always been a lack of open source &quot;professional projects&quot; where one can learn how a production-grade ros2 code base looks like. There are quite a few using ros-neotic out in the wild however.</p> <hr /> <p><a href="https://answers.ros.org/question/415555/best-practices-or-code-examples-of-how-a-%22complete-system%22-manages-nodes/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/76665/sameh4/" rel="nofollow noreferrer">sameh4</a> on ROS Answers with karma: 89 on 2023-05-18</p> <p>Post score: 1</p>
Best practices or code examples of how a "complete system" manages nodes
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This is definitely a tuning thing and unfortunately there's no substitution for good tuning in a critic based system. Between DWB and MPPI, there's definitely the behavior you want possible but its going to take some time to tune the system for what you want if it doesn't do what you want out of the box. As much as I try my hardest to make things work well out of the box, the local trajectory planners are a unique instance that when you want something different than what I pre-tuned for you, its going to be a few days of tuning and building that intuition for yourself to get things in a good spot for the behavior you desire. No other advanced trajectory planning technique with dynamic behavior is going to be much, if at all, easier.</p> <p>There are some other somewhat hacky solutions (depending on your view point) that could be played to make it easier, but I don't want to digress too much in this ticket. But I'll leave the point that just because you have a global plan, doesn't mean you could also have a local-global plan for the local-local planner to track for handling large but static deviations. Small and dynamic deviations the local planner should be able to be tuned to handle (probably also large / static too. The choice of one vs the other cannot really be made without trying both to see what behavioral trade-off is best for your application)</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-05-18</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/66603/pepis/" rel="nofollow noreferrer">Pepis</a> on 2023-05-19</strong>:<br /> Thanks for your answer steve!</p> <blockquote> <p>its going to be a few days of tuning and building that intuition for yourself to get things in a good spot for the behavior you desire</p> </blockquote> <p>Is there any good sequence of steps that could make tuning faster / easier for tuning the DWB controller especially for this type of reactive behavior? Ex: tune <code>A</code> critic first until you reach behavior <code>B</code>, then tune critic <code>C</code>...</p> <blockquote> <p>But I'll leave the point that just because you have a global plan, doesn't mean you could also have a local-global plan for the local-local planner to track for handling large but static deviations</p> </blockquote> <p>Could you elaborate on this? what in the the global-global plan would be the input to the local-global plan?</p> <blockquote> <p>The choice of one vs the other cannot really be made without trying both to see what behavioral trade-off is best for your application</p> </blockquote> <p>Are there any advantages of leaving global planning out at all and relying only on the controller?</p> <p>Thanks in advance for your help!</p>
103278
2023-05-18T15:01:02.000
|ros|microcontroller|navigation|ros2|planner|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi!</p> <p>Reading through some notes and material around nav2 I found a couple of mentions to a navigation setup often referred to as “reactive navigation”, which takes out continuous re-planning from the stack and replaces it for a single plan at the beginning of the navigation that connects the poses to navigate through with minimum cost lines; when there’s no static map those may as well be just straight lines.</p> <p>I’m currently working on a robot that ought to work in large outdoors suburban-like environments navigating through sidewalks of different widths: some of them may barely fit the robot but are not usually populated with obstacles, while others are very wide but are very frequently populated with people moving around the robot.</p> <p>I tried to set up this “reactive navigation” style on a simulated world with no static map using the DWB controller and an 8x8m local costmap, however, despite lowering the scale of the path-related critics and raising the obstacle-related, I struggled a lot to to make the robot go around even static objects that were in the way marked by the initial “straight line plan”. These obstacles would have been easily dodged by a navigation system using continuous replanning, as they would have been marked in the global costmap and the path for the controller to follow would have accounted for them. However it is not possible to mark them in a “static layer” beforehand because even though they may be static to the robot, they may be there just temporarily (ex: a parked car slightly blocking the sidewalk).</p> <p>Has anyone had experience with this setup of the navigation stack? How did you set up your critics? Are there any guidelines for tuning the DWB controller for achieving a good balance between obstacle avoidance and path following? I expect the controller to dodge obstacles of all sizes, from a football ball to a full golf-car parked on the sidewalk or a big group of people the robot cannot go through, meaning it would have to be able to go pretty far away from the “straight line path”.</p> <p>Do you think this setup would be more suited for dynamic outdoors environments instead of having continuous replanning at a relatively high frequency on a limited window around the robot while having the controller tuned more for path following? What would be the advantages of each approach?</p> <hr /> <p><a href="https://answers.ros.org/question/415560/%5Bnav2%5D-suggestions-around-single-plan---controller-only-reactive-navigation/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/66603/pepis/" rel="nofollow noreferrer">Pepis</a> on ROS Answers with karma: 130 on 2023-05-18</p> <p>Post score: 0</p>
[Nav2] Suggestions around single plan - controller only reactive navigation
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I've been experiencing a rather vexing issue with the localization and planning for my Ackermann type vehicle using Nav2. Initially, the problem seemed to be related to the particle size; however, upon changing the image resolution, I managed to get the size of particles similar to the turtlebot tutorial. Now, I'm beginning to suspect that the planning issue might be connected to the costmap and Lidar, as suggested by the repeated warnings I've received:</p> <pre><code>[rviz2-4] [INFO] [1684557117.532457854] [rviz]: Message Filter dropping message: frame 'odom' at time 18.718 for reason 'the timestamp on the message is earlier than all the data in the transform cache' [controller_server-8] [WARN] [1684557117.542791989] [local_costmap.local_costmap]: Sensor origin at (4.15, -0.01 2.18) is out of map bounds (34.12, 29.97, 2.95) to (-14.95, -14.95, 0.00). The costmap cannot raytrace for it 9.98, 2.95) to (-14.95, -14.95, 0.00). The costmap cannot raytrace for it. [controller_server-8] [WARN] [1684557296.342507914] [local_costmap.local_costmap]: Sensor origin at (4.19, 0.00 2.18) is out of map bounds (34.17, 29.98, 2.95) to (-14.95, -14.95, 0.00). The costmap cannot raytrace for it. [controller_server-8] [WARN] [1684557296.542695295] [local_costmap.local_costmap]: Sensor origin at (4.19, 0.00 2.18) is out of map bounds (34.17, 29.98, 2.95) to (-14.95, -14.95, 0.00). The costmap cannot raytrace for it. [controller_server-8] [WARN] [1684557296.742759887] [local_costmap.local_costmap]: Sensor origin at (4.19, 0.00 2.18) is out of map bounds (34.17, 29.98, 2.95) to (-14.95, -14.95, 0.00). The costmap cannot raytrace for it. [controller_server-8] [WARN] [1684557296.942633179] [local_costmap.local_costmap]: Sensor origin at (4.19, 0.00 2.18) is out of map bounds (34.17, 29.98, 2.95) to (-14.95, -14.95, 0.00). The costmap cannot raytrace for it. [controller_server-8] [WARN] [1684557297.142774081] [local_costmap.local_costmap]: Sensor origin at (4.19, 0.00 2.18) is out of map bounds (34.17, 29.98, 2.95) to (-14.95, -14.95, 0.00). The costmap cannot raytrace for it. [controller_server-8] [WARN] [1684557297.342435994] [local_costmap.local_costmap]: Sensor origin at (4.19, 0.00 2.18) is out of map bounds (34.17, 29.98, 2.95) to (-14.95, -14.95, 0.00). The costmap cannot raytrace for it. [controller_server-8] [WARN] [1684557297.542871713] [local_costmap.local_costmap]: Sensor origin at (4.19, 0.00 2.18) is out of map bounds (34.17, 29.98, 2.95) to (-14.95, -14.95, 0.00). The costmap cannot raytrace for it. ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) </code></pre> <p>I I believe that there might be a misconfiguration issue with costmap parameters (size, height, width) as the Lidar is mapping correctly and localization appears functional. I am yet to find a solution for this</p> <hr /> <p>Update:</p> <p>I've made some progress and managed to resolve the costmap issue. The solution involved using a static transform publisher from base_link to Lidar. Interestingly, even though my joint state publisher is functioning correctly, this redundant step was required, which deviates from the turtlebot tutorial.</p> <p>However, it's important to note that the placement of my Lidar is not directly attached to the base_link, but to other children from base_link. The costmap is highly sensitive to offset in the Z-axis. For instance, running &quot;ros2 static publisher 0 0 0.3 0 0 0 0 base_link lidar_link&quot; would raise a costmap error. Yet, the costmap doesn't seem to raise issues even when x and y offsets can reach up to 15 meters.</p> <p>After running the node with the launch file, I can use the &quot;Set Goal Pose&quot; icon on Rviz and see the desired goal spot coordinates on Terminal. But the planner doesn't draw on Rviz or calculate anything, it just freezes.</p> <p>As a provisional fix, I've been manually setting the pose and goal coordinates using the ros2 launch action. This method helps to draw the planner in Rviz, but the controller can't move my truck (presumably set for lighter robots). It only steers the wheels without forward movement.</p> <p>To overcome this, I provide a starting linear velocity via teleop, and the truck then follows the drawn path. Unfortunately, both the localization (AMCL) and Costmap do not travel along with the vehicle, leading to the truck losing its location very quickly.</p> <p>Adjusting an Ackermann Robot to use Nav2 has been a struggle, and despite following all the documentation and paid course steps, the performance remains unsatisfactory.</p> <p>I hope this information can assist other researchers or students facing similar issues, and any further help or suggestions for improvement would be greatly appreciated.</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-05-19</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103280
2023-05-18T21:50:38.000
|ros|ekf-localization|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi I was able to solve &quot;partially&quot; the related issue <a href="https://answers.ros.org/question/415423/nav2-amcl-fails-to-localize-my-custom-ackermann-robot/" rel="nofollow noreferrer">AMCL Fails to localize</a>.</p> <p>I've been working on improving localization for my custom Ackermann robot in an environment scaled 7-12 times the size of the standard turtlebot world. However, I've encountered a couple of issues.</p> <ol> <li><strong>Localization Anomalies</strong>: Despite the environment scale, the AMCL particles appear much smaller and less dispersed than when applied to the turtlebot3. I've adjusted several parameters in my <a href="https://pastebin.com/ntSjYye2" rel="nofollow noreferrer">nav2_params.yaml</a>l file, but the issue persists. How <strong>can I increase the size and spread</strong> of these particles?</li> </ol> <p>Here's a video: <a href="https://www.youtube.com/watch?v=Kwdw0Po_V6c" rel="nofollow noreferrer">AMCL Particles too Small</a> illustrating the issue, and a screenshot of my RQT Graph for reference.</p> <p>2.<strong>Trajectory Planning</strong>: Despite nodes and topics from the planner server and recover_server appearing correctly, the trajectory is not being calculated or drawn in RVIZ. The topics /goal_pose and /plan <strong>do not receive any data from the trajectory planner</strong>. Could the small <strong>AMCL particles be causing</strong> this issue?</p> <p>I've verified that my RVIZ configurations (Costmaps, TF, footprint, maps) and Gazebo plugins (publishing odom TF, Lidar, camera) seem to be functioning correctly, as illustrated in the following image:</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16844645924864837.png" alt="image description" /></p> <p>I appreciate an assistance in this issue.</p> <hr /> <p><a href="https://answers.ros.org/question/415566/amcl-small-particles-don%27t-allow-planning-on-nav2/" 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-05-18</p> <p>Post score: 0</p>
AMCL Small particles don't allow Planning on NAV2
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Based on the log information, it's clear this is unrelated to colcon; it's CMake that's finding the wrong version of python when building the <code>ament_cmake_export_assemblies</code> package. The script that fails is invoked from inside the call to <code>ament_package</code> and it seems to use the version of python found <a href="https://github.com/ament/ament_cmake/blob/77c1dd758dc65f80bd6644ec80261c0f3bfa6f7f/ament_cmake_core/cmake/core/python.cmake#L21" rel="nofollow noreferrer">here</a> which happens when <code>find_package(ament_cmake)</code> is called. Looking at the CMake docs for finding Python, it looks like the main way to control which one is found is via the <a href="https://cmake.org/cmake/help/latest/module/FindPython3.html#hints" rel="nofollow noreferrer">Python3_ROOT_DIR</a> variable. You could try to set it to the one you want as a <code>--cmake-arg</code> in the colcon invocation or via <code>colcon.pkg</code> file for that package specifically.</p> <hr /> <p>Original answer:</p> <p>Colcon doesn't &quot;select&quot; a python version. Like all python tools, it uses the version of the environment it was installed into. The script that runs when you invoke <code>colcon</code> as an executable command is a python file generated in the install process and its first line is a shebang pointing to the python interpreter of the environment. On Ubuntu, when you do <code>apt install python3-colcon</code> it points to <code>/usr/bin/python3</code> since it's using the global system environment. But you can also <code>pip install</code> it in other places (like a virtual env) and then it will point to that interpreter instead. Or alternatively, if you have a python environment which can see the installed colcon packages (like a virtual env which can see system packages), you can run colcon inside that environment through it's interpreter directly via <code>python -m colcon</code>.</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-05-19</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/114248/deric/" rel="nofollow noreferrer">Deric</a> on 2023-05-24</strong>:<br /> Thank you for your response, but sadly running colcon with <code>python -m colcon</code> does not prevent the wrong Python version (3.11) from being selected when building packages.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/2128/jdlangs/" rel="nofollow noreferrer">jdlangs</a> on 2023-05-25</strong>:<br /> That would indicate your <code>python</code> command points to a 3.11 version, which you can double check with <code>python --version</code>. So you need to sort out calling the version you actually want.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/114248/deric/" rel="nofollow noreferrer">Deric</a> on 2023-05-26</strong>:<br /> <code>python --version</code> returns the version which I installed (3.7.9)</p> <p><strong>Comment by <a href="https://answers.ros.org/users/2128/jdlangs/" rel="nofollow noreferrer">jdlangs</a> on 2023-05-31</strong>:<br /> Perhaps you can post more details/logs on how you know a different python version is involved?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/114248/deric/" rel="nofollow noreferrer">Deric</a> on 2023-06-02</strong>:<br /> I added the part of the log which contains the selected Python version and the error, the full log is available at the Issue which I linked.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/2128/jdlangs/" rel="nofollow noreferrer">jdlangs</a> on 2023-06-02</strong>:<br /> Thanks for the log info, that cleared things up quite a bit. It would have been nice to have that pasted from the start. Reviewing an attached zip file of logs on a linked issue is a bit much to ask from question answerers.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/114248/deric/" rel="nofollow noreferrer">Deric</a> on 2023-06-07</strong>:<br /> Sorry, I will try to be more forthcoming next time</p> <p><strong>Comment by <a href="https://answers.ros.org/users/164650/rakin374/" rel="nofollow noreferrer">rakin374</a> on 2023-07-21</strong>:<br /> Hey did you guys end up solving this issue? I am stuck on it now</p> <p><strong>Comment by <a href="https://answers.ros.org/users/114248/deric/" rel="nofollow noreferrer">Deric</a> on 2023-07-22</strong>:<br /> I noticed that <code>Python3_FIND_STRATEGY</code> has to be set to <code>LOCATION</code> to prevent CMake from using the highest Python Version available, the final colcon args are <code>-DPython3_ROOT_DIR=C:Path/to/Python -DPython3_FIND_STRATEGY=LOCATION -DPython3_FIND_REGISTRY=NEVER</code>.</p>
103282
2023-05-19T09:51:59.000
|ros|ros2|colcon|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello, I encountered problems while setting up Github Actions for a ROS2 Humble project on Windows. I used an <a href="https://github.com/ros-tooling/setup-ros" rel="nofollow noreferrer">action</a> for setting up ROS2 since it seemed pretty complicated on Windows which uses Python version 3.7.</p> <p>The problem is that colcon selects Python version 3.11 and fails with <code>ModuleNotFoundError: No module named 'catkin_pkg'</code> when building packages.</p> <p>I tried using <code>-DPYTHON_EXECUTABLE=...</code> or Pythons`s virtual environments and created an <a href="https://github.com/ros-tooling/setup-ros/issues/552" rel="nofollow noreferrer">issue</a> at the repository containing the action which contains links to the workflow and logs, does anybody know a way of forcing colcon to use a particular Python version?</p> <p>Edit: I also tried replacing the actions and doing everything by my self but the error persists.</p> <pre><code>2023-05-05T14:34:04.6016022Z Starting &gt;&gt;&gt; dotnet_cmake_module 2023-05-05T14:34:04.7077082Z Starting &gt;&gt;&gt; ament_cmake_export_assemblies 2023-05-05T14:34:05.9151305Z Not searching for unused variables given on the command line. 2023-05-05T14:34:05.9152542Z Not searching for unused variables given on the command line. 2023-05-05T14:34:21.1725257Z -- Found ament_cmake_core: 1.3.3 (C:/dev/humble/ros2-windows/share/ament_cmake_core/cmake) 2023-05-05T14:34:21.1726025Z -- Found ament_cmake: 1.3.3 (C:/dev/humble/ros2-windows/share/ament_cmake/cmake) 2023-05-05T14:34:42.3629746Z -- Found Python3: C:/hostedtoolcache/windows/Python/3.11.3/x86/python3.exe (found version &quot;3.11.3&quot;) found components: Interpreter 2023-05-05T14:34:42.3630442Z [Processing: ament_cmake_export_assemblies, dotnet_cmake_module] 2023-05-05T14:34:42.3631019Z -- Found Python3: C:/hostedtoolcache/windows/Python/3.11.3/x86/python3.exe (found version &quot;3.11.3&quot;) found components: Interpreter 2023-05-05T14:34:42.6704445Z Traceback (most recent call last): 2023-05-05T14:34:42.6705318Z File &quot;C:\dev\humble\ros2-windows\share\ament_cmake_core\cmake\core\package_xml_2_cmake.py&quot;, line 22, in &lt;module&gt; 2023-05-05T14:34:42.6705850Z from catkin_pkg.package import parse_package_string 2023-05-05T14:34:42.6706309Z ModuleNotFoundError: No module named 'catkin_pkg' </code></pre> <hr /> <p><a href="https://answers.ros.org/question/415600/colcon-select-python-version/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/114248/deric/" rel="nofollow noreferrer">Deric</a> on ROS Answers with karma: 18 on 2023-05-19</p> <p>Post score: 0</p>
Colcon select Python version
<p>It can help to increase the ekf rate. In <code>ekf.yaml</code>, that's the <code>frequency</code> parameter. I have mine set at 250 Hz.</p>
103284
2023-05-19T20:56:27.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone.</p> <p>I have some issue.</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16845478111381424.png" alt="image description" /></p> <p>When I start NAV2, the robot starts bouncing around.</p> <p>Is that issue of nav2 parameter?</p> <p>I'm completely lost and would appreciate some help.</p> <pre><code>amcl: ros__parameters: use_sim_time: False alpha1: 0.1 alpha2: 0.1 alpha3: 0.1 alpha4: 0.1 alpha5: 0.1 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: 3.0 laser_max_range: 15.9 laser_min_range: 0.16 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.5 pf_z: 0.99 recovery_alpha_fast: 0.0 recovery_alpha_slow: 0.0 resample_interval: 1 robot_model_type: &quot;omnidirectional&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 </code></pre> <hr /> <pre><code>controller_server: ros__parameters: use_sim_time: False controller_frequency: 20.0 #이동속도 가 임계값보다 낮으면 컨트롤러는 이동 회전을 멈춤 min_x_velocity_threshold: 0.005 min_y_velocity_threshold: 0.005 min_theta_velocity_threshold: 0.005 ####### 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: 0.25 # yaw_goal_tolerance: 0.25 # stateful: True general_goal_checker: stateful: True plugin: &quot;nav2_controller::SimpleGoalChecker&quot; xy_goal_tolerance: 0.25 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.10 max_vel_y: 0.10 max_vel_theta: 0.5 min_speed_xy: 0.0 max_speed_xy: 0.10 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: 1.25 acc_lim_y: 1.25 acc_lim_theta: 1.62 decel_lim_x: -1.25 decel_lim_y: -1.25 decel_lim_theta: -1.62 vx_samples: 20 vy_samples: 5 vtheta_samples: 20 sim_time: 1.7 # granularity 높을수록 이동경로가 세분화 되어 부드럽고 정교한 이동이 이뤄짐 하지만 계산비용 증가 linear_granularity: 0.05 angular_granularity: 0.05 transform_tolerance: 0.2 xy_goal_tolerance: 0.25 trans_stopped_velocity: 0.01 #로봇이 정지상태로 간주되는 선속도 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 </code></pre> <hr /> <pre><code>local_costmap: local_costmap: ros__parameters: update_frequency: 5.0 publish_frequency: 2.0 global_frame: odom robot_base_frame: base_footprint use_sim_time: False rolling_window: true width: 3 height: 3 resolution: 0.05 robot_radius: 0.58 plugins: [&quot;obstacle_layer&quot;, &quot;voxel_layer&quot;, &quot;inflation_layer&quot;] inflation_layer: plugin: &quot;nav2_costmap_2d::InflationLayer&quot; cost_scaling_factor: 1.0 inflation_radius: 0.58 #로봇 중심으로 주변 장애물에 대해 인플레이션. 로봇 반경 주변으로 장애물과의 접촉 반경. 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: 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.1 static_layer: map_subscribe_transient_local: True always_send_full_costmap: True local_costmap_client: ros__parameters: use_sim_time: False local_costmap_rclcpp_node: ros__parameters: use_sim_time: False global_costmap: global_costmap: ros__parameters: update_frequency: 1.0 publish_frequency: 1.0 global_frame: map robot_base_frame: base_footprint use_sim_time: False robot_radius: 0.58 resolution: 0.05 track_unknown_space: true 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; raytrace_max_range: 3.0 raytrace_min_range: 0.0 obstacle_max_range: 1.25 #2.5 obstacle_min_range: 0.0 static_layer: plugin: &quot;nav2_costmap_2d::StaticLayer&quot; map_subscribe_transient_local: True 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: 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 inflation_layer: plugin: &quot;nav2_costmap_2d::InflationLayer&quot; cost_scaling_factor: 3.0 inflation_radius: 0.58 always_send_full_costmap: True </code></pre> <p>global_costmap_client: ros__parameters: use_sim_time: False global_costmap_rclcpp_node: ros__parameters: use_sim_time: False</p> <hr /> <p><a href="https://answers.ros.org/question/415607/nav2-robot-bouncing/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/94528/robobo/" rel="nofollow noreferrer">Robobo</a> on ROS Answers with karma: 36 on 2023-05-19</p> <p>Post score: 1</p>
Nav2 robot bouncing
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>sequence numbers are deprecated and should be ignored.</p> <p>The most in depth post about it: <a href="https://github.com/ros2/common_interfaces/issues/1#issuecomment-112621348" rel="nofollow noreferrer">https://github.com/ros2/common_interfaces/issues/1#issuecomment-112621348</a></p> <p>And removed in ROS 2: <a href="https://github.com/ros2/common_interfaces/pull/2" rel="nofollow noreferrer">https://github.com/ros2/common_interfaces/pull/2</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2023-05-22</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/30692/pitosalas/" rel="nofollow noreferrer">pitosalas</a> on 2023-05-22</strong>:<br /> Thanks, @tfoote. As I have your briefest attention, let me pick your brain. I am struggling with a bug that I think relates to the tf of odom to base. In rviz, when I set the global frame to be odom, the /laserscan display gives an &quot;unknown error&quot;. If I set the global frame to anything else, e.g. base, then it works fine. My current hypothsis is that while the tf tree looks fine, that something about converting the /scan message frame from scan to base to odom fails. Stumped.</p> <p>Does any of that ring a bell?</p>
103286
2023-05-22T19:07:52.000
|transform|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I noticed the folliowing weird thing: (don't be perturbed: for analysis I load it into excel.)</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16848002661643234.png" alt="image description" /></p> <p>Should the sequence numbers in tf topics published be increasing? I saw this and it was quite suspicious...</p> <p>Thank you!</p> <hr /> <p><a href="https://answers.ros.org/question/415668/%5Btf%5D-sequence-numbers-of-rostopic-tf/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/30692/pitosalas/" rel="nofollow noreferrer">pitosalas</a> on ROS Answers with karma: 628 on 2023-05-22</p> <p>Post score: 0</p>
[tf] Sequence numbers of rostopic tf
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Ok I realized I was stupid. I just used python's <code>type()</code> and found out it is <code>rclpy.action.server.ServerGoalHandle</code>. Problem solved.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/149313/erel/" rel="nofollow noreferrer">Erel</a> with karma: 16 on 2023-05-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103288
2023-05-23T02:14:51.000
|ros|rclpy|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, When opening an action server it looks something like this:</p> <pre><code>self.move_up_action_server = ActionServer(self, MoveVerticalAction, 'move_vertical', self.move_up_callback) </code></pre> <p>With the callback being:</p> <pre><code>def move_up_callback(self, goal_handle): </code></pre> <p>I couldn't find anywhere what is the type of <code>goal_handle</code>. Seems like it has <code>goal_handle.request</code>, <code>goal_handle.publish_feedback</code>, <code>goal_handle.succeed</code>. Maybe some of you know what is the python type I should use?<br><br>Thanks</p> <hr /> <p><a href="https://answers.ros.org/question/415682/rclpy.action.actionserver-callback-%27goal_handle%27-type/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/149313/erel/" rel="nofollow noreferrer">Erel</a> on ROS Answers with karma: 16 on 2023-05-23</p> <p>Post score: 0</p>
rclpy.action.ActionServer callback 'goal_handle' type
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>To make it really concrete: the following should print the time <code>t</code> at which message <code>msg</code> was recorded followed by the contents for each message received on the topic <code>/robo_explorer/loadcell</code>:</p> <pre><code>for topic, msg, t in rosbag.Bag('input.bag').read_messages(): if topic == &quot;/robo_explorer/loadcell&quot;: print (f&quot;{t}: '{msg}'&quot;) </code></pre> <p>(haven't checked the syntax, so there may be errors)</p> <p>That would be the best you could do in the absence of a <code>std_msgs/Header</code> field.</p> <p>And note again: this would get you time at which the message was recorded, not when it was published.</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-05-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5421/marcus-barnet/" rel="nofollow noreferrer">Marcus Barnet</a> on 2023-05-23</strong>:<br /> I'm not a python expert, so probably I had to change the code you provide, however, I tried your code as it is but unfortunately it just prints a series of: {t}: '{msg}'</p> <pre><code>{t}: '{msg}' {t}: '{msg}' {t}: '{msg}' {t}: '{msg}' </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/5421/marcus-barnet/" rel="nofollow noreferrer">Marcus Barnet</a> on 2023-05-23</strong>:<br /> Ok, my fault, I needed to check the syntax, now it works and prints the timestamp! Thank you for your support!</p> <pre><code>print (t, msg) </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-05-23</strong>:<br /> As I wrote:</p> <blockquote> <p>haven't checked the syntax, so there may be errors</p> </blockquote> <p>I've added the <code>f</code> prefix, to make it an f-string. Note that if you're not using Python 3, it still won't work.</p> <p>Finally: this is all just an example. Please experiment and use it to arrive at a satisfactory solution.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5421/marcus-barnet/" rel="nofollow noreferrer">Marcus Barnet</a> on 2023-05-23</strong>:<br /> Thank you for your help and support, I was able to correctly recover the timestamp.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-05-24</strong>:<br /> Just to make it extra clear: you did not recover a / the timestamp.</p> <p>You're now using the time Rosbag recorded your message.</p> <p>Those are two very different things.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5421/marcus-barnet/" rel="nofollow noreferrer">Marcus Barnet</a> on 2023-05-24</strong>:<br /> Yes, you have reason, I should edit my previous comment to avoid misunderstandings. I just recovered the time related to when rosbag utility received the message from the original topic. It is still OK for me since it was just a test. EDIT: I cannot change my previous post, unfortunately.</p>
103290
2023-05-23T04:00:49.000
|ros|ros-melodic|rosbag|timestamp|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi to all,</p> <p>unfortunately, I recorded a very long bag file containing some topics that have a timestamp and two topics that do not include it since I forgot to add it before to launch the ROS node. Unfortunately, all the topics have different sampling time, so I cannot find a valid method to reference the value recorded in the topics without the timestamp against the timestamp from the other topics.</p> <p>Is there a way to add the timestamp also in the topics that do not include it? I was hoping that when you launch &quot;<code>rosbag record -a</code>&quot; the utility somehow keeps trace of the time acquisition. :)</p> <p>This is the topic list and the topics without the timestamp are loadcell and steering. Hope you can help me, thank you!</p> <pre><code>topics: /diagnostics 692 msgs : diagnostic_msgs/DiagnosticArray /joy 18326 msgs : sensor_msgs/Joy /robo_explorer/cmd_vel 18326 msgs : geometry_msgs/Twist /robo_explorer/enc 4537 msgs : std_msgs/String /robo_explorer/io_status 18326 msgs : robo_explorer/robo_io /robo_explorer/loadcell 7049 msgs : std_msgs/String /robo_explorer/steering 9887 msgs : std_msgs/String /robo_explorer/sys 4538 msgs : std_msgs/String /robo_explorer/velocity 4537 msgs : std_msgs/String /rosout 56497 msgs : rosgraph_msgs/Log (4 connections) /rosout_agg 56484 msgs : rosgraph_msgs/Log </code></pre> <p>This is the <a href="http://www.skeetty.com/test.bag" rel="nofollow noreferrer">test.bag file</a> as reference.</p> <hr /> <p><a href="https://answers.ros.org/question/415696/extract-timestamp-from-bag-for-some-topics-without-the-time/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/5421/marcus-barnet/" rel="nofollow noreferrer">Marcus Barnet</a> on ROS Answers with karma: 287 on 2023-05-23</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-05-23</strong>:<br /> quick comment: I'm not sure exactly what you're asking, but <code>rosbag</code> does store the reception time with each message it records. It will be wildly inaccurate though (well .. depends on your requirements) compared to stamps stored in <code>header.stamp</code>. See #q199941 and #q318536 for earlier questions, and <a href="http://wiki.ros.org/rosbag/Cookbook" rel="nofollow noreferrer">wiki/rosbag/Cookbook</a> for a collection of example Python <code>rosbag</code> processing scripts.</p> <blockquote> <p>Is there a way to add the timestamp also in the topics that do not include it?</p> </blockquote> <p>no, not without changing your <code>.msg</code> definition and completely rewriting/processing the <code>.bag</code> file.</p> <p>You <em>can</em> figure out reception time for all messages recorded, but you wouldn't then &quot;add it&quot; like you seem to be asking.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5421/marcus-barnet/" rel="nofollow noreferrer">Marcus Barnet</a> on 2023-05-23</strong>:<br /> Thank you a lot for your support. I already tried that links before opening the topic since I wasn't able to retrieve the time in any way by using that examples. The loadcell topic is just a string with values separated by a comma. I uploaded the bag file in the main topic just for reference.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-05-23</strong>:<br /> The first example in the Cookbook (<a href="http://wiki.ros.org/rosbag/Cookbook#Rewrite_bag_with_header_timestamps" rel="nofollow noreferrer"></a>) basically does this:</p> <pre><code>for topic, msg, t in rosbag.Bag('input.bag').read_messages(): ... </code></pre> <p>The <code>t</code> there is the time the message was received/recorded.</p> <p>Just to clarify: you will not somehow get a &quot;timestamp&quot; as part of the messages that were recorded. Rosbag does not change what it records (actually, it doesn't even deserialise the msgs it receives, so it only records a binary blob). The only thing you can do is ask Rosbag to give you the time at which it recorded the message.</p> <p>That is what the <code>t</code> is in the snippet above.</p> <blockquote> <p>The loadcell topic is just a string with values separated by a comma</p> </blockquote> <p>pedantic, but that's of course never a good idea in a strongly typed system such as ROS.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5421/marcus-barnet/" rel="nofollow noreferrer">Marcus Barnet</a> on 2023-05-23</strong>:<br /> I already tried that specific example but it only gives me the original topic as output without any timestamp.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-05-23</strong>:<br /> I'm confused.</p> <p>The <em>only</em> time information you would have access to in case of a message stream in a <code>.bag</code> where the <code>.msg</code> themselves don't contain a <code>std_msgs/Header</code> would be the time at which each individual message got recorded.</p> <p><em>That</em> time is what you have access to in the <code>t</code> variable in the line:</p> <pre><code>for topic, msg, t in rosbag.Bag('input.bag').read_messages(): </code></pre> <p>Notice the <code>t</code> in the <code>topic, msg, t</code> (unpacked) <code>tuple</code>.</p> <p>That <code>t</code> is not part of your <code>.msg</code> definition. It's what Rosbag itself records, in addition to the message contents.</p>
Extract timestamp from bag for some topics without the time
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>OK i found out where my issue was , after i looked at the info of the node &quot;slam_localization&quot; i noticed that the 2 subscribers created by the transform listener were subscribing to the wrong topic , indeed , they are subscribing to the topic /XPal_2/tf and /XPal_2/tf_static although the topics where the tf are being published are just /tf and /tf_static , so that means either my nodes which are publishing the tf on the topics are missing the namespace either i need to remove the namespace on the node &quot;slam_localization&quot;. Anyway i found a work aroud method which is to subscribe / publish the info between the topics /tf , /tf_static and /XPal_2/tf and /XPal_2/tf_static. Hope that helps if anyone is having the same issue.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/150846/rstef/" rel="nofollow noreferrer">Rstef</a> with karma: 21 on 2023-05-30</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103292
2023-05-23T08:51:29.000
|ros|ros2|transform|tf2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello , i am trying to do the transform between 2 frames (base_link and map) using the tf2_ros package, but it seems there is an issue somewhere. Both of the frames (base_link and map) do exist , i can see it on the tree frames when i use tf2_tools view_frames.py , also i am able to do the transform when using tf2_ros tf2_echo between my 2 frames and even more relevant , i am able to see on rviz all of the tfs being placed right, but when i am using in my code the lookup_transfrom method to get the transform between base_link and map, it says &quot;Could not transform XPal_2/base_link to map because &quot;map&quot; passed to lookupTransform argument target_frame does not exist&quot;. here is the relevant code (knowing all of this code is inside a ros node called &quot;SlamLocalization&quot;) :</p> <pre><code>self.source_frame = config_server.ROBOT_NETWORK[&quot;namespace&quot;] + &quot;/&quot; + &quot;base_link&quot; #namespace is XPal_2 self.target_frame = &quot;map&quot; self.slam_tf_buffer = Buffer() self.slam_tf_subscriber = TransformListener(self.slam_tf_buffer, self) self.timer = self.create_timer(0.05, self.slam_tf_callback) def slam_tf_callback(self): &quot;&quot;&quot; Callback function for slam tf subscriber between map and robot frames &quot;&quot;&quot; try: slam_tf = self.slam_tf_buffer.lookup_transform(self.target_frame, self.source_frame, rclpy.time.Time(),rclpy.duration.Duration(seconds=4.0) ) logger.log(&quot;tf_transform : {}&quot;.format(slam_tf)) except TransformException as ex: logger.log('Could not transform {} to {} because {}'.format(self.source_frame, self.target_frame, ex)) return self.publish_slam_position(slam_tf) #method used to publish on a topic the position , not relevant for this issue def main(args=None): rclpy.init(args=args) slam_localization = SlamLocalization() executor = MultiThreadedExecutor() rclpy.spin(slam_localization, executor=executor) # Destroy the node explicitly slam_localization.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p>Also important to know , the frames map and odom (which is the child of map) are published by the package slam_toolbox and the rest of the frames are published by the urdf file (base_link and all of his childs)</p> <hr /> <p><a href="https://answers.ros.org/question/415719/%5Bros2-foxy%5D-:-could-not-transform-base_link-to-map-because-%22map%22-passed-to-lookuptransform-argument-target_frame-does-not-exist./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/150846/rstef/" rel="nofollow noreferrer">Rstef</a> on ROS Answers with karma: 21 on 2023-05-23</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> on 2023-05-23</strong>:<br /> Does it error once or a couple of times at startup? Or does it continuously happen?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/150846/rstef/" rel="nofollow noreferrer">Rstef</a> on 2023-05-24</strong>:<br /> the error happens continuously</p> <p><strong>Comment by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> on 2023-05-24</strong>:<br /> That probably means that you aren't receiving any data. You should check what the SlamLocalization is doing in the spin. Is rclpy turning over and receiving any messages?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/150846/rstef/" rel="nofollow noreferrer">Rstef</a> on 2023-05-25</strong>:<br /> The node is spinning right and it is receiving all the messages needed , here is what the ros node info returns :</p> <pre><code>/XPal_2/slam_localization Subscribers: /XPal_2/tf: tf2_msgs/msg/TFMessage /XPal_2/tf_static: tf2_msgs/msg/TFMessage Publishers: /XPal_2/slam_position: ea_custom_message/msg/MsgPosition /parameter_events: rcl_interfaces/msg/ParameterEvent /rosout: rcl_interfaces/msg/Log Service Servers: /XPal_2/slam_localization/describe_parameters: rcl_interfaces/srv/DescribeParameters /XPal_2/slam_localization/get_parameter_types: rcl_interfaces/srv/GetParameterTypes /XPal_2/slam_localization/get_parameters: rcl_interfaces/srv/GetParameters /XPal_2/slam_localization/list_parameters: rcl_interfaces/srv/ListParameters /XPal_2/slam_localization/set_parameters: rcl_interfaces/srv/SetParameters /XPal_2/slam_localization/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically </code></pre> <p>tell me if you need more informations</p>
[ROS2 FOXY] : Could not transform base_link to map because "map" passed to lookupTransform argument target_frame does not exist
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It could be caused by your TF tree being wrong (if for some reason your URDF and the SDF don't align) but I'm thinking the more likely case if you use the standard URDF/SDF setups is that your footprint is actually what's wrong. The origin of the points that you use to define your footprint should be the base_link. For mobile robots, that's typically the center of rotation or for ackermann vehicles its the center of the rear axle (typically). For articulated trucks, you'd have to check the convention, but I imagine its the same.</p> <p>It might just be that your footprint itself visualized in rviz is incorrectly defined relative to a coordinate system causing it to appear offset.</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-05-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/37882/vini71/" rel="nofollow noreferrer">Vini71</a> on 2023-05-24</strong>:<br /> Thank you once again for sharing your insightful observations, Steve! I plan to thoroughly review them in the coming week</p> <p><strong>Comment by <a href="https://answers.ros.org/users/37882/vini71/" rel="nofollow noreferrer">Vini71</a> on 2023-06-25</strong>:<br /> Steve, I fixed pose localization errors by aligning my robot's SDF with <a href="https://www.ros.org/reps/rep-0103.html" rel="nofollow noreferrer">REP 103</a>. However, the planner could only be triggered via the terminal, with planning and localization issues persisting.</p> <p>Switching from binary to a <a href="https://github.com/ros-planning/navigation2/tree/e23d70862907b23072012fc4b3fafce31ffa8781" rel="nofollow noreferrer">source-based NAV2 setup</a> for ros2 galactic, working over the tb3 example, replacing it by an Ackermann Model <a href="https://www.youtube.com/watch?v=eIc12jz56kc" rel="nofollow noreferrer">mini racecar video</a>, localization and planning with rviz2 have finally worked.</p> <p>However, I'm unsure how to handle scaling up to real truck dimensions and a higher lidar position. Could you guide me on which <strong>specific config files and parameters to adjust, related to lidar height,</strong> range, and field of view, to avoid &quot;<strong>robot out of boundaries</strong>&quot; and similar errors, since just <strong>oversizing the costmap</strong> is not enough to mitigate this error?</p>
103294
2023-05-23T15:15:39.000
|ros|ros2|transform|tf2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>While implementing <strong>SLAM with Nav2</strong> on my Ackermann-style truck robot, I've run into an issue where the initial localization starts with my vehicle facing in the <strong>opposite direction (x orientation reversed)</strong>. Specifically, the truck's front bumper and rear end are inverted in the RViz visualization, leading to mislocalization when the vehicle starts moving.</p> <p>This issue is demonstrated in this video: <a href="https://www.youtube.com/watch?v=MwGM7frJNtY" rel="nofollow noreferrer">lnverted Localization Rviz</a>, I highlight the misalignment by adding an obstacle in Gazebo. The obstacle in front of the truck incorrectly appears at the rear end in RViz due to this localization error.</p> <p>I am unsure how to address this problem. Could the solution involve inverting a specific TF in the Xacro file related to the IMU origin, or should I consider another possible solution?</p> <p>Any assistance in resolving this inverted localization issue would be greatly appreciated.</p> <hr /> <p><a href="https://answers.ros.org/question/415734/inverted-initial-localization-in-nav2-for-ackermann-vehicle---front-and-rear-ends-misaligned-in-rviz/" 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-05-23</p> <p>Post score: 0</p>
Inverted Initial Localization in Nav2 for Ackermann Vehicle - Front and Rear Ends Misaligned in RViz
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Looking over the <code>rclpy</code> API docs, unless there are functions undocumented, you cannot do that in python3, but you can in C++. You want to cancel all goals using <code>async_cancel_all_goals</code> even if they were sent from another client (e.g. rviz2).</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-05-24</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/50383/juan-carlos/" rel="nofollow noreferrer">Juan Carlos</a> on 2023-05-26</strong>:<br /> Thanks a lot, I use the action client <code>navigate_to_pose</code>. I just create the client and with the function <code>async_cancel_all_goals</code> I was able to stop the robot</p> <pre><code>rclcpp_action::Client&lt;nav2_msgs::action::NavigateToPose&gt;::SharedPtr cancel_navto_client = rclcpp_action::create_client&lt;nav2_msgs::action::NavigateToPose&gt;(node,&quot;/navigate_to_pose&quot;); cancel_navto_client-&gt;async_cancel_all_goals(); </code></pre>
103296
2023-05-23T20:22:41.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to replicate this button but in a python code. The robot should stop if it is close &lt;2 m from any obstacle. I know the functions BasicNavigator.cancelTask() works but just if you add the goal in code but I need to use the Nav2 Goal tool.</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16848905658024161.png" alt="image description" /></p> <p>I tried using the Simple Commander API just calling the BasicNavigator.cancelTask() function but is not working I think I am using wrong. Does anyone how to do it ? It should be calling a service but I do not know which one exactly.</p> <pre><code>#!/usr/bin/env python3 import rclpy from nav2_simple_commander.robot_navigator import BasicNavigator from rclpy.node import Node from rclpy.action import ActionClient from std_srvs.srv import SetBool class StopNavigation(Node): def __init__(self): super().__init__('stop_navigation') # Create a BasicNavigator object. self.navigator = BasicNavigator() def stop_navigation_client(self): while rclpy.ok: self.navigator.waitUntilNav2Active() client = self.create_client(SetBool, &quot;soft_stop_navigation&quot;) # Wait for the SetBool client to become available. while not client.wait_for_service(timeout_sec=1.0): rclpy.spin_once(self) # Send a request to the SetBool client. request = SetBool.Request() request.data = True future = client.call_async(request) rclpy.spin_until_future_complete(self, future) # Check the response. response = future.result() print(&quot;&quot;) print(&quot;future_t: &quot;, response.success) print(&quot;feedback: &quot;,self.navigator.getFeedback()) print(&quot;&quot;) if response.success: print(&quot;SetBool service succeeded, Cancel Nav.&quot;) self.navigator.cancelTask() # Check if the task was successfully canceled if self.navigator.cancelTask(): print(&quot;Task was successfully canceled&quot;) else: print(&quot;Task could not be canceled&quot;) break else: print(&quot;Continue Nav...&quot;) def main(): # Initialize the ROS node. rclpy.init() # Create a MyNode object. node = StopNavigation() # Wait for the SetBool client to become available. node.stop_navigation_client() rclpy.spin_once(node) # Shutdown the ROS node. rclpy.shutdown() if __name__ == &quot;__main__&quot;: main() </code></pre> <hr /> <p><a href="https://answers.ros.org/question/415739/i-am-using-in-rviz2-the-tool-nav2-goal.-but-i-want-to-cancel-the-robot%27s-navigation-when-it-is-at-a-distance-of-less-than-2-meters-from-an-obstacle/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/50383/juan-carlos/" rel="nofollow noreferrer">Juan Carlos</a> on ROS Answers with karma: 17 on 2023-05-23</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2023-05-24</strong>:<br /> Perhaps you should use <a href="https://navigation.ros.org/configuration/packages/nav2_controller-plugins/simple_goal_checker.html" rel="nofollow noreferrer">the SimpleGoalChecker</a> and modify its <code>xy_goal_tolerance</code> parameter?</p>
I am using in rviz2 the tool nav2 goal. But I want to cancel the robot's navigation when it is at a distance of less than 2 meters from an obstacle
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Some, at least minor, filtering is encouraged before throwing depth feeds into your costmaps for this kind of non-trivial noise around the surfaces of physical objects.</p> <p>Without more information, I can't give you precise recommendations, but generally speaking PCL has a number of useful filters that when combined (or just 1 individually) can remove that kind of noise. The compute available, degree at which you want to remove noise, and the amount of data you want to decimate are all parts of the equation.</p> <p>I haven't looked at literature recently on this subject, but it wouldn't surprise me if there were some techniques that might aid you as well using kernal filters.</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-05-24</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/130069/n000oob/" rel="nofollow noreferrer">n000oob</a> on 2023-05-26</strong>:<br /> thanks! by the way is exploring pcl_ros can be use in this case? I'm using galactic version</p> <p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2023-05-26</strong>:<br /> Sure, that would work too, those are basically nodes that do the PCL individual things so you can swap them in / out easily. Its not terribly different than using PCL itself, just depends on what you're more comfortable with and how often you think you'll need to rearrange things.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/130069/n000oob/" rel="nofollow noreferrer">n000oob</a> on 2023-05-29</strong>:<br /> thank you for the great help and information.</p>
103298
2023-05-24T04:29:06.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm having problems on how to filter those few noisy streams near the camera, the clip is here <a href="https://youtu.be/ypiaW1GZGOA" rel="nofollow noreferrer">https://youtu.be/ypiaW1GZGOA</a></p> <p>what I've tried so far is to calibrate, wondered if the distortion model affects those noise , the default uses plumb bob. but upon using below config:</p> <pre><code>image_width: 640 image_height: 480 camera_name: depth_PS1080_PrimeSense camera_matrix: rows: 3 cols: 3 data: [570.478986, 0.000000, 330.949612, 0.000000, 577.133855, 202.275876, 0.000000, 0.000000, 1.000000] distortion_model: plumb_bob distortion_coefficients: rows: 1 cols: 5 data: [0.034195, 0.018035, -0.022867, 0.001739, 0.000000] rectification_matrix: rows: 3 cols: 3 data: [1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000] projection_matrix: rows: 3 cols: 4 data: [587.691833, 0.000000, 331.098836, 0.000000, 0.000000, 582.344971, 192.450352, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000] </code></pre> <p>but after i use this the config, the stream is just straight vertical, most pointclouds are gone.</p> <p>any suggestions would definitely help thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/415752/improve-pointcloud-streams/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/130069/n000oob/" rel="nofollow noreferrer">n000oob</a> on ROS Answers with karma: 15 on 2023-05-24</p> <p>Post score: 0</p>
improve pointcloud streams
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><strong>Hello ROS community,</strong></p> <p>I recently encountered an issue while using the MoveIt2 Setup Assistant, where it generated integer values for joint limits in the configuration files. This caused compatibility issues when launching MoveIt2, resulting in the following error message:</p> <p>terminate called after throwing an instance of 'rclcpp::exceptions::InvalidParameterTypeException' what(): parameter 'robot_description_planning.joint_limits.joint_X.max_velocity' has invalid type: expected [double] got [integer]</p> <p>After investigating the problem, I discovered that the MoveIt2 Setup Assistant generates integer values for joint limits by default, while MoveIt expects them to be doubles (floating-point numbers).</p> <p>To resolve this issue, I recommend following these steps:</p> <pre><code>Open the configuration files generated by the MoveIt2 Setup Assistant. Locate the joint limit parameters, such as joint_X.max_velocity, where X corresponds to the joint number. Change the integer values to doubles by adding a decimal point and a zero after the integer value. For example, change 5 to 5.0. Save the modified configuration files. </code></pre> <p>By changing the integer values to doubles, MoveIt will correctly interpret the joint limits and prevent the InvalidParameterTypeException error.</p> <p>I hope this solution helps anyone who may encounter this issue while using the MoveIt2 Setup Assistant. If you have any further questions or need clarification, feel free to ask!</p> <p><strong>Best regards, roskuttan</strong></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/150922/roskuttan/" rel="nofollow noreferrer">Roskuttan</a> with karma: 53 on 2023-05-25</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103300
2023-05-24T05:53:03.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><strong>Hello everyone,</strong></p> <p>I'm trying to configure my custom-made robotic manipulator to use MoveIt2 and perform motion planning and simulation in Gazebo. I'm running into some issues when trying to run the demo.launch.py file. Specifically, I'm seeing several error messages related to the controller manager and robot model not being loaded.</p> <p><strong>Here are the details: ROS Distro: ROS2 Humble Packages: gazebo_ros2_control, moveit2, and a custom package for my robot</strong></p> <p><strong>Error Messages:-</strong></p> <blockquote> <p>roskuttan2@roskuttan2:~/ros2_ws$ ros2 launch hexa_bot_description_moveit_config demo.launch.py</p> </blockquote> <p>[INFO] [launch]: All log files can be found below /home/roskuttan2/.ros/log/2023-05-24-15-34-27-976153-roskuttan2-29661 [INFO] [launch]: Default logging verbosity is set to INFO Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead. [INFO] [static_transform_publisher-1]: process started with pid [29662] [INFO] [robot_state_publisher-2]: process started with pid [29664] [INFO] [move_group-3]: process started with pid [29666] [INFO] [rviz2-4]: process started with pid [29668] [INFO] [ros2_control_node-5]: process started with pid [29670] [INFO] [spawner-6]: process started with pid [29672] [INFO] [spawner-7]: process started with pid [29691] [static_transform_publisher-1] [INFO] [1684922668.700475327] [static_transform_publisher0]: Spinning until stopped - publishing transform [static_transform_publisher-1] translation: ('0.000000', '0.000000', '0.000000') [static_transform_publisher-1] rotation: ('0.000000', '0.000000', '0.000000', '1.000000') [static_transform_publisher-1] from 'world' to 'base_link' [robot_state_publisher-2] [WARN] [1684922668.707950107] [kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. [robot_state_publisher-2] [INFO] [1684922668.708029943] [robot_state_publisher]: got segment JAW1_1 [robot_state_publisher-2] [INFO] [1684922668.708062812] [robot_state_publisher]: got segment JAW2_1 [robot_state_publisher-2] [INFO] [1684922668.708071760] [robot_state_publisher]: got segment JAW3_1 [robot_state_publisher-2] [INFO] [1684922668.708077457] [robot_state_publisher]: got segment JAW6_1 [robot_state_publisher-2] [INFO] [1684922668.708082723] [robot_state_publisher]: got segment Jaw4_1 [robot_state_publisher-2] [INFO] [1684922668.708090723] [robot_state_publisher]: got segment Jaw5_1 [robot_state_publisher-2] [INFO] [1684922668.708096410] [robot_state_publisher]: got segment NEMA_3_1 [robot_state_publisher-2] [INFO] [1684922668.708101730] [robot_state_publisher]: got segment NEMA_4_1 [robot_state_publisher-2] [INFO] [1684922668.708106985] [robot_state_publisher]: got segment NEMA_5_1 [robot_state_publisher-2] [INFO] [1684922668.708114370] [robot_state_publisher]: got segment Nema_1_1 [robot_state_publisher-2] [INFO] [1684922668.708120014] [robot_state_publisher]: got segment Nema_2_1 [robot_state_publisher-2] [INFO] [1684922668.708125161] [robot_state_publisher]: got segment Nema_6_1 [robot_state_publisher-2] [INFO] [1684922668.708130170] [robot_state_publisher]: got segment base_link [rviz2-4] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. [ros2_control_node-5] [INFO] [1684922668.724202049] [resource_manager]: Loading hardware 'GazeboSimSystem' [ros2_control_node-5] terminate called after throwing an instance of 'pluginlib::LibraryLoadException' [ros2_control_node-5] what(): According to the loaded plugin descriptions the class gazebo_ros2_control/GazeboSystem with base class type hardware_interface::SystemInterface does not exist. Declared types are fake_components/GenericSystem mock_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem test_system [ros2_control_node-5] Stack trace (most recent call last): [ros2_control_node-5] #16 Object &quot;&quot;, at 0xffffffffffffffff, in [ros2_control_node-5] #15 Object &quot;/opt/ros/humble/lib/controller_manager/ros2_control_node&quot;, at 0x55d431a4dd84, in [move_group-3] [INFO] [1684922668.727829680] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0.00349362 seconds [move_group-3] [INFO] [1684922668.728205202] [moveit_robot_model.robot_model]: Loading robot model 'hexa_bot'... [ros2_control_node-5] #14 Source &quot;../csu/libc-start.c&quot;, line 392, in __libc_start_main_impl [0x7f701de29e3f] [ros2_control_node-5] #13 Source &quot;../sysdeps/nptl/libc_start_call_main.h&quot;, line 58, in __libc_start_call_main [0x7f701de29d8f] [ros2_control_node-5] #12 Object &quot;/opt/ros/humble/lib/controller_manager/ros2_control_node&quot;, at 0x55d431a4d89e, in [ros2_control_node-5] #11 Object &quot;/opt/ros/humble/lib/libcontroller_manager.so&quot;, at 0x7f701e7b9c27, in controller_manager::ControllerManager::ControllerManager(std::shared_ptrrclcpp::Executor, std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt; const&amp;, rclcpp::NodeOptions const&amp;) [ros2_control_node-5] #10 Object &quot;/opt/ros/humble/lib/libcontroller_manager.so&quot;, at 0x7f701e7b8dd7, in controller_manager::ControllerManager::init_resource_manager(std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt; const&amp;) [ros2_control_node-5] #9 Object &quot;/opt/ros/humble/lib/libhardware_interface.so&quot;, at 0x7f701e1c2207, in hardware_interface::ResourceManager::load_urdf(std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt; const&amp;, bool) [ros2_control_node-5] #8 Object &quot;/opt/ros/humble/lib/libhardware_interface.so&quot;, at 0x7f701e1ca856, in [ros2_control_node-5] #7 Object &quot;/opt/ros/humble/lib/libhardware_interface.so&quot;, at 0x7f701e1a1858, in [ros2_control_node-5] #6 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f701e2ae517, in __cxa_throw [ros2_control_node-5] #5 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f701e2ae2b6, in std::terminate() [ros2_control_node-5] #4 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f701e2ae24b, in [ros2_control_node-5] #3 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f701e2a2bbd, in [ros2_control_node-5] #2 Source &quot;./stdlib/abort.c&quot;, line 79, in abort [0x7f701de287f2] [ros2_control_node-5] #1 Source &quot;../sysdeps/posix/raise.c&quot;, line 26, in raise [0x7f701de42475] [ros2_control_node-5] #0 | Source &quot;./nptl/pthread_kill.c&quot;, line 89, in __pthread_kill_internal [ros2_control_node-5] | Source &quot;./nptl/pthread_kill.c&quot;, line 78, in __pthread_kill_implementation [ros2_control_node-5] Source &quot;./nptl/pthread_kill.c&quot;, line 44, in __pthread_kill [0x7f701de96a7c] [ros2_control_node-5] Aborted (Signal sent by tkill() 29670 1000) [move_group-3] terminate called after throwing an instance of 'rclcpp::exceptions::InvalidParameterTypeException' [move_group-3] what(): parameter 'robot_description_planning.joint_limits.joint_2.max_velocity' has invalid type: expected [double] got [integer] [move_group-3] Stack trace (most recent call last): [move_group-3] #18 Object &quot;&quot;, at 0xffffffffffffffff, in [move_group-3] #17 Object &quot;/opt/ros/humble/lib/moveit_ros_move_group/move_group&quot;, at 0x556b13d91784, in [move_group-3] #16 Source &quot;../csu/libc-start.c&quot;, line 392, in __libc_start_main_impl [0x7effd4229e3f] [move_group-3] #15 Source &quot;../sysdeps/nptl/libc_start_call_main.h&quot;, line 58, in __libc_start_call_main [0x7effd4229d8f] [move_group-3] #14 Object &quot;/opt/ros/humble/lib/moveit_ros_move_group/move_group&quot;, at 0x556b13d90322, in [move_group-3] #13 Object &quot;/opt/ros/humble/lib/libmoveit_cpp.so.2.5.4&quot;, at 0x7effd4d78094, in moveit_cpp::MoveItCpp::MoveItCpp(std::shared_ptrrclcpp::Node const&amp;, moveit_cpp::MoveItCpp::Options const&amp;) [move_group-3] #12 Object &quot;/opt/ros/humble/lib/libmoveit_cpp.so.2.5.4&quot;, at 0x7effd4d75a3b, in moveit_cpp::MoveItCpp::loadPlanningSceneMonitor(moveit_cpp::MoveItCpp::PlanningSceneMonitorOptions const&amp;) [move_group-3] #11 Object &quot;/opt/ros/humble/lib/libmoveit_planning_scene_monitor.so.2.5.4&quot;, at 0x7effd4c9960a, in planning_scene_monitor::PlanningSceneMonitor::PlanningSceneMonitor(std::shared_ptrrclcpp::Node const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt; const&amp;) [move_group-3] #10 Object &quot;/opt/ros/humble/lib/libmoveit_planning_scene_monitor.so.2.5.4&quot;, at 0x7effd4c9955a, in planning_scene_monitor::PlanningSceneMonitor::PlanningSceneMonitor(std::shared_ptrrclcpp::Node const&amp;, std::shared_ptr&lt;planning_scene::PlanningScene&gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt; const&amp;) [move_group-3] #9 Object &quot;/opt/ros/humble/lib/libmoveit_robot_model_loader.so.2.5.4&quot;, at 0x7effd4443c1e, in robot_model_loader::RobotModelLoader::RobotModelLoader(std::shared_ptrrclcpp::Node const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt; const&amp;, bool) [move_group-3] #8 Object &quot;/opt/ros/humble/lib/libmoveit_robot_model_loader.so.2.5.4&quot;, at 0x7effd44423d9, in robot_model_loader::RobotModelLoader::configure(robot_model_loader::RobotModelLoader::Options const&amp;) [move_group-3] #7 Object &quot;/opt/ros/humble/lib/libmoveit_robot_model_loader.so.2.5.4&quot;, at 0x7effd443c1a2, in [move_group-3] #6 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7effd46ae517, in __cxa_throw [move_group-3] #5 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7effd46ae2b6, in std::terminate() [move_group-3] #4 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7effd46ae24b, in [move_group-3] #3 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7effd46a2bbd, in [move_group-3] #2 Source &quot;./stdlib/abort.c&quot;, line 79, in abort [0x7effd42287f2] [move_group-3] #1 Source &quot;../sysdeps/posix/raise.c&quot;, line 26, in raise [0x7effd4242475] [move_group-3] #0 | Source &quot;./nptl/pthread_kill.c&quot;, line 89, in __pthread_kill_internal [move_group-3] | Source &quot;./nptl/pthread_kill.c&quot;, line 78, in __pthread_kill_implementation [move_group-3] Source &quot;./nptl/pthread_kill.c&quot;, line 44, in __pthread_kill [0x7effd4296a7c] [move_group-3] Aborted (Signal sent by tkill() 29666 1000) [rviz2-4] [INFO] [1684922669.003443390] [rviz2]: Stereo is NOT SUPPORTED [rviz2-4] [INFO] [1684922669.004206744] [rviz2]: OpenGl version: 4.3 (GLSL 4.3) [rviz2-4] [INFO] [1684922669.027584700] [rviz2]: Stereo is NOT SUPPORTED [rviz2-4] Warning: class_loader.impl: SEVERE WARNING!!! A namespace collision has occurred with plugin factory for class rviz_default_plugins::displays::InteractiveMarkerDisplay. New factory will OVERWRITE existing one. This situation occurs when libraries containing plugins are directly linked against an executable (the one running right now generating this message). Please separate plugins out into their own library or just don't link against the library and use either class_loader::ClassLoader/MultiLibraryClassLoader to open. [rviz2-4] at line 253 in /opt/ros/humble/include/class_loader/class_loader/class_loader_core.hpp [ERROR] [ros2_control_node-5]: process has died [pid 29670, exit code -6, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_thpmnbde --params-file /home/roskuttan2/ros2_ws/install/hexa_bot_description_moveit_config/share/hexa_bot_description_moveit_config/config/ros2_controllers.yaml']. [ERROR] [move_group-3]: process has died [pid 29666, exit code -6, cmd '/opt/ros/humble/lib/moveit_ros_move_group/move_group --ros-args --params-file /tmp/launch_params_dxbx1rs5 --params-file /tmp/launch_params_48ugzghh']. [spawner-7] [INFO] [1684922671.009950473] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-6] [INFO] [1684922671.026591131] [spawner_hexa_bot_description_group_controller]: Waiting for '/controller_manager' node to exist [rviz2-4] [ERROR] [1684922672.130330591] [moveit_ros_visualization.motion_planning_frame]: Action server: /recognize_objects not available [rviz2-4] [INFO] [1684922672.151834003] [moveit_ros_visualization.motion_planning_frame]: MoveGroup namespace changed: / -&gt; . Reloading params. [spawner-7] [INFO] [1684922673.020264249] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-6] [INFO] [1684922673.035092681] [spawner_hexa_bot_description_group_controller]: Waiting for '/controller_manager' node to exist [spawner-7] [INFO] [1684922675.029253228] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-6] [INFO] [1684922675.044829332] [spawner_hexa_bot_description_group_controller]: Waiting for '/controller_manager' node to exist [spawner-7] [INFO] [1684922677.038332564] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-6] [INFO] [1684922677.054533688] [spawner_hexa_bot_description_group_controller]: Waiting for '/controller_manager' node to exist [spawner-7] [ERROR] [1684922679.046636011] [spawner_joint_state_broadcaster]: Controller manager not available [spawner-6] [ERROR] [1684922679.062596025] [spawner_hexa_bot_description_group_controller]: Controller manager not available [ERROR] [spawner-7]: process has died [pid 29691, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --ros-args']. [ERROR] [spawner-6]: process has died [pid 29672, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner hexa_bot_description_group_controller --ros-args']. [rviz2-4] [ERROR] [1684922683.283295822] [rviz]: Could not find parameter robot_description_semantic and did not receive robot_description_semantic via std_msgs::msg::String subscription within 10.000000 seconds. [rviz2-4] Error: Could not parse the SRDF XML File. Error=XML_ERROR_EMPTY_DOCUMENT ErrorID=13 (0xd) Line number=0 [rviz2-4] at line 715 in ./src/model.cpp [rviz2-4] [ERROR] [1684922683.287717563] [moveit_rdf_loader.rdf_loader]: Unable to parse SRDF [rviz2-4] [ERROR] [1684922683.294888309] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Robot model not loaded ^C[rviz2-4] [INFO] [1684922701.918329435] [rclcpp]: signal_handler(signum=2) [WARNING] [launch]: user interrupted with ctrl-c (SIGINT) [robot_state_publisher-2] [INFO] [1684922701.918333012] [rclcpp]: signal_handler(signum=2) [static_transform_publisher-1] [INFO] [1684922701.918796360] [rclcpp]: signal_handler(signum=2) [INFO] [static_transform_publisher-1]: process has finished cleanly [pid 29662] [INFO] [robot_state_publisher-2]: process has finished cleanly [pid 29664] [ERROR] [rviz2-4]: process has died [pid 29668, exit code -11, cmd '/opt/ros/humble/lib/rviz2/rviz2 -d /home/roskuttan2/ros2_ws/install/hexa_bot_description_moveit_config/share/hexa_bot_description_moveit_config/config/moveit.rviz --ros-args --params-file /tmp/launch_params_ajn0rii4 --params-file /tmp/launch_params_qwstxkze']. [rviz2-4] [INFO] [1684922701.918329435] [rclcpp]: signal_handler(signum=2)</p> <hr /> <p><a href="https://answers.ros.org/question/415759/error-loading-custom-robotic-manipulator-model-in-moveit2-on-ros2-humble(error-launching-demo.py)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/150922/roskuttan/" rel="nofollow noreferrer">Roskuttan</a> on ROS Answers with karma: 53 on 2023-05-24</p> <p>Post score: 1</p>
Error Loading Custom Robotic Manipulator Model in MoveIt2 on ROS2 Humble(error launching demo.py)
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I'm pretty sure that doesn't exist at the moment, or I at least don't know of a direct analogue of what you refer to on the ROS 1 wiki. (Edit: would perhaps make for a nice contribution: the information is all there).</p> <p>An alternative, but somewhat different, could be <a href="https://repo.ros2.org/status_page" rel="nofollow noreferrer">repo.ros2.org/status_page</a>. These are also linked from the <a href="https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html#resources" rel="nofollow noreferrer">Resources section</a> in the Humble Ubuntu installation documentation.</p> <p>Those pages are periodically updated by the ROS 2 buildfarm, and provide basically the same information as the list you refer to on the ROS 1 wiki, but in a different format.</p> <p>The names of the pages correspond to the platform/OS a particular ROS 2 version supports and gets packages built for. For Humble fi, there are:</p> <ul> <li><a href="https://repo.ros2.org/status_page/ros_humble_default.html" rel="nofollow noreferrer">ros_humble_default.html</a>: the &quot;default&quot; OS for Humble, being Ubuntu Jammy</li> <li><a href="https://repo.ros2.org/status_page/ros_humble_rhel.html" rel="nofollow noreferrer">ros_humble_rhel.html</a>: Humble on RedHat Enteprise Linux</li> <li><a href="https://repo.ros2.org/status_page/ros_humble_ujv8.html" rel="nofollow noreferrer">ros_humble_ujv8.html</a>: Humble on Ubuntu Jammy on ARMv8 (or <code>arm64</code>, as opposed to something like <code>armhf</code>)</li> </ul> <p>If you open the first one, and filter for <code>rclcpp</code>, <a href="https://repo.ros2.org/status_page/ros_humble_default.html?q=rclcpp%24" rel="nofollow noreferrer">you get this page</a>:</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16849596074561402.jpg" alt="image description" /></p> <p>The links to the buildfarm jobs are &quot;hidden&quot; in the last two columns: <code>Jsource</code> and <code>J64</code>. That would be the <em>source jobs</em> and the <code>amd64</code> binary jobs respectively. The squares can have different colours than green, and the page has a legend for what those other colours would mean which I won't duplicate here.</p> <p>The first square in each column links you to a job. For <code>rclcpp</code> that would be:</p> <ul> <li><a href="https://build.ros2.org/view/Hsrc_uJ/job/Hsrc_uJ__rclcpp__ubuntu_jammy__source" rel="nofollow noreferrer">Hsrc_uJ__rclcpp__ubuntu_jammy__source</a>: the source job for <code>rclcpp</code> in Humble, on Ubuntu Jammy</li> <li><a href="https://build.ros2.org/view/Hbin_uJ64/job/Hbin_uJ64__rclcpp__ubuntu_jammy_amd64__binary" rel="nofollow noreferrer">Hbin_uJ64__rclcpp__ubuntu_jammy_amd64__binary</a>: the binary job building <code>rclcpp</code> in Humble, for Ubuntu Jammy on <code>amd64</code></li> </ul> <p>For other supported platforms/OS, you'd have to open the other pages under <code>repos.ros2.org/status_page</code>.</p> <p>Or perhaps you could navigate to the source job and check what <em>Downstream Projects</em> exist:</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16849600815013534.jpg" alt="image description" /></p> <p>As yet another alternative: that same host also serves <code>.yaml</code> files which contain the same/similar information: <a href="https://repo.ros2.org/status_page/yaml" rel="nofollow noreferrer">repo.ros2.org/status_page/yaml</a>. For <code>rclcpp</code> in <code>ros_humble_default.yaml</code>:</p> <pre><code>rclcpp: build_status: ubuntu: jammy: amd64: build: 16.0.4-2jammy.20230426.055957 main: 16.0.4-2jammy.20230426.055957 test: 16.0.4-2jammy.20230426.055957 source: build: 16.0.4-2jammy main: 16.0.4-2jammy test: 16.0.4-2jammy maintainers: ... </code></pre> <p>This doesn't link to any jobs per se, but if your question is really just:</p> <blockquote> <p>How can I see what binaries are available for a ROS2 package?</p> </blockquote> <p>combining the information from all three <code>.yaml</code>s for Humble would seem to answer that.</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-05-24</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/39292/chives_onion/" rel="nofollow noreferrer">chives_onion</a> on 2023-05-25</strong>:<br /> I was indeed just looking for available binaries, but your answer will help me track releases more closely. Thank you much!</p>
103302
2023-05-24T14:45:27.000
|ros2|jenkins|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am developing on an amd64 system and would like to be able to quickly see if there are binaries available for packages on other architectures (arm).</p> <p>The ROS1 wiki has a handy section in the Package Links that shows all the Jenkins jobs, but I can't seem to find the same information in ROS Index for ROS2 packages.</p> <p>How can I see what binaries are available for a ROS2 package?</p> <hr /> <p><a href="https://answers.ros.org/question/415772/how-to-view-jenkins-jobs-in-ros-index/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/39292/chives_onion/" rel="nofollow noreferrer">chives_onion</a> on ROS Answers with karma: 180 on 2023-05-24</p> <p>Post score: 0</p>
How to view Jenkins jobs in ROS Index
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Thank you gvdhoom and chased11 so much for your kind help.</p> <p>After setting only ROS_IP and ROS_MASTER_URI for each device (ROS_IPs set to their own ips for each device and ROS_MASTER_URI is set to <code>http://(ip address of master):11311</code> for each device) i am able to connect to ros master from the other computer and can subscribe to the topic from there.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/151105/mericgeren/" rel="nofollow noreferrer">mericgeren</a> with karma: 26 on 2023-05-29</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103304
2023-05-25T07:31:26.000
|ros-melodic|rospy|roscore|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I have two computers on a local network. First of them has Ubuntu 18.04 as OS, ROS Melodic installed and connected to the network with an Ethernet cable. The other one has Windows 10 as OS, ROS Noetic installed and connected to the same network with WIFI. I want to publish some message from the computer with Ubuntu into the other one with Windows 10 running a master with &quot;roscore&quot;. To achieve this, i have changed ROS_MASTER_URI, ROS_IP and ROS_HOSTNAME to ones of the computer with Windows 10 from &quot;.bashrc&quot; using:</p> <blockquote> <p>export ROS_HOSTNAME</p> </blockquote> <p>export ROS_MASTER_URI</p> <blockquote> </blockquote> <p>export ROS_IP</p> <p>Then, i started my ros master in the computer with Windows 10 using the command &quot;roscore&quot; and then, in the terminal of PC with Ubuntu, i entered:</p> <blockquote> <p>/usr/bin/python /home/theUser/catkin_ws/src/myProject/scripts/RosPublisher.py</p> </blockquote> <p>to run my publisher code written in Python. Which will initialize my node with:</p> <blockquote> <p>rospy.init_node(&quot;thePublisher&quot;, anonymous = True)</p> </blockquote> <p>then, prepare and publish my message.</p> <p>After, running my code i got the following error:</p> <blockquote> <p>Unable to register with master node [http://computer:11311]: master may not be running yet. Will keep trying.</p> </blockquote> <p>Then, when i want to check topics with &quot;rostopic list&quot; i see:</p> <blockquote> <p>ERROR: Unable to communicate with master!</p> </blockquote> <p>Can you help me with this issue please?</p> <p>Thanks in advance.</p> <p>P.S. For setting ROS_HOSTNAME, ROS_MASTER_URI and ROS_IP, i used simply &quot;set ROS_HOSTNAME&quot;, &quot;set ROS_MASTER_URI&quot; and &quot;set ROS_IP&quot; in my cmd terminal (created by using steps specified there: <a href="https://wiki.ros.org/Installation/Windows" rel="nofollow noreferrer">link text</a>)</p> <hr /> <p><a href="https://answers.ros.org/question/415798/%22error:-unable-to-communicate-with-master!%22-and-%22unable-to-register-with-master-node%22/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/151105/mericgeren/" rel="nofollow noreferrer">mericgeren</a> on ROS Answers with karma: 26 on 2023-05-25</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/115712/chased11/" rel="nofollow noreferrer">chased11</a> on 2023-05-26</strong>:<br /> Did you set ROS_IP to the IP of the system that terminal is in or the IP of machine running master? I’ve seen users set the ROS_IP the same for both machines, which is wrong.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/151105/mericgeren/" rel="nofollow noreferrer">mericgeren</a> on 2023-05-27</strong>:<br /> On both systems my ROS_HOSTNAME, ROS_MASTER_URI and ROS_IP is set to ones of the system running ROS master. Could you explain what do you mean when you say setting the same ROS_IP for both machines is wrong? Do you say i should set ROS_IP of each system to their own IP or you say i should set my ROS_IP of each system to IP of the other system?</p> <p>Thanky for the support you have offered.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-05-28</strong>:\</p> <blockquote> <p>Do you say i should set ROS_IP of each system to their own IP</p> </blockquote> <p>yes.</p> <blockquote> <p>On both systems my ROS_HOSTNAME, [..] and ROS_IP [..]</p> </blockquote> <p>there's no need to set both <code>ROS_HOSTNAME</code> and <code>ROS_IP</code>.</p> <p>If you have working DNS, set <code>ROS_HOSTNAME</code>. If not, set <code>ROS_IP</code>.</p> <p><code>ROS_HOSTNAME</code> and <code>ROS_IP</code> tell your ROS nodes about the IP configuration of the PC you set them on, <em>not</em> of the master.</p> <p><em>Only</em> <code>ROS_MASTER_URI</code> should &quot;point&quot; to where <code>roscore</code> is running.</p> <p>(think about it: why would there be three configuration variables all containing the exact same information?)</p> <p><strong>Comment by <a href="https://answers.ros.org/users/151105/mericgeren/" rel="nofollow noreferrer">mericgeren</a> on 2023-05-29</strong>:<br /> Thank you gvdhoom and chased11 so much for your kind help.</p> <p>After setting only ROS_IP and ROS_MASTER_URI for each device (ROS_IPs set to their own ips for each device and ROS_MASTER_URI is set to http://(ip address of master):11311 for each device) i am able to connect to ros master from the other computer and can subscribe to the topic from there.</p>
"ERROR: Unable to communicate with master!" and "Unable to Register with master node"
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I was able to resolve this error by adding inertia to URDF file.</p> <p>check this issue : <a href="https://github.com/gazebosim/gazebo-classic/issues/2869" rel="nofollow noreferrer">https://github.com/gazebosim/gazebo-classic/issues/2869</a></p> <p>from <a href="https://answers.gazebosim.org//question/26054/frameattachedtograph-error-when-spawning-robot-from-urdf/" rel="nofollow noreferrer">https://answers.gazebosim.org//question/26054/frameattachedtograph-error-when-spawning-robot-from-urdf/</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/44968/benthebear93/" rel="nofollow noreferrer">benthebear93</a> with karma: 17 on 2023-05-26</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103306
2023-05-25T11:42:16.000
|gazebo|ros2|urdf|xacro|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Ubuntu : 22.04 Ros version : Rolling gazebo : fortress</p> <p>i am trying to load a panda robot in gazebo fortress but couldn't really find any basic tutorial.</p> <p>so i tried to write some launch files but couldn't really load a robot in to gazebo.</p> <p>def generate_launch_description(): pkg_panda= get_package_share_directory('moveit_resources_panda_moveit_config')</p> <pre><code>moveit_config = ( MoveItConfigsBuilder( robot_name=&quot;panda&quot;, package_name=&quot;moveit_resources_panda_moveit_config&quot; ) .robot_description(file_path=&quot;config/panda.urdf.xacro&quot;) .trajectory_execution(file_path=&quot;config/gripper_moveit_controllers.yaml&quot;) .moveit_cpp( file_path=get_package_share_directory(&quot;get_antipodal&quot;) + &quot;/config/panda_test.yaml&quot; ) .to_moveit_configs() ) xacro_file = os.path.join(pkg_panda, 'config', 'panda.urdf.xacro') doc = xacro.parse(open(xacro_file)) xacro.process_doc(doc) params = {'robot_description': doc.toxml()} rviz_config_file = os.path.join( get_package_share_directory(&quot;get_antipodal&quot;), &quot;config&quot;, &quot;panda_test.rviz&quot;, ) rviz_node = Node( package=&quot;rviz2&quot;, executable=&quot;rviz2&quot;, name=&quot;rviz2&quot;, output=&quot;log&quot;, arguments=[&quot;-d&quot;, rviz_config_file], parameters=[ moveit_config.robot_description, moveit_config.robot_description_semantic, ], ) spawn_entity_node = Node( package='ros_gz_sim', executable='create', arguments=[ '-name', 'panda', '-string', doc.toxml(), '-x', '0', '-y', '0', '-z', '0.025', '-R', '0', '-P', '0', '-Y', '0' ], output='screen' ) #robot state publisher robot_state_publisher = Node( package=&quot;robot_state_publisher&quot;, executable=&quot;robot_state_publisher&quot;, name=&quot;robot_state_publisher&quot;, output=&quot;log&quot;, parameters=[moveit_config.robot_description], ) # Gazebo Sim pkg_ros_gz_sim = get_package_share_directory('ros_gz_sim') gazebo = IncludeLaunchDescription( PythonLaunchDescriptionSource( os.path.join(pkg_ros_gz_sim, 'launch', 'gz_sim.launch.py') ), launch_arguments={'gz_args': '-r empty.sdf'}.items(), ) ros2_controllers_path = os.path.join( get_package_share_directory(&quot;moveit_resources_panda_moveit_config&quot;), &quot;config&quot;, &quot;ros2_controllers.yaml&quot;, ) ros2_control_node = Node( package=&quot;controller_manager&quot;, executable=&quot;ros2_control_node&quot;, parameters=[moveit_config.robot_description, ros2_controllers_path], output=&quot;log&quot;, ) load_controllers = [] for controller in [ &quot;panda_arm_controller&quot;, &quot;panda_hand_controller&quot;, &quot;joint_state_broadcaster&quot;, ]: load_controllers += [ ExecuteProcess( cmd=[&quot;ros2 run controller_manager spawner {}&quot;.format(controller)], shell=True, output=&quot;log&quot;, ) ] return LaunchDescription( [ robot_state_publisher, ros2_control_node, rviz_node, gazebo, spawn_entity_node, ] + load_controllers ) </code></pre> <p>and these error keep shows.</p> <p>[ruby $(which ign) gazebo-4] [Err] [UserCommands.cc:1138] Error Code 16: Msg: A model must have at least one link.</p> <p>[ruby $(which ign) gazebo-4] [Err] [UserCommands.cc:1138] Error Code 16: Msg: A model must have at least one link.</p> <p>[ruby $(which ign) gazebo-4] [Err] [UserCommands.cc:1138] Error Code 24: Msg: FrameAttachedToGraph error: scope context name[] does not match <strong>model</strong> or world.</p> <p>[ruby $(which ign) gazebo-4] [Err] [UserCommands.cc:1138] Error Code 22: Msg: attached_to name[panda_link7] specified by frame with name[panda_joint8] does not match a nested model, link, joint, or frame name in model with name[panda].</p> <p>[ruby $(which ign) gazebo-4] [Err] [UserCommands.cc:1138] Error Code 27: Msg: PoseRelativeToGraph error, Vertex with name [panda::panda_joint8] is disconnected; it should have 1 incoming edge in MODEL relative_to graph.</p> <p>[ruby $(which ign) gazebo-4] [Err] [UserCommands.cc:1138] Error Code 27: Msg: PoseRelativeToGraph unable to find path to source vertex when starting from vertex with id [4].</p> <p>[ruby $(which ign) gazebo-4] [Err] [UserCommands.cc:1138] Error Code 27: Msg: PoseRelativeToGraph unable to find path to source vertex when starting from vertex with id [3].</p> <p>[ruby $(which ign) gazebo-4] [Err] [UserCommands.cc:1138] Error Code 27: Msg: PoseRelativeToGraph unable to find path to source vertex when starting from vertex with id [5].</p> <p>[ruby $(which ign) gazebo-4] [Err] [UserCommands.cc:1138] Error Code 27: Msg: PoseRelativeToGraph unable to find path to source vertex when starting from vertex with id [6].</p> <p>Any other simple example, such as gz_ros2_control_demos works fine. even copy paste launch file from gz_ros2_control_demos to my launch file works.</p> <p>Any idea?</p> <ul> <li>if there is a basic tutorials or some basic knowledge plz tell me.</li> </ul> <hr /> <p><a href="https://answers.ros.org/question/415811/unable-to-load-panda.urdf.xacro-in-gazebo-fortress/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/44968/benthebear93/" rel="nofollow noreferrer">benthebear93</a> on ROS Answers with karma: 17 on 2023-05-25</p> <p>Post score: 0</p>
Unable to load panda.urdf.xacro in gazebo fortress
<p>There is the third-party package <a href="https://github.com/AndrejOrsula/pymoveit2" rel="nofollow noreferrer"><code>pymoveit2</code></a> that provides a &quot;pure&quot; Python API to MoveIt2 via the topics provided by <code>move_group</code> instead of binding the C++ API. This is closer to the behaviour of <a href="https://github.com/ros-planning/moveit/tree/master/moveit_commander" rel="nofollow noreferrer"><code>moveit_commander</code></a> and <a href="https://github.com/mikeferguson/moveit_python" rel="nofollow noreferrer"><code>moveit_python</code></a> in ROS 1.</p>
103308
2023-05-25T13:14:32.000
|ros|ros2|moveit-commander|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am confused on the new <a href="https://moveit.picknik.ai/main/doc/examples/motion_planning_python_api/motion_planning_python_api_tutorial.html" rel="nofollow noreferrer">MoveItPy</a> python bindings for MoveIt2. I used <a href="http://docs.ros.org/en/kinetic/api/moveit_tutorials/html/doc/moveit_commander_scripting/moveit_commander_scripting_tutorial.html" rel="nofollow noreferrer">moveit_commander</a> or <a href="https://ros-planning.github.io/moveit_tutorials/doc/move_group_python_interface/move_group_python_interface_tutorial.html" rel="nofollow noreferrer">move_group_python_interface</a> python interface in MoveIt in the past, and thought the new bindings would be equivalent, but I don't think they are.</p> <p>The tutorial for MoveItPy did not reveal the difference, which is quite fundamental IMHO and can influence how to setup the pipeline or how to migrate an old pipeline. I also did not find an updated Concept diagram replacing moveit_commander with MoveItPy to help clarify where MoveItPy inserts itself.</p> <p>I use this question to ask for a confirmation that I understood the difference, and maybe guide others.</p> <ul> <li><strong>moveit_commander</strong>: In my understanding, moveit_commander worked like this :</li> </ul> <blockquote> <p>UserApp (py) -&gt; moveit_commander (binding) -&gt; MoveGroupInterface (cpp) -&gt; actions -&gt; MoveGroup capability (cpp) -&gt; MoveitCPP core functions (cpp)</p> </blockquote> <p>MoveGroup capability was started in a node for a specific robot + planner + controller settings. There could be several UserApps running in nodes, connecting to &quot;MoveIt&quot; core functions in a separate unit via the move_group_interface and actions. Usually one would startup a robot_bringup + moveit move_group node for that robot, and later user apps would connect to the running MoveIt core through the actions.</p> <ul> <li><strong>MoveItPy</strong> What I understood from MoveItPy:</li> </ul> <blockquote> <p>UserApp (py) -&gt; MoveItPy (binding)-&gt; MoveitCPP</p> </blockquote> <p>The UserApp in python instantiates MoveItPy, which itself starts up the whole Moveit2 core, for a specific robot (all robot and moveit params must be given). There is no &quot;core&quot; MoveIt running independently of the user app.</p> <p>Is that correct ?</p> <p>So in that diagram for a python only usage, MoveGroup block should be replaced directly by MoveItPy and moveit commander does not exist, and there is no arrow between the user app (black terminal above moveit commander) and MoveItPy as it needs to be instantiated by the user app.<img src="https://moveit.picknik.ai/main/_images/moveit_pipeline.png" alt="image description" /></p> <p>In case I am correct, for existing pipelines based on the availability of MoveGroup actions, and then connecting to them and/or using MoveItCommander to do so, MoveItPy is not a straight forward switch, especially if the startup of the UserApp + access to MoveIt was done separately from the MoveIt core functions.</p> <hr /> <p><a href="https://answers.ros.org/question/415818/moveitpy-vs-moveitcommander/movegrouppython/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/768/guihome/" rel="nofollow noreferrer">GuiHome</a> on ROS Answers with karma: 242 on 2023-05-25</p> <p>Post score: 1</p>
MoveItPy vs MoveItCommander/MoveGroupPython
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>As far as I know, the only way to change a LaunchConfiguration (e.g. argument value) to a raw Python type is through the opaque function. LaunchConfiguration's can be concatenated to others, or to string, that lead to a new LaunchConfiguration that can be passed to an included launch or to a node (params / remaps / arguments). But as you have seen, it cannot be used as a raw Python type which is necessary when using them in a loop.</p> <p>You can find here an example of launch argument that is used in a loop through an opaque function. The loop calls another launch files in a given namespace, with some arguments. <a href="https://github.com/oKermorgant/anf_launch/blob/main/launch/spawn_all_launch.py" rel="nofollow noreferrer">https://github.com/oKermorgant/anf_launch/blob/main/launch/spawn_all_launch.py</a></p> <p>The <a href="https://github.com/oKermorgant/anf_launch" rel="nofollow noreferrer">anf_launch</a> was created for a seminar on ROS 2 launch files and highlights most of the use cases.</p> <p>Note that it relies on <a href="https://github.com/oKermorgant/simple_launch" rel="nofollow noreferrer">simple_launch</a> (I am the author) to hide all the wrapping around OpaqueFunction.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/11856/olivier-kermorgant/" rel="nofollow noreferrer">Olivier Kermorgant</a> with karma: 280 on 2023-05-26</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/148269/i1cps/" rel="nofollow noreferrer">i1Cps</a> on 2023-06-12</strong>:<br /> Thanks Olivier, <code>simple_launch</code> was exactly what i needed</p>
103310
2023-05-25T14:32:41.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Version: ROS2 Foxy</p> <p>Platform: Ubuntu 20:04</p> <p>Hello everyone,</p> <p>I'm programmatically calling a launch file 'c' from a launch file 'b' from a launch file 'a' which is called in the terminal. In launch file 'b' I have two hard coded variables to calculate how many robots I want to spawn and where to spawn them. I want these hard coded variables to become arguments which are passed to launch file 'b' from launch file 'a'.</p> <p>Without over complicating the question, I need to be able to perform calculations using them as typical python variables.</p> <pre><code>import os from ament_index_python.packages import get_package_share_directory, get_package_prefix from launch import LaunchDescription, LaunchContext from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource from launch.substitutions import TextSubstitution, LaunchConfiguration,PythonExpression,PathJoinSubstitution def gen_robot_list(number_of_robots, map_number): #This function will calculate robot attributes using two variables #This is the one condition I dont want to have to change. _ = '' def generate_launch_description(): #Process the URDF file pkg_path = os.path.join(get_package_share_directory('my_bot')) xacro_file = os.path.join(pkg_path,'description','robot.urdf.xacro') map_number = LaunchConfiguration('map_number') number_of_robots = LaunchConfiguration('number_of_robots') #Below is where the argument variables will go (Replacing '2' and '7') robots = gen_robot_list(2, 7) # Create the list of spawn robots commands spawn_robots_cmds = [] # Below is all neccessary for multi-robot control within ros name spaces and stuff for robot in robots: print(&quot;#############&quot;+str(robot)) spawn_robots_cmds.append( IncludeLaunchDescription( PythonLaunchDescriptionSource(os.path.join( get_package_share_directory('my_bot'), 'launch', 'c.launch.py')), # Arguments to pass into the node which spawns the robot entity in gazebo launch_arguments={ 'robot_urdf': xacro_file, 'x': TextSubstitution(text=str(robot['x_pose'])), 'y': TextSubstitution(text=str(robot['y_pose'])), 'z': TextSubstitution(text=str(robot['z_pose'])), 'robot_name': robot['name'], 'robot_name_prefix': robot['name']+'/', 'robot_namespace': robot['ns'], 'use_sim_time': 'true', 'rotation': TextSubstitution(text=str(robot['rotation'])), }.items() ) ) # Create the launch description and populate ld = LaunchDescription() # Creates a independent launch desc for each robot in list creating # multiple robot state publishers and entity spawners for spawn_robot_cmd in spawn_robots_cmds: ld.add_action(spawn_robot_cmd) return ld </code></pre> <p>What have I tried so far:</p> <p>I have managed to add simple LaunchArguments that I convert to LaunchConfiguration's. `</p> <h1>Declare a launch argument 'map_number'</h1> <pre><code>map_number_arg = DeclareLaunchArgument( 'map_number', default_value='1', description='Number of the map to be launched' ) robot_number_arg = DeclareLaunchArgument( 'robot_numbers', default_value='3', description='Number of robots to be launched' ) # This Launch file handles the simulation of the environment (Gazebo) start_world = IncludeLaunchDescription( PythonLaunchDescriptionSource(os.path.join(get_package_share_directory(package_name), 'launch', 'start_world.launch.py')), launch_arguments={ 'map_number': LaunchConfiguration('map_number'), 'robot_number': TextSubstitution(text=str(LaunchConfiguration('robot_number'))) }.items() )` </code></pre> <p>These launch configuration can be passed to different launch files fine. But I cant access them as normal python variables I.E. I cant do <code>LC=LaunchConfiguration('number_of_robots')</code> then <code>for i in range of(LC):</code> or <code>if LC==1:</code></p> <p>I tried using Opaque Functions which allows the perform(context) function to work. This was the closest solution so far but I'm pretty sure they can only be used to launch nodes, not deal with calling other Launch files. I think this because every source code I have found using OpaqueFunction directly calls a Node, And when I try to call a Launch file with it. I get error: <code>exception=AttributeError(&quot;'OpaqueFunction' object has no attribute 'get_launch_arguments'&quot;)</code></p> <p>I tried using text substitutions which honestly sounded like they would fix everything but have a separate purpose that has nothing to do substituting LaunchConfigurations to strings</p> <p>TO SUMMARISE:</p> <p>I want to pass variables from one launch file to another, This must be done programmaticaly and I need to be able to use them as a pure python variable. I.E. will <code>print(variable)</code> print a string variable or will it print a LaunchConfugration object ID due to LaunchConfiguration's not being calculated during run time.</p> <p>Been stuck on this for a couple months and I'm beginning to think this idea is not how ROS2 Launch files were designed to be used. So, if its truly not possible what would be a better alternative to the way I'm currently doing things.</p> <p>Thanks for your time!</p> <hr /> <p><a href="https://answers.ros.org/question/415825/can-i-programmatically-call-a-launch-file-with-arguments-that-can-be-used-as-a-variable-for-python-operations/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/148269/i1cps/" rel="nofollow noreferrer">i1Cps</a> on ROS Answers with karma: 3 on 2023-05-25</p> <p>Post score: 0</p>
Can I programmatically call a launch file with arguments that can be used as a variable for python operations
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>This is documented in section 7.1 of <a href="https://wiki.ros.org/xacro" rel="nofollow noreferrer">https://wiki.ros.org/xacro</a></p> <p>Example snippet: <code>params=&quot;x y:=${2*y} z:=0&quot;</code></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-05-27</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103312
2023-05-26T14:52:32.000
|xacro|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have a main xacro file where I am calling another xacro as such:</p> <pre><code> &lt;xacro:include filename=&quot;$(find uuv_gazebo_ros_plugins)/urdf/thruster_snippets.xacro&quot;/&gt; </code></pre> <p>I have modified the included xacro &quot;thruster_snippets.xacro&quot; so that I can change the size of the thrusters if needed. (sometimes the .dae file is large and therefore needs to be scaled down). The parameter that I added was <strong>scale</strong> to the &quot;<strong>generic_thruster_macro</strong>&quot; and the &quot;<strong>thruster_module_first_order_basic_fcn_macro</strong>&quot;.</p> <p>However, I want to set a default value for scale so that I don't have to include that parameter every time I add a new robot.</p> <p>Does anyone know how to do this?</p> <p>This code looks like this:</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;!-- ROTOR DYNAMICS MACROS --&gt; &lt;!-- First order dynamics --&gt; &lt;xacro:macro name=&quot;rotor_dyn_first_order_macro&quot; params=&quot;time_constant&quot;&gt; &lt;dynamics&gt; &lt;type&gt;FirstOrder&lt;/type&gt; &lt;timeConstant&gt;${time_constant}&lt;/timeConstant&gt; &lt;/dynamics&gt; &lt;/xacro:macro&gt; &lt;!-- MACROS FOR CONVERSION FUNCTIONS BETWEEN ROTOR'S ANG. VELOCITY AND THRUSTER FORCE --&gt; &lt;!-- 1) Basic curve Input: x Output: thrust Function: thrust = rotorConstant * x * abs(x) --&gt; &lt;xacro:macro name=&quot;thruster_cf_basic_macro&quot; params=&quot;rotor_constant&quot;&gt; &lt;conversion&gt; &lt;type&gt;Basic&lt;/type&gt; &lt;rotorConstant&gt;${rotor_constant}&lt;/rotorConstant&gt; &lt;/conversion&gt; &lt;/xacro:macro&gt; &lt;!-- 2) Dead-zone nonlinearity described in [1] [1] Bessa, Wallace Moreira, Max Suell Dutra, and Edwin Kreuzer. &quot;Thruster dynamics compensation for the positioning of underwater robotic vehicles through a fuzzy sliding mode based approach.&quot; ABCM Symposium Series in Mechatronics. Vol. 2. 2006. Input: x Output: thrust Function: thrust = rotorConstantL * (x * abs(x) - deltaL), if x * abs(x) &lt;= deltaL thrust = 0, if deltaL &lt; x * abs(x) &lt; deltaR thrust = rotorConstantR * (x * abs(x) - deltaR), if x * abs(x) &gt;= deltaL --&gt; &lt;xacro:macro name=&quot;thruster_cf_dead_zone_macro&quot; params=&quot;rotor_constant_l rotor_constant_r delta_l delta_r&quot;&gt; &lt;conversion&gt; &lt;type&gt;Bessa&lt;/type&gt; &lt;rotorConstantL&gt;<span class="math-container">${rotor_constant_l}&lt;/rotorConstantL&gt; &lt;rotorConstantR&gt;$</span>{rotor_constant_r}&lt;/rotorConstantR&gt; &lt;deltaL&gt;<span class="math-container">${delta_l}&lt;/deltaL&gt; &lt;deltaR&gt;$</span>{delta_r}&lt;/deltaR&gt; &lt;/conversion&gt; &lt;/xacro:macro&gt; &lt;!-- 3) Linear interpolation If you have access to the thruster's data sheet, for example, you can enter samples of the curve's input and output values and the thruster output will be found through linear interpolation of the given samples. --&gt; &lt;xacro:macro name=&quot;thruster_cf_linear_interp_macro&quot; params=&quot;input_values output_values&quot;&gt; &lt;conversion&gt; &lt;type&gt;LinearInterp&lt;/type&gt; &lt;inputValues&gt;<span class="math-container">${input_values}&lt;/inputValues&gt; &lt;outputValues&gt;$</span>{output_values}&lt;/outputValues&gt; &lt;/conversion&gt; &lt;/xacro:macro&gt; &lt;!-- THRUSTER MODULE MACROS --&gt; &lt;xacro:macro name=&quot;generic_thruster_macro&quot; params=&quot;namespace thruster_id *origin mesh_filename scale *dynamics *conversion&quot;&gt; &lt;joint name=&quot;<span class="math-container">${namespace}/thruster_$</span>{thruster_id}_joint&quot; type=&quot;continuous&quot;&gt; &lt;xacro:insert_block name=&quot;origin&quot;/&gt; &lt;axis xyz=&quot;1 0 0&quot;/&gt; &lt;parent link=&quot;<span class="math-container">${namespace}/base_link"/&gt; &lt;child link="$</span>{namespace}/thruster_${thruster_id}&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;<span class="math-container">${namespace}/thruster_$</span>{thruster_id}&quot;&gt; &lt;xacro:box_inertial x=&quot;0&quot; y=&quot;0&quot; z=&quot;0&quot; mass=&quot;0.001&quot;&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;/xacro:box_inertial&gt; &lt;visual&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz=&quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;mesh filename=&quot;<span class="math-container">${mesh_filename}" scale="$</span>{scale}&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;collision&gt; &lt;!-- todo: gazebo needs a collision volume or it will ignore the pose of the joint that leads to this link (and assume it to be the identity) --&gt; &lt;geometry&gt; &lt;cylinder length=&quot;0.000001&quot; radius=&quot;0.000001&quot;/&gt; &lt;/geometry&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo&gt; &lt;plugin name=&quot;<span class="math-container">${namespace}_$</span>{thruster_id}_thruster_model&quot; filename=&quot;libuuv_thruster_ros_plugin.so&quot;&gt; &lt;linkName&gt;<span class="math-container">${namespace}/thruster_$</span>{thruster_id}&lt;/linkName&gt; &lt;jointName&gt;<span class="math-container">${namespace}/thruster_$</span>{thruster_id}_joint&lt;/jointName&gt; &lt;thrusterID&gt;${thruster_id}&lt;/thrusterID&gt; &lt;xacro:insert_block name=&quot;dynamics&quot;/&gt; &lt;xacro:insert_block name=&quot;conversion&quot;/&gt; &lt;/plugin&gt; &lt;/gazebo&gt; &lt;gazebo reference=&quot;<span class="math-container">${namespace}/thruster_$</span>{thruster_id}&quot;&gt; &lt;selfCollide&gt;false&lt;/selfCollide&gt; &lt;/gazebo&gt; &lt;/xacro:macro&gt; &lt;!-- Thruster model with first order dynamic model for the rotor dynamics and a proportional non-linear steady-state conversion from the rotor's angular velocity to output thrust force --&gt; &lt;xacro:macro name=&quot;thruster_module_first_order_basic_fcn_macro&quot; params=&quot;namespace thruster_id *origin mesh_filename scale dyn_time_constant rotor_constant&quot;&gt; &lt;xacro:generic_thruster_macro namespace=&quot;<span class="math-container">${namespace}" thruster_id="$</span>{thruster_id}&quot; mesh_filename=&quot;<span class="math-container">${mesh_filename}" scale = "$</span>{scale}&quot;&gt; &lt;xacro:insert_block name=&quot;origin&quot;/&gt; &lt;xacro:rotor_dyn_first_order_macro time_constant=&quot;<span class="math-container">${dyn_time_constant}"/&gt; &lt;xacro:thruster_cf_basic_macro rotor_constant="$</span>{rotor_constant}&quot;/&gt; &lt;/xacro:generic_thruster_macro&gt; &lt;/xacro:macro&gt; &lt;/robot&gt; </code></pre> <hr /> <p><a href="https://answers.ros.org/question/415876/%5Bgazebo-11%5D-how-to-set-a-default-variable/parameter-in-xacro/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/53275/anonymous53275/" rel="nofollow noreferrer">anonymous53275</a> on ROS Answers with karma: 1 on 2023-05-26</p> <p>Post score: 0</p>
[gazebo 11] How to set a default variable/parameter in xacro
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I ended up writing a simple Python script which concatenates the two yaml files together into one yaml file, then loads that one. Like this: <a href="https://www.geeksforgeeks.org/python-program-to-merge-two-files-into-a-third-file/" rel="nofollow noreferrer">https://www.geeksforgeeks.org/python-program-to-merge-two-files-into-a-third-file/</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/21281/andyze/" rel="nofollow noreferrer">AndyZe</a> with karma: 2331 on 2023-05-28</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103314
2023-05-28T14:32:45.000
|ros|yaml|parameters|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I want to load 2 sets of parameters from 2 different yamls to the same namespace from a launch file, like this:</p> <p>YAML1:</p> <pre><code>- id: foo1 waypoints: - type: foo1 </code></pre> <p>YAML2:</p> <pre><code>- id: foo2 waypoints: - type: foo2 </code></pre> <p>Launch file:</p> <pre><code> &lt;node name=&quot;foo&quot; pkg=&quot;foo&quot; type=&quot;foo&quot; required=&quot;true&quot;&gt; &lt;!-- Common config, applicable to all robot types --&gt; &lt;rosparam file=&quot;<span class="math-container">$(arg common_maintenance_config)" command="load" ns="maintenance_motions"/&gt; &lt;!-- Configuration specific to this robot --&gt; &lt;rosparam file="$</span>(arg robot_specific_maintenance_config)&quot; command=&quot;load&quot; ns=&quot;maintenance_motions&quot;/&gt; &lt;/node&gt; </code></pre> <p>Seems pretty straight-forward, right? In practice, I find that the second set of parameters overwrites the first. So if I do <code>rosparam get /maintenance_motions</code> the result is:</p> <pre><code>- id: foo2 waypoints: - type: foo2 </code></pre> <p>So the second yaml overwrote the first one. What is the least janky workaround? I've already tried loading all parameters in the global namespace.</p> <hr /> <p><a href="https://answers.ros.org/question/415922/loading-2-yaml%27s-to-same-parameter-namespace/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/21281/andyze/" rel="nofollow noreferrer">AndyZe</a> on ROS Answers with karma: 2331 on 2023-05-28</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/21281/andyze/" rel="nofollow noreferrer">AndyZe</a> on 2023-05-28</strong>:<br /> Kinda-related question: <a href="https://answers.ros.org/question/199608/roslaunch-order-of-rosparams/" rel="nofollow noreferrer">https://answers.ros.org/question/199608/roslaunch-order-of-rosparams/</a></p> <p>Possible answer involving a Python script here: <a href="https://answers.ros.org/question/361582/ros-launch-get-param-in-launch-file-to-append-to-param-from-config-file/?answer=397388#post-id-397388" rel="nofollow noreferrer">https://answers.ros.org/question/361582/ros-launch-get-param-in-launch-file-to-append-to-param-from-config-file/?answer=397388#post-id-397388</a></p>
Loading 2 yaml's to same parameter namespace
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>The 'time_from_start' field must be a sub <strong>message</strong> of type 'Duration'</p> </blockquote> <p>You are using the wrong type of object. These two object types are not interchangable: rclpy.time.Duration and builtin_interfaces.msg.Duration</p> <p>You can convert between them using the time.Duration methods <code>to_msg()</code> and <code>from_msg()</code></p> <pre><code>from rclpy.time import Duration my_duration_msg = Duration(seconds=10.0).to_msg() </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-05-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/151050/icon45/" rel="nofollow noreferrer">Icon45</a> on 2023-05-29</strong>:<br /> Hi Mike,</p> <p>thanks for your answer, i updated the line <code>from rclpy.time import Duration</code> to <code>from biultin_interfaces.msg import Duration</code> and now i' getting the following error: <code>TypeError: Duration.__init__() takes 1 positional argument but 2 were given</code></p> <p>The line where i use the Duration is now as follows:</p> <pre><code>point.time_from_start = Duration(1.0) </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-05-29</strong>:<br /> I updated my answer.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/151050/icon45/" rel="nofollow noreferrer">Icon45</a> on 2023-05-30</strong>:<br /> Hi Mike thank you very much for the update. It Worked!</p>
103316
2023-05-29T03:24:49.000
|ros|rclpy|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi everyone,</p> <p>i created a python node, that should controll a Universal Robot UR10 via a Joint Trajectory. Here's its code:</p> <pre><code>#!/usr/bin/env python3 import rclpy from rclpy.node import Node from rclpy.time import Duration from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint class Ur10ManualJoints(Node): def __init__(self): super().__init__('Ur10ManualJoints') #Publisher creation self.publisher = self.create_publisher(JointTrajectory, 'joint_trajectory', 10) joint_name = ['shoulder_pan_joint', 'shoulder_lift_joint','elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'] joint_pos = [] for joint_name in joint_name: pos = input(f'Gebe Position für {joint_name} ein:') # Translation: Enter position for {joint_name} joint_pos.append(float(pos)) #Constructing the Message joint_traj_msg = JointTrajectory() joint_traj_msg.joint_names = joint_name point = JointTrajectoryPoint() point.positions = joint_pos point.time_from_start = Duration(seconds=10) joint_traj_msg.points.append(point) #Publish th msg self.get_logger().info(f&quot;[HINWEIS] Nachricht: {joint_traj_msg} wurde veröffentlicht&quot;) #Translation: Message {joint_traj_msg} was published self.publisher.publish(joint_traj_msg) def main(args=None): rclpy.init(args=args) node = Ur10ManualJoints() rclpy.spin(node) rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p>And here's the Error i get when running the node:</p> <pre><code>ros2 run ur10_faps_driver Ur10ManualJoints Gebe Position für shoulder_pan_joint ein:1 Gebe Position für shoulder_lift_joint ein:1 Gebe Position für elbow_joint ein:1 Gebe Position für wrist_1_joint ein:1 Gebe Position für wrist_2_joint ein:1 Gebe Position für wrist_3_joint ein:1 Traceback (most recent call last): File &quot;/home/ubuntu/Schreibtisch/ros2_ws/install/ur10_faps_driver/lib/ur10_faps_driver/Ur10ManualJoints&quot;, line 33, in &lt;module&gt; sys.exit(load_entry_point('ur10-faps-driver==0.0.0', 'console_scripts', 'Ur10ManualJoints')()) File &quot;/home/ubuntu/Schreibtisch/ros2_ws/install/ur10_faps_driver/lib/python3.10/site-packages/ur10_faps_driver/Ur10ManualJoints.py&quot;, line 39, in main node = Ur10ManualJoints() File &quot;/home/ubuntu/Schreibtisch/ros2_ws/install/ur10_faps_driver/lib/python3.10/site-packages/ur10_faps_driver/Ur10ManualJoints.py&quot;, line 29, in __init__ point.time_from_start = Duration(seconds=10) File &quot;/opt/ros/humble/local/lib/python3.10/dist-packages/trajectory_msgs/msg/_joint_trajectory_point.py&quot;, line 271, in time_from_start assert \ AssertionError: The 'time_from_start' field must be a sub message of type 'Duration' 1[ros2run]: Process exited with failure 1 </code></pre> <p>Does anyone know wahts going on here, bc i didn`t find anything on the internet about such an error.</p> <hr /> <p><a href="https://answers.ros.org/question/415938/assertionerror:-the-%27time_from_start%27-field-must-be-a-sub-message-of-type-%27duration%27/" 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-05-29</p> <p>Post score: 0</p>
AssertionError: The 'time_from_start' field must be a sub message of type 'Duration'
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>The best way to get code that's indexed is to leverage the tool <a href="http://wiki.ros.org/rosinstall_generator" rel="nofollow noreferrer"><code>rosinstall_generator</code> documented here</a></p> <p>In general git repositories don't support checking out specific subtrees so we generally don't do partial checkouts, but if you really need to to that you can put COLCON_IGNORE files in checked out packages that you want to skip before you build. There are some other ignore logic available from colcon too.</p> <p>The output of rosinstall_generator is then typically piped to <code>vcstool</code> <a href="https://github.com/dirk-thomas/vcstool" rel="nofollow noreferrer">https://github.com/dirk-thomas/vcstool</a></p> <p>The name is based on the previous downstrema tool <code>rosinstall</code>.</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-05-30</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103318
2023-05-29T23:53:42.000
|ros|ros2|github|colcon|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><strong>Is there a standard way to download a ROS2 package from GitHub and install it with<code>colcon</code>?</strong></p> <p>I am looking for something more automated than just copy-pasting or using git submodules. I am currently getting away by using CMake <code>ExternalProject_Add</code> but I was curious if there was a better way.</p> <p>Bonus question: what if I want to compile and install only one package in a repository with multiple packages? For example the <a href="https://github.com/ros2/common_interfaces/tree/humble/geometry_msgs" rel="nofollow noreferrer"><code>geometry_msgs</code></a> package in the <a href="https://github.com/ros2/common_interfaces/tree/humble" rel="nofollow noreferrer"><code>common_interfaces</code></a> repository.</p> <hr /> <p><a href="https://answers.ros.org/question/415964/download-a-ros2-package-from-github-and-install-it-with-colcon/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/134345/laststardust/" rel="nofollow noreferrer">LastStarDust</a> on ROS Answers with karma: 3 on 2023-05-29</p> <p>Post score: 0</p>
Download a ROS2 package from GitHub and install it with colcon
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi!</p> <p>From the <a href="http://wiki.ros.org/roscpp/Overview/Timers" rel="nofollow noreferrer">roscpp tutorials</a>:</p> <blockquote> <p>Note that, in this example, the timer object must be a member of the class for callbacks to fire.</p> </blockquote> <p>Thus, you should have</p> <pre><code>class Timer { public: ros::NodeHandle nh_; Timer(ros::NodeHandle* nh) ; void init_timers(); void stateTimerCallback(const ros::TimerEvent&amp; event); ros::Timer timer_; }; </code></pre> <p>and modify the line where you call <code>nh_.createTimer()</code> as follows:</p> <pre><code>timer_ = nh_.createTimer(ros::Duration(1.0),&amp;Timer::stateTimerCallback,this,oneshot,autostart); </code></pre> <p>Hope this helps!</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-05-31</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/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-05-31</strong>:<br /> Summarising: the <code>timer_</code> object only &quot;exists&quot; as long as <code>init_timers()</code> is executing. Which is perhaps a couple hundred nanoseconds. It then immediately gets destroyed. No <code>timer_</code> -&gt; no callbacks.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/151868/gaunav/" rel="nofollow noreferrer">GauNav</a> on 2023-06-01</strong>:<br /> Thanks @bluegiraffe-sc , @gvdhoorn .</p>
103320
2023-05-31T00:53:20.000
|ros|roscpp|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Here Is My timer callback code</p> <pre class="lang-cpp prettyprint-override"><code> #include #include class Timer { public: ros::NodeHandle nh_; Timer(ros::NodeHandle* nh) ; void init_timers(); void stateTimerCallback(const ros::TimerEvent& event); }; Timer::Timer(ros::NodeHandle* nh) : nh_(*nh) { Timer::init_timers(); } void Timer::init_timers() { const bool oneshot = false; bool autostart = true; ros::Timer timer_ = nh_.createTimer(ros::Duration(1.0),&Timer::stateTimerCallback,this,oneshot,autostart); timer_.start() ; ROS_INFO("Init_Timer \n"); printf("Init_Timer\n"); ROS_DEBUG("Init_Timer\n"); } void Timer::stateTimerCallback(const ros::TimerEvent& event) { ROS_INFO("I am here\n"); printf("I am here\n"); ROS_DEBUG("I am here\n"); } int main(int argc, char **argv) { ros::init(argc,argv,"timer_node"); ros::NodeHandle nh; Timer timer(&nh); ros::spin(); return 0; } </code></pre> <p>The output i get after running the node</p> <pre><code> $ rosrun timertest timertest_node [ INFO] [1685511182.674019058]: /timer_node: Init_Timer Init_Timer </code></pre> <p>I wait for 1 minute but still there was no output from callback. What might be the reason ?</p> <hr /> <p><a href="https://answers.ros.org/question/416000/timer-callback-not-getting-called/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/151868/gaunav/" rel="nofollow noreferrer">GauNav</a> on ROS Answers with karma: 3 on 2023-05-31</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/151868/gaunav/" rel="nofollow noreferrer">GauNav</a> on 2023-05-31</strong>:<br /> Really sorry if my question comes out as silly. I am not completely sure about working of roscpp.</p>
Timer Callback not getting called
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Assuming this is Gazebo Classic (as opposed to the new Gazebo, formerly Ignition) I suspect this is the same as <a href="https://github.com/UniversalRobots/Universal_Robots_ROS2_Gazebo_Simulation/issues/19" rel="nofollow noreferrer">https://github.com/UniversalRobots/Universal_Robots_ROS2_Gazebo_Simulation/issues/19</a></p> <p>There's a lot of detail there but I'll briefly summarize for the forum here.</p> <p>In ROS 1, <code>gazebo_ros_control</code> set the Open Dynamics Engine <code>dParamFmax</code> parameter <a href="https://github.com/ros-simulation/gazebo_ros_pkgs/blob/noetic-devel/gazebo_ros_control/src/default_robot_hw_sim.cpp#L240" rel="nofollow noreferrer">here</a>. This parameter is used in ODE joint motors:</p> <p><a href="http://ode.org/wiki/index.php/Manual#Stops_and_motor_parameters" rel="nofollow noreferrer">http://ode.org/wiki/index.php/Manual#Stops_and_motor_parameters</a></p> <blockquote> <p>Joint motors solve all these problems: they bring the body up to speed in one time step, provided that does not take more force than is allowed</p> </blockquote> <p>The <code>gazebo_ros2_control</code> plugin, as far as I can tell, does not set this parameter right now and IIRC it defaults to zero.</p> <p>Because of the way passive joint friction is implemented in ODE, a <a href="https://github.com/gazebosim/gazebo-classic/blob/gazebo11/gazebo/physics/ode/ODEJoint.cc#L444" rel="nofollow noreferrer">joint motor with zero speed and a max force</a>, a workaround for <em>active</em> joints without building <code>gazebo_ros2_control</code> from source is to add a joint <code>&lt;dynamics&gt;</code> tag to your URDF with the friction parameter set to some suitable value for this maximum joint motor force parameter.</p> <p><code>gazebo_ros_control</code> set the <code>dParamFmax</code> or <code>fmax</code> parameter to the joint effort limit. IMO, theoretically, it should probably be higher than that with joint effort limits enforced in some other way, but practically either should work fine for simulation.</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-05-31</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/150922/roskuttan/" rel="nofollow noreferrer">Roskuttan</a> on 2023-05-31</strong>:<br /> I would like to extend my deepest gratitude for the outstanding solution you provided to our problem. The inclusion of the dynamics tag, incorporating friction and damping, in my code has had a remarkable impact. The manipulator now remains stationary as intended, which is exactly the behavior I had anticipated. Your willingness to address my inquiries has been incredibly beneficial. Your contribution, particularly the integration of the dynamics tag, has made a significant and valuable difference. I cannot express enough how grateful I am for your assistance.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/126315/aki1608/" rel="nofollow noreferrer">Aki1608</a> on 2023-06-06</strong>:<br /> This solved my issue as well. Thank you so much. @danzimmerman and @Roskuttan. :)</p>
103322
2023-05-31T04:57:36.000
|gazebo|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><strong>Hello Ros Community,</strong></p> <p><strong>Description:</strong> I am currently in the process of developing a six-axis manipulator in ROS 2, utilizing MoveIt 2 for motion planning and Gazebo for simulation. Regrettably, I am facing a perplexing issue where the manipulator demonstrates peculiar behavior and instability, particularly when I employ position control as the command interface in Gazebo. To provide further clarity, I have included relevant visuals,launch files and urdf that can be accessed <a href="https://drive.google.com/drive/folders/1EUNBH-oY05JytrRrNj5-cKArNqGPdPcN?usp=drive_link" rel="nofollow noreferrer">HERE</a>.</p> <p>I am using ROS2 Humble</p> <p>To provide more context and aid in troubleshooting, here are the details related to the problem:</p> <p><strong>I am using the following launch file to start the Gazebo simulation and relevant ROS nodes:</strong></p> <blockquote> <p>ros2 launch hexa_bot_description gazebo.launch.py use_sim_time:=true</p> </blockquote> <p><strong>When executing the gazebo.launch.py launch file, the following log messages are displayed:</strong></p> <p>[INFO] [launch]: All log files can be found below /home/roskuttan/.ros/log/2023-05-31-08-57-10-218724-SILENT-KILLERED-1779 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [1780] [INFO] [joint_state_publisher-2]: process started with pid [1782] [INFO] [gzserver-3]: process started with pid [1784] [INFO] [gzclient-4]: process started with pid [1786] [INFO] [spawn_entity-5]: process started with pid [1788] [robot_state_publisher-1] [WARN] [1685503631.131584399] [kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. [robot_state_publisher-1] [INFO] [1685503631.131687999] [robot_state_publisher]: got segment JAW1_1 [robot_state_publisher-1] [INFO] [1685503631.131721599] [robot_state_publisher]: got segment JAW2_1 [robot_state_publisher-1] [INFO] [1685503631.131729199] [robot_state_publisher]: got segment JAW3_1 [robot_state_publisher-1] [INFO] [1685503631.131734199] [robot_state_publisher]: got segment JAW6_1 [robot_state_publisher-1] [INFO] [1685503631.131738899] [robot_state_publisher]: got segment Jaw4_1 [robot_state_publisher-1] [INFO] [1685503631.131743399] [robot_state_publisher]: got segment Jaw5_1 [robot_state_publisher-1] [INFO] [1685503631.131748099] [robot_state_publisher]: got segment NEMA_3_1 [robot_state_publisher-1] [INFO] [1685503631.131752799] [robot_state_publisher]: got segment NEMA_4_1 [robot_state_publisher-1] [INFO] [1685503631.131757499] [robot_state_publisher]: got segment NEMA_5_1 [robot_state_publisher-1] [INFO] [1685503631.131761999] [robot_state_publisher]: got segment Nema_1_1 [robot_state_publisher-1] [INFO] [1685503631.131766599] [robot_state_publisher]: got segment Nema_2_1 [robot_state_publisher-1] [INFO] [1685503631.131771199] [robot_state_publisher]: got segment Nema_6_1 [robot_state_publisher-1] [INFO] [1685503631.131775699] [robot_state_publisher]: got segment base_link [joint_state_publisher-2] [INFO] [1685503631.388555295] [joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic... [spawn_entity-5] [INFO] [1685503631.573401292] [spawn_entity]: Spawn Entity started [spawn_entity-5] [INFO] [1685503631.573742092] [spawn_entity]: Loading entity published on topic robot_description [spawn_entity-5] /opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead. [spawn_entity-5] warnings.warn( [spawn_entity-5] [INFO] [1685503631.575072992] [spawn_entity]: Waiting for entity xml on robot_description [spawn_entity-5] [INFO] [1685503631.577393492] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30 [spawn_entity-5] [INFO] [1685503631.577719191] [spawn_entity]: Waiting for service /spawn_entity [spawn_entity-5] [INFO] [1685503633.833226053] [spawn_entity]: Calling service /spawn_entity [spawn_entity-5] [INFO] [1685503634.191623847] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [hexa_bot] [gzserver-3] [INFO] [1685503634.323934645] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin [gzserver-3] [INFO] [1685503634.327896245] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: / [gzserver-3] [INFO] [1685503634.328103945] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control [gzserver-3] [INFO] [1685503634.328150045] [gazebo_ros2_control]: Loading parameter files /home/roskuttan/hexa_bot_ws/install/hexa_bot_description/share/hexa_bot_description/config/hexa_bot.yaml [gzserver-3] [INFO] [1685503634.331047945] [gazebo_ros2_control]: connected to service!! robot_state_publisher [gzserver-3] [INFO] [1685503634.331636045] [gazebo_ros2_control]: Recieved urdf from param server, parsing... [gzserver-3] [INFO] [1685503634.339149145] [gazebo_ros2_control]: Loading joint: joint_1 [gzserver-3] [INFO] [1685503634.339277145] [gazebo_ros2_control]: State: [gzserver-3] [INFO] [1685503634.339294445] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339308445] [gazebo_ros2_control]: found initial value: 0.000000 [gzserver-3] [INFO] [1685503634.339355745] [gazebo_ros2_control]: velocity [gzserver-3] [INFO] [1685503634.339370145] [gazebo_ros2_control]: Command: [gzserver-3] [INFO] [1685503634.339380745] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339434745] [gazebo_ros2_control]: Loading joint: joint_2 [gzserver-3] [INFO] [1685503634.339447245] [gazebo_ros2_control]: State: [gzserver-3] [INFO] [1685503634.339457845] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339467945] [gazebo_ros2_control]: found initial value: 0.000000 [gzserver-3] [INFO] [1685503634.339480145] [gazebo_ros2_control]: velocity [gzserver-3] [INFO] [1685503634.339490045] [gazebo_ros2_control]: Command: [gzserver-3] [INFO] [1685503634.339500045] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339518345] [gazebo_ros2_control]: Loading joint: joint_3 [gzserver-3] [INFO] [1685503634.339529145] [gazebo_ros2_control]: State: [gzserver-3] [INFO] [1685503634.339539545] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339549045] [gazebo_ros2_control]: found initial value: 0.000000 [gzserver-3] [INFO] [1685503634.339560345] [gazebo_ros2_control]: velocity [gzserver-3] [INFO] [1685503634.339570345] [gazebo_ros2_control]: Command: [gzserver-3] [INFO] [1685503634.339580945] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339596745] [gazebo_ros2_control]: Loading joint: joint_4 [gzserver-3] [INFO] [1685503634.339607345] [gazebo_ros2_control]: State: [gzserver-3] [INFO] [1685503634.339617045] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339625945] [gazebo_ros2_control]: found initial value: 0.000000 [gzserver-3] [INFO] [1685503634.339637045] [gazebo_ros2_control]: velocity [gzserver-3] [INFO] [1685503634.339646245] [gazebo_ros2_control]: Command: [gzserver-3] [INFO] [1685503634.339656045] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339673545] [gazebo_ros2_control]: Loading joint: joint_5 [gzserver-3] [INFO] [1685503634.339681245] [gazebo_ros2_control]: State: [gzserver-3] [INFO] [1685503634.339687245] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339693645] [gazebo_ros2_control]: found initial value: 0.000000 [gzserver-3] [INFO] [1685503634.339701245] [gazebo_ros2_control]: velocity [gzserver-3] [INFO] [1685503634.339707145] [gazebo_ros2_control]: Command: [gzserver-3] [INFO] [1685503634.339713145] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339722645] [gazebo_ros2_control]: Loading joint: joint_6 [gzserver-3] [INFO] [1685503634.339729245] [gazebo_ros2_control]: State: [gzserver-3] [INFO] [1685503634.339735045] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339740545] [gazebo_ros2_control]: found initial value: 0.000000 [gzserver-3] [INFO] [1685503634.339747545] [gazebo_ros2_control]: velocity [gzserver-3] [INFO] [1685503634.339753445] [gazebo_ros2_control]: Command: [gzserver-3] [INFO] [1685503634.339759445] [gazebo_ros2_control]: position [gzserver-3] [INFO] [1685503634.339879245] [resource_manager]: Initialize hardware 'GazeboSystem' [gzserver-3] [INFO] [1685503634.340063045] [resource_manager]: Successful initialization of hardware 'GazeboSystem' [gzserver-3] [INFO] [1685503634.340181345] [resource_manager]: 'configure' hardware 'GazeboSystem' [gzserver-3] [INFO] [1685503634.340187145] [resource_manager]: Successful 'configure' of hardware 'GazeboSystem' [gzserver-3] [INFO] [1685503634.340192045] [resource_manager]: 'activate' hardware 'GazeboSystem' [gzserver-3] [INFO] [1685503634.340195145] [resource_manager]: Successful 'activate' of hardware 'GazeboSystem' [gzserver-3] [INFO] [1685503634.340283245] [gazebo_ros2_control]: Loading controller_manager [gzserver-3] [INFO] [1685503634.357185244] [gazebo_ros2_control]: Loaded gazebo_ros2_control. [INFO] [spawn_entity-5]: process has finished cleanly [pid 1788] [INFO] [ros2-6]: process started with pid [1934] [INFO] [ros2-7]: process started with pid [1936] [gzserver-3] [INFO] [1685503635.299160028] [controller_manager]: Loading controller 'joint_state_broadcaster' [gzserver-3] [INFO] [1685503635.312398828] [controller_manager]: Setting use_sim_time=True for joint_state_broadcaster to match controller manager (see ros2_control#325 for details) [gzserver-3] [INFO] [1685503635.315865028] [controller_manager]: Configuring controller 'joint_state_broadcaster' [gzserver-3] [INFO] [1685503635.316443328] [joint_state_broadcaster]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published [gzserver-3] [INFO] [1685503639.271185105] [controller_manager]: Loading controller 'arm_controller' [ros2-7] Sucessfully loaded controller joint_state_broadcaster into state active [gzserver-3] [INFO] [1685503639.293424404] [controller_manager]: Setting use_sim_time=True for arm_controller to match controller manager (see ros2_control#325 for details) [gzserver-3] [INFO] [1685503639.296883904] [controller_manager]: Configuring controller 'arm_controller' [gzserver-3] [INFO] [1685503639.297277404] [arm_controller]: No specific joint names are used for command interfaces. Using 'joints' parameter. [gzserver-3] [INFO] [1685503639.297381904] [arm_controller]: Command interfaces are [position] and state interfaces are [position velocity]. [gzserver-3] [INFO] [1685503639.297455104] [arm_controller]: Using 'splines' interpolation method. [gzserver-3] [INFO] [1685503639.299070304] [arm_controller]: Controller state will be published at 50.00 Hz. [gzserver-3] [INFO] [1685503639.300950304] [arm_controller]: Action status changes will be monitored at 20.00 Hz. [ros2-6] Sucessfully loaded controller arm_controller into state active [INFO] [ros2-7]: process has finished cleanly [pid 1936] [INFO] [ros2-6]: process has finished cleanly [pid 1934] [INFO] [gzclient-4]: process has finished cleanly [pid 1786]</p> <hr /> <p><a href="https://answers.ros.org/question/416011/strange-behavior-and-instability-of-six-axis-manipulator-in-ros-2-with-gazebo(classic)-when-using-position-control/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/150922/roskuttan/" rel="nofollow noreferrer">Roskuttan</a> on ROS Answers with karma: 53 on 2023-05-31</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/151888/gio/" rel="nofollow noreferrer">Gio</a> on 2023-05-31</strong>:<br /> I'm also having such issues in my project someone help me with a solution it's so urgent I'm at the deadline of my project</p>
Strange behavior and instability of six-axis manipulator in ROS 2 with Gazebo(Classic) when using position control
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have successfully resolved the issue and would like to share the resolution process, which may benefit others who encounter a similar problem. The issue I faced was twofold:</p> <p><strong>1. Discrepancy in the Naming Convention:</strong></p> <p>In my <code>hexa_bot.yaml</code> file, the arm controller was referenced as <code>arm_controller</code>. However, in the MoveIt configuration files, <code>ros2_controllers.yaml</code> and <code>moveit_controllers.yaml</code>, the arm controller was named <code>arm_controller_controller</code>. This inconsistency in naming caused the system to be unable to correctly identify and match the arm controller across these files, leading to the failure in the execution of the motion plan. <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16862808993296626.png" alt="image description" /></p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16862810321322893.png" alt="image description" /></p> <p><strong>2. Incorrect Node Launch Sequence:</strong></p> <p>There was an issue with the controller manager dying, which was due to the incorrect sequence in which the launch nodes were initiated. The gazebo launch node should be started first, followed by the MoveIt demo launch node. Failing to do so resulted in the controller manager not starting properly.</p> <p>It's important to note that the issue was not related to the <code>gazebo_ros2_control</code> tag, which was initially suspected to be the cause.</p> <p>By correcting the naming discrepancy and ensuring consistency in referencing the arm controller across all the files (I changed <code>arm_controller_controller</code> to arm_controller in the <code>ros2_controllers.yaml</code> and <code>moveit_controllers.yaml</code> files), I was able to resolve the first issue. Ensuring the correct sequence of node launches resolved the second issue. Now, with the correct and consistent naming and proper node launch sequence, the system can accurately identify the arm controller, allowing the motion plan to be executed correctly and the ROS2 controller manager to function without any interruptions.</p> <p>This experience serves as a reminder of the importance of maintaining consistent naming conventions across different files within a project, especially when these files have interdependencies, and the necessity of following the correct node launch sequence.</p> <p>I hope this detailed explanation assists others facing similar issues. Consistency is crucial when dealing with complex systems like ROS2.</p> <p>I'd like to express my sincere gratitude to @danzimmerman for directing me towards the right path. Your input played a crucial role in identifying the root causes and arriving at the solutions. Thank you!</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/150922/roskuttan/" rel="nofollow noreferrer">Roskuttan</a> with karma: 53 on 2023-06-08</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103324
2023-06-01T02:33:59.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p><strong>Hello ROS Community,</strong></p> <p>I am currently working on a project with MoveIt 2 and ROS2 (Humble) and I am facing an issue I can't seem to resolve.</p> <p><strong>Context:</strong></p> <p>I am running a simulation of a six-jointed robot and using MoveIt 2 for planning. I have successfully created a motion plan for my robot, but when I try to execute the plan, it fails. Additionally, my controller manager keeps dying.</p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16856114416589717.png" alt="image description" /></p> <p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1685611450506468.jpg" alt="image description" /></p> <p>LOG:</p> <pre><code>roskuttan@SILENT-KILLERED:~/hexa_bot_ws$ ros2 launch hexa_bot_description_moveit_config demo.launch.py use_sim_time:=true [INFO] [launch]: All log files can be found below /home/roskuttan/.ros/log/2023-05-31-21-33-40-784795-SILENT-KILLERED-11858 [INFO] [launch]: Default logging verbosity is set to INFO Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead. [INFO] [static_transform_publisher-1]: process started with pid [11859] [INFO] [robot_state_publisher-2]: process started with pid [11861] [INFO] [move_group-3]: process started with pid [11863] [INFO] [rviz2-4]: process started with pid [11865] [INFO] [ros2_control_node-5]: process started with pid [11867] [INFO] [spawner-6]: process started with pid [11869] [INFO] [spawner-7]: process started with pid [11871] [static_transform_publisher-1] [INFO] [1685549021.419656555] [static_transform_publisher0]: Spinning until stopped - publishing transform [static_transform_publisher-1] translation: ('0.000000', '0.000000', '0.000000') [static_transform_publisher-1] rotation: ('0.000000', '0.000000', '0.000000', '1.000000') [static_transform_publisher-1] from 'world' to 'base_link' [ros2_control_node-5] [INFO] [1685549021.428105055] [resource_manager]: Loading hardware 'GazeboSystem' [ros2_control_node-5] terminate called after throwing an instance of 'pluginlib::LibraryLoadException' [ros2_control_node-5] what(): According to the loaded plugin descriptions the class gazebo_ros2_control/GazeboSystem with base class type hardware_interface::SystemInterface does not exist. Declared types are fake_components/GenericSystem mock_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem test_system [ros2_control_node-5] Stack trace (most recent call last): [ros2_control_node-5] #16 Object &quot;&quot;, at 0xffffffffffffffff, in [ros2_control_node-5] #15 Object &quot;/opt/ros/humble/lib/controller_manager/ros2_control_node&quot;, at 0x55bfce760d84, in [ros2_control_node-5] #14 Object &quot;/usr/lib/x86_64-linux-gnu/libc.so.6&quot;, at 0x7f99cabb9e3f, in __libc_start_main [robot_state_publisher-2] [WARN] [1685549021.429758155] [kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. [ros2_control_node-5] #13 Object &quot;/usr/lib/x86_64-linux-gnu/libc.so.6&quot;, at 0x7f99cabb9d8f, in [ros2_control_node-5] #12 Object &quot;/opt/ros/humble/lib/controller_manager/ros2_control_node&quot;, at 0x55bfce76089e, in [ros2_control_node-5] #11 Object &quot;/opt/ros/humble/lib/libcontroller_manager.so&quot;, at 0x7f99cb26d171, in controller_manager::ControllerManager::ControllerManager(std::shared_ptr&lt;rclcpp::Executor&gt;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, rclcpp::NodeOptions const&amp;) [ros2_control_node-5] #10 Object &quot;/opt/ros/humble/lib/libcontroller_manager.so&quot;, at 0x7f99cb26c257, in controller_manager::ControllerManager::init_resource_manager(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) [robot_state_publisher-2] [INFO] [1685549021.429863355] [robot_state_publisher]: got segment JAW1_1 [robot_state_publisher-2] [INFO] [1685549021.429918055] [robot_state_publisher]: got segment JAW2_1 [robot_state_publisher-2] [INFO] [1685549021.429927655] [robot_state_publisher]: got segment JAW3_1 [robot_state_publisher-2] [INFO] [1685549021.429934355] [robot_state_publisher]: got segment JAW6_1 [robot_state_publisher-2] [INFO] [1685549021.429940655] [robot_state_publisher]: got segment Jaw4_1 [robot_state_publisher-2] [INFO] [1685549021.429946955] [robot_state_publisher]: got segment Jaw5_1 [robot_state_publisher-2] [INFO] [1685549021.429953255] [robot_state_publisher]: got segment NEMA_3_1 [robot_state_publisher-2] [INFO] [1685549021.429959555] [robot_state_publisher]: got segment NEMA_4_1 [robot_state_publisher-2] [INFO] [1685549021.429965955] [robot_state_publisher]: got segment NEMA_5_1 [robot_state_publisher-2] [INFO] [1685549021.429972355] [robot_state_publisher]: got segment Nema_1_1 [robot_state_publisher-2] [INFO] [1685549021.429978655] [robot_state_publisher]: got segment Nema_2_1 [robot_state_publisher-2] [INFO] [1685549021.429984755] [robot_state_publisher]: got segment Nema_6_1 [robot_state_publisher-2] [INFO] [1685549021.429991155] [robot_state_publisher]: got segment base_link [ros2_control_node-5] #9 Object &quot;/opt/ros/humble/lib/libhardware_interface.so&quot;, at 0x7f99caabe207, in hardware_interface::ResourceManager::load_urdf(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, bool) [ros2_control_node-5] #8 Object &quot;/opt/ros/humble/lib/libhardware_interface.so&quot;, at 0x7f99caac6856, in [ros2_control_node-5] #7 Object &quot;/opt/ros/humble/lib/libhardware_interface.so&quot;, at 0x7f99caa9d858, in [ros2_control_node-5] #6 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f99cae86517, in __cxa_throw [ros2_control_node-5] #5 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f99cae862b6, in std::terminate() [ros2_control_node-5] #4 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f99cae8624b, in [ros2_control_node-5] #3 Object &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30&quot;, at 0x7f99cae7abbd, in [ros2_control_node-5] #2 Object &quot;/usr/lib/x86_64-linux-gnu/libc.so.6&quot;, at 0x7f99cabb87f2, in abort [ros2_control_node-5] #1 Object &quot;/usr/lib/x86_64-linux-gnu/libc.so.6&quot;, at 0x7f99cabd2475, in raise [ros2_control_node-5] #0 Object &quot;/usr/lib/x86_64-linux-gnu/libc.so.6&quot;, at 0x7f99cac26a7c, in pthread_kill [ros2_control_node-5] Aborted (Signal sent by tkill() 11867 1000) [ERROR] [ros2_control_node-5]: process has died [pid 11867, exit code -6, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_7r7rh_1h --params-file /home/roskuttan/hexa_bot_ws/install/hexa_bot_description_moveit_config/share/hexa_bot_description_moveit_config/config/ros2_controllers.yaml']. [move_group-3] [INFO] [1685549021.449993556] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0.0034793 seconds [move_group-3] [INFO] [1685549021.450093856] [moveit_robot_model.robot_model]: Loading robot model 'hexa_bot'... [move_group-3] [WARN] [1685549021.554605257] [kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. [move_group-3] [INFO] [1685549021.826553560] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Publishing maintained planning scene on 'monitored_planning_scene' [move_group-3] [INFO] [1685549021.826699960] [moveit.ros_planning_interface.moveit_cpp]: Listening to 'joint_states' for joint states [move_group-3] [INFO] [1685549021.827212460] [moveit_ros.current_state_monitor]: Listening to joint states on topic 'joint_states' [move_group-3] [INFO] [1685549021.827698260] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/attached_collision_object' for attached collision objects [move_group-3] [INFO] [1685549021.827730360] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting planning scene monitor [move_group-3] [INFO] [1685549021.828636760] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/planning_scene' [move_group-3] [INFO] [1685549021.828666160] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting world geometry update monitor for collision objects, attached objects, octomap updates. [move_group-3] [INFO] [1685549021.829195760] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to 'collision_object' [move_group-3] [INFO] [1685549021.829711260] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to 'planning_scene_world' for planning scene world geometry [move_group-3] [WARN] [1685549021.829869660] [moveit.ros.occupancy_map_monitor.middleware_handle]: Resolution not specified for Octomap. Assuming resolution = 0.1 instead [move_group-3] [ERROR] [1685549021.829882660] [moveit.ros.occupancy_map_monitor.middleware_handle]: No 3D sensor plugin(s) defined for octomap updates [move_group-3] [INFO] [1685549021.956556861] [moveit.ros_planning_interface.moveit_cpp]: Loading planning pipeline 'ompl' [move_group-3] [INFO] [1685549021.967400661] [moveit.ros_planning.planning_pipeline]: Using planning interface 'OMPL' [move_group-3] [INFO] [1685549021.968736261] [moveit_ros.add_time_optimal_parameterization]: Param 'ompl.path_tolerance' was not set. Using default value: 0.100000 [move_group-3] [INFO] [1685549021.968770861] [moveit_ros.add_time_optimal_parameterization]: Param 'ompl.resample_dt' was not set. Using default value: 0.100000 [move_group-3] [INFO] [1685549021.968776561] [moveit_ros.add_time_optimal_parameterization]: Param 'ompl.min_angle_change' was not set. Using default value: 0.001000 [move_group-3] [INFO] [1685549021.968795761] [moveit_ros.fix_workspace_bounds]: Param 'ompl.default_workspace_bounds' was not set. Using default value: 10.000000 [move_group-3] [INFO] [1685549021.968810061] [moveit_ros.fix_start_state_bounds]: Param 'ompl.start_state_max_bounds_error' was set to 0.100000 [move_group-3] [INFO] [1685549021.968814261] [moveit_ros.fix_start_state_bounds]: Param 'ompl.start_state_max_dt' was not set. Using default value: 0.500000 [move_group-3] [INFO] [1685549021.968823561] [moveit_ros.fix_start_state_collision]: Param 'ompl.start_state_max_dt' was not set. Using default value: 0.500000 [move_group-3] [INFO] [1685549021.968827461] [moveit_ros.fix_start_state_collision]: Param 'ompl.jiggle_fraction' was not set. Using default value: 0.020000 [move_group-3] [INFO] [1685549021.968831861] [moveit_ros.fix_start_state_collision]: Param 'ompl.max_sampling_attempts' was not set. Using default value: 100 [move_group-3] [INFO] [1685549021.968840961] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Add Time Optimal Parameterization' [move_group-3] [INFO] [1685549021.968843961] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Resolve constraint frames to robot links' [move_group-3] [INFO] [1685549021.968846661] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Workspace Bounds' [move_group-3] [INFO] [1685549021.968849061] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Bounds' [move_group-3] [INFO] [1685549021.968851361] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State In Collision' [move_group-3] [INFO] [1685549021.968870061] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Path Constraints' [move_group-3] [INFO] [1685549021.970424561] [moveit.ros_planning_interface.moveit_cpp]: Loading planning pipeline 'chomp' [move_group-3] [INFO] [1685549021.971178561] [moveit.ros_planning.planning_pipeline]: Multiple planning plugins available. You should specify the '~planning_plugin' parameter. Using 'ompl_interface/OMPLPlanner' for now. [move_group-3] [INFO] [1685549021.971303161] [moveit.ros_planning.planning_pipeline]: Using planning interface 'OMPL' [move_group-3] [INFO] [1685549021.972436761] [moveit.ros_planning_interface.moveit_cpp]: Loading planning pipeline 'pilz_industrial_motion_planner' [move_group-3] [INFO] [1685549021.974974061] [moveit.pilz_industrial_motion_planner.joint_limits_aggregator]: Reading limits from namespace robot_description_planning [move_group-3] [INFO] [1685549021.985698861] [moveit.pilz_industrial_motion_planner]: Available plugins: pilz_industrial_motion_planner/PlanningContextLoaderCIRC pilz_industrial_motion_planner/PlanningContextLoaderLIN pilz_industrial_motion_planner/PlanningContextLoaderPTP [move_group-3] [INFO] [1685549021.985751361] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderCIRC [move_group-3] [INFO] [1685549021.986958761] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [CIRC] [move_group-3] [INFO] [1685549021.986990961] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderLIN [move_group-3] [INFO] [1685549021.987695061] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [LIN] [move_group-3] [INFO] [1685549021.987727361] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderPTP [move_group-3] [INFO] [1685549021.988397661] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [PTP] [move_group-3] [INFO] [1685549021.988430361] [moveit.ros_planning.planning_pipeline]: Using planning interface 'Pilz Industrial Motion Planner' [move_group-3] [INFO] [1685549022.044199962] [moveit.plugins.moveit_simple_controller_manager]: Added FollowJointTrajectory controller for hexa_group_controller [move_group-3] [INFO] [1685549022.044348862] [moveit.plugins.moveit_simple_controller_manager]: Returned 1 controllers in list [move_group-3] [INFO] [1685549022.044368962] [moveit.plugins.moveit_simple_controller_manager]: Returned 1 controllers in list [move_group-3] [INFO] [1685549022.044593362] [moveit_ros.trajectory_execution_manager]: Trajectory execution is managing controllers [move_group-3] [INFO] [1685549022.044608362] [move_group.move_group]: MoveGroup debug mode is ON [move_group-3] [INFO] [1685549022.062510262] [move_group.move_group]: [move_group-3] [move_group-3] ******************************************************** [move_group-3] * MoveGroup using: [move_group-3] * - ApplyPlanningSceneService [move_group-3] * - ClearOctomapService [move_group-3] * - CartesianPathService [move_group-3] * - ExecuteTrajectoryAction [move_group-3] * - GetPlanningSceneService [move_group-3] * - KinematicsService [move_group-3] * - MoveAction [move_group-3] * - MotionPlanService [move_group-3] * - QueryPlannersService [move_group-3] * - StateValidationService [move_group-3] ******************************************************** [move_group-3] [move_group-3] [INFO] [1685549022.062578162] [moveit_move_group_capabilities_base.move_group_context]: MoveGroup context using planning plugin ompl_interface/OMPLPlanner [move_group-3] [INFO] [1685549022.062591762] [moveit_move_group_capabilities_base.move_group_context]: MoveGroup context initialization complete [move_group-3] Loading 'move_group/ApplyPlanningSceneService'... [move_group-3] Loading 'move_group/ClearOctomapService'... [move_group-3] Loading 'move_group/MoveGroupCartesianPathService'... [move_group-3] Loading 'move_group/MoveGroupExecuteTrajectoryAction'... [move_group-3] Loading 'move_group/MoveGroupGetPlanningSceneService'... [move_group-3] Loading 'move_group/MoveGroupKinematicsService'... [move_group-3] Loading 'move_group/MoveGroupMoveAction'... [move_group-3] Loading 'move_group/MoveGroupPlanService'... [move_group-3] Loading 'move_group/MoveGroupQueryPlannersService'... [move_group-3] Loading 'move_group/MoveGroupStateValidationService'... [move_group-3] [move_group-3] You can start planning now! [move_group-3] [rviz2-4] [INFO] [1685549023.470930477] [rviz2]: Stereo is NOT SUPPORTED [rviz2-4] [INFO] [1685549023.471053777] [rviz2]: OpenGl version: 4.1 (GLSL 4.1) [rviz2-4] [INFO] [1685549023.501633577] [rviz2]: Stereo is NOT SUPPORTED [rviz2-4] Warning: class_loader.impl: SEVERE WARNING!!! A namespace collision has occurred with plugin factory for class rviz_default_plugins::displays::InteractiveMarkerDisplay. New factory will OVERWRITE existing one. This situation occurs when libraries containing plugins are directly linked against an executable (the one running right now generating this message). Please separate plugins out into their own library or just don't link against the library and use either class_loader::ClassLoader/MultiLibraryClassLoader to open. [rviz2-4] at line 253 in /opt/ros/humble/include/class_loader/class_loader/class_loader_core.hpp [spawner-6] [INFO] [1685549023.684063179] [spawner_hexa_group_controller]: Waiting for '/controller_manager' node to exist [spawner-7] [INFO] [1685549023.697945680] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-6] [INFO] [1685549025.692602801] [spawner_hexa_group_controller]: Waiting for '/controller_manager' node to exist [spawner-7] [INFO] [1685549025.706280201] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [rviz2-4] [ERROR] [1685549026.603712111] [moveit_ros_visualization.motion_planning_frame]: Action server: /recognize_objects not available [rviz2-4] [INFO] [1685549026.626118711] [moveit_ros_visualization.motion_planning_frame]: MoveGroup namespace changed: / -&gt; . Reloading params. [rviz2-4] [INFO] [1685549027.162018417] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0.419107 seconds [rviz2-4] [INFO] [1685549027.162081317] [moveit_robot_model.robot_model]: Loading robot model 'hexa_bot'... [rviz2-4] [WARN] [1685549027.265816918] [kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. [rviz2-4] [INFO] [1685549027.569002321] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting planning scene monitor [rviz2-4] [INFO] [1685549027.570028021] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/monitored_planning_scene' [spawner-6] [INFO] [1685549027.701593522] [spawner_hexa_group_controller]: Waiting for '/controller_manager' node to exist [spawner-7] [INFO] [1685549027.715603622] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [rviz2-4] [INFO] [1685549028.015328126] [interactive_marker_display_94082560574336]: Connected on namespace: /rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic [rviz2-4] [WARN] [1685549028.028109026] [kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. [rviz2-4] [INFO] [1685549028.037560326] [moveit_ros_visualization.motion_planning_frame]: group hexa_group [rviz2-4] [INFO] [1685549028.037607926] [moveit_ros_visualization.motion_planning_frame]: Constructing new MoveGroup connection for group 'hexa_group' in namespace '' [rviz2-4] [INFO] [1685549028.055481726] [move_group_interface]: Ready to take commands for planning group hexa_group. [rviz2-4] [INFO] [1685549028.056432626] [moveit_ros_visualization.motion_planning_frame]: group hexa_group [rviz2-4] [INFO] [1685549028.078346227] [interactive_marker_display_94082560574336]: Sending request for interactive markers [rviz2-4] [INFO] [1685549028.110504727] [interactive_marker_display_94082560574336]: Service response received for initialization [spawner-6] [INFO] [1685549029.709702566] [spawner_hexa_group_controller]: Waiting for '/controller_manager' node to exist [spawner-7] [INFO] [1685549029.724280667] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-6] [ERROR] [1685549031.717070515] [spawner_hexa_group_controller]: Controller manager not available [spawner-7] [ERROR] [1685549031.732596315] [spawner_joint_state_broadcaster]: Controller manager not available [ERROR] [spawner-6]: process has died [pid 11869, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner hexa_group_controller --ros-args']. [ERROR] [spawner-7]: process has died [pid 11871, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --ros-args']. [move_group-3] [INFO] [1685550203.588396713] [moveit_move_group_default_capabilities.move_action_capability]: Received request [rviz2-4] [INFO] [1685550203.588840613] [move_group_interface]: Plan and Execute request accepted [move_group-3] [INFO] [1685550203.589105613] [moveit_move_group_default_capabilities.move_action_capability]: executing.. [move_group-3] [INFO] [1685550204.589486014] [moveit_ros.current_state_monitor]: Didn't received robot state (joint angles) with recent timestamp within 1.000000 seconds. [move_group-3] Check clock synchronization if your are running ROS across multiple machines! [move_group-3] [WARN] [1685550204.589572414] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Failed to fetch current robot state. [move_group-3] [INFO] [1685550204.589851214] [moveit_move_group_default_capabilities.move_action_capability]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline. [move_group-3] [INFO] [1685550204.590623014] [moveit_ros.plan_execution]: Planning attempt 1 of at most 1 [move_group-3] [INFO] [1685550204.590696614] [moveit_move_group_capabilities_base.move_group_capability]: Using planning pipeline 'ompl' [move_group-3] [INFO] [1685550204.594164414] [moveit.ompl_planning.model_based_planning_context]: Planner configuration 'hexa_group' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed. [move_group-3] [WARN] [1685550204.803294815] [moveit_trajectory_processing.time_optimal_trajectory_generation]: Joint velocity limits are not defined. Using the default 1 rad/s. You can define velocity limits in the URDF or joint_limits.yaml. [move_group-3] [WARN] [1685550204.803342315] [moveit_trajectory_processing.time_optimal_trajectory_generation]: Joint acceleration limits are not defined. Using the default 1 rad/s^2. You can define acceleration limits in the URDF or joint_limits.yaml. [move_group-3] [INFO] [1685550204.807110715] [moveit.plugins.moveit_simple_controller_manager]: Returned 1 controllers in list [move_group-3] [INFO] [1685550204.807181715] [moveit.plugins.moveit_simple_controller_manager]: Returned 1 controllers in list [move_group-3] [INFO] [1685550204.807390815] [moveit_ros.trajectory_execution_manager]: Validating trajectory with allowed_start_tolerance 0.01 [move_group-3] [INFO] [1685550205.807536415] [moveit_ros.current_state_monitor]: Didn't received robot state (joint angles) with recent timestamp within 1.000000 seconds. [move_group-3] Check clock synchronization if your are running ROS across multiple machines! [move_group-3] [WARN] [1685550205.807644115] [moveit_ros.trajectory_execution_manager]: Failed to validate trajectory: couldn't receive full current joint state within 1s [move_group-3] [INFO] [1685550205.807974815] [moveit_move_group_default_capabilities.move_action_capability]: Solution found but controller failed during execution [rviz2-4] [INFO] [1685550205.809449015] [move_group_interface]: Plan and Execute request aborted [rviz2-4] [ERROR] [1685550205.889689215] [move_group_interface]: MoveGroupInterface::move() failed or timeout reached [rviz2-4] [INFO] [1685550214.709188686] [move_group_interface]: MoveGroup action client/server ready [move_group-3] [INFO] [1685550214.709703786] [moveit_move_group_default_capabilities.move_action_capability]: Received request [move_group-3] [INFO] [1685550214.709881186] [moveit_move_group_default_capabilities.move_action_capability]: executing.. [rviz2-4] [INFO] [1685550214.709934386] [move_group_interface]: Planning request accepted [move_group-3] [INFO] [1685550215.710077184] [moveit_ros.current_state_monitor]: Didn't received robot state (joint angles) with recent timestamp within 1.000000 seconds. [move_group-3] Check clock synchronization if your are running ROS across multiple machines! [move_group-3] [WARN] [1685550215.710154784] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Failed to fetch current robot state. [move_group-3] [INFO] [1685550215.710255684] [moveit_move_group_default_capabilities.move_action_capability]: Planning request received for MoveGroup action. Forwarding to planning pipeline. [move_group-3] [INFO] [1685550215.710386384] [moveit_move_group_capabilities_base.move_group_capability]: Using planning pipeline 'ompl' [move_group-3] [INFO] [1685550215.710926284] [moveit.ompl_planning.model_based_planning_context]: Planner configuration 'hexa_group' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed. [move_group-3] [INFO] [1685550215.919333384] [moveit_move_group_default_capabilities.move_action_capability]: Motion plan was computed successfully. [rviz2-4] [INFO] [1685550215.919845184] [move_group_interface]: Planning request complete! [rviz2-4] [INFO] [1685550216.010869384] [move_group_interface]: time taken to generate plan: 0.0359888 seconds [move_group-3] [INFO] [1685550217.064185082] [moveit_move_group_default_capabilities.execute_trajectory_action_capability]: Received goal request [move_group-3] [INFO] [1685550217.064419882] [moveit_move_group_default_capabilities.execute_trajectory_action_capability]: Execution request received [move_group-3] [INFO] [1685550217.064451582] [moveit.plugins.moveit_simple_controller_manager]: Returned 1 controllers in list [move_group-3] [INFO] [1685550217.064463882] [moveit.plugins.moveit_simple_controller_manager]: Returned 1 controllers in list [move_group-3] [INFO] [1685550217.064563082] [moveit_ros.trajectory_execution_manager]: Validating trajectory with allowed_start_tolerance 0.01 [rviz2-4] [INFO] [1685550217.064417482] [move_group_interface]: Execute request accepted [move_group-3] [INFO] [1685550218.064699880] [moveit_ros.current_state_monitor]: Didn't received robot state (joint angles) with recent timestamp within 1.000000 seconds. [move_group-3] Check clock synchronization if your are running ROS across multiple machines! [move_group-3] [WARN] [1685550218.064772280] [moveit_ros.trajectory_execution_manager]: Failed to validate trajectory: couldn't receive full current joint state within 1s [move_group-3] [INFO] [1685550218.064894380] [moveit_move_group_default_capabilities.execute_trajectory_action_capability]: Execution completed: ABORTED [rviz2-4] [INFO] [1685550218.065488680] [move_group_interface]: Execute request aborted [rviz2-4] [ERROR] [1685550218.165020080] [move_group_interface]: MoveGroupInterface::execute() failed or timeout reacheds </code></pre> <hr /> <p><a href="https://answers.ros.org/question/416055/unable-to-execute-motion-plan-in-moveit-2-and-ros2-controller-manager-keeps-dying/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/150922/roskuttan/" rel="nofollow noreferrer">Roskuttan</a> on ROS Answers with karma: 53 on 2023-06-01</p> <p>Post score: 2</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-06-01</strong>:<br /> Hello,</p> <p>Can you please, post your log and screenshot over here, I think you have enough karma to upload images.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/150922/roskuttan/" rel="nofollow noreferrer">Roskuttan</a> on 2023-06-01</strong>:<br /> I have atttached the log in the drive because i am unable to post the full log here</p> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-06-01</strong>:<br /> I have updated your question, I hope it helps you.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/150922/roskuttan/" rel="nofollow noreferrer">Roskuttan</a> on 2023-06-01</strong>:<br /> ok thank you so much</p>
Unable to execute motion plan in MoveIt 2 and ROS2 controller manager keeps dying
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi!</p> <p>The problem with your code is that you are actually calling <code>Lock_pub.publish()</code> once. This triggers the callback once. Then, the interpreter reaches <code>rospy.spin()</code> which keeps your program from stopping. When the callback receives a new detection, then <code>door_state</code> changes, but <code>Lock_pub.publish()</code> is not called anymore (you are &quot;stuck&quot; at <code>rospy.spin()</code>).</p> <p>To achieve the behavior you want, you could use a class as follows:</p> <pre><code>class LatchDecision(): def __init__(self): #Declaring USB port related to relay self.relayport = serial.Serial(port = &quot;/dev/ttyUSB0&quot;, baudrate = 9600, bytesize = serial.EIGHTBITS, parity = serial.PARITY_NONE, stopbits = serial.STOPBITS_ONE, timeout = 1, writeTimeout = 2) #Declaring open and close commands in bytes used to control relay self.OPEN_CMD = b'\xA0\x01\x01\xA2' self.CLOSE_CMD = b'\xA0\x01\x00\xA1' # Create the publisher and the subscriber self.Lock_pub = rospy.Publisher('/doorcmd', String, queue_size=10) self.Lock_sub = rospy.Subscriber('/detection', String, self.Lock_callback) def Lock_callback(self, detection): door_state rospy.loginfo(&quot;Command is %s&quot;, detection.data) if detection.data == 'SH' or detection.data == 'MH': self.relayport.write(self.CLOSE_CMD) door_state = 'closed' else : self.relayport.write(self.OPEN_CMD) door_state = 'opened' rospy.loginfo(&quot;door_state %s&quot;, door_state) self.Lock_pub.publish(door_state) if __name__ == &quot;__main__&quot;: rospy.init_node('Latch_decision', anonymous=True) ld = LatchDecision() rospy.spin() </code></pre> <p>In this way, every time you have a new detection, you also publish a message on <code>/doorcmd</code>.</p> <p><strong>Note.</strong> I have made <code>OPEN/CLOSE_CMD</code> as they are constants. It is a good practice as it improves readability, but it does not affect the execution at all.</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-06-01</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/149103/lilipop/" rel="nofollow noreferrer">Lilipop</a> on 2023-06-01</strong>:<br /> Hi, I thought that with each function call the publisher would execute too. Your explanation is very clear, I just tested your changes and it works perfectly.</p> <p>Thank you so much for the help !</p> <p>Lilia.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> on 2023-06-01</strong>:<br /> Great!</p> <p>If it actually solved your problem, would you mind marking the answer as <em>correct</em>?</p> <p>Thanks!</p>
103327
2023-06-01T03:30:12.000
|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello ROS community,</p> <p>I want to implement a ROS node that is both subscriber and publisher. The idea is that each time the subscribed topic changes, the node will publish to another topic. The node takes a detection command and gives a door command controlling a USB latch.</p> <p>Here is the code :</p> <pre><code>#!/usr/bin/env python import rospy from std_msgs.msg import String import serial #Declaring USB port related to relay relayport = serial.Serial(port = &quot;/dev/ttyUSB0&quot;, baudrate = 9600, bytesize = serial.EIGHTBITS, parity = serial.PARITY_NONE, stopbits = serial.STOPBITS_ONE, timeout = 1, writeTimeout = 2) #Declaring open and close commands in bytes used to control relay open_cmd = b'\xA0\x01\x01\xA2' close_cmd = b'\xA0\x01\x00\xA1' door_state = '' def Lock_callback(detection): #Callback function to be used when receiving detection topic data global door_state rospy.loginfo(&quot;Command is %s&quot;, detection.data) if detection.data == 'SH' or detection.data == 'MH' : #Close relay (ON) in Short High and Medium High states to lock door relayport.write(close_cmd) door_state = 'closed' rospy.loginfo(&quot;door_state %s&quot;, door_state) else : #Open relay (OFF) in other detection states relayport.write(open_cmd) door_state = 'opened' rospy.loginfo(&quot;door_state %s&quot;, door_state) def Lock_decision(): #Lock decision function to subscribe to detection state topic and publish Lock topic Lock_pub = rospy.Publisher('/doorcmd', String, queue_size=10) rospy.init_node('Latch_decision', anonymous=True) #Create ROS node for relay Lock_sub = rospy.Subscriber('/detection', String, Lock_callback) #Subscribe node to relay command topic Lock_pub.publish(door_state) rospy.spin() if __name__ == '__main__': Lock_decision() </code></pre> <p>The Lock_pub.publish only gives one value at the start and stops which is not what I want. I want to publish the /doorcmd topic everytime it is changed by the /detection topic. Any clues on how to do that ? What is the problem in my code ?</p> <p>Thanks and regards. Lilia.</p> <hr /> <p><a href="https://answers.ros.org/question/416057/ros-subscriber-and-publisher-node/" 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-06-01</p> <p>Post score: 0</p>
ROS Subscriber and Publisher node
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Yes, but it's <a href="https://docs.ros.org/en/melodic/api/rospy/html/rospy.topics.Topic-class.html#get_num_connections" rel="nofollow noreferrer">get_num_connections()</a>.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-06-03</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103329
2023-06-03T08:14:16.000
|ros|rospy|publisher|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>In rospy do you have a <code>getNumSubscribers()</code> function for the Publisher?</p> <hr /> <p><a href="https://answers.ros.org/question/416125/rospy-getnumsubscribers()/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/3511/schizzz8/" rel="nofollow noreferrer">schizzz8</a> on ROS Answers with karma: 183 on 2023-06-03</p> <p>Post score: 0</p>
Rospy getNumSubscribers()
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Solved it (?). Adding</p> <pre><code>target_link_libraries (ndt_test ${PCL_LIBRARIES} Eigen3::Eigen) </code></pre> <p>to cmake_lists solved the issue. I still don't know what the source of the problem is (basically, why not linking Eigen would cause problems with PCL).</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/123880/alna_perera/" rel="nofollow noreferrer">ALNA_Perera</a> with karma: 33 on 2023-06-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103331
2023-06-06T00:26:24.000
|ros2|pcl|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I am trying to implement something like this: <a href="https://pcl.readthedocs.io/en/latest/normal_distributions_transform.html#normal-distributions-transform" rel="nofollow noreferrer">https://pcl.readthedocs.io/en/latest/normal_distributions_transform.html#normal-distributions-transform</a> using lidar output.</p> <p>I'm getting linking errors when trying to compile this.</p> <pre><code>colcon build --symlink-install Starting &gt;&gt;&gt; cpp_tests --- stderr: cpp_tests ** WARNING ** io features related to pcap will be disabled /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::Registration&lt;pcl::PointXYZ, pcl::PointXYZ, float&gt;::align(pcl::PointCloud&lt;pcl::PointXYZ&gt;&amp;, Eigen::Matrix&lt;float, 4, 4, 0, 4, 4&gt; const&amp;)': ndt_transform_calculator.cpp:(.text._ZN3pcl12RegistrationINS_8PointXYZES1_fE5alignERNS_10PointCloudIS1_EERKN5Eigen6MatrixIfLi4ELi4ELi0ELi4ELi4EEE[_ZN3pcl12RegistrationINS_8PointXYZES1_fE5alignERNS_10PointCloudIS1_EERKN5Eigen6MatrixIfLi4ELi4ELi0ELi4ELi4EEE]+0x242): undefined reference to `pcl::search::KdTree&lt;pcl::PointXYZ, pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt; &gt;::setPointRepresentation(std::shared_ptr&lt;pcl::PointRepresentation&lt;pcl::PointXYZ&gt; const&gt; const&amp;)' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::Registration&lt;pcl::PointXYZ, pcl::PointXYZ, float&gt;::Registration()': ndt_transform_calculator.cpp:(.text._ZN3pcl12RegistrationINS_8PointXYZES1_fEC2Ev[_ZN3pcl12RegistrationINS_8PointXYZES1_fEC5Ev]+0x69): undefined reference to `pcl::search::KdTree&lt;pcl::PointXYZ, pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt; &gt;::KdTree(bool)' /usr/bin/ld: ndt_transform_calculator.cpp:(.text._ZN3pcl12RegistrationINS_8PointXYZES1_fEC2Ev[_ZN3pcl12RegistrationINS_8PointXYZES1_fEC5Ev]+0x98): undefined reference to `pcl::search::KdTree&lt;pcl::PointXYZ, pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt; &gt;::KdTree(bool)' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::VoxelGridCovariance&lt;pcl::PointXYZ&gt;::VoxelGridCovariance()': ndt_transform_calculator.cpp:(.text._ZN3pcl19VoxelGridCovarianceINS_8PointXYZEEC2Ev[_ZN3pcl19VoxelGridCovarianceINS_8PointXYZEEC5Ev]+0xe7): undefined reference to `pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt;::KdTreeFLANN(bool)' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt;::~KdTreeFLANN()': ndt_transform_calculator.cpp:(.text._ZN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEED2Ev[_ZN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEED5Ev]+0x26): undefined reference to `pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt;::cleanup()' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::VoxelGridCovariance&lt;pcl::PointXYZ&gt;::filter(bool)': ndt_transform_calculator.cpp:(.text._ZN3pcl19VoxelGridCovarianceINS_8PointXYZEE6filterEb[_ZN3pcl19VoxelGridCovarianceINS_8PointXYZEE6filterEb]+0x135): undefined reference to `pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt;::setInputCloud(std::shared_ptr&lt;pcl::PointCloud&lt;pcl::PointXYZ&gt; const&gt; const&amp;, std::shared_ptr&lt;std::vector&lt;int, std::allocator&lt;int&gt; &gt; const&gt; const&amp;)' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl19VoxelGridCovarianceINS_8PointXYZEEE[_ZTVN3pcl19VoxelGridCovarianceINS_8PointXYZEEE]+0x48): undefined reference to `pcl::VoxelGridCovariance&lt;pcl::PointXYZ&gt;::applyFilter(pcl::PointCloud&lt;pcl::PointXYZ&gt;&amp;)' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl9VoxelGridINS_8PointXYZEEE[_ZTVN3pcl9VoxelGridINS_8PointXYZEEE]+0x48): undefined reference to `pcl::VoxelGrid&lt;pcl::PointXYZ&gt;::applyFilter(pcl::PointCloud&lt;pcl::PointXYZ&gt;&amp;)' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x10): undefined reference to `pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt;::setInputCloud(std::shared_ptr&lt;pcl::PointCloud&lt;pcl::PointXYZ&gt; const&gt; const&amp;, std::shared_ptr&lt;std::vector&lt;int, std::allocator&lt;int&gt; &gt; const&gt; const&amp;)' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x28): undefined reference to `pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt;::nearestKSearch(pcl::PointXYZ const&amp;, unsigned int, std::vector&lt;int, std::allocator&lt;int&gt; &gt;&amp;, std::vector&lt;float, std::allocator&lt;float&gt; &gt;&amp;) const' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x40): undefined reference to `pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt;::radiusSearch(pcl::PointXYZ const&amp;, double, std::vector&lt;int, std::allocator&lt;int&gt; &gt;&amp;, std::vector&lt;float, std::allocator&lt;float&gt; &gt;&amp;, unsigned int) const' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x58): undefined reference to `pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt;::setEpsilon(float)' /usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::VoxelGridCovariance&lt;pcl::PointXYZ&gt;::radiusSearch(pcl::PointXYZ const&amp;, double, std::vector&lt;pcl::VoxelGridCovariance&lt;pcl::PointXYZ&gt;::Leaf const*, std::allocator&lt;pcl::VoxelGridCovariance&lt;pcl::PointXYZ&gt;::Leaf const*&gt; &gt;&amp;, std::vector&lt;float, std::allocator&lt;float&gt; &gt;&amp;, unsigned int) const': ndt_transform_calculator.cpp:(.text._ZNK3pcl19VoxelGridCovarianceINS_8PointXYZEE12radiusSearchERKS1_dRSt6vectorIPKNS2_4LeafESaIS8_EERS5_IfSaIfEEj[_ZNK3pcl19VoxelGridCovarianceINS_8PointXYZEE12radiusSearchERKS1_dRSt6vectorIPKNS2_4LeafESaIS8_EERS5_IfSaIfEEj]+0xdc): undefined reference to `pcl::KdTreeFLANN&lt;pcl::PointXYZ, flann::L2_Simple&lt;float&gt; &gt;::radiusSearch(pcl::PointXYZ const&amp;, double, std::vector&lt;int, std::allocator&lt;int&gt; &gt;&amp;, std::vector&lt;float, std::allocator&lt;float&gt; &gt;&amp;, unsigned int) const' collect2: error: ld returned 1 exit status gmake[2]: *** [CMakeFiles/ndt_test.dir/build.make:189: ndt_test] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:252: CMakeFiles/ndt_test.dir/all] Error 2 gmake: *** [Makefile:149: all] Error 2 --- Failed &lt;&lt;&lt; cpp_tests [2.47s, exited with code 2] Summary: 0 packages finished [2.66s] 1 package failed: cpp_tests 1 package had stderr output: cpp_tests </code></pre> <p>As far as I can tell, this is triggered by the line</p> <pre><code>pcl::NormalDistributionsTransform&lt;pcl::PointXYZ, pcl::PointXYZ&gt; ndt; </code></pre> <p>(Basically it compiles if I remove all references to NDT but I obviously can't do what I want to do.</p> <pre><code>#include &lt;pcl/registration/ndt.h&gt; </code></pre> <p>causes no problems, neither does initializing point clouds).</p> <p>My CMakeLists file:</p> <pre><code>cmake_minimum_required(VERSION 3.8) project(cpp_tests) #Default to C++14 if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 14) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES &quot;Clang&quot;) add_compile_options(-Wall -Wextra) # -Wpedantic) endif() # find dependencies find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(std_msgs REQUIRED) find_package(sensor_msgs REQUIRED) find_package(nav_msgs REQUIRED) find_package(PCL 1.12 REQUIRED) find_package (Eigen3 3.4 REQUIRED NO_MODULE) # uncomment the following section in order to fill in # further dependencies manually. # find_package(&lt;dependency&gt; REQUIRED) include_directories(<span class="math-container">${PCL_INCLUDE_DIRS}) link_directories($</span>{PCL_LIBRARY_DIRS}) add_definitions(${PCL_DEFINITIONS}) add_executable(talker src/publisher_member_function.cpp) ament_target_dependencies(talker rclcpp std_msgs) add_executable(listener src/subscriber_member_function.cpp) ament_target_dependencies(listener rclcpp std_msgs) add_executable(pubsub src/publisher_subscriber_function.cpp) ament_target_dependencies(pubsub rclcpp std_msgs) add_executable(icp_test src/icp_transform_calculator.cpp) ament_target_dependencies(icp_test rclcpp std_msgs PCL sensor_msgs nav_msgs) add_executable(ndt_test src/ndt_transform_calculator.cpp) ament_target_dependencies(ndt_test rclcpp std_msgs PCL sensor_msgs nav_msgs) target_link_libraries (icp_test ${PCL_LIBRARIES} Eigen3::Eigen) install(TARGETS talker listener pubsub icp_test ndt_test DESTINATION lib/${PROJECT_NAME}) if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) # the following line skips the linter which checks for copyrights # comment the line when a copyright and license is added to all source files set(ament_cmake_copyright_FOUND TRUE) # the following line skips cpplint (only works in a git repo) # comment the line when this package is in a git repo and when # a copyright and license is added to all source files set(ament_cmake_cpplint_FOUND TRUE) ament_lint_auto_find_test_dependencies() endif() ament_package() </code></pre> <p>The strangest part is that I did the same thing with ICP and that compiles without any problems. However, if I copy the contents of icp_transform_calculator.cpp into ndt_transform_calculator.cpp, I get basically the same linking error at pcl::IterativeClosestPoint&lt;pcl::PointXYZ, pcl::PointXYZ&gt; icp; instead.</p> <p>(icp_transform_calculator.cpp compiles no problem at the same time with the exact same code and same dependencies).</p> <p>At this point, I can't think of any reason for this issue, which is why I am posting it here. Is there any way to solve this issue?</p> <p>Thank you.</p> <p>EDIT:</p> <p>Solved it (?). Adding</p> <pre><code>target_link_libraries (ndt_test ${PCL_LIBRARIES} Eigen3::Eigen) </code></pre> <p>to cmake_lists solved the issue. I still don't know what the source of the problem is (basically, why not linking Eigen would cause problems with PCL).</p> <hr /> <p><a href="https://answers.ros.org/question/416206/linking-errors-pcl/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/123880/alna_perera/" rel="nofollow noreferrer">ALNA_Perera</a> on ROS Answers with karma: 33 on 2023-06-06</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/875/130s/" rel="nofollow noreferrer">130s</a> on 2023-06-06</strong>:<br /> @ALNA_Perera Glad you resolved by yourself and thanks for sharing your resolution by updating your post.. Would you mind posting that as an answer, then mark it as &quot;Answer&quot; so that others can tell the question is resolved, and easily find the answer?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/123880/alna_perera/" rel="nofollow noreferrer">ALNA_Perera</a> on 2023-06-06</strong>:<br /> I will do that. I'm still not sure why that worked though.</p>
Linking errors PCL
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>If you are asking how to publish messages stored in a rosbag file in &quot;real time&quot; using the rosbag API, then yes, your code must insert an appropriate delay between read calls.</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-06</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 2</p>
103333
2023-06-06T01:51:42.000
|python|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I use python and and want to read rosbag data at the data timestamp. Is there a routine to do that or should I generate delay after each read corresponding to the duration to the next timestamp ?</p> <hr /> <p><a href="https://answers.ros.org/question/416211/read-rosbag-in-python-at-timestamp/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/67329/dev4all12358/" rel="nofollow noreferrer">dev4all12358</a> on ROS Answers with karma: 23 on 2023-06-06</p> <p>Post score: 0</p>
Read rosbag in python at timestamp
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Thank you for the responses. It wasn't any of these issues but I appreciate them being addressed. I am new to ROS2 and LINUX so I may have been missing something when trying to find these nodes in system manager, but what fixed it was forcing ROS2 to crash by shutting down python in terminal.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/152794/koener/" rel="nofollow noreferrer">koener</a> with karma: 16 on 2023-06-07</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103335
2023-06-06T10:04:36.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>For context, I am working on a simulation for a robot and I am using an external library for pointcloud to laserscan conversion. Everything was originally working fine, but all of a sudden I have these ros2 nodes running which I can't figure out how to kill. I believe they are stopping my TF frames from registering. I have tried using the kill command and trying to find them using &quot;htop&quot;, and I have tried finding them in my system monitor, but I can't seem to locate them anywhere to try and shut them down. These are the names of the nodes and the properties:</p> <pre><code>/vtr/boreas_odometry_feaeexyoeg /vtr/boreas_odometry_xkzleovjry /vtr/boreas_odometry_yvjvpzmakr </code></pre> <p>from node info:</p> <pre><code>/vtr/boreas_odometry_feaeexyoeg Subscribers: /clock: rosgraph_msgs/msg/Clock /parameter_events: rcl_interfaces/msg/ParameterEvent Publishers: /clock: rosgraph_msgs/msg/Clock /parameter_events: rcl_interfaces/msg/ParameterEvent /rosout: rcl_interfaces/msg/Log /tf: tf2_msgs/msg/TFMessage /tf_static: tf2_msgs/msg/TFMessage /vtr/boreas_2021_09_09_15_28_lidar_odometry: std_msgs/msg/String /vtr/filtered_point_cloud: sensor_msgs/msg/PointCloud2 /vtr/loc_path: nav_msgs/msg/Path /vtr/odometry: nav_msgs/msg/Odometry /vtr/raw_point_cloud: sensor_msgs/msg/PointCloud2 /vtr/submap_odo: sensor_msgs/msg/PointCloud2 /vtr/udist_point_cloud: sensor_msgs/msg/PointCloud2 Service Servers: /vtr/boreas_odometry_feaeexyoeg/describe_parameters: rcl_interfaces/srv/DescribeParameters /vtr/boreas_odometry_feaeexyoeg/get_parameter_types: rcl_interfaces/srv/GetParameterTypes /vtr/boreas_odometry_feaeexyoeg/get_parameters: rcl_interfaces/srv/GetParameters /vtr/boreas_odometry_feaeexyoeg/list_parameters: rcl_interfaces/srv/ListParameters /vtr/boreas_odometry_feaeexyoeg/set_parameters: rcl_interfaces/srv/SetParameters /vtr/boreas_odometry_feaeexyoeg/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically Service Clients: /vtr/boreas_odometry_feaeexyoeg/describe_parameters: rcl_interfaces/srv/DescribeParameters /vtr/boreas_odometry_feaeexyoeg/get_parameter_types: rcl_interfaces/srv/GetParameterTypes /vtr/boreas_odometry_feaeexyoeg/get_parameters: rcl_interfaces/srv/GetParameters /vtr/boreas_odometry_feaeexyoeg/list_parameters: rcl_interfaces/srv/ListParameters /vtr/boreas_odometry_feaeexyoeg/set_parameters: rcl_interfaces/srv/SetParameters /vtr/boreas_odometry_feaeexyoeg/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically </code></pre> <hr /> <p><a href="https://answers.ros.org/question/416225/how-do-i-stop-these-nodes-from-running/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/152794/koener/" rel="nofollow noreferrer">koener</a> on ROS Answers with karma: 16 on 2023-06-06</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-06</strong>:<br /> Where ROS 1 was <code>localhost</code> by default, ROS 2 is <code>everything-on-your-network</code> by default.</p> <p>Is someone else perhaps also running ROS 2 nodes on your network?</p> <p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-06-07</strong>:<br /> If @gvdhoorn's guess is correct, you need to set a unique <code>domain id</code>. This is a DDS config parameter.</p>
How do I stop these nodes from running
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>If you look at what actually gets imported when you type <code>import rospy</code> you will find that it pulls in an enormous amount of code. C++ includes tend to be a lot more granular and manual.</p> <p>For anything beyond some basic publisher and subscriber functionality for monitoring/interacting with ROS systems you'll probably find that it's unworkably cumbersome to satisfy C++ dependencies without building your projects in a full ROS/Catkin environment. In addition to locating and including all relevant headers, you need to find all shared library objects and link to those.</p> <p>You could theoretically skip Catkin and ROS packaging and just work with plain CMake to find the packages you need to include and link with your C++ code. HOwever, that will likely make it harder to break your project into several logically independent components. Catkin is there to help you build several packages that depend on each other in the order they're needed in the source dependency graph.</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-06-09</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103337
2023-06-08T07:01:52.000
|c++|ros-melodic|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello Community,</p> <p>So I have been working with ROS lately, it was really easy testing code in python where I just had to import rospy to work with ROS as I wished. I would then execute my programs with $python code.py.</p> <p>So now I want to kinda do the same thing in C++, I wrote a simple code for test, but with no CMakelists where I specify the roscpp dependency, it is not able to recognize the #include &quot;ros/ros.h&quot;, I was wondering if it would be possible if I added the ros.h header file :</p> <ul> <li>Where can I find this header file ?</li> <li>Will other ROS related packages (like std_msgs) get included with it ?</li> </ul> <p>Thanks for the replies :)</p> <p>Lilia.</p> <hr /> <p><a href="https://answers.ros.org/question/416285/build-ros-code-cpp-without-catkin-package/" 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-06-08</p> <p>Post score: 0</p>
Build ROS code cpp without Catkin Package
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>With c++, it is usually best to look at only the first error and ignore the enormous spew that follows. All the info you need is shown near the start:</p> <pre><code>[4.770s] /home/USERNAME/repos/thesis/ros2_ws/src/ros2_yolo_cpp/src/pose_eval.cpp:55:105: error: no matching function for call to ‘compute3DCentroid&lt;pcl::PointXYZRGB, int32_t&gt;(pcl::PointCloud&lt;pcl::PointXYZRGB&gt;&amp;, Eigen::Matrix&lt;float, 4, 1&gt;&amp;)’ ... [4.771s] /usr/include/pcl-1.10/pcl/common/impl/centroid.hpp:50:1: note: candidate: ‘unsigned int pcl::compute3DCentroid(pcl::ConstCloudIterator&lt;PointT&gt;&amp;, Eigen::Matrix&lt;Scalar, 4, 1&gt;&amp;) [with PointT = pcl::PointXYZRGB; Scalar = int]’ </code></pre> <p>The compiler is telling you that you need to pass a pointcloud iterator, not the the pointcloud itself.</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-11</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/141877/nilaos/" rel="nofollow noreferrer">Nilaos</a> on 2023-06-15</strong>:<br /> Thanks for the help - it turns out that while that was what the compiler wasn't a fan of, due to template matching it was actually the mismatch of passing in a float matrix while setting the second template type in that function call to be an int_32t that the compiler didn't like.</p> <p>While I would normally agree re error spew, the second error here that's followed is still proving a thorn in my side. I've tried changing the callback function inputs to be a <code>const MsgTypeXYZ::ConstSharedPtr &amp;msg</code> but that hasn't really changed the error message at all. Do you have any ideas for that?</p>
103339
2023-06-09T01:21:36.000
|ros|pcl|approximatetime|message-filters|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Compiler: gcc9.4.0 Arch: Ubuntu20.04/AMD64 PCL: 1.10 ROS Galactic</p> <p>I've got two errors which I believe are hindering me from compiling my code here successfully. The first is affecting my attempt to calculate the 3D centroid using PCL:</p> <pre><code>cannot bind non-const lvalue reference of type ‘Eigen::Matrix&lt;int, 4, 1&gt;&amp;’ to an rvalue of type ‘Eigen::Matrix&lt;int, 4, 1&gt;’ </code></pre> <p>I've tried a few different type, including pointers/non-pointers, but I'm a bit stumped with this.</p> <p>The second is an issue with using message_filters effectively. I've tried to copy the approach used by <a href="https://github.com/ros-perception/image_pipeline/blob/galactic/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp" rel="nofollow noreferrer">image_pipeline</a> for stereography, but it's throwing a number of errors:</p> <pre><code>error: no matching function for call to ‘message_filters::MessageEvent&lt;const vision_msgs::msg::Detection2D_&lt;std::allocator&lt;void&gt; &gt; &gt;::MessageEvent(const message_filters::MessageEvent&lt;const sensor_msgs::msg::PointCloud2_&lt;std::allocator&lt;void&gt; &gt; &gt;&amp;, bool)’ error: no matching function for call to ‘message_filters::Signal9&lt;vision_msgs::msg::Detection2D_&lt;std::allocator&lt;void&gt; &gt;, sensor_msgs::msg::PointCloud2_&lt;std::allocator&lt;void&gt; &gt;, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType, message_filters::NullType&gt;::addCallback&lt;const M0ConstPtr&amp;, const M1ConstPtr&amp;, const M2ConstPtr&amp;, const M3ConstPtr&amp;, const M4ConstPtr&amp;, const M5ConstPtr&amp;, const M6ConstPtr&amp;, const M7ConstPtr&amp;, const M8ConstPtr&amp;&gt;(std::_Bind_helper&lt;false, const std::_Bind&lt;void (pose_eval::PoseEval::*(pose_eval::PoseEval*, std::_Placeholder&lt;1&gt;, std::_Placeholder&lt;2&gt;))(sensor_msgs::msg::PointCloud2_&lt;std::allocator&lt;void&gt; &gt;&amp;, vision_msgs::msg::Detection2D_&lt;std::allocator&lt;void&gt; &gt;&amp;)&gt;&amp;, const std::_Placeholder&lt;1&gt;&amp;, const std::_Placeholder&lt;2&gt;&amp;, const std::_Placeholder&lt;3&gt;&amp;, const std::_Placeholder&lt;4&gt;&amp;, const std::_Placeholder&lt;5&gt;&amp;, const std::_Placeholder&lt;6&gt;&amp;, const std::_Placeholder&lt;7&gt;&amp;, const std::_Placeholder&lt;8&gt;&amp;, const std::_Placeholder&lt;9&gt;&amp;&gt;::type)’ [5.100s] 280 | ::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7, std::placeholders::_8, std::placeholders::_9)); </code></pre> <p>The latter error might be causing the former, but I'm not 100% on that. Full error log is not attached, so please find it at the bottom here.</p> <p>The relevant code is follows:</p> <pre><code>PoseEval::PoseEval(rclcpp::NodeOptions options) : Node(&quot;pose_eval_cpp&quot;, options) { rclcpp::QoS qos = rclcpp::SystemDefaultsQoS(); std::string ns = std::string(this-&gt;get_namespace()); this-&gt;detect_loc_pub_ = this-&gt;create_publisher&lt;PointStamped&gt;(ns + std::string(&quot;/detect_pos&quot;), qos); message_filters::Subscriber&lt;PointCloud2&gt; pc2_sub_(this, ns + &quot;&quot;, qos.get_rmw_qos_profile()); message_filters::Subscriber&lt;Detection2D&gt; best_detect_sub_(this, ns + &quot;&quot;, qos.get_rmw_qos_profile()); this-&gt;synch_subs_.reset(new ApproximateSync(ApproximatePolicy(20), pc2_sub_, best_detect_sub_)); this-&gt;synch_subs_-&gt;registerCallback(std::bind(&amp;PoseEval::points_callback, this, std::placeholders::_1, std::placeholders::_2)); } void PoseEval::points_callback(PointCloud2&amp; points, Detection2D&amp; best_match) { RCLCPP_INFO(this-&gt;get_logger(), &quot;Synching detection and cloud&quot;); // Find best result auto byScore = [&amp;](const ObjectHypothesisWithPose&amp; a, const ObjectHypothesisWithPose&amp; b) { return a.hypothesis.score &lt; b.hypothesis.score; }; auto best = std::max_element(best_match.results.begin(), best_match.results.end(), byScore); auto best_class = best-&gt;hypothesis.class_id; auto best_score = best-&gt;hypothesis.score; // Get ROI points auto box = best_match.bbox; auto box_c = box.center; auto top = box_c.y - box.size_y / 2, bottom = box_c.y + box.size_y / 2, left = box_c.x - box.size_x / 2, right = box_c.x + box.size_x / 2; pcl::PointCloud&lt;pcl::PointXYZRGB&gt;::Ptr cloud = boost::make_shared&lt;pcl::PointCloud&lt;pcl::PointXYZRGB&gt;&gt;(); pcl::PointCloud&lt;pcl::PointXYZRGB&gt;::Ptr cloud_subset = boost::make_shared&lt;pcl::PointCloud&lt;pcl::PointXYZRGB&gt;&gt;(); pcl::fromROSMsg(points, *cloud); // Extract ROI pcl::ExtractIndices&lt;pcl::PointXYZRGB&gt; filter(true); filter.setInputCloud(cloud); filter.setIndices(top, left, bottom - top, right - left); filter.filter(*cloud_subset); // Find Centroid auto centroid = Eigen::Vector4f(0, 0, 0, 0); auto n_pts_used = pcl::compute3DCentroid&lt;pcl::PointXYZRGB, std::int32_t&gt;(*cloud_subset, centroid); RCLCPP_INFO(this-&gt;get_logger(), &quot;Centroid found at %lf,%lf,%lf&quot;, centroid.x(), centroid.y(), centroid.z()); // Construct message auto pt = Point(); pt.x = centroid.x(); pt.y = centroid.y(); pt.z = centroid.z(); auto pt_s = PointStamped(); pt_s.point = pt; pt_s.header = Header(points.header); this-&gt;detect_loc_pub_-&gt;publish(pt_s); } </code></pre> <p>And error messages:</p> <blockquote> <p>This code block was moved to the following github gist: <a href="https://gist.github.com/answers-se-migration-openrobotics/dd081e35037ca8c8493772fc1f2bda24" rel="nofollow noreferrer">https://gist.github.com/answers-se-migration-openrobotics/dd081e35037ca8c8493772fc1f2bda24</a></p> </blockquote> <p>(Apologies for the verbosity, I cannot attach this log to the post). Thanks!</p> <hr /> <p><a href="https://answers.ros.org/question/416302/compilation-issues-with-pcl-and-message_filters:-;--cannot-bind-non-const-lvalue/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/141877/nilaos/" rel="nofollow noreferrer">Nilaos</a> on ROS Answers with karma: 13 on 2023-06-09</p> <p>Post score: 0</p>
Compilation issues with PCL and message_filters: ; cannot bind non-const lvalue
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>costmap_updates is an <strong>output</strong> message of the costmap2D program which is providing updates to just regions that were recently changed instead of sending the full costmap each iteration. It is <strong>NOT</strong> an input message to change the costmap nor should it be manually set. You should have your updates go through the costmap via plugin layers or other mechanisms to publish out the centralized environmental model.</p> <p>The fact that you see flickering is because the costmap is overwriting your manually sent changes because the costmap knows nothing about them. Only rviz is using that, nothing else.</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-06-12</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/118401/chwa02/" rel="nofollow noreferrer">ChWa02</a> on 2023-06-13</strong>:<br /> Thank you very much for the hint!</p>
103341
2023-06-12T07:38:22.000
|navigation|costmap|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi all,</p> <p>Ubuntu: 22.04 ROS: Humble</p> <p>I'm trying to update my generated costmap based on several factors. Currently, I'm getting a costmap based on the robots laser scan. In order to update this map I've tried to use the costmap_updates message where I'm publishing a updated version of the costmap.<br /> Sadly, this does not lead to the wanted behavior as the generated costmap flicks between the one from the laser scan and the one I'm publishing. Is there any way to combine these two sources to one costmap?</p> <p>I would really like to share some screenshots of the behavior I'm getting, but sadly my karma is not yet high enough.</p> <p>Best regards!</p> <hr /> <p><a href="https://answers.ros.org/question/416392/how-to-combine-local-costmap-from-laserscan-and-update-with-/costmap_updates/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/118401/chwa02/" rel="nofollow noreferrer">ChWa02</a> on ROS Answers with karma: 3 on 2023-06-12</p> <p>Post score: 0</p>
How to combine local costmap from laserscan and update with /costmap_updates
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>When accessing pixel values in an image in OpenCV, the convention is image[row][col] or image[y][x]. Currently it is [x][y] and that may be why you are getting the error (since you are accessing non-existent pixels).</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/153759/sohai/" rel="nofollow noreferrer">sohai</a> with karma: 16 on 2023-06-13</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103343
2023-06-12T21:06:15.000
|ros|3d-object-recognition|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am trying to create a python scripted node which calculates object distance based on what is detected from an object detection library I'm utilizing. The node is subscribed to the <code>/camera/color/image_raw</code> which it obtains the color image. This data is fed to the object detection model and the bounding box information is obtained. The location of the bounding box center is calculated using formula:</p> <pre><code>Center_x = x + (width / 2) Center_y = y + (height / 2) where: (x, y) are the coordinates of the top-left corner of the bounding box. width is the width of the bounding box. height is the height of the bounding box. </code></pre> <p>This coordinate is converted to it's corresponding location in the depth image (The node is also subscribed to the <code>camera\depth\image_raw</code> topic). This is the conversion formula I used:</p> <pre><code>scale_factor_x = width_depth / width_color scale_factor_y = height_depth / height_color x_depth = int(x_color * scale_factor_x) y_depth = int(y_color * scale_factor_y) </code></pre> <p>Here is the code:</p> <pre><code>#!/usr/bin/python3 import rospy from rospy.numpy_msg import numpy_msg import numpy as np from ultralytics import YOLO from cv_bridge import CvBridge from sensor_msgs.msg import Image import threading from std_msgs.msg import Header import cv2 #from yolov3.cfg import * class camera_detect: def __init__(self): self.bridge = CvBridge() self.model = YOLO('yolov5s.pt') self.mutex = threading.Lock() self.cv_image = None self.result = None self.class_names = None self.boxes = None self.info = None self.distance = None self.c1_time_stamp = None self.c2_time_stamp = None self.Center_x = None # x coordinate of bounding box center self.Center_y = None # y coordinate of bounding box center self.color_image_height = None #Height of opencv color image self.color_image_width = None #Width of opencv color image def callback1(self,msg): image=msg self.c1_time_stamp=msg.header.stamp with self.mutex: print(&quot;callback1 gets lock&quot;) if self.distance is None: self.cv_image = self.bridge.imgmsg_to_cv2(image, desired_encoding='passthrough') #convert to opencv format self.color_image_height = self.cv_image.shape[0] self.color_image_width = self.cv_image.shape[1] self.result = self.model(self.cv_image, verbose=True)[0] self.class_names = self.result.names self.boxes = self.result.boxes.data.cpu().numpy() try: for i in range(len(self.boxes)): print(&quot;NUMBER: &quot;,i) class_index = int(self.boxes[i][5]) class_name = self.class_names[class_index] print(&quot;CLASS_NAME: &quot;,str(class_name) ) if str(class_name) == &quot;fire hydrant&quot; or str(class_name) == &quot;chair&quot; or str(class_name) == &quot;laptop&quot;: self.info = self.boxes[i][0:4] self.Center_x = self.info[0] + (self.info[2] / 2) self.Center_y = self.info[1] + (self.info[3] / 2) else: self.info = None except IndexError: pass print(&quot;callback1 releases lock&quot;) def callback2(self, msg): depth_image = self.bridge.imgmsg_to_cv2(msg, desired_encoding='passthrough') #convert to opencv format self.c2_time_stamp = msg.header.stamp #SCALE FACTOR RELATES COLOR IMAGE AND DEPTH IMAGE scale_factor_x = depth_image.shape[1] / self.color_image_width scale_factor_y = depth_image.shape[0] /self.color_image_height with self.mutex: print(&quot;callback2 gets lock&quot;) if self.info is not None: #RELATE THE LOCATION OF PIXEL OF CENTER OF BOUNDING BOX TO PIXEL LOCATION IN DEPTH IMAGE x_depth = int(self.Center_x * scale_factor_x) y_depth = int(self.Center_y * scale_factor_y) print(&quot;X_DEPTH: &quot;,x_depth,&quot;Y_DEPTH: &quot;,y_depth) self.distance = depth_image[x_depth][y_depth] print(&quot;DISTANCE: &quot;, self.distance) time1 = rospy.Time(self.c1_time_stamp.secs, self.c1_time_stamp.nsecs) time2 = rospy.Time(self.c2_time_stamp.secs, self.c2_time_stamp.nsecs) # Calculate the time difference in seconds #time_diff = (time2 - time1).to_sec() #print(&quot;TIME_DIFF: &quot;,time_diff) self.distance = None print(&quot;callback2 releases lock&quot;) def detect(self): rospy.Subscriber(&quot;/camera/color/image_raw&quot;, Image, self.callback1, queue_size=1, buff_size=2_000_000) def detect_depth(self): rospy.Subscriber(&quot;/camera/depth/image_raw&quot;, Image, self.callback2, queue_size=1, buff_size=2_000_000) if __name__ == &quot;__main__&quot;: try: rospy.init_node(&quot;test_node&quot;) tester = camera_detect() tester.detect() tester.detect_depth() rospy.spin() except rospy.ROSInterruptException: pass </code></pre> <p>I get this error:</p> <pre><code>0: 480x640 1 fire hydrant, 28.6ms Speed: 4.0ms preprocess, 28.6ms inference, 9.8ms postprocess per image at shape (1, 3, 640, 640) NUMBER: 0 CLASS_NAME: fire hydrant callback1 releases lock callback2 gets lock X_DEPTH: 1203 Y_DEPTH: 182 [ERROR] [1686621381.764477, 910.003000]: bad callback: &lt;bound method camera_detect.callback2 of &lt;__main__.camera_detect object at 0x7f4a82a332b0&gt;&gt; Traceback (most recent call last): File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py&quot;, line 750, in _invoke_callback cb(msg) File &quot;/home/philip/tests_ws/src/ml_test/src/camera_test.py&quot;, line 76, in callback2 self.distance = depth_image[x_depth][y_depth] IndexError: index 1203 is out of bounds for axis 0 with size 720 </code></pre> <p>It would seem I'm not using the right formula to get what I want. I would be grateful for any help as to what I'm doing wrong.</p> <hr /> <p><a href="https://answers.ros.org/question/416411/require-help-deriving-correct-formula-to-calculate-object-distance/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on ROS Answers with karma: 167 on 2023-06-12</p> <p>Post score: 0</p>
Require Help Deriving correct formula to calculate object distance
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I figured it out:</p> <p>Since I was porting the code from ROS1, they initiated their node like this:</p> <pre><code>class OPEN_VRnode { public: OPEN_VRnode(int rate); ~OPEN_VRnode(); bool Init(); void Run(); void Shutdown(); bool setOriginCB(const std::shared_ptr&lt;std_srvs::srv::Empty::Request&gt; req, std::shared_ptr&lt;std_srvs::srv::Empty::Response&gt; res); void set_feedback(const sensor_msgs::msg::JoyFeedback::ConstPtr msg); rclcpp::Node:: nh_; VRInterface vr_; </code></pre> <p>...</p> <pre><code>OPEN_VRnode::OPEN_VRnode(int rate) : loop_rate_(rate) , nh_(&quot;open_vr_node&quot;) , vr_() , world_offset_({0, 0, 0}) , world_yaw_(0) { </code></pre> <p>But this resulted in no <code>shared_ptr</code> being created, so then later in the code when I ran <code>rclcpp::spin_some(nh_.get_shared_from_this());</code> there was no valid shared ptr to pass to spin_some.</p> <p>Fixed the issue by changing <code>nh_</code> to <code>nh_ptr_</code> and the type from <code>rclcpp::Node</code> to <code>rclcpp::Node::SharedPtr</code> and then initializing it in the class constructor.</p> <p>Full code can be found on my repository:<br /> <a href="https://github.com/NU-Haptics-Lab/open_vr_ros/tree/ros2" rel="nofollow noreferrer">https://github.com/NU-Haptics-Lab/open_vr_ros/tree/ros2</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/30452/buckley.toby/" rel="nofollow noreferrer">buckley.toby</a> with karma: 116 on 2023-06-15</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103345
2023-06-14T10:58:08.000
|windows|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>No clue what this error code means.</p> <p>System: Windows 10 ROS Humble</p> <p>Github repo with my code (forked from robosavvy's vive_ros):<br /> <a href="https://github.com/NU-Haptics-Lab/open_vr_ros/tree/ros2" rel="nofollow noreferrer">https://github.com/NU-Haptics-Lab/open_vr_ros/tree/ros2</a></p> <p>I've tried setting my ROS_DOMAIN_ID and nothing changes.</p> <hr /> <p><a href="https://answers.ros.org/question/416479/%5Bros2run%5D:-process-exited-with-failure-3221226505/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/30452/buckley.toby/" rel="nofollow noreferrer">buckley.toby</a> on ROS Answers with karma: 116 on 2023-06-14</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/30452/buckley.toby/" rel="nofollow noreferrer">buckley.toby</a> on 2023-06-27</strong>:<br /> just a note to anyone reading this in the future: that failure code is a generic Windows failure code.</p>
[ros2run]: Process exited with failure 3221226505
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <blockquote> <p>How to read Roll and Pitch</p> </blockquote> <p>You obtain these from the IMU sensor. The ros driver typically publishes on a topic named something like <code>/imu/data</code>. By reading the raw sensor data, you are getting the values in the IMU frame. You may need to apply a transformation if you want the values in some other frame (like world or map.)</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-16</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/154231/gabrielc15/" rel="nofollow noreferrer">gabrielc15</a> on 2023-06-19</strong>:<br /> Thank you, this is exactly what I was looking for. Just to clarify for future users, the topic is named /imu</p>
103347
2023-06-15T20:36:57.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am using the Turtlebot3 with ROS2 Foxy and I can't read the Roll and Pitch, just the Yaw. I'm using this launch: roslaunch turtlebot3_bringup turtlebot3_robot.launch</p> <p>and the result is: <img src="https://emanual.robotis.com/assets/images/platform/turtlebot3/example/rqt_6.png" alt="image description" /></p> <p>Which is the same result presented at the <a href="https://emanual.robotis.com/docs/en/platform/turtlebot3/basic_operation/" rel="nofollow noreferrer">documentation</a></p> <p>I tested, my opencr itself and it really has the gyroscope to read the 3-axis.</p> <p>So, what I have to do to have access to the Roll and Pitch?</p> <hr /> <p><a href="https://answers.ros.org/question/416546/how-to-read-roll-and-pitch-with-turtlebot3?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/154231/gabrielc15/" rel="nofollow noreferrer">gabrielc15</a> on ROS Answers with karma: 3 on 2023-06-15</p> <p>Post score: 0</p>
How to read Roll and Pitch with Turtlebot3?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Great, that finally worked by following the proposition on <a href="https://github.com/ROBOTIS-GIT/turtlebot3/issues/965#issuecomment-1633344157" rel="nofollow noreferrer">https://github.com/ROBOTIS-GIT/turtlebot3/issues/965#issuecomment-1633344157</a></p> <p>To keep a trace of the answer, although this is just a copy/paste of the github issue :</p> <pre><code>sudo swapoff /swapfile sudo fallocate -l 2G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile sudo nano /etc/fstab </code></pre> <p>and then add</p> <pre><code>/swapfile swap swap defaults 0 0 </code></pre> <p>to the <code>/etc/fstab</code> file</p> <p>On my RPB3 , it took almost 2 hours to compile the turtlebot3_node package. And on the swap, I looked at it from time to time, it occupied at most 1.5 GB out of the 2 GB.</p> <p>One last thing, I ran the compilation with <code>colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release</code>, i.e. no more with the debug or sequential flags.</p> <p>By the way, I also release ansible roles for deploying ROS2 on either Turtlebot2 or Turtlebot3. Some parts are custom to my own devices but should still be pretty customilzable and useful for others. The ansible scripts are provided at <a href="https://github.com/jeremyfix/ros2_ansible_turtlebot" rel="nofollow noreferrer">https://github.com/jeremyfix/ros2_ansible_turtlebot</a></p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/154763/jeremy-fix/" rel="nofollow noreferrer">Jeremy Fix</a> with karma: 31 on 2023-07-18</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103352
2023-06-19T02:24:25.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hello,</p> <p>I'm having troubles when following the <a href="https://emanual.robotis.com/docs/en/platform/turtlebot3/sbc_setup/#sbc-setup" rel="nofollow noreferrer">robotis ros2 humble SBC setup instructions</a> when it is time to <code>colcon build --symlink-install --parallel-workers 1</code></p> <p>This does not work and the worker gets blocked.</p> <p>Following suggestions in several posts I found, I tried to reduce the CPU and memory footprint of the compilation by running the following command</p> <p><code>colcon build --symlink-install --executor sequential --cmake-args &quot; -DCMAKE_C_FLAGS_RELWITHDEBINFO=-O0&quot; --cmake-args &quot; -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O0&quot;</code></p> <p>But, around 28% of compiling turtlebot3_node, it displays</p> <p>` INFO: task kworker/0:0:1149 blocked for more than 120 seconds. Tainted: G C E 5.15.0-1030-raspi # 32-Ubuntu INFO: task kworker/0:0:1149 blocked for more than 241 seconds. Tainted: G C E 5.15.0-1030-raspi # 32-Ubunt ... INFO: task kworker/0:0:1149 blocked for more than 1208 seconds. Tainted: G C E 5.15.0-1030-raspi # 32-Ubunt</p> <p>`</p> <p>Then I hit Ctrl+C and the compilation resumed, skipping the compilation of turtlebot3_node.</p> <p>I do not know if this is relevant but, when (or just before maybe) I pressed Ctrl+C, I also got the message</p> <p><code>systemd[1]: snapd.service: Watchdog timout (limit 5 min)</code></p> <p>From what I see from htop, one <code>cc1plus</code> process is taking 65.7% of the RAM. There are also several snapd processes that take some 1.6% of the RAM, some of them takes 20% of the CPU as well .</p> <hr /> <p><a href="https://answers.ros.org/question/416622/task-worker-blocked-when-compiling-turtlebot3_node-for-ros2-on-the-rpi-3b+/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/154763/jeremy-fix/" rel="nofollow noreferrer">Jeremy Fix</a> on ROS Answers with karma: 31 on 2023-06-19</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/154763/jeremy-fix/" rel="nofollow noreferrer">Jeremy Fix</a> on 2023-06-19</strong>:<br /> One follow up ,</p> <p>I noticed in the second command that I forgot to add <code>--parallel-workers 1</code> , therefore, I'm now retrying with</p> <p><code>colcon build --symlink-install --executor sequential --cmake-args &quot; -DCMAKE_C_FLAGS_RELWITHDEBINFO=-O0&quot; --cmake-args &quot; -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O0&quot; --parallel-workers 1</code></p> <p>And building is running. The console (I'm running ubuntu server 22.04) is not super responsive, but the build percent progress is rising.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/145944/anhhazz/" rel="nofollow noreferrer">AnhHazz</a> on 2023-06-23</strong>:<br /> Have you solved this prolem? I got the same today</p> <p><strong>Comment by <a href="https://answers.ros.org/users/154763/jeremy-fix/" rel="nofollow noreferrer">Jeremy Fix</a> on 2023-06-23</strong>:<br /> Unfortunately not ! I'm currently trying several things for compiling on the RPI : like killing all the snapd processes, trying to compile without colcon (with the usual cmake process). For now, no success.</p> <p>I do not know if we can cross compile.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/154763/jeremy-fix/" rel="nofollow noreferrer">Jeremy Fix</a> on 2023-06-27</strong>:<br /> I tried bypassing colcon and using the usual cmake way of building a package, still with the cmake options above, but this is still failing;</p> <p>I'm at the point where I do know if there is another option than cross compiling.</p> <p><strong>Comment by <a href="https://answers.ros.org/users/145944/anhhazz/" rel="nofollow noreferrer">AnhHazz</a> on 2023-06-27</strong>:<br /> I asked chatgpt for help. It show some ways but i can't try until this weekend. Can you try it if you have time? Here is the conversation link: <a href="https://chat.openai.com/share/b063d502-3458-44b4-8432-942d0832e903" rel="nofollow noreferrer">https://chat.openai.com/share/b063d502-3458-44b4-8432-942d0832e903</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/145944/anhhazz/" rel="nofollow noreferrer">AnhHazz</a> on 2023-07-12</strong>:<br /> Hey, i posted this on github and got some help. Look like it's gonna work this time</p> <p>Here is the issue link : <a href="https://github.com/ROBOTIS-GIT/turtlebot3/issues/965#issuecomment-1633344157" rel="nofollow noreferrer">https://github.com/ROBOTIS-GIT/turtlebot3/issues/965#issuecomment-1633344157</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/154763/jeremy-fix/" rel="nofollow noreferrer">Jeremy Fix</a> on 2023-07-13</strong>:<br /> Wow, great ! I cannot test it right now but in one week or so I should be able to test it. Thank you for the github discussion that led to some solution !:</p>
Task worker blocked when compiling turtlebot3_node for ROS2 on the RPI 3B+
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Have a look at <a href="https://discourse.ros.org/t/when-did-you-consider-yourself-good-at-ros/31720/9" rel="nofollow noreferrer">this discussion</a>.</p> <p>Dependent on your needs, <em>developing</em> a solution to your task might involve:</p> <ul> <li>Purely using existing packages, or</li> <li>Changing code of existing packages, or</li> <li>Writing new packages, or</li> <li>Submitting patches to the ROS core libraries.</li> </ul> <p>Those are all different levels of 'being a developer'.</p> <p>So what's in a name... The question is rather: do you succeed in solving the tasks that you want to solve. If yes: great! If no: keep on learning. You will get there, but it's a very steep learning curve.</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-20</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on 2023-06-20</strong>:<br /> Thank you so much ! Hope you have a good day !</p>
103354
2023-06-20T02:27:38.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I worked on ROS for 3 months now, and I'm using other people's package to do my project, but I feel like I can only use, not make my own package, is it ok? what does it mean to be a ROS developer?</p> <hr /> <p><a href="https://answers.ros.org/question/416655/what-is-the-standard-you-can-be-called-good-at-ros-?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/144407/tapleflib/" rel="nofollow noreferrer">TapleFlib</a> on ROS Answers with karma: 39 on 2023-06-20</p> <p>Post score: 0</p>
What is the standard you can be called good at ROS?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Found the error For those, who has the same problem. In launch file the name of the node was <strong>name='navsat_transform_node'</strong>, and in yaml file &quot;<strong>navsat_transform</strong>&quot; both names should be the same - navsat_transform_node in this case.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/154499/dan__2022/" rel="nofollow noreferrer">Dan__2022</a> with karma: 26 on 2023-06-24</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103357
2023-06-22T15:33:32.000
|ros|ros2|ekf|navsat-transform-node|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi, please, help me with following issue, i've been trying to solve it for a week already...</p> <p>Can't make my navsat_transform node publishing <em>utm_transform</em>. And <em>odometry/filtered</em> from EKF always has Pose-Position X Y and Z = 0 (although Orientation on Z isn't 0) - is it right at all?</p> <p><em>gps/filtered</em> and <em>odometry/gps</em> are published correctly by navsat_transform node</p> <p><em>demo/imu plugin</em> publishes <em>demo/imu</em> topic<br /> <em>demo/gps plugin</em> publishes <em>demo/gps</em> topic</p> <p>no errors, output is</p> <p><strong>[navsat_transform_node-5] [INFO] [1687465374.225880796] [navsat_transform_node]: Datum (latitude, longitude, altitude) is (</strong>*, ***, ***) [navsat_transform_node-5] [INFO] [1687465374.226410996] [navsat_transform_node]: Datum UTM coordinate is (37U, ***.81, *<strong>.65) [navsat_transform_node-5] [INFO] [1687465374.303980897] [navsat_transform_node]: Corrected for magnetic declination of 0, user-specified offset of 0 and meridian convergence of -0.0255208. Transform heading factor is now -0.0255726</strong></p> <p>what is wrong with my configuration? Thanks!</p> <p><strong>launch file extract:</strong></p> <pre><code> robot_localization_node = launch_ros.actions.Node( package='robot_localization', executable='ekf_node', name='ekf_filter_node', output='screen', parameters=[os.path.join(pkg_share, 'config/ekf.yaml'), {'use_sim_time': LaunchConfiguration('use_sim_time')}] ) navsat_transform_node = launch_ros.actions.Node( package='robot_localization', executable='navsat_transform_node', name='navsat_transform_node', output='screen', parameters=[os.path.join(pkg_share, 'config/navsat_transform.yaml'),{'use_sim_time': LaunchConfiguration('use_sim_time')}], remappings=[('gps/fix', 'demo/gps'),('imu', 'demo/imu')] ) </code></pre> <p><strong>navsat_transform.yaml</strong></p> <pre><code>navsat_transform: ros__parameters: use_sim_time: true frequency: 10.0 delay: 3.0 magnetic_declination_radians: 0.2008874 yaw_offset: 1.5707963 zero_altitude: true broadcast_utm_transform: true broadcast_utm_transform_as_parent_frame: true publish_filtered_gps: true use_odometry_yaw: false wait_for_datum: true </code></pre> <p><strong>ekf.yaml</strong></p> <pre><code>ekf_filter_node: ros__parameters: use_sim_time: true frequency: 30.0 sensor_timeout: 0.1 transform_time_offset: 0.0 transform_timeout: 0.0 two_d_mode: true publish_acceleration: true publish_tf: true print_diagnostics: true debug: false reset_on_time_jump: true map_frame: map # Defaults to &quot;map&quot; if unspecified odom_frame: odom # Defaults to &quot;odom&quot; if unspecified base_link_frame: base_link # Defaults to &quot;base_link&quot; if unspecified world_frame: odom # Defaults to the value of odom_frame if unspecified odom0: /odometry/gps odom0_config: [true, true, false, false, false, false, false, false, false, false, false, false, false, false, false] odom0_queue_size: 10 odom0_nodelay: false odom0_differential: false odom0_relative: false imu0: /demo/imu imu0_config: [false, false, false, true, true, true, false, false, false, true, true, true, true, true, true] imu0_nodelay: false imu0_differential: false odom0_relative: false imu0_queue_size: 7 imu0_remove_gravitational_acceleration: true use_control: false </code></pre> <p><strong>[EDIT]</strong><br /> Timothee, thank you so much!<br /> I've had no error like &quot;What strange is that you should have gotten a RCLCPP WARN saying : Parameter 'broadcast_utm_transform' has been deprecated. Please use 'broadcast_cartesian_transform' instead.&quot;</p> <p>Maybe somthing is totally wrong with some global set-up in my system?</p> <p>reconfiguring like</p> <pre><code>map_frame: map odom_frame: base_link base_link_frame: base_link world_frame: map </code></pre> <p>resulted in error <strong>[ekf_filter_node]: Invalid frame configuration! The values for map_frame, odom_frame, and base_link_frame must be unique. If using a base_link_frame_output values, it must not match the map_frame or odom_frame.</strong></p> <p>2nd EKF, as far as I got, not useful with only IMU without wheels odometry. I'm not going to use wheels odometry in my robot... so changed it to</p> <pre><code> 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: map # Defaults to the value of odom_frame if unspecified </code></pre> <p>In navsat yaml replaced <strong>utm</strong>* with</p> <pre><code>broadcast_cartesian_transform_: true broadcast_cartesian_transform_as_parent_frame_: true </code></pre> <p>provided map-&gt;odom transform from topic odometry/gps as</p> <pre><code>self.create_subscription(Odometry, 'odometry/gps', self.__og_sensor_callback, 10) .... def __og_sensor_callback(self, msg): self.get_logger().info('Publishing TF odom -&gt; base_link ') t = TransformStamped() t.header.stamp = self.get_clock().now().to_msg() t.header.frame_id = 'odom' t.child_frame_id = 'base_link' t.transform.translation.x = msg.pose.pose.position.x t.transform.translation.y = msg.pose.pose.position.y t.transform.translation.z = 0.0 t.transform.rotation=msg.pose.pose.orientation self.tf_broadcaster.sendTransform(t) </code></pre> <p>map-&gt;odom is published as static transform like</p> <pre><code> self.tf_publisher = StaticTransformBroadcaster(self) tf = TransformStamped() tf.header.stamp = self.get_clock().now().to_msg() tf.header.frame_id = 'map' tf.child_frame_id = 'odom' tf.transform.translation.x = 0.0 tf.transform.translation.y = 0.0 tf.transform.translation.z = 0.0 self.tf_publisher.sendTransform(tf) </code></pre> <p>get map-&gt;odom-&gt;base_link-&gt;... all setup on TF-tree clear and in proper order, can be traced with ros2 run tf2_ros tf2_echo map odom and ros2 run tf2_ros tf2_echo odom base_link</p> <p>still no UTM(or cartesian) -&gt; map transform... nothing</p> <p><strong>and what else i noticed..</strong> although i have &quot;magnetic_declination_radians: <strong>0.2008874</strong>&quot; in my navsat_transform.yaml, the output is &quot; Corrected for magnetic declination of <strong>0</strong>, user-specified offset of 0 and meridian convergence of <strong>-0.0255208</strong>. Transform heading factor is now -0.0255722&quot; - and that's not what I set, not 0.2008874.</p> <p>Should it be like this at all?</p> <hr /> <p><a href="https://answers.ros.org/question/416769/navsat_transform-node-doesn%27t-publish-utm_transform/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/154499/dan__2022/" rel="nofollow noreferrer">Dan__2022</a> on ROS Answers with karma: 26 on 2023-06-22</p> <p>Post score: 0</p>
navsat_transform node doesn't publish utm_transform
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I think I resolved most of my performance problems so I will post here how I managed to gain performance :</p> <hr /> <p>Virtual Machine specific :</p> <p>Reducing the number of core, video memory and RAM <strong>really</strong> improved my performance and I think a good rule of thumb is to not give more than a quarter of your available ressources to the VM. I am currently using 6 cores, 32 Mo and 6 GB of RAM and it work a lot better than before. Check also for any power restriction made by the host on either global performance or your WiFi adapter.</p> <hr /> <p>System wide changes :</p> <p>I discovered online that wifi power saver can be <strong>very</strong> detrimental to ROS2 performance over WIFI, and I recommend strongly to deactivate it on both end of the ROS2 communication. To do so :</p> <pre><code>sudo -i gedit /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf </code></pre> <p>Then if you see <code>wifi.powersave = 3</code>, change the 3 to a 2 (it disable powersave), save the file, close gedit and restart your machine.</p> <p>Check also for any power restriction on either global performance or your WiFi adapter.</p> <hr /> <p>ROS2 specfic :</p> <p>Switching to CycloneDDS <em>seems</em> to work better over WiFi, you can find it <a href="https://docs.ros.org/en/foxy/Installation/DDS-Implementations/Working-with-Eclipse-CycloneDDS.html" rel="nofollow noreferrer">here</a>. Limiting the info that was transiting through Wifi can help too, but it can't be done in every scenario.</p> <p>Now I run all the algorithms on the bot, and only use my pc as a visualization / command sender and I can affirm it work really better.</p> <p>Hope this will help others who struggle with performances !</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/148408/timoth%C3%A9e/" rel="nofollow noreferrer">Timothée</a> with karma: 23 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/26871/billy/" rel="nofollow noreferrer">billy</a> on 2023-07-27</strong>:<br /> +1 for circling back and answering</p>
103359
2023-06-22T18:46:09.000
|ros|ros2|performance|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>To describe my problem more accurately, my pc become near unusable when I run slam toolbox and rviz2, with at least 10 seconds between a click and its response (it's really painful)</p> <p>The robot that I use is a real one, I connect through wifi to it and ssh to launch the node on it but slam and rviz2 run on my computer.</p> <p>With a simple node to control the robot, they are the only node running and there are no other program that could have a significant impact on the performance</p> <p>I am running ROS2 foxy on a virtual machine with Kubuntu 20.04</p> <p>Spec of my PC :</p> <pre><code>System : Windows 10 Processor 12th Gen Intel(R) Core(TM) i5-1250P 1.70 GHz Installed RAM 16,0 GB (15,2 GB usable) System type 64-bit operating system, x64-based processor </code></pre> <p>Spec of the virtual machine :</p> <pre><code>12/24 proc core (100 % of the core allocated each) 9110 MB of RAM 128 Mo of video memory </code></pre> <p>Is it a problem with my computer ? or is the virtual machine reducing too much my performance ?</p> <p>I can of course do any other manipulation you want, just tell me and I will do it as soon as possible</p> <hr /> <p><a href="https://answers.ros.org/question/416772/slam-toolbox-and-rviz2-slowing-down-my-computer/" 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-06-22</p> <p>Post score: 0</p>
Slam toolbox and Rviz2 slowing down my computer
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I've created a workaround for this, consisting of a new custom message definition containing all messages of interest and a simple python node that synchronises and republishes the messages as a 'bundled' message.</p> <p>Not exactly a 'great' solution, but it works.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/141877/nilaos/" rel="nofollow noreferrer">Nilaos</a> with karma: 13 on 2023-07-02</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p>
103361
2023-06-23T00:15:31.000
|message-filters|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Compiler: gcc9.4.0 Arch: Ubuntu20.04/AMD64 ROS Galactic</p> <p>I'm struggling still to compile a node using an approximate time sync from two topics. I've attempted to closely follow the method used by <a href="https://github.com/ros-perception/image_pipeline/blob/galactic/stereo_image_proc/src/stereo_image_proc/point_cloud_node.cpp" rel="nofollow noreferrer">image_pipeline</a> but even with a few changes to try to solve my issue I'm still stumped on how to get template matching to work correctly here. Help understanding what's going on/wrong here would be appreciated :)</p> <p>My class is defined as:</p> <pre><code>namespace pose_eval { using namespace geometry_msgs::msg; using namespace sensor_msgs::msg; using namespace vision_msgs::msg; using namespace std_msgs::msg; template &lt;class T&gt; using Sub = message_filters::Subscriber&lt;T&gt;; class PoseEval : public rclcpp::Node { private: using ApproxPolicy = message_filters::sync_policies::ApproximateTime&lt;Detection2D, PointCloud2&gt;; using ApproxSync = message_filters::Synchronizer&lt;ApproxPolicy&gt;; rclcpp::Publisher&lt;PointStamped&gt;::SharedPtr detect_loc_pub_; std::shared_ptr&lt;ApproxSync&gt; synch_subs_; message_filters::Subscriber&lt;PointCloud2&gt; pc2_sub_; message_filters::Subscriber&lt;Detection2D&gt; best_detect_sub_; void points_callback(const PointCloud2::ConstSharedPtr &amp;points, const Detection2D &amp;best_match); public: PoseEval(rclcpp::NodeOptions options); PoseEval(); ~PoseEval(); }; } </code></pre> <p>And instantiated as:</p> <pre><code>PoseEval::PoseEval(rclcpp::NodeOptions options) : Node(&quot;pose_eval_cpp&quot;, options) { rclcpp::QoS qos = rclcpp::SystemDefaultsQoS(); std::string ns = std::string(this-&gt;get_namespace()); this-&gt;detect_loc_pub_ = this-&gt;create_publisher&lt;PointStamped&gt;(ns + std::string(&quot;/&quot;), qos); pc2_sub_.subscribe(this, ns + &quot;&quot;, qos.get_rmw_qos_profile()); best_detect_sub_.subscribe(this, ns + &quot;&quot;, qos.get_rmw_qos_profile()); synch_subs_ = std::make_shared&lt;ApproxSync&gt;( ApproxPolicy(5), pc2_sub_, best_detect_sub_); synch_subs_-&gt;registerCallback(std::bind(&amp;PoseEval::points_callback, this, std::placeholders::_1, std::placeholders::_2)); } </code></pre> <p>The (very verbose) error for that is:</p> <blockquote> <p>This code block was moved to the following github gist: <a href="https://gist.github.com/answers-se-migration-openrobotics/405b01eee5b166fb7d811748cb80fbc5" rel="nofollow noreferrer">https://gist.github.com/answers-se-migration-openrobotics/405b01eee5b166fb7d811748cb80fbc5</a></p> </blockquote> <hr /> <p><a href="https://answers.ros.org/question/416779/template-errors-creating-approximate-time-synchroniser/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/141877/nilaos/" rel="nofollow noreferrer">Nilaos</a> on ROS Answers with karma: 13 on 2023-06-23</p> <p>Post score: 0</p>
Template errors creating Approximate Time Synchroniser
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>You misunderstand what the collision element is for: it is used by algorithms for <strong>detecting</strong> collision, but these elements do not directly prevent it. Only some API calls will check for collision and stop the movement. It's your responsibility (or that of the code you chose to run) to not send joint-movement commands that cause collision.</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-23</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 0</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/151151/tp7/" rel="nofollow noreferrer">TP7</a> on 2023-06-23</strong>:<br /> Ok thank you for the update</p>
103363
2023-06-23T05:35:51.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I have made a 15 DOF robot and add collision element to avoid internal collisions, but anyway the links collide within each other. I use RViz to visualise the robot.</p> <hr /> <p><a href="https://answers.ros.org/question/416794/i-use-collision-element-in-my-code-but-still-the-robot-links-crush-each-other.-why?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/151151/tp7/" rel="nofollow noreferrer">TP7</a> on ROS Answers with karma: 13 on 2023-06-23</p> <p>Post score: 1</p> <hr /> <h3>Original comments</h3> <p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-06-23</strong>:<br /> Can you able to provide more details? please, If possible upload an image to support questions.</p> <ol> <li>What are the steps you have followed till now?</li> </ol>
I use collision element in my code but still the robot links crush each other. Why?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>It seems that the problem is that the function &quot;dynamic-completion-table&quot; has changed its name in emacs, now it is called &quot;completion-table-dynamic&quot;.</p> <p>To solve the problem, I changed in the file: &quot;/opt/ros/noetic/share/emacs/site-lisp/rosemacs.el&quot; all occurrences of &quot;dynamic-completion-table&quot; by &quot;completion-table- dynamic&quot;. it seems to work for now.</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/155797/hdd--robot/" rel="nofollow noreferrer">hdd--robot</a> with karma: 38 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/875/130s/" rel="nofollow noreferrer">130s</a> on 2023-06-29</strong>:<br /> Glad you found a workaround. Seeing <code>/opt/ros/noetic/share/emacs</code> in your error output, I guess your <code>rosemacs</code> is installed via the installer, of which code is maintained at <a href="https://github.com/code-iai/ros_emacs_utils/issues" rel="nofollow noreferrer">https://github.com/code-iai/ros_emacs_utils/issues</a>. Why don't you submit a bugfix?</p>
103365
2023-06-25T04:21:43.000
|ros|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>After installing ros-noetic on a debian 10. I installed ros-noetic-rosemacs via apt. The installed version is : 0.4.17-1buster.20220221.094135.</p> <p>When I run emacs (emacs --debug-init) I get the following error:</p> <pre><code>Debugger entered--Lisp error: (void-function dynamic-completion-table) (dynamic-completion-table #'(lambda (str) (rosemacs-bsearch str ros-all-topics))) (setq topic-completor (dynamic-completion-table #'(lambda (str) (rosemacs-bsearch str ros-all-topics)))) load-with-code-conversion(&quot;/opt/ros/noetic/share/emacs/site-lisp/rosemacs.el&quot; &quot;/opt/ros/noetic/share/emacs/site-lisp/rosemacs.el&quot; nil t) require(rosemacs) load-with-code-conversion(&quot;/opt/ros/noetic/share/emacs/site-lisp/rosemacs-con...&quot; &quot;/opt/ros/noetic/share/emacs/site-lisp/rosemacs-con...&quot; nil t) require(rosemacs-config) load-with-code-conversion(&quot;/home/hdd/.emacs.d/init.el&quot; &quot;/home/hdd/.emacs.d/init.el&quot; t t) load(&quot;/home/hdd/.emacs.d/init&quot; noerror nomessage) startup--load-user-init-file(#f(compiled-function () #&lt;bytecode 0x10b2151e256b0ed8&gt;) #f(compiled-function () #&lt;bytecode -0x1f3c686ddc0cdc35&gt;) t) command-line() normal-top-level() </code></pre> <p>Do you have any idea how to make rosemacs work?</p> <hr /> <p><a href="https://answers.ros.org/question/416843/rosemacs-error-:-dynamic-completion-table/" 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-25</p> <p>Post score: 1</p>
rosemacs error : dynamic-completion-table
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>First you need to add your declared argument to the final <code>LaunchDescription</code> that you return:</p> <pre><code>return LaunchDescription([arg_n_drones, *l_include_drown_spawn]) </code></pre> <p>To use it in your launch file as a normal Python variable, I believe you must use <code>OpaqueFunction</code>:</p> <p><a href="https://answers.ros.org/question/415825/can-i-programmatically-call-a-launch-file-with-arguments-that-can-be-used-as-a-variable-for-python-operations/" rel="nofollow noreferrer">https://answers.ros.org/question/415825/can-i-programmatically-call-a-launch-file-with-arguments-that-can-be-used-as-a-variable-for-python-operations/</a></p> <p><a href="https://answers.ros.org/question/416438/adding-node-from-within-opaquefunction-in-ros2-python-launch-file/" rel="nofollow noreferrer">https://answers.ros.org/question/416438/adding-node-from-within-opaquefunction-in-ros2-python-launch-file/</a></p> <p>That second answer includes a concrete example of using a declared launch argument to do N things. There are a couple of ways to access its string value. You can use a <code>LaunchConfiguration</code> object inside your <code>OpaqueFunction</code> and use <code>LaunchConfiguration.perform(context)</code>:</p> <p><a href="https://github.com/danzimmerman/dz_launch_examples/blob/rolling/launch/opaque_multi_nodes.launch.py#L9" rel="nofollow noreferrer">https://github.com/danzimmerman/dz_launch_examples/blob/rolling/launch/opaque_multi_nodes.launch.py#L9</a></p> <p>or you can access it by name from the <code>context.launch_configurations</code> dictionary:</p> <p><a href="https://github.com/danzimmerman/dz_launch_examples/blob/rolling/launch/arg_examples.launch.py#L24" rel="nofollow noreferrer">https://github.com/danzimmerman/dz_launch_examples/blob/rolling/launch/arg_examples.launch.py#L24</a></p> <p>(<code>LaunchConfiguration.perform(context)</code> accesses this internally, see <a href="https://github.com/ros2/launch/blob/rolling/launch/launch/substitutions/launch_configuration.py#L96" rel="nofollow noreferrer">here</a>).</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-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/146607/s%C3%A9bastienl/" rel="nofollow noreferrer">SébastienL</a> on 2023-06-27</strong>:<br /> thank you, it was missing indeed. With the correction, the arg is in the output of ros2 launch -s. Any idea on how to get its value ?</p> <pre><code>context = LaunchContext(argv=sys.argv) arg_n_drones.visit(context) # return None </code></pre> <p><strong>Comment by <a href="https://answers.ros.org/users/37963/danzimmerman/" rel="nofollow noreferrer">danzimmerman</a> on 2023-06-27</strong>:<br /> Updated my answer with info there. I am not sure there's any way besides <code>OpaqueFunction</code> to get a valid context. It's the only way I know.</p> <p>Creating a new one in <code>generate_launch_description()</code> seems to give an empty dict for <code>context.launch_configurations</code> and a subsequent error:</p> <p><a href="https://github.com/danzimmerman/dz_launch_examples/blob/rolling/launch/multi_nodes_no_opaque.launch.py" rel="nofollow noreferrer">https://github.com/danzimmerman/dz_launch_examples/blob/rolling/launch/multi_nodes_no_opaque.launch.py</a></p> <p><strong>Comment by <a href="https://answers.ros.org/users/146607/s%C3%A9bastienl/" rel="nofollow noreferrer">SébastienL</a> on 2023-06-27</strong>:<br /> Well it seems my problem is solved thank you. I'd already tried the solution with OpaqueFunction but i failed at the time. I suppose that forgetting to put my argument in the LaunchDescription was a prerequisite for testing the other solutions. Your example files are very good, simple and clear !</p>
103367
2023-06-26T06:21:54.000
|python|ros2|roslaunch|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Hi,</p> <p>I read a lot of questions about arguments and launch files and did not find something related to my case (maybe this one <a href="https://answers.ros.org/question/375591/how-to-get-argument-values-in-ros2/" rel="nofollow noreferrer">https://answers.ros.org/question/375591/how-to-get-argument-values-in-ros2/</a>, but I can't get the value of the LaunchConfiguration)</p> <p>So here is my pb, I want an argument be used in the launch file to loop on IncludeLaunchDescription instanciation -&gt; I have a yml file working for 1 drone, and i want to use many drones.</p> <pre><code>def generate_launch_description(): # ... arg_n_drones = DeclareLaunchArgument( &quot;N&quot;, default_value=&quot;1&quot;, description=&quot;number of drones in the simulation.&quot; ) # this does not seem to be enough to have the argument visible with the --show-args option N = 1 # I would like something based on arg_n_drones l_include_drone_spawn = [] for i in range(1,N+1): l_include_drone_spawn.append( IncludeLaunchDescription( &quot;launch/spawn_drone.yml&quot;, ) ) return LaunchDescription([ # ... *l_include_drone_spawn, ]) </code></pre> <p>Any help appreciated,</p> <hr /> <p><a href="https://answers.ros.org/question/416863/how-to-get-argument-from-launch-file-not-used-in-a-node-?/" 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-26</p> <p>Post score: 1</p>
How to get argument from launch-file not used in a Node?
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>Alright I found the problem. In my code I accidentally had the main inside my URDriverSubscriber class....</p> <hr /> <p>Originally posted by <a href="https://answers.ros.org/users/152842/areyer/" rel="nofollow noreferrer">Areyer</a> with karma: 26 on 2023-06-27</p> <p>This answer was <strong>ACCEPTED</strong> on the original site</p> <p>Post score: 1</p>
103369
2023-06-26T12:32:52.000
|ros2|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p> <p>I am currently trying to simulate the UR10e in Unity to then remote control it in VR. So far I have managed to control the robot locally by using the universal robots ros2 driver for humble. But I have problems with unity. I was following the guide of the unity-robotics-hub, transfer the xarco files to an urdf. For this I added the ur_description to the ur driver and generated the urdf file with following command</p> <pre><code>ros2 run xacro xacro <span class="math-container">$(ros2 pkg prefix ur_description --share)/urdf/ur.urdf.xacro \ name:=ur10e \ joint_limit_params:=$</span>(ros2 pkg prefix ur_description --share)/config/ur10e/joint_limits.yaml \ physical_params:=<span class="math-container">$(ros2 pkg prefix ur_description --share)/config/ur10e/physical_parameters.yaml \ kinematics_params:=$</span>(ros2 pkg prefix ur_description --share)/config/ur10e/default_kinematics.yaml \ visual_params:=$(ros2 pkg prefix ur_description --share)/config/ur10e/visual_parameters.yaml </code></pre> <p>after that I have placed the generated file in the Asset folder in unity and used the urdf-importer to integrate my model in the project.</p> <p>Then I created a new packag in the ur_driver</p> <pre><code>ros2 pkg create --build-type ament_python unity_messages </code></pre> <p>created a Subscriber Node in the python maiin file and tried to get the message information of the robot states with the following script</p> <pre><code>import rclpy from rclpy.node import Node from sensor_msgs.msg import JointState class URDriverSubscriber(Node): def __init__(self): super().__init__('ur_driver_subscriber') self.subscription = self.create_subscription( JointState, 'joint_states', self.callback_function, 10 ) self.subscription def callback_function(self, msg): joint_positions = msg.position self.get_logger().info(f'Received joint positions: {joint_positions}') def main(args=None): rclpy.init(args=args) ur_driver_subscriber = URDriverSubscriber() rclpy.spin(ur_driver_subscriber) ur_driver_subscriber.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p>made according adjustments in the newly created package.xml file where I have added rclpy and sensor_msgs. In the setup.py I have added 'unity_messages = unity_messages.main:main' into the console_scripts. Finally after executing the code with ros2 run unity_messages unity_messages I get the error that URDriverSubscriber does not exist.</p> <p>Could anyone please tell me what I have done wrong? My end goal is to simulate the roboter in unity to then be able to remote control it over VR.</p> <p>I am working on Ubuntu 22.04, installed the real time kernel 5.15.107-rt62 and use ros2 humble.</p> <p>Thanks in advance for your help!</p> <hr /> <p><a href="https://answers.ros.org/question/416882/ros2-unity-subscribe-to-joint_states/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/152842/areyer/" rel="nofollow noreferrer">Areyer</a> on ROS Answers with karma: 26 on 2023-06-26</p> <p>Post score: 0</p>
ROS2 Unity subscribe to joint_states