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>I solved the following problem by reinstalling foxy Gazebo package <code>sudo apt install ros-foxy-gazebo-* </code></p>
103799
2023-08-30T08:28:47.343
|gazebo|ros2|roslaunch|ros-foxy|ubuntu-20.04|
<p>I am trying to run <code>ros2 launch gazebo_ros gazebo.launch.py</code> on ROS 2 Foxy. Unfortunately, I came across the following error:</p> <pre><code>[INFO] [launch]: All log files can be found below /home/mubashir/.ros/log/2023-08-30-13-25-29-406060-mubashir-7514 [INFO] [launch]: Default logging verbosity is set to INFO Task exception was never retrieved future: &lt;Task finished name='Task-2' coro=&lt;LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226&gt; exception=ImportError(&quot;cannot import name 'GazeboRosPaths' from 'scripts' (/home/mubashir/ros2_foxy_ws/install/pedsim_gazebo_plugin/lib/python3.8/site-packages/scripts/__init__.py)&quot;)&gt; Traceback (most recent call last): File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py&quot;, line 228, in _process_one_event await self.__process_event(next_event) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py&quot;, line 248, in __process_event visit_all_entities_and_collect_futures(entity, self.__context)) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 45, in visit_all_entities_and_collect_futures futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context) [Previous line repeated 1 more time] File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py&quot;, line 38, in visit_all_entities_and_collect_futures sub_entities = entity.visit(context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py&quot;, line 108, in visit return self.execute(context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/include_launch_description.py&quot;, line 130, in execute launch_description = self.__launch_description_source.get_launch_description(context) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_source.py&quot;, line 84, in get_launch_description self._get_launch_description(self.__expanded_location) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_description_source.py&quot;, line 51, in _get_launch_description return get_launch_description_from_python_launch_file(location) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py&quot;, line 62, in get_launch_description_from_python_launch_file launch_file_module = load_python_launch_file_as_module(python_launch_file_path) File &quot;/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py&quot;, line 37, in load_python_launch_file_as_module loader.exec_module(mod) File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 848, in exec_module File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed File &quot;/opt/ros/foxy/share/gazebo_ros/launch/gzserver.launch.py&quot;, line 28, in &lt;module&gt; from scripts import GazeboRosPaths ImportError: cannot import name 'GazeboRosPaths' from 'scripts' (/home/mubashir/ros2_foxy_ws/install/pedsim_gazebo_plugin/lib/python3.8/site-packages/scripts/__init__.py) </code></pre>
ImportError: cannot import name 'GazeboRosPaths' from 'scripts'
<p>First of all, diff_drive_controller does not parse URDF for the kinematic parameter: You have to define them correctly in the yaml file.</p> <p>/odom topic is purely coming from diff_drive_controller, so you could deactivate all of the localization for debugging your issue.</p> <p>You have configured it for open-loop odometry, i.e., you don't have position encoders or velocity sensors? If your wheels don't follow the desired speed, the odometry will be wrong obviously. In this case you could use robot_localization package to incorporate IMU measurements, see <a href="https://navigation.ros.org/setup_guides/odom/setup_odom.html" rel="nofollow noreferrer">nav2 tutorials</a>.</p>
103800
2023-08-30T08:33:54.030
|transform|control|ros-control|ros-humble|tf2-ros|
<p>i have a differential drive mobile robot and i want to add him the navigation and the localization satck.</p> <p>Currently it's controlled by a teleop. But when i look the transform between odom and base_link with this command :</p> <pre><code>ros2 run tf2_ros tf2_echo odom diffbot_base_link </code></pre> <p>the rotation in degree and the translation increase faster than the real robot is moving ans rotating.</p> <p>I check if my controller description is same as my urdf and it's look like same for me.</p> <p>I also try to remove arguments : <em>wheel_separation: 0.430 and wheel_radius: 0.095</em> to let the controller searching for them in the urdf file. But, when i do it, the robot can't move exept backward.</p> <p>I check if one wheel turn on rviz match with one wheel turn in the real robot and that ok.</p> <p>So is suspect that the problem could be in urdf file or the config of the controller but i can't determine where. But, i don't really now where i can't search to find the problem.</p> <p>Tell me if you need more information or if it's isn't clear. Hope you can help me ! Thx per advance.</p> <p><strong>There is my launch file for the controller:</strong></p> <pre><code>def generate_launch_description(): ld = LaunchDescription() remappings = [('/tf', 'tf'),('/tf_static', 'tf_static')] robot_description_path = os.path.join( get_package_share_directory('ros2_control_demo_example_2'), 'urdf', 'diffbot.urdf.xacro') robot_description_config = xacro.process_file(robot_description_path) robot_description = {'robot_description': robot_description_config.toxml()} config_controller = os.path.join( get_package_share_directory('ros2_control_demo_example_2'), 'controllers', 'base_mobile_controller.yaml') remote_modbus_rtu = Node( package=&quot;remote_modbus_rtu&quot;, executable=&quot;remote_modbus_rtu_standalone&quot;, parameters=[ {&quot;modbus_is_remote&quot;: False}, {&quot;serial_is_remote&quot;: False}, {&quot;serial_dev_name&quot;: '/dev/ttyUSB0'}, {&quot;serial_baud_rate&quot;: 115200}, {&quot;serial_parity&quot;: True}, {&quot;serial_data&quot;: 8}, {&quot;serial_stop&quot;: 1}, {&quot;serial_flow_control&quot;: True}, {&quot;modbus_prefix&quot;: '/modbus/example_bus'} ] ) controller_manager = Node( package='controller_manager', executable='ros2_control_node', parameters=[robot_description, config_controller], remappings=[('/odom', 'odom')], output=&quot;both&quot;, ) sick_safetyscanners2 = Node( package=&quot;sick_safetyscanners2&quot;, executable=&quot;sick_safetyscanners2_node&quot;, name=&quot;sick_safetyscanners2_node&quot;, output=&quot;screen&quot;, emulate_tty=True, parameters=[ {&quot;frame_id&quot;: &quot;scan&quot;, &quot;sensor_ip&quot;: &quot;10.10.10.1&quot;, &quot;host_ip&quot;: &quot;10.10.10.10&quot;, &quot;interface_ip&quot;: &quot;0.0.0.0&quot;, &quot;host_udp_port&quot;: 6060, &quot;channel&quot;: 0, &quot;channel_enabled&quot;: True, &quot;skip&quot;: 1, &quot;angle_start&quot;: 0.0, &quot;angle_end&quot;: 0.0, &quot;time_offset&quot;: 0.0, &quot;general_system_state&quot;: True, &quot;derived_settings&quot;: True, &quot;measurement_data&quot;: True, &quot;intrusion_data&quot;: True, &quot;application_io_data&quot;: True, &quot;use_persistent_config&quot;: False, &quot;min_intensities&quot;: 0.0 } ] ) robot_description_content = Command( [ PathJoinSubstitution([FindExecutable(name=&quot;xacro&quot;)]), &quot; &quot;, PathJoinSubstitution( [FindPackageShare(&quot;ros2_control_demo_example_2&quot;), &quot;urdf&quot;, &quot;diffbot.urdf.xacro&quot;] ), ] ) robot_description = {&quot;robot_description&quot;: robot_description_content} robot_state_pub_node = Node( package=&quot;robot_state_publisher&quot;, executable=&quot;robot_state_publisher&quot;, output=&quot;both&quot;, parameters=[robot_description], # remappings=[ # (&quot;/diff_controller/cmd_vel_unstamped&quot;, &quot;/cmd_vel&quot;), # ], ) diff_drive_spawner = Node( package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[&quot;diff_controller&quot;, &quot;--controller-manager&quot;, &quot;/controller_manager&quot;], ) joint_state_broadcaster_spawner = Node( package=&quot;controller_manager&quot;, executable=&quot;spawner&quot;, arguments=[&quot;joint_state_broadcaster&quot;, &quot;--controller-manager&quot;, &quot;/controller_manager&quot;], ) delay_diff_drive_controller_spawner_after_joint_state_broadcaster_spawner = \ RegisterEventHandler( event_handler=OnProcessExit( target_action=joint_state_broadcaster_spawner, on_exit=[diff_drive_spawner], ) ) </code></pre> <p><strong>There is my launch file for the localization :</strong></p> <pre><code>def generate_launch_description(): ld = LaunchDescription() namespace = LaunchConfiguration('namespace') use_sim_time = LaunchConfiguration('use_sim_time') autostart = LaunchConfiguration('autostart') params_file = LaunchConfiguration('params_file') use_composition = LaunchConfiguration('use_composition') container_name = LaunchConfiguration('container_name') container_name_full = (namespace, '/', container_name) use_respawn = LaunchConfiguration('use_respawn') log_level = LaunchConfiguration('log_level') lifecycle_nodes = ['map_server', 'amcl'] remappings = [('/tf', 'tf'),('/tf_static', 'tf_static')] configured_params = RewrittenYaml( source_file=params_file, root_key=namespace, param_rewrites={}, convert_types=True) stdout_linebuf_envvar = SetEnvironmentVariable( 'RCUTILS_LOGGING_BUFFERED_STREAM', '1') declare_namespace_cmd = DeclareLaunchArgument( 'namespace', default_value='', description='Top-level namespace') declare_map_yaml_cmd = DeclareLaunchArgument( 'map', default_value='', description='Full path to map yaml file to load') declare_use_sim_time_cmd = DeclareLaunchArgument( 'use_sim_time', default_value='false', description='Use simulation (Gazebo) clock if true') declare_params_file_cmd = DeclareLaunchArgument( 'params_file', default_value=os.path.join( get_package_share_directory('ros2_control_demo_example_2'), 'config', 'nav2_params.yaml'), description='Full path to the ROS2 parameters file to use for all launched nodes') declare_autostart_cmd = DeclareLaunchArgument( 'autostart', default_value='true', description='Automatically startup the nav2 stack') declare_use_composition_cmd = DeclareLaunchArgument( 'use_composition', default_value='False', description='Use composed bringup if True') declare_container_name_cmd = DeclareLaunchArgument( 'container_name', default_value='nav2_container', description='the name of conatiner that nodes will load in if use composition') declare_use_respawn_cmd = DeclareLaunchArgument( 'use_respawn', default_value='False', description='Whether to respawn if a node crashes. Applied when composition is disabled.') declare_log_level_cmd = DeclareLaunchArgument( 'log_level', default_value='info', description='log level') load_nodes = GroupAction( condition=IfCondition(PythonExpression(['not ', use_composition])), actions=[ SetParameter('use_sim_time', False), Node( package='nav2_map_server', executable='map_server', name='map_server', output='screen', respawn=use_respawn, respawn_delay=2.0, parameters=[configured_params, {'yaml_filename': 'cei1.yaml', &quot;topic_name&quot;: &quot;map&quot;, &quot;frame_id&quot;: &quot;map&quot;}], arguments=['--ros-args', '--log-level', log_level], remappings=remappings), Node( package='nav2_amcl', executable='amcl', name='amcl', output='screen', respawn=use_respawn, respawn_delay=2.0, parameters=[configured_params], arguments=['--ros-args', '--log-level', log_level], remappings=remappings), Node( package='nav2_lifecycle_manager', executable='lifecycle_manager', name='lifecycle_manager_localization', output='screen', arguments=['--ros-args', '--log-level', log_level], parameters=[{'autostart': autostart}, {'node_names': lifecycle_nodes}]) ] ) # LoadComposableNode for map server twice depending if we should use the # value of map from a CLI or launch default or user defined value in the # yaml configuration file. They are separated since the conditions # currently only work on the LoadComposableNodes commands and not on the # ComposableNode node function itself load_composable_nodes = GroupAction( condition=IfCondition(use_composition), actions=[ SetParameter('use_sim_time', False), LoadComposableNodes( target_container=container_name_full, composable_node_descriptions=[ ComposableNode( package='nav2_map_server', plugin='nav2_map_server::MapServer', name='map_server', parameters=[configured_params, {'yaml_filename': 'cei1.yaml', &quot;topic_name&quot;: &quot;map&quot;, &quot;frame_id&quot;: &quot;map&quot;}], remappings=remappings), ], ), LoadComposableNodes( target_container=container_name_full, composable_node_descriptions=[ ComposableNode( package='nav2_amcl', plugin='nav2_amcl::AmclNode', name='amcl', parameters=[configured_params], remappings=remappings), ComposableNode( package='nav2_lifecycle_manager', plugin='nav2_lifecycle_manager::LifecycleManager', name='lifecycle_manager_localization', parameters=[{'autostart': autostart, 'node_names': lifecycle_nodes}]), ], ) ] ) </code></pre> <p><strong>There is the config for the controller</strong></p> <pre><code>controller_manager: ros__parameters: update_rate: 50 # Hz diff_controller: type: diff_drive_controller/DiffDriveController joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster diff_controller: ros__parameters: type: diff_drive_controller/DiffDriveController pose_covariance_diagonal : [0.001, 0.001, 0.001, 0.001, 0.001, 0.01] twist_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.01] publish_rate: 50.0 odom_frame_id: odom base_frame_id: diffbot_base_link left_wheel_names: ['diffbot_left_wheel_joint'] right_wheel_names: ['diffbot_right_wheel_joint'] wheels_per_side: 1 wheel_separation: 0.430 wheel_radius: 0.095 cmd_vel_timeout: 0.5 use_stamped_vel: false open_loop: true enable_odom_tf: true publish_wheel_data: true wheel_separation_multiplier: 1.0 wheel_radius_multiplier: 1.0 linear.x.has_velocity_limits: false linear.x.has_acceleration_limits: false linear.x.has_jerk_limits: false linear.x.max_velocity: 1.6 linear.x.min_velocity: -0.6 linear.x.max_acceleration: 1.6 linear.x.min_acceleration: -0.6 linear.x.max_jerk: 0.0 linear.x.min_jerk: 0.0 angular.z.has_velocity_limits: false angular.z.has_acceleration_limits: false angular.z.has_jerk_limits: false angular.z.max_velocity: 1.6 angular.z.min_velocity: -0.6 angular.z.max_acceleration: 1.6 angular.z.min_acceleration: -0.6 angular.z.max_jerk: 0.0 angular.z.min_jerk: 0.0 </code></pre> <p><strong>There is the rqt_grap</strong> :</p> <p><a href="https://i.stack.imgur.com/WsQIR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WsQIR.jpg" alt="enter image description here" /></a></p>
Transform between odom and base_link is faster than in real life [Solved]
<p>Matching your set of four questions:</p> <ul> <li>Yes, default_robot_padding is probably the best (only?) MoveIt2 parameter to currently deal with poor control tolerances.</li> <li>I believe you can add this to the joint_limits.yaml that was generated for your robot via the moveit_setup_assistant (see below for more details on why this is the correct file).</li> <li>Technically, you could encode similar information in the URDF - but it would likely be challenging to get correct - you'd have to adjust the scale (and possibly also the origin) of each collision mesh/geometry in your URDF. Note that scaling the meshes up is likely not exactly the same as applying padding around them.</li> <li>MoveIt2 wouldn't be able inflate the collision mesh/geometry on a per-joint value (the URDF approach would be capable) - but I want to specifically clarify here: this is really a parameter of the collision mesh/geometry, not the joint itself. What you are doing is inflating the size of the mesh/geometry - that is quite a bit different than modeling the actual ambiguity of where the robot geometry is based on the control error - I am not aware of any available collision checker which supports such.</li> </ul> <p>With regards to where to put the parameters, unfortunately, the launch files generated in MoveIt2 are a bit convoluted - my rational here is that the full parameter name is &quot;<a href="https://github.com/ros-planning/moveit2/blob/47d92ef973680aea1badd6cc6080598f040a89f4/moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp#L1616" rel="nofollow noreferrer">robot_description_planning.default_robot_padding</a>&quot;. joint_limits.yaml includes the &quot;default_velocity_scaling_factor&quot; parameter <a href="https://github.com/ros-planning/moveit2/blob/47d92ef973680aea1badd6cc6080598f040a89f4/moveit_ros/planning_interface/move_group_interface/src/move_group_interface.cpp#L153" rel="nofollow noreferrer">which is also in the robot_description_planning namespace</a> - therefore, the entire contents of the joint_limits.yaml should be loaded into the proper namespace.</p>
103825
2023-08-31T10:38:07.640
|ros2|moveit|path-planning|collision|
<p>I am trying to find a way to add padding to the robot to avoid unwanted collisions caused by low control precision. Optimally I could either set a uniform padding of e.g. 5 cm or - even better - specific padding values for each link of the robot.</p> <p>During my research I found <a href="https://robotics.stackexchange.com/a/80802">this old post</a> valid for ROS/MoveIt that proposes to set a parameter <code>default_robot_padding: 0.05</code>. Here is the old post:</p> <p>Unfortunately I can't get this working with ROS2/MoveIt2. So here are my questions:</p> <ul> <li>Is it the right approach at all to set a padding parameter to avoid unwanted collisions due to low precision?</li> <li>How and where can I set a padding parameter?</li> <li>Would it be possible to add parameters close to the robot definition, e.g. directly in the URDF?</li> <li>Could it be set vor individual joints differently?</li> </ul> <p>My setup is:</p> <ul> <li>ROS2 Iron</li> <li>MoveIt2 (Main branch, there is no iron currently)</li> <li>Ubuntu 22.04</li> </ul> <p>Any help or direction in which I can have a look would be very much appreciated.</p>
How to add padding to a robot using ROS2/MoveIt2?
<p>joint_state should be a sensor_msgs/JointState msg not a list. If you search for &quot;header&quot; in the error msg you can see that it is trying to serialize the header in the joint state msg which doesn't exist because you passed a list. <code>_x.goal.request.start_state.joint_state.header.stamp.secs</code></p>
103832
2023-08-31T13:49:52.557
|ros|moveit|
<p>I'm trying to create a client to send a goal to the move_group server via Python.</p> <p>Here is my code snippet:</p> <pre><code>client = actionlib.SimpleActionClient('move_group', moveit_msgs.msg.MoveGroupAction) client.wait_for_server() MoveGroupGoal = moveit_msgs.msg.MoveGroupGoal() start_state_ = moveit_msgs.msg.RobotState() start_state_.joint_state = [0, 1.2, 0, 0.2, 0, -0.8, 0] MoveGroupGoal.request.start_state = start_state_ posestamped = geometry_msgs.msg.PoseStamped() posestamped.header.frame_id = &quot;base_link&quot; posestamped.pose.orientation.w = 0.025 posestamped.pose.orientation.x = 0.0 posestamped.pose.orientation.y = 1.0 posestamped.pose.orientation.z = 0.0 posestamped.pose.position.x = 0.3 posestamped.pose.position.y = 0.0 posestamped.pose.position.z = 0.8 tolerance_position = 0.1 tolerance_orientation = 0.1 constraint_goal = moveit.core.kinematic_constraints.constructGoalConstraints( &quot;tool0&quot;, posestamped, tolerance_position, tolerance_orientation) MoveGroupGoal.request.goal_constraints = constraint_goal client.send_goal(MoveGroupGoal) client.wait_for_result() return client.get_result() </code></pre> <p>Before running the above code, the <code>demo.launch</code> in the <code>MoveIt</code> package has been launched.</p> <p>However, when the program executed to line <code>client.send_goal(MoveGroupGoal)</code>, I met the following error</p> <pre><code> File &quot;/opt/ros/noetic/lib/python3/dist-packages/actionlib/simple_action_client.py&quot;, line 92, in send_goal self.gh = self.action_client.send_goal(goal, self._handle_transition, self._handle_feedback) File &quot;/opt/ros/noetic/lib/python3/dist-packages/actionlib/action_client.py&quot;, line 561, in send_goal return self.manager.init_goal(goal, transition_cb, feedback_cb) File &quot;/opt/ros/noetic/lib/python3/dist-packages/actionlib/action_client.py&quot;, line 466, in init_goal self.send_goal_fn(action_goal) File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py&quot;, line 882, in publish self.impl.publish(data) File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py&quot;, line 1066, in publish serialize_message(b, self.seq, message) File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/msg.py&quot;, line 152, in serialize_message msg.serialize(b) File &quot;/home/xzc/mambaforge/envs/robostackenv/lib/python3.9/site-packages/moveit_msgs/msg/_MoveGroupActionGoal.py&quot;, line 917, in serialize buff.write(_get_struct_6d3I().pack(_x.goal.request.workspace_parameters.min_corner.x, _x.goal.request.workspace_parameters.min_corner.y, _x.goal.request.workspace_parameters.min_corner.z, _x.goal.request.workspace_parameters.max_corner.x, _x.goal.request.workspace_parameters.max_corner.y, _x.goal.request.workspace_parameters.max_corner.z, _x.goal.request.start_state.joint_state.header.seq, _x.goal.request.start_state.joint_state.header.stamp.secs, _x.goal.request.start_state.joint_state.header.stamp.nsecs)) AttributeError: 'list' object has no attribute 'header' </code></pre> <p>Did I miss the definitions of some messages?</p> <p>Thanks in advance!</p>
AttributeError: 'list' object has no attribute 'header'
<p>I was <a href="https://community.gazebosim.org/t/list-of-community-repositories-for-gazebo-sim/2237/2" rel="nofollow noreferrer">pointed to</a> the <a href="https://github.com/osrf/subt/tree/master/subt-communication/subt_communication_broker" rel="nofollow noreferrer">SubT Competition repository</a>, which comes close but uses <code>catkin</code>.</p> <p>But based on that I managed to get to a working solution.</p> <p>I made a <strong>fully documented example repository</strong>, which can be found on GitHub <a href="https://github.com/jrutgeer/gazebo_assorted_tests/tree/main/custom_protobuf_msgs" rel="nofollow noreferrer"><strong>here</strong></a>.</p>
103833
2023-08-31T14:15:13.267
|gazebo|cmake|
<p>I would like to define custom Protobuf messages for Gazebo Sim in a separate 'interfaces' repository (i.e. not in the <code>gz-msgs</code> source tree), and use them in another 'application' repository.</p> <p>Can someone point me to example <code>CMakeList.txt</code> files for this?</p> <p>The custom messages need to import existing messages (e.g. from <code>gz-msgs</code> or another messages repository).</p> <p>(This question was edited and stripped from the info that is no longer relevant given the answer below.)</p>
Custom Protobuf messages for Gazebo Sim, in separate package
<p>It looks like your URDF is not correctly formatted. If it is a small file, you can go through it physically, or if you are using XACRO to compose your final URDF instead, you can do a test-run to know where the problem is: <code>xacro &lt;your-robot-description-package&gt;/xacro/&lt;filename&gt;.xacro</code></p> <p>What would be nice is if you can also update the question with your URDF file, and the logs of what goes on when you start the program.</p>
103846
2023-09-01T07:52:40.533
|gazebo|gazebo-plugin|errors|spawn-model|
<pre><code>started roslaunch server http://imperator:44931/ SUMMARY ======== PARAMETERS * /gazebo/enable_ros_network: True * /rosdistro: noetic * /rosversion: 1.16.0 * /use_sim_time: True NODES / fake_joint_calibration (rostopic/rostopic) gazebo (gazebo_ros/gzserver) gazebo_gui (gazebo_ros/gzclient) spawn_model (gazebo_ros/spawn_model) tf_footprint_base (tf/static_transform_publisher) auto-starting new master process[master]: started with pid [4910] ROS_MASTER_URI=http://localhost:11311 setting /run_id to 748f8e6e-48c6-11ee-b487-89ca708d657b process[rosout-1]: started with pid [4920] started core service [/rosout] process[gazebo-2]: started with pid [4923] process[gazebo_gui-3]: started with pid [4927] process[tf_footprint_base-4]: started with pid [4933] process[spawn_model-5]: started with pid [4934] process[fake_joint_calibration-6]: started with pid [4938] [INFO] [1693572769.965658, 0.000000]: Loading model XML from file /home/tongthai/simmu_test_ws/src/roboto1/urdf/roboto1.urdf [ERROR] [1693572769.966635, 0.000000]: Invalid XML: mismatched tag: line 15, column 4 [ INFO] [1693572770.315223737]: Finished loading Gazebo ROS API Plugin. [ INFO] [1693572770.316298680]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting... [ INFO] [1693572770.431659788]: Finished loading Gazebo ROS API Plugin. [ INFO] [1693572770.432430709]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting... [spawn_model-5] process has died [pid 4934, exit code 1, cmd /opt/ros/noetic/lib/gazebo_ros/spawn_model -file /home/tongthai/simmu_test_ws/src/roboto1/urdf/roboto1.urdf -urdf -model roboto1 __name:=spawn_model __log:=/home/tongthai/.ros/log/748f8e6e-48c6-11ee-b487-89ca708d657b/spawn_model-5.log]. log file: /home/tongthai/.ros/log/748f8e6e-48c6-11ee-b487-89ca708d657b/spawn_model-5*.log [ INFO] [1693572770.707983962]: waitForService: Service [/gazebo/set_physics_properties] is now available. [ INFO] [1693572770.729437439, 0.006000000]: Physics dynamic reconfigure ready. </code></pre> <hr /> <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com) Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578 For more information, please see http://wiki.ros.org/sw_urdf_exporter --&gt; &lt;robot name=&quot;roboto1&quot;&gt; &lt;link name =&quot;base_footprint&quot;/&gt; &lt;visual&gt; &lt;origin rpy=&quot;0 0 0&quot; xyz = &quot;0 0 0&quot;/&gt; &lt;geometry&gt; &lt;box size=&quot;0.001 0.001 0.001&quot;/&gt; &lt;/geometry&gt; &lt;/visual&gt; &lt;/link&gt; &lt;gazebo reference=&quot;base_footprint&quot;&gt; &lt;turnGravityOff&gt;false&lt;/turnGravityOff&gt; &lt;/gazebo&gt; &lt;joint name=&quot;base_footprint_joint&quot; type=&quot;fixed&quot;&gt; &lt;origin rpy=&quot;3.14 3.14 0&quot; xyz= &quot;0 0 0.01&quot;/&gt; &lt;parent link=&quot;base_footprint&quot;/&gt; &lt;child link=&quot;base_link&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;base_link&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.00835889577270117 0.0464174696676208 0.0415665008980647&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;4.78492035526277&quot; /&gt; &lt;inertia ixx=&quot;0.0164976933926148&quot; ixy=&quot;4.94520401850225E-20&quot; ixz=&quot;-1.24305191507615E-18&quot; iyy=&quot;0.0516216957643921&quot; iyz=&quot;-1.41736846507219E-19&quot; izz=&quot;0.0364032483895405&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://roboto1/meshes/base_link.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;1 1 1 1&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://roboto1/meshes/base_link.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;gazebo reference=&quot;base_link&quot;&gt; &lt;material&gt;Gazebo/Blue/&lt;/material&gt; &lt;/gazebo&gt; &lt;link name=&quot;Left_front_wheel&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0 -0.00545945945945946 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.0498455771833579&quot; /&gt; &lt;inertia ixx=&quot;1.50954939562691E-05&quot; ixy=&quot;4.24025859714313E-22&quot; ixz=&quot;3.77811760315945E-21&quot; iyy=&quot;2.90148410428803E-05&quot; iyz=&quot;1.58030475154248E-22&quot; izz=&quot;1.50954939562691E-05&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://roboto1/meshes/Left_front_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.298039215686275 0.298039215686275 0.298039215686275 1&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://roboto1/meshes/Left_front_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;Left_front_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.12 0.111 -0.02&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;Left_front_wheel&quot; /&gt; &lt;axis xyz=&quot;0 1 0&quot; /&gt; &lt;limit effort=&quot;1&quot; velocity=&quot;1&quot; /&gt; &lt;/joint&gt; &lt;gazebo reference=&quot;Left_front_wheel&quot;&gt; &lt;material&gt;Gazebo/Black/&lt;/material&gt; &lt;/gazebo&gt; &lt;link name=&quot;Right_Front_wheel&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0 0.00545945945945944 6.93889390390723E-18&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.0498455771833578&quot; /&gt; &lt;inertia ixx=&quot;1.50954939562691E-05&quot; ixy=&quot;6.51878753893785E-22&quot; ixz=&quot;2.97239867136387E-21&quot; iyy=&quot;2.90148410428803E-05&quot; iyz=&quot;1.63428094845551E-22&quot; izz=&quot;1.50954939562691E-05&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://roboto1/meshes/Right_Front_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.298039215686275 0.298039215686275 0.298039215686275 1&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://roboto1/meshes/Right_Front_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;Right_front_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.12 -0.111 -0.02&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;Right_Front_wheel&quot; /&gt; &lt;axis xyz=&quot;0 1 0&quot; /&gt; &lt;limit effort=&quot;1&quot; velocity=&quot;1&quot; /&gt; &lt;/joint&gt; &lt;gazebo reference=&quot;Right_front_wheel&quot;&gt; &lt;material&gt;Gazebo/Black/&lt;/material&gt; &lt;/gazebo&gt; &lt;link name=&quot;Left_back_wheel&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0 -0.00545945945945946 6.93889390390723E-18&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.0498455771833579&quot; /&gt; &lt;inertia ixx=&quot;1.50954939562691E-05&quot; ixy=&quot;1.58480178324137E-22&quot; ixz=&quot;-1.24917598375175E-21&quot; iyy=&quot;2.90148410428803E-05&quot; iyz=&quot;-3.25772371894751E-22&quot; izz=&quot;1.50954939562691E-05&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://roboto1/meshes/Left_back_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.298039215686275 0.298039215686275 0.298039215686275 1&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://roboto1/meshes/Left_back_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;Left_back_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-0.13 0.111 -0.02&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;Left_back_wheel&quot; /&gt; &lt;axis xyz=&quot;0 -1 0&quot; /&gt; &lt;limit effort=&quot;1&quot; velocity=&quot;1&quot; /&gt; &lt;/joint&gt; &lt;link name=&quot;right_back_wheel&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-1.38777878078145E-17 0.00545945945945944 6.93889390390723E-18&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.0498455771833578&quot; /&gt; &lt;inertia ixx=&quot;1.50954939562691E-05&quot; ixy=&quot;3.33374489672229E-22&quot; ixz=&quot;2.74709347018384E-21&quot; iyy=&quot;2.90148410428802E-05&quot; iyz=&quot;1.54533657342654E-22&quot; izz=&quot;1.5095493956269E-05&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://roboto1/meshes/right_back_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.298039215686275 0.298039215686275 0.298039215686275 1&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://roboto1/meshes/right_back_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;Right_back_wheel&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-0.13 -0.111 -0.02&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;right_back_wheel&quot; /&gt; &lt;axis xyz=&quot;0 -1 0&quot; /&gt; &lt;limit effort=&quot;1&quot; velocity=&quot;1&quot; /&gt; &lt;/joint&gt; &lt;gazebo&gt; &lt;plugin name=&quot;differential_drive_controller&quot; filename=&quot;libgazebo_ros_diff_drive.so&quot;&gt; &lt;!-- Plugin update rate in Hz --&gt; &lt;updateRate&gt;${update_rate}&lt;/updateRate&gt; &lt;!-- Name of left joint, defaults to `left_joint` --&gt; &lt;leftJoint&gt;Left_front_joint&lt;/leftJoint&gt; &lt;!-- Name of right joint, defaults to `right_joint` --&gt; &lt;rightJoint&gt;Right_front_joint&lt;/rightJoint&gt; &lt;!-- The distance from the center of one wheel to the other, in meters, defaults to 0.34 m --&gt; &lt;wheelSeparation&gt;0.222&lt;/wheelSeparation&gt; &lt;!-- Diameter of the wheels, in meters, defaults to 0.15 m --&gt; &lt;wheelDiameter&gt;0.07&lt;/wheelDiameter&gt; &lt;!-- Wheel acceleration, in rad/s^2, defaults to 0.0 rad/s^2 --&gt; &lt;wheelAcceleration&gt;1.0&lt;/wheelAcceleration&gt; &lt;!-- Maximum torque which the wheels can produce, in Nm, defaults to 5 Nm --&gt; &lt;wheelTorque&gt;20&lt;/wheelTorque&gt; &lt;!-- Topic to receive geometry_msgs/Twist message commands, defaults to `cmd_vel` --&gt; &lt;commandTopic&gt;cmd_vel&lt;/commandTopic&gt; &lt;!-- Topic to publish nav_msgs/Odometry messages, defaults to `odom` --&gt; &lt;odometryTopic&gt;odom&lt;/odometryTopic&gt; &lt;!-- Odometry frame, defaults to `odom` --&gt; &lt;odometryFrame&gt;odom&lt;/odometryFrame&gt; &lt;!-- Robot frame to calculate odometry from, defaults to `base_footprint` --&gt; &lt;robotBaseFrame&gt;base_footprint&lt;/robotBaseFrame&gt; &lt;!-- Odometry source, 0 for ENCODER, 1 for WORLD, defaults to WORLD --&gt; &lt;odometrySource&gt;1&lt;/odometrySource&gt; &lt;!-- Set to true to publish transforms for the wheel links, defaults to false --&gt; &lt;publishWheelTF&gt;true&lt;/publishWheelTF&gt; &lt;!-- Set to true to publish transforms for the odometry, defaults to true --&gt; &lt;publishOdom&gt;true&lt;/publishOdom&gt; &lt;!-- Set to true to publish sensor_msgs/JointState on /joint_states for the wheel joints, defaults to false --&gt; &lt;publishWheelJointState&gt;true&lt;/publishWheelJointState&gt; &lt;!-- Set to true to swap right and left wheels, defaults to true --&gt; &lt;legacyMode&gt;false&lt;/legacyMode&gt; &lt;/plugin&gt; &lt;/gazebo&gt; &lt;/robot&gt; </code></pre> <hr /> <p>Here's an errors I got during spawn the model on gazebo. I imported the model as URDF from Solidworks. as the beginning without adjustment model can be launched without any problems. After I've adjusted for plugin. However these errors are existed. I wonder how can I fix this. If more informations are needed I will gladly to provide more infos...... Edited: New terminal log and urdf code have been updated. Really appreciate for helps.</p>
{spawn_model-5} process has died
<p>This seems more like a robot motor controller gain tuning issue than a cmd_vel one, look in the control loop on your microcontroller/motor controller.</p> <p>At least on the standard <code>Twist</code> messages sent alongside <code>cmd_vel</code>, there aren't any fields for acceleration.</p>
103857
2023-09-01T16:26:42.317
|ros-humble|
<p>I am using the Carter robot and want to manipulate it back and forth using cmd_vel topic.</p> <p>While testing with multiple commands, when I publish the joint twist message such as x: 0.5 and then x: -0.5, the robot rattles and then goes backward.</p> <p>I want to add some deceleration functions and want to know where I can find some hints to implement them.</p> <p>Thanks!</p>
Abrupt cmd_vel change from + to - causes rattle in robot
<p>Looks like I managed to solve the issue with @Bi0T1N help. To anyone interested in my setup:</p> <ol> <li>I have .sdf file with my world (walls and robot)</li> <li>I'm running Gazebo simulation</li> <li>Gazebo publishes some topics (there is /tf topic but it is just tf of robot in the world), I'm using joint_state, lidar, IMU, cmd_vel</li> <li>To get more TF I'm running robot_state_publisher</li> <li>robot_state_publisher needs .urdf, using parsers is not worth it in my case, so I'm repeating .sdf robot in .urdf with some changes</li> <li>Gazebo lidar publishes static frame, that I'm using in RViz2, I have to TF frrm that frame to chassis and then to wheels etc.</li> <li>At the end I have got 2 robot description files, full TF tree, working Gazebo and RViz (TF, RobotModel, LidarFrame) without any errors.</li> </ol> <p><a href="https://github.com/KlaudiuszSoltysik/ros-roomba" rel="nofollow noreferrer">https://github.com/KlaudiuszSoltysik/ros-roomba</a></p>
103861
2023-09-01T19:05:57.587
|ros|gazebo|gazebo-ignition|
<p>I have a robot in .sdf, that I'm simulating in Gazebo Ignition. For further development I need TF of that robot. How can I get it?<br /> I found information, that TF is published to /world/&lt;world_name&gt;/model/&lt;model_name&gt;/state (<a href="https://gazebosim.org/api/gazebo/4.5/classignition_1_1gazebo_1_1systems_1_1JointStatePublisher.html" rel="nofollow noreferrer">source</a>), in my case /world/roomba_world/state, with message of type<br /> <a href="https://i.stack.imgur.com/StjDC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/StjDC.png" alt="enter image description here" /></a> How can i bridge it to ROS Humble? What is ROS substitute of SerializedStepMap?</p> <pre><code>ros2 run ros_gz_bridge parameter_bridge /world/roomba_world/state@???[ignition.msgs.SerializedStepMap </code></pre> <p>My second question: I found other tutorials using ros_gazebo_pkgs, but current documentation of Gazebo for ROS users tells to install <a href="https://gazebosim.org/docs/fortress/ros_installation" rel="nofollow noreferrer">Ignition</a>, what is current way to do simulations? URDF of robot in ROS + ros_gazebo_pkgs? Currently I have SDF for Ignition/Gazebo and simplified URDF for RViz2, it is convinient, because I can simulate lidar without <code>&lt;gazebo&gt;&lt;/gazebo&gt;</code> tags etc, but on the other hand it is not that easy to get TF.</p>
Gazebo Ignition how to bridge SerializedStepMap
<p>First, you don't seem to correctly define pose, homogeneous transformation matrices etc.</p> <p>A 'pose' is defined by a position and an orientation. Position is typically represented by [x,y,z]' coordinates and rotation is typically represented by:</p> <ul> <li>3 values (e.g. some Euler angles representation or Roll-Pitch-Yaw), or</li> <li>4 values (e.g. a quaternion), or</li> <li>9 values (3x3 rotation matrix).</li> </ul> <p>There are pros and cons to each representation but this is out of the scope of this question.</p> <p>A homogeneous transform matrix is a 4x4 matrix of the form <code>[R, p; 0, 0, 0, 1]</code> with <code>R</code> a 3x3 rotation matrix and <code>p</code> a 3x1 position vector.</p> <p>Then to answer your question:</p> <p>KDL provides <code>diff()</code> functions for this purpose, see <a href="https://github.com/orocos/orocos_kinematics_dynamics/blob/b35de34ab6ca9cb9a776531f519d95d973f83d7f/orocos_kdl/src/frames.hpp#L1179-L1187" rel="nofollow noreferrer">here in the code</a>.</p> <p>Mind you, you will also need to have a good understanding of the concept of a twist (6x1 vector holding translational and rotational velocities), and of the reference point and reference frame of a twist.</p>
103863
2023-09-01T23:52:44.750
|ros|kinematics|inverse-kinematics|frame|kdl|
<p>I am implementing inverse kinematics on a robot, and I am confused about how to calculate error from my desired pose to my current estimated pose. Both are orocos-kdl frames that consist of a 3x3 position matrix, 3x1 rotation matrix, and a 1x4 homogeneous transform matrix at the bottom.I simply don't know what the procedure is to calculate the error between those two frames. Is it simply to multiply it by its own inverse? Subtraction of KDL frames isn't something that c++ allows me to do.</p> <p>This error needs to be in a form that I can multiply by the psedoinverse jacobian to get a 6x1 matrix of changes to make to my working joint angle value.</p>
How to calculate error for inverse kinematics?
<p>The noise characteristics can be configured through the <a href="http://sdformat.org/spec?ver=1.10&amp;elem=sensor#sensor_imu" rel="nofollow noreferrer">SDF</a>. Currently the following characteristics are supported:</p> <ul> <li>&quot;none&quot; (no noise)</li> <li>&quot;gaussian&quot; (draw noise values independently for each measurement from a Gaussian distribution)</li> <li>&quot;gaussian_quantized&quot; (&quot;gaussian&quot; plus quantization of outputs (ie. rounding)</li> </ul> <p>It can be configured for the <code>x</code>, <code>y</code> and <code>z</code> coordinates for the <a href="http://sdformat.org/spec?ver=1.10&amp;elem=sensor#imu_angular_velocity" rel="nofollow noreferrer"><code>angular velocity</code></a> and <a href="http://sdformat.org/spec?ver=1.10&amp;elem=sensor#imu_linear_acceleration" rel="nofollow noreferrer"><code>linear acceleration</code></a>.</p>
103877
2023-09-02T21:28:42.947
|gazebo|imu|
<p>I am compiling Gazebo from source on my Ubuntu 22.04 Mac M1 Parallels VM.</p> <p>I am wondering how I can change the noise characteristics (like standard deviation) of the default IMU sensor in Gazebo Garden.</p> <p>I noticed that there is already a class that handles these IMU sensor changes, but I am unsure of how to use it. <a href="https://gazebosim.org/api/gazebo/6.9/classignition_1_1gazebo_1_1Imu.html" rel="nofollow noreferrer">https://gazebosim.org/api/gazebo/6.9/classignition_1_1gazebo_1_1Imu.html</a></p> <p>Where would I insert this class? Would I treat like a plugin and put it into the SDF? I see it has something to do with the Component Inspector. Or would a different method be more convenient?</p> <p>Any help would be appreciated. Thanks!</p>
Gazebo Garden: change noise characteristics of IMU sensor
<p>They are in the Gazebo Sim github repository:</p> <ul> <li>System plugins can be found <a href="https://github.com/gazebosim/gz-sim/tree/gz-sim7/src/systems" rel="nofollow noreferrer">here</a>,</li> <li>Gui plugins are <a href="https://github.com/gazebosim/gz-sim/tree/gz-sim7/src/gui/plugins" rel="nofollow noreferrer">here</a>,</li> <li>Example worlds using these plugins are <a href="https://github.com/gazebosim/gz-sim/tree/gz-sim7/examples/worlds" rel="nofollow noreferrer">here</a>.</li> </ul> <p>Documentation of each plugin is written in the header files, e.g. <a href="https://github.com/gazebosim/gz-sim/blob/2dbcc6c872a204e44f4dd3e3be8c44a98b04452f/src/systems/diff_drive/DiffDrive.hh#L35-L131" rel="nofollow noreferrer">here</a>.</p> <p>The 'name' of a plugin is in the code, typically at the end. E.g. <a href="https://github.com/gazebosim/gz-sim/blob/2dbcc6c872a204e44f4dd3e3be8c44a98b04452f/src/systems/diff_drive/DiffDrive.cc#L682" rel="nofollow noreferrer">here</a>.</p> <p>The 'file name' is the name of the compiled shared library. E.g. <code>gz-sim-diff-drive-system</code> for <code>libgz-sim-diff-drive-system.so</code>.</p> <p>I was expecting to find the name for each system in the respective <code>CMakeLists.txt</code> file, e.g. <a href="https://github.com/gazebosim/gz-sim/blob/2dbcc6c872a204e44f4dd3e3be8c44a98b04452f/src/systems/diff_drive/CMakeLists.txt#L1" rel="nofollow noreferrer">here</a> but it does not fully correspond. Based on <a href="https://github.com/gazebosim/gz-sim/blob/2dbcc6c872a204e44f4dd3e3be8c44a98b04452f/src/systems/CMakeLists.txt#L77-L79" rel="nofollow noreferrer">this comment</a> I conclude that the <code>CMakeLists.txt</code> name always gets a prefix <code>gz-sim-</code> and a postfix <code>-system</code>.</p> <p>Gui plugins on the other hand do seem to get the name from the <code>CMakeLists.txt</code> file, without suffix or postfix.</p> <p>There is an <a href="https://github.com/gazebosim/gz-sim/issues/1995" rel="nofollow noreferrer">open issue</a> about a default repository for community-written plugins, but no concrete suggestions yet. So I currently just put my plugins in a github repository (for now only a <a href="https://community.gazebosim.org/t/waste-bin-system-plugin-for-gazebo-sim/2188" rel="nofollow noreferrer">'waste bin' plugin</a>).</p>
103881
2023-09-03T06:07:36.643
|gazebo|gazebo-plugin|plugin|gazebo-plugins|
<p>I have a basic question regarding gazebo plugins. The gazebo tutorial 'Moving the Robot' available at <a href="https://gazebosim.org/docs/harmonic/moving_robot" rel="nofollow noreferrer">Link</a> refers to the differential drive plugin coded as shown in the picture.</p> <p><a href="https://i.stack.imgur.com/xlKvK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xlKvK.png" alt="enter image description here" /></a></p> <p>Where can I find more information about these plugins, more specifically:</p> <p>a) Where can I find the list of all plugins?</p> <p>b) For a given plugin, where can I find the details of the plugin such as filename to use (e.g: filename=&quot;gz-sim-diff-drive-system&quot;), name of the plugin (e.g: name=&quot;gz::sim::systems::DiffDrive&quot;&gt;) and the other parameters of the plugin (left_joint, right_joint,wheel_separation etc.)</p> <p>TIA</p>
Gazebo plugin location and documentation
<p>I don't see any obvious error in your configuration. I'd suggest to deactivate your controllers to reduce the console output first. Are there any hints from gazebo_ros2_control in the console output after startup? We'd expect something like this</p> <pre><code>[gzserver-1] [INFO] [1693925869.902853130] [gazebo_ros2_control]: Loading parameter files /workspaces/ros2_rolling_ws/install/ros2_control_demo_example_9/share/ros2_control_demo_example_9/config/rrbot_controllers.yaml [gzserver-1] [INFO] [1693925869.905758939] [gazebo_ros2_control]: connected to service!! robot_state_publisher [gzserver-1] [INFO] [1693925869.906197304] [gazebo_ros2_control]: Received urdf from param server, parsing... [gzserver-1] [INFO] [1693925869.921388893] [gazebo_ros2_control]: Loading joint: joint1 [gzserver-1] [INFO] [1693925869.921568214] [gazebo_ros2_control]: State: [gzserver-1] [INFO] [1693925869.921584405] [gazebo_ros2_control]: position [gzserver-1] [INFO] [1693925869.921610463] [gazebo_ros2_control]: velocity [gzserver-1] [INFO] [1693925869.921617429] [gazebo_ros2_control]: Command: [gzserver-1] [INFO] [1693925869.921622572] [gazebo_ros2_control]: position [gzserver-1] [INFO] [1693925869.921842521] [gazebo_ros2_control]: Loading joint: joint2 [gzserver-1] [INFO] [1693925869.921877715] [gazebo_ros2_control]: State: [gzserver-1] [INFO] [1693925869.921883715] [gazebo_ros2_control]: position [gzserver-1] [INFO] [1693925869.921890631] [gazebo_ros2_control]: velocity [gzserver-1] [INFO] [1693925869.921895989] [gazebo_ros2_control]: Command: [gzserver-1] [INFO] [1693925869.921901159] [gazebo_ros2_control]: position </code></pre>
103918
2023-09-04T20:02:11.793
|gazebo|ros2|ros-control|gazebo-ros-control|
<p>i am having problems with my robot simulation with gazebo and ROS 2 Humble and hope someone can help me. I already have the URDF setup for gazebo and ros2_control, however every time I launch my simulation the command interfaces load but the state interfaces doesnt as shown in the output.</p> <pre><code>~$ ros2 control list_hardware_interfaces command interfaces joint1_1/position [available] [claimed] joint1_2/position [available] [claimed] joint2_1/position [available] [claimed] joint2_2/position [available] [claimed] state interfaces </code></pre> <p>The thing is I already have the state interfaces in the ros2_control tag in my urdf:</p> <pre class="lang-xml prettyprint-override"><code> &lt;ros2_control name=&quot;GazeboSimSystem&quot; type=&quot;system&quot;&gt; &lt;hardware&gt; &lt;plugin&gt;gazebo_ros2_control/GazeboSystem&lt;/plugin&gt; &lt;/hardware&gt; &lt;joint name=&quot;joint1_1&quot;&gt; &lt;command_interface name=&quot;position&quot;&gt; &lt;param name=&quot;min&quot;&gt;0.174533&lt;/param&gt; &lt;param name=&quot;max&quot;&gt;1.047198&lt;/param&gt; &lt;/command_interface&gt; &lt;state_interace name=&quot;position&quot;/&gt; &lt;state_interace name=&quot;velocity&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;joint1_2&quot;&gt; &lt;command_interface name=&quot;position&quot;&gt; &lt;param name=&quot;min&quot;&gt;-1.047198&lt;/param&gt; &lt;param name=&quot;max&quot;&gt;-0.174533&lt;/param&gt; &lt;/command_interface&gt; &lt;state_interace name=&quot;position&quot;/&gt; &lt;state_interace name=&quot;velocity&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;joint2_1&quot;&gt; &lt;command_interface name=&quot;position&quot;&gt; &lt;param name=&quot;min&quot;&gt;0.174533&lt;/param&gt; &lt;param name=&quot;max&quot;&gt;1.047198&lt;/param&gt; &lt;/command_interface&gt; &lt;state_interace name=&quot;position&quot;/&gt; &lt;state_interace name=&quot;velocity&quot;/&gt; &lt;/joint&gt; &lt;joint name=&quot;joint2_2&quot;&gt; &lt;command_interface name=&quot;position&quot;&gt; &lt;param name=&quot;min&quot;&gt;-1.047198&lt;/param&gt; &lt;param name=&quot;max&quot;&gt;-0.174533&lt;/param&gt; &lt;/command_interface&gt; &lt;state_interace name=&quot;position&quot;/&gt; &lt;state_interace name=&quot;velocity&quot;/&gt; &lt;/joint&gt; &lt;/ros2_control&gt; </code></pre> <p>And this is my controllers YAML file:</p> <pre class="lang-yaml prettyprint-override"><code>controller_manager: ros__parameters: update_rate: 100 # Hz use_sim_time: true joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster gripper_action_controller: type: position_controllers/JointGroupPositionController gripper_joints_controller: type: position_controllers/JointGroupPositionController gripper_action_controller: ros__parameters: joints: - joint1_1 command_interfaces: - position state_interfaces: - position - velocity state_publish_rate: 100.0 action_monitor_rate: 20.0 constraints: stopped_velocity_tolerance: 0.2 goal_time: 0.0 joint1_1: { trajectory: 0.2, goal: 0.1 } gripper_joints_controller: ros__parameters: joints: - joint1_2 - joint2_1 - joint2_2 command_interfaces: - position state_interfaces: - position - velocity state_publish_rate: 100.0 action_monitor_rate: 20.0 </code></pre> <p>I dont really know what am I missing to be able to have the state_interfaces showing</p> <p>[EDIT]</p> <p>This is what I get from <code>gazebo_ros2_control</code>:</p> <pre><code>[gzserver-2] [INFO] [1693929015.325649048] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin [gzserver-2] [INFO] [1693929015.328121613] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: / [gzserver-2] [INFO] [1693929015.328333972] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control [gzserver-2] [INFO] [1693929015.328393399] [gazebo_ros2_control]: Loading parameter files /home/automatebase/ur_ws/install/flower_gripper_description/share/flower_gripper_description/config/ros2_controllers.yaml [gzserver-2] [INFO] [1693929015.330788985] [gazebo_ros2_control]: connected to service!! robot_state_publisher [gzserver-2] [INFO] [1693929015.332729509] [gazebo_ros2_control]: Recieved urdf from param server, parsing... [gzserver-2] [INFO] [1693929015.345232360] [gazebo_ros2_control]: Loading joint: joint1_1 [gzserver-2] [INFO] [1693929015.345300994] [gazebo_ros2_control]: State: [gzserver-2] [INFO] [1693929015.345309704] [gazebo_ros2_control]: Command: [gzserver-2] [INFO] [1693929015.345319038] [gazebo_ros2_control]: position [gzserver-2] [INFO] [1693929015.345328932] [gazebo_ros2_control]: Loading joint: joint1_2 [gzserver-2] [INFO] [1693929015.345336106] [gazebo_ros2_control]: State: [gzserver-2] [INFO] [1693929015.345342381] [gazebo_ros2_control]: Command: [gzserver-2] [INFO] [1693929015.345348242] [gazebo_ros2_control]: position [gzserver-2] [INFO] [1693929015.345354755] [gazebo_ros2_control]: Loading joint: joint2_1 [gzserver-2] [INFO] [1693929015.345360559] [gazebo_ros2_control]: State: [gzserver-2] [INFO] [1693929015.345366201] [gazebo_ros2_control]: Command: [gzserver-2] [INFO] [1693929015.345371966] [gazebo_ros2_control]: position [gzserver-2] [INFO] [1693929015.345378289] [gazebo_ros2_control]: Loading joint: joint2_2 [gzserver-2] [INFO] [1693929015.345384131] [gazebo_ros2_control]: State: [gzserver-2] [INFO] [1693929015.345389584] [gazebo_ros2_control]: Command: [gzserver-2] [INFO] [1693929015.345395082] [gazebo_ros2_control]: position </code></pre>
ros2_control state interfaces not showing up
<p>You found the right entry. However you should be referencing the parent key, not the platform specific package.</p> <p>So <code>sdl2</code> and then on your platform rosdep will determine that it should install <code>libsdl2-dev</code> on other platforms it will resolve appropriately using the other rules.</p> <p>Our default is to use the Debian/Ubuntu naming policy so most are the same and likely your source of confusion. However this is an older legacy rule so doesn't match exactly.</p>
103919
2023-09-04T22:50:50.320
|ros|rosdep|ros-humble|
<p>OS: Ubuntu 22.04.3 LTS ROS2 Distro: Humble</p> <p>I ran this command inside the directory that contains the src folder for all my ROS packages.</p> <pre><code>rosdep install -y -r --from-paths src --ignore-src --rosdistro=humble </code></pre> <p>However, I got this error:</p> <pre><code>ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies: keyboard_teleop: Cannot locate rosdep definition for [libsdl2-dev] Continuing to install resolvable dependencies... #All required rosdeps installed successfully </code></pre> <p>But the rosdep key I used &quot;libsdl2-dev&quot; is from the official rosdep key github: <a href="https://github.com/ros/rosdistro/blob/0bec75fd1305910808b07776fbd1997a8c315998/rosdep/base.yaml" rel="nofollow noreferrer">https://github.com/ros/rosdistro/blob/0bec75fd1305910808b07776fbd1997a8c315998/rosdep/base.yaml</a> (line 4651)</p> <p>I thought putting the line</p> <pre><code>&lt;depend&gt;libsdl2-dev&lt;/depend&gt; </code></pre> <p>inside the package.xml file of the package allows rosdep to find and install the necessary dependencies of the package.</p> <p>Is there something I did wrong? I am new to managing dependencies with rosdep.</p>
rosdep key for SDL2 not working
<p>When something works on one machine but not the other, it's generally a configuiration/versioning issue. It appears that <code>ament_auto_find_test_dependencies</code> wasn't added until <a href="https://github.com/ament/ament_cmake/blame/65b1754af10bb1f8d23f33d68ef6f41c0bce5376/ament_cmake_auto/ament_cmake_auto-extras.cmake#L24" rel="nofollow noreferrer">two years ago (check the git blame)</a>, so if you're on 20.04, it's likely that the &quot;unknown CMake command&quot; is because that command simply doesn't exist on your 20.04 computer.</p> <p>You can try these three things:</p> <ul> <li>Upgrading CMake, Catkin, Ament, and whatever else in the build chain</li> <li>Using <a href="https://www.devdoc.net/linux/cmake-3.9.6/command/if.html" rel="nofollow noreferrer">CMake's <code>if</code> statement</a>, which can be used to check if a command/macro is available, to first check if testing can be performed using that command before attempting it</li> <li>Both of the above, to maximize both your environment and portability of your project.</li> </ul>
103945
2023-09-05T19:52:55.030
|ubuntu|
<p>this project builds fine on a rapsberry pi 4</p> <pre><code>https://github.com/fmrico/book_ros2 </code></pre> <p>Now I try to build this on a virtual box VM using this image</p> <p>ubuntu-20.04.6-desktop-amd64.iso</p> <p>I have been installing any package conceivable, yet this does not build</p> <pre><code>phil@ROS2:~/WORK/bookros2_ws$ colcon build --symlink-install Starting &gt;&gt;&gt; launch_pal Finished &lt;&lt;&lt; launch_pal [4.17s] Starting &gt;&gt;&gt; pmb2_controller_configuration Finished &lt;&lt;&lt; pmb2_controller_configuration [5.45s] Starting &gt;&gt;&gt; pal_gripper_controller_configuration Finished &lt;&lt;&lt; pal_gripper_controller_configuration [4.27s] Starting &gt;&gt;&gt; pmb2_laser_sensors --- stderr: pmb2_laser_sensors CMake Error at CMakeLists.txt:8 (ament_auto_find_test_dependencies): Unknown CMake command &quot;ament_auto_find_test_dependencies&quot;. --- Failed &lt;&lt;&lt; pmb2_laser_sensors [3.63s, exited with code 1] Summary: 3 packages finished [18.0s] 1 package failed: pmb2_laser_sensors 1 package had stderr output: pmb2_laser_sensors 33 packages not processed </code></pre> <p>thanks for your help</p> <p>[edit]</p> <pre><code>phil@ROS2:~/WORK/bookros2_ws$ cat /home/phil/WORK/bookros2_ws/src/ThirdParty/pmb2_navigation/pmb2_laser_sensors/CMakeLists.txt cmake_minimum_required(VERSION 3.5) project(pmb2_laser_sensors) find_package(ament_cmake_auto REQUIRED) ament_auto_find_build_dependencies() if(BUILD_TESTING) ament_auto_find_test_dependencies() ament_lint_auto_find_test_dependencies() endif() ament_auto_package(INSTALL_TO_SHARE config launch) </code></pre>
Ubuntu 20.04 64bits - Unknown CMake command "ament_auto_find_test_dependencies"
<p>You can use <a href="http://wiki.ros.org/rosserial" rel="nofollow noreferrer">rosserial</a> for sending commands over the Serial port to your Arduino.</p> <blockquote> <p>|0000|0000|0000|0000|0000| as |ID|Motor_1|Motor_2|Motor_3|Motor_4|</p> </blockquote> <p>This is called a <strong>dataframe</strong>. If you do end up using Serial transports, you would have to design your own dataframe. What you have should work, but do keep in mind your requirements. If the arduino is responsible for sending over some information about each motor encoder, you should adapt your dataframe to include this information as well. Also, you should think about using some start and end flags <em>(could be a sequence or a particular number)</em> that will help you to know when a new transmission has arrived, and when the current transmission has ended.</p> <p><strong>EDIT:</strong> I looked at the <a href="https://www.elprocus.com/nrf24l01/#:%7E:text=NRF24L01%20is%20a%20radio%20transceiver,crystal%20oscillator%20modulator%2C%20and%20demodulator." rel="nofollow noreferrer">nRF240L1</a> module you were talking about, and turns out it uses an SPI-based communication interface. In this case, your arduino would act as a bridge, which takes in data passed in via Serial , and sends the appropriate SPI commands over to the particular transceiver.</p>
103950
2023-09-06T06:10:02.397
|ros|roslaunch|ros-noetic|
<p>How can a motor control node (which will subscribe to the cmd_vel topic) be linked to my robot hardware?</p> <p>My first idea is to communicate via byte signal like</p> <blockquote> <p>|0000|0000|0000|0000|0000|</p> </blockquote> <p>as</p> <blockquote> <p>|ID|Motor_1|Motor_2|Motor_3|Motor_4|</p> </blockquote> <p>Arduino will be used as the low level hardware control, and receive the signal and information via byte using a nrf240L1 module. Would this work?</p>
Controlling Arduino device from ROS node
<p>I was able to solve this issue by myself. The problem was a missing RAPID module on the real robot controller. It is called <code>TRob1Main.mod</code> and is included in PickNiks Github repository. It enables the EGM connection to the ROS2-PC. You can load in the file with RobotStudio and execute it with the Flex Pendant.</p>
103959
2023-09-06T14:10:16.890
|ubuntu|ros-humble|abb|
<p>I am currently working on a project where I want to control an ABB robot IRB 2600 via ROS2 Humble. I am using a PC with the operating system Ubuntu 22.04. I came across the PickNik Robotics ABB ROS2 Driver Release on the Internet and followed the installation instructions.</p> <p>Here is the Link: <a href="https://github.com/PickNikRobotics/abb_ros2" rel="nofollow noreferrer">https://github.com/PickNikRobotics/abb_ros2</a></p> <p>I have adapted the robot description and configuration files to my robot model. I then tried to connect to the robot and start the controllers with the following command:</p> <pre><code>ros2 launch abb_bringup abb_control.launch.py description_package:=abb_irb2600_support description_file:=irb2600.xacro launch_rviz:=false moveit_config_package:=abb_irb2600_moveit_config use_fake_hardware:=false </code></pre> <p>In the following code block you can see that the robot controller is found, but no connection to the robot can be established. I do not know how to solve this problem. Maybe someone already worked with this software and can help me.</p> <pre><code>nihe@ws-autom-03:~<span class="math-container">$ source /opt/ros/humble/setup.bash nihe@ws-autom-03:~$</span> source /var/Airbus/dev_ws/install/setup.bash nihe@ws-autom-03:~$ ros2 launch ros2srrc_irb2600_bringup irb2600_bringup.launch.py [INFO] [launch]: All log files can be found below /home/nihe/.ros/log/2023-09-20-15-37-19-339069-ws-autom-03-41673 [INFO] [launch]: Default logging verbosity is set to INFO ===== ABB IRB-2600: Robot Bringup (ros2srrc_irb2600_bringup) ===== Robot configuration: - IP Address: Please input the IP Address of the Robot: 10.83.141.60 - Cell layout: + Option N1: ABB IRB-2600 alone. + Option N2: Cranfield University: IA Lab enclosure. + Option N3: Pick and Place use-case. Please select: 1 - End-effector: + Option N1: No end-effector. + Option N2: Schunk EGP-64 parallel gripper. Please select: 1 [INFO] [ros2_control_node-1]: process started with pid [41679] [INFO] [robot_state_publisher-2]: process started with pid [41681] [INFO] [static_transform_publisher-3]: process started with pid [41683] [INFO] [spawner-4]: process started with pid [41685] [INFO] [spawner-5]: process started with pid [41687] [INFO] [rws_client-6]: process started with pid [41689] [static_transform_publisher-3] [WARN] [1695217060.038130787] []: Old-style arguments are deprecated; see --help for new-style arguments [static_transform_publisher-3] [INFO] [1695217060.044351888] [static_transform_publisher]: Spinning until stopped - publishing transform [static_transform_publisher-3] translation: ('0.000000', '0.000000', '0.000000') [static_transform_publisher-3] rotation: ('0.000000', '0.000000', '0.000000', '1.000000') [static_transform_publisher-3] from 'world' to 'base_link' [robot_state_publisher-2] [INFO] [1695217060.046552659] [robot_state_publisher]: got segment base [robot_state_publisher-2] [INFO] [1695217060.046595124] [robot_state_publisher]: got segment base_link [robot_state_publisher-2] [INFO] [1695217060.046598763] [robot_state_publisher]: got segment flange [robot_state_publisher-2] [INFO] [1695217060.046601146] [robot_state_publisher]: got segment link_1 [robot_state_publisher-2] [INFO] [1695217060.046602966] [robot_state_publisher]: got segment link_2 [robot_state_publisher-2] [INFO] [1695217060.046604773] [robot_state_publisher]: got segment link_3 [robot_state_publisher-2] [INFO] [1695217060.046606572] [robot_state_publisher]: got segment link_4 [robot_state_publisher-2] [INFO] [1695217060.046608293] [robot_state_publisher]: got segment link_5 [robot_state_publisher-2] [INFO] [1695217060.046610030] [robot_state_publisher]: got segment link_6 [robot_state_publisher-2] [INFO] [1695217060.046611891] [robot_state_publisher]: got segment tool0 [robot_state_publisher-2] [INFO] [1695217060.046613805] [robot_state_publisher]: got segment world [ros2_control_node-1] [INFO] [1695217060.049850046] [resource_manager]: Loading hardware 'ABBMultiInterfaceHardware' [ros2_control_node-1] [INFO] [1695217060.053529694] [resource_manager]: Initialize hardware 'ABBMultiInterfaceHardware' [ros2_control_node-1] [INFO] [1695217060.215627067] [ABBSystemHardware]: Robot controller description: [ros2_control_node-1] ============================================================ [ros2_control_node-1] = Summary of robot controller at '10.83.141.60:80' [ros2_control_node-1] ============================================================ [ros2_control_node-1] # General Information: [ros2_control_node-1] |- RobotWare version: 6.13.01.00 [ros2_control_node-1] |- System name: 2600-117066 [ros2_control_node-1] |- System type: Real Controller [ros2_control_node-1] |- Options: [ros2_control_node-1] |- RobotWare Base [ros2_control_node-1] |- 888-2 PROFINET Controller/Device [ros2_control_node-1] |- 997-1 PROFIsafe F-Device [ros2_control_node-1] |- 996-1 Safety Module [ros2_control_node-1] |- 988-1 RW Add-In Prepared [ros2_control_node-1] |- 608-1 World Zones [ros2_control_node-1] |- 611-1 Path Recovery [ros2_control_node-1] |- 613-1 Collision Detection [ros2_control_node-1] |- 616-1 PC Interface [ros2_control_node-1] |- 617-1 FlexPendant Interface [ros2_control_node-1] |- 623-1 Multitasking [ros2_control_node-1] |- 689-1 Externally Guided Motion (EGM) [ros2_control_node-1] |- UDPUC Driver [ros2_control_node-1] |- 1125-2 SafeMove Pro [ros2_control_node-1] |- Motor Commutation [ros2_control_node-1] |- Service Info System [ros2_control_node-1] |- Pendelum Calibration [ros2_control_node-1] |- Drive System IRB 2600/390/4400/6400R [ros2_control_node-1] |- IRB 2600-20/1.65 Type B [ros2_control_node-1] |- Axis Calibration [ros2_control_node-1] [ros2_control_node-1] # Mechanical Units: [ros2_control_node-1] |- Unit: ROB_1 [ros2_control_node-1] [ros2_control_node-1] # Mechanical Unit Groups: [ros2_control_node-1] |- N/A (only for MultiMove systems) [ros2_control_node-1] ============================================================ [ros2_control_node-1] [INFO] [1695217060.215686877] [ABBSystemHardware]: Configuring EGM interface... [ros2_control_node-1] [INFO] [1695217060.215868184] [ABBSystemHardware]: Configuring EGM for mechanical unit group on port 6511 [ros2_control_node-1] [INFO] [1695217060.222640339] [resource_manager]: Successful initialization of hardware 'ABBMultiInterfaceHardware' [ros2_control_node-1] [INFO] [1695217060.222969956] [resource_manager]: 'configure' hardware 'ABBMultiInterfaceHardware' [ros2_control_node-1] [INFO] [1695217060.222985511] [resource_manager]: Successful 'configure' of hardware 'ABBMultiInterfaceHardware' [ros2_control_node-1] [INFO] [1695217060.223000702] [resource_manager]: 'activate' hardware 'ABBMultiInterfaceHardware' [ros2_control_node-1] [INFO] [1695217060.223008084] [ABBSystemHardware]: Connecting to robot... [rws_client-6] [INFO] [1695217060.224645263] [rws_client]: RWS client services initialized! [rws_client-6] [INFO] [1695217060.328933511] [rws_client]: RWS state publisher initialized! [ros2_control_node-1] [INFO] [1695217060.723230666] [ABBSystemHardware]: Not connected to robot... [ros2_control_node-1] [INFO] [1695217061.723624846] [ABBSystemHardware]: Not connected to robot... [spawner-5] [INFO] [1695217062.194168494] [spawner_joint_trajectory_controller]: Waiting for '/controller_manager' services to be available [spawner-4] [INFO] [1695217062.194262892] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available [ros2_control_node-1] [INFO] [1695217062.724055181] [ABBSystemHardware]: Not connected to robot... [ros2_control_node-1] [INFO] [1695217063.724514652] [ABBSystemHardware]: Not connected to robot... [spawner-5] [INFO] [1695217064.206666214] [spawner_joint_trajectory_controller]: Waiting for '/controller_manager' services to be available [spawner-4] [INFO] [1695217064.206822352] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available [ros2_control_node-1] [INFO] [1695217064.725035900] [ABBSystemHardware]: Not connected to robot... [ros2_control_node-1] [INFO] [1695217065.725563891] [ABBSystemHardware]: Not connected to robot... [spawner-4] [INFO] [1695217066.218913375] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available [spawner-5] [INFO] [1695217066.218926162] [spawner_joint_trajectory_controller]: Waiting for '/controller_manager' services to be available [ros2_control_node-1] [INFO] [1695217066.726038631] [ABBSystemHardware]: Not connected to robot... [ros2_control_node-1] [INFO] [1695217067.726593491] [ABBSystemHardware]: Not connected to robot... [spawner-4] [INFO] [1695217068.231779535] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available [spawner-5] [INFO] [1695217068.231825933] [spawner_joint_trajectory_controller]: Waiting for '/controller_manager' services to be available [ros2_control_node-1] [INFO] [1695217068.727029265] [ABBSystemHardware]: Not connected to robot... [ros2_control_node-1] [INFO] [1695217069.727507168] [ABBSystemHardware]: Not connected to robot... [spawner-4] [ERROR] [1695217070.244324257] [spawner_joint_state_broadcaster]: Controller manager not available [spawner-5] [ERROR] [1695217070.244537101] [spawner_joint_trajectory_controller]: Controller manager not available [ERROR] [spawner-4]: process has died [pid 41685, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --controller-manager /controller_manager --ros-args']. [ERROR] [spawner-5]: process has died [pid 41687, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_trajectory_controller -c /controller_manager --ros-args']. </code></pre>
ABB ROS2 Driver Problem Connecting To Robot
<p>Your configuration or model is invalid, which prevents MoveIt from using it. This is the specific error:</p> <p><code>[move_group-1] [ERROR] [1694012428.345117932] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'</code></p> <p>This is telling us that you are attempting to make use of some joint called <code>joint_5_mimic</code>, but that it is not being provided by the <code>arm_robot</code> model.</p> <p>As a result, you need to check that that your arm_robot URDF does actually contain this joint. You'll also need to make sure that this joint has been included in the move_group when configured using the MoveIt 2 setup assistant (docs <a href="https://moveit.picknik.ai/humble/doc/examples/setup_assistant/setup_assistant_tutorial.html" rel="nofollow noreferrer">here</a>).</p> <hr /> <p>Edit since you've added this information:</p> <blockquote> <p>I mimic joint 4 in the opposite direction to perform a grasp using a gripper in my robot model</p> </blockquote> <p>It is unusual to do this in MoveIt (and actually I'm not sure if treating joints this way is fully supported, but don't quote me on that). The more typical approach would be to have the move group handle <em>just</em> the arm, and then the gripper is a standalone end-effector that MoveIt doesn't need to provide plans for directly. It'll still need to know the collisions, etc, but it won't be responsible for handling the inverse kinematics of the gripper.</p> <p>So with that in mind, my recommendation would be to</p> <ul> <li>remove the gripper from the move group</li> <li>provide the ability to open/close the gripper using some other functionality (take a look at the <a href="https://github.com/ros-industrial/robotiq" rel="nofollow noreferrer">Robotiq grippers</a> for a better demonstration of this)</li> <li>Perform kinematic planning using MoveIt and then open/close gripper as a standalone process that is not handled kinematically.</li> </ul>
103963
2023-09-06T15:29:59.723
|moveit|move-group|
<p>I'm facing an issue on moveit when I try to manually configure the robot model in moveit. I'm getting errors in the robot model when trying to launch moveit launch file in the following sequence below and I mimic joint 4 in the opposite direction to perform a grasp using a gripper in my robot model. Here is my <a href="https://github.com/AdithyaDamarla/ROS2_Motion_Planning.git" rel="nofollow noreferrer">GitHub repo</a></p> <p>This is my output in the terminal when I run in a sequence <em><strong>gazebo.launch.py</strong></em>, <em><strong>controller.launch.py</strong></em> followed by <em><strong>moveit.launch.py</strong></em>.</p> <pre><code>damarla@damarla:~/ros2control$ ros2 launch arm_robot_moveit moveit.launch.py [INFO] [launch]: All log files can be found below /home/damarla/.ros/log/2023-09-06-17-00-22-607579-damarla-11097 [INFO] [launch]: Default logging verbosity is set to INFO WARNING:root:Cannot infer URDF from `/home/damarla/ros2control/install/arm_robot_moveit/share/arm_robot_moveit`. -- using config/arm_robot.urdf WARNING:root:Cannot infer SRDF from `/home/damarla/ros2control/install/arm_robot_moveit/share/arm_robot_moveit`. -- using config/arm_robot.srdf [INFO] [move_group-1]: process started with pid [11102] [INFO] [rviz2-2]: process started with pid [11104] [rviz2-2] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. [move_group-1] [INFO] [1694012423.431871548] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0 seconds [move_group-1] [INFO] [1694012423.433388806] [moveit_robot_model.robot_model]: Loading robot model 'arm_robot'... [move_group-1] [INFO] [1694012423.434358278] [moveit_robot_model.robot_model]: No root/virtual joint specified in SRDF. Assuming fixed joint [move_group-1] [INFO] [1694012423.865155745] [moveit_kinematics_base.kinematics_base]: Using position only ik [move_group-1] [INFO] [1694012425.260442551] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Publishing maintained planning scene on 'monitored_planning_scene' [move_group-1] [INFO] [1694012425.260720014] [moveit.ros_planning_interface.moveit_cpp]: Listening to 'joint_states' for joint states [move_group-1] [INFO] [1694012425.262647894] [moveit_ros.current_state_monitor]: Listening to joint states on topic 'joint_states' [move_group-1] [INFO] [1694012425.263455907] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/attached_collision_object' for attached collision objects [move_group-1] [INFO] [1694012425.263483366] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting planning scene monitor [move_group-1] [INFO] [1694012425.264933042] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/planning_scene' [move_group-1] [INFO] [1694012425.264966412] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting world geometry update monitor for collision objects, attached objects, octomap updates. [move_group-1] [INFO] [1694012425.265801550] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to 'collision_object' [move_group-1] [INFO] [1694012425.266665953] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to 'planning_scene_world' for planning scene world geometry [move_group-1] [WARN] [1694012425.267298621] [moveit.ros.occupancy_map_monitor.middleware_handle]: Resolution not specified for Octomap. Assuming resolution = 0.1 instead [move_group-1] [ERROR] [1694012425.267328149] [moveit.ros.occupancy_map_monitor.middleware_handle]: No 3D sensor plugin(s) defined for octomap updates [move_group-1] [ERROR] [1694012425.381326649] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012425.574183704] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [INFO] [1694012427.898257942] [moveit.ros_planning_interface.moveit_cpp]: Loading planning pipeline 'pilz_industrial_motion_planner' [move_group-1] [ERROR] [1694012427.899235651] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.899962334] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900000829] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900025056] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900047270] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900069015] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900110126] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900134147] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900205442] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900238005] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900260457] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900281975] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900303337] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900324611] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012427.900346972] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [INFO] [1694012427.914311507] [moveit.pilz_industrial_motion_planner.joint_limits_aggregator]: Reading limits from namespace robot_description_planning [move_group-1] [INFO] [1694012427.929095164] [moveit.pilz_industrial_motion_planner]: Available plugins: pilz_industrial_motion_planner/PlanningContextLoaderCIRC pilz_industrial_motion_planner/PlanningContextLoaderLIN pilz_industrial_motion_planner/PlanningContextLoaderPTP [move_group-1] [INFO] [1694012427.929129872] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderCIRC [move_group-1] [INFO] [1694012427.935363709] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [CIRC] [move_group-1] [INFO] [1694012427.935999212] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderLIN [move_group-1] [INFO] [1694012427.938983840] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [LIN] [move_group-1] [INFO] [1694012427.939539179] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderPTP [move_group-1] [INFO] [1694012427.942555583] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [PTP] [move_group-1] [INFO] [1694012427.943143147] [moveit.ros_planning.planning_pipeline]: Using planning interface 'Pilz Industrial Motion Planner' [move_group-1] [INFO] [1694012427.949306191] [moveit.ros_planning_interface.moveit_cpp]: Loading planning pipeline 'chomp' [move_group-1] [ERROR] [1694012427.951833312] [moveit.ros_planning.planning_pipeline]: Exception while loading planner 'chomp_interface/CHOMPPlanner': According to the loaded plugin descriptions the class chomp_interface/CHOMPPlanner with base class type planning_interface::PlannerManager does not exist. Declared types are ompl_interface/OMPLPlanner pilz_industrial_motion_planner/CommandPlannerAvailable plugins: ompl_interface/OMPLPlanner, pilz_industrial_motion_planner/CommandPlanner [move_group-1] [INFO] [1694012427.961000062] [moveit_ros.fix_workspace_bounds]: Param 'chomp.default_workspace_bounds' was not set. Using default value: 10.000000 [move_group-1] [INFO] [1694012427.961832365] [moveit_ros.fix_start_state_bounds]: Param 'chomp.start_state_max_bounds_error' was set to 0.100000 [move_group-1] [INFO] [1694012427.962377647] [moveit_ros.fix_start_state_bounds]: Param 'chomp.start_state_max_dt' was not set. Using default value: 0.500000 [move_group-1] [INFO] [1694012427.962963161] [moveit_ros.fix_start_state_collision]: Param 'chomp.start_state_max_dt' was not set. Using default value: 0.500000 [move_group-1] [INFO] [1694012427.963561446] [moveit_ros.fix_start_state_collision]: Param 'chomp.jiggle_fraction' was set to 0.050000 [move_group-1] [INFO] [1694012427.964080448] [moveit_ros.fix_start_state_collision]: Param 'chomp.max_sampling_attempts' was not set. Using default value: 100 [move_group-1] [INFO] [1694012427.964931502] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Add Time Parameterization' [move_group-1] [INFO] [1694012427.965812754] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Resolve constraint frames to robot links' [move_group-1] [INFO] [1694012427.968255337] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Workspace Bounds' [move_group-1] [INFO] [1694012427.968278133] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Bounds' [move_group-1] [INFO] [1694012427.968284304] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State In Collision' [move_group-1] [INFO] [1694012427.968290491] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Path Constraints' [move_group-1] [ERROR] [1694012427.978163778] [moveit.ros_planning_interface.moveit_cpp]: Failed to initialize planning pipeline 'chomp'. [move_group-1] [INFO] [1694012427.984607682] [moveit.ros_planning_interface.moveit_cpp]: Loading planning pipeline 'ompl' [move_group-1] [ERROR] [1694012428.017916006] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [INFO] [1694012428.115319535] [moveit.ros_planning.planning_pipeline]: Using planning interface 'OMPL' [move_group-1] [INFO] [1694012428.119716411] [moveit_ros.fix_workspace_bounds]: Param 'ompl.default_workspace_bounds' was not set. Using default value: 10.000000 [move_group-1] [INFO] [1694012428.120413441] [moveit_ros.fix_start_state_bounds]: Param 'ompl.start_state_max_bounds_error' was set to 0.100000 [move_group-1] [INFO] [1694012428.120878620] [moveit_ros.fix_start_state_bounds]: Param 'ompl.start_state_max_dt' was not set. Using default value: 0.500000 [move_group-1] [INFO] [1694012428.121226722] [moveit_ros.fix_start_state_collision]: Param 'ompl.start_state_max_dt' was not set. Using default value: 0.500000 [move_group-1] [INFO] [1694012428.121546516] [moveit_ros.fix_start_state_collision]: Param 'ompl.jiggle_fraction' was set to 0.050000 [move_group-1] [INFO] [1694012428.121859004] [moveit_ros.fix_start_state_collision]: Param 'ompl.max_sampling_attempts' was not set. Using default value: 100 [move_group-1] [INFO] [1694012428.122177815] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Add Time Parameterization' [move_group-1] [INFO] [1694012428.122500968] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Resolve constraint frames to robot links' [move_group-1] [INFO] [1694012428.122855972] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Workspace Bounds' [move_group-1] [INFO] [1694012428.123218650] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Bounds' [move_group-1] [INFO] [1694012428.123578251] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State In Collision' [move_group-1] [INFO] [1694012428.123946388] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Path Constraints' [move_group-1] [ERROR] [1694012428.191827479] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [FATAL] [1694012428.218998432] [moveit_ros.trajectory_execution_manager]: Exception while loading controller manager 'moveit_simple_controller/MoveItSimpleControllerManager': According to the loaded plugin descriptions the class moveit_simple_controller/MoveItSimpleControllerManager with base class type moveit_controller_manager::MoveItControllerManager does not exist. Declared types are moveit_simple_controller_manager/MoveItSimpleControllerManager [move_group-1] [ERROR] [1694012428.219724910] [moveit_ros.trajectory_execution_manager]: Failed to reload controllers: `controller_manager_` does not exist. [move_group-1] [INFO] [1694012428.221761439] [moveit_ros.trajectory_execution_manager]: Trajectory execution is managing controllers [move_group-1] [INFO] [1694012428.223782146] [move_group.move_group]: MoveGroup debug mode is ON [move_group-1] [INFO] [1694012428.307856730] [move_group.move_group]: [move_group-1] [move_group-1] ******************************************************** [move_group-1] * MoveGroup using: [move_group-1] * - ApplyPlanningSceneService [move_group-1] * - ClearOctomapService [move_group-1] * - CartesianPathService [move_group-1] * - ExecuteTrajectoryAction [move_group-1] * - GetPlanningSceneService [move_group-1] * - KinematicsService [move_group-1] * - MoveAction [move_group-1] * - MotionPlanService [move_group-1] * - QueryPlannersService [move_group-1] * - StateValidationService [move_group-1] ******************************************************** [move_group-1] [move_group-1] [INFO] [1694012428.308015960] [moveit_move_group_capabilities_base.move_group_context]: MoveGroup context using planning plugin ompl_interface/OMPLPlanner [move_group-1] [INFO] [1694012428.308038801] [moveit_move_group_capabilities_base.move_group_context]: MoveGroup context initialization complete [move_group-1] Loading 'move_group/ApplyPlanningSceneService'... [move_group-1] Loading 'move_group/ClearOctomapService'... [move_group-1] Loading 'move_group/MoveGroupCartesianPathService'... [move_group-1] Loading 'move_group/MoveGroupExecuteTrajectoryAction'... [move_group-1] Loading 'move_group/MoveGroupGetPlanningSceneService'... [move_group-1] Loading 'move_group/MoveGroupKinematicsService'... [move_group-1] Loading 'move_group/MoveGroupMoveAction'... [move_group-1] Loading 'move_group/MoveGroupPlanService'... [move_group-1] Loading 'move_group/MoveGroupQueryPlannersService'... [move_group-1] Loading 'move_group/MoveGroupStateValidationService'... [move_group-1] [move_group-1] You can start planning now! [move_group-1] [move_group-1] [ERROR] [1694012428.345117932] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012428.481281894] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012428.581690115] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012428.690183074] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012428.806492246] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012428.928206957] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012429.069404377] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012429.234023061] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012429.362592711] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012429.495362228] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012429.602467505] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012429.725921759] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012429.856541282] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012429.977396568] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012430.090659941] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012430.203335063] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012430.323374128] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012430.433809989] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012430.549070609] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012430.784446826] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012430.905078852] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012431.018402346] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012431.142214877] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012431.251748896] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012431.365726843] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012431.499175785] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012431.631390811] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012431.752993154] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012431.861795521] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012431.968442148] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012432.092238312] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012432.208372721] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012432.322000701] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' [move_group-1] [ERROR] [1694012432.442328421] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot' </code></pre> <p>Thanks in Advance Adithya</p>
Moveit failed to find the robot model when using manual moveit configuration
<p>Welcome to RSE.</p> <p>So you want to simulate a gripper interacting with objects in Gazebo Classic? Don't use position or velocity interfaces. In my experience, that just doesn't work. You have to use an effort interface to let the physics engine solve that properly. This brings some other problems</p> <ul> <li>Mimicking position within gazebo with exposing an effort interface via ros2_control isn't implemented yet. Mimicking effort would be supported, but your &quot;mimicked&quot; finger will not have the same position as the &quot;main&quot; finger. I'm not aware of a different method as implementing a custom gazebo_system, see for example <a href="https://github.com/ros-controls/gazebo_ros2_control/pull/111" rel="nofollow noreferrer">this PR</a>.</li> <li>If your robot has a position interface (i.e. servo?), you can't use the same within your gazebo simulation without writing (again) a custom gazebo_system implementing some actuator dynamics between position-effort.</li> </ul> <p>Currently, you have to use an <a href="https://github.com/ros-controls/gazebo_ros2_control/blob/master/gazebo_ros2_control_demos/config/cartpole_controller_effort.yaml#L5" rel="nofollow noreferrer">effort_controller</a> to forward topics to efforts, because the gripper_controller's effort interface was broken (fixed with this <a href="https://github.com/ros-controls/ros2_controllers/pull/756" rel="nofollow noreferrer">PR</a>, but it will take some time to be released as binary)</p>
103967
2023-09-06T17:03:25.933
|gazebo|control|ros-humble|gripper|
<p>I want my robot arm (Turtlebot3 with <a href="https://emanual.robotis.com/docs/en/platform/openmanipulator_x/overview/" rel="nofollow noreferrer">OpenManipulator-X</a>) to firmly grab a box, however the gripper does a sudden close movement and the box flies away. Is a firm closing movement possible with <code>ros2_control</code> in Gazebo Classic?</p> <p>The gripper model uses <a href="https://control.ros.org/humble/doc/ros2_controllers/gripper_controllers/doc/userdoc.html" rel="nofollow noreferrer">gripper controller</a> from <code>ros2_control</code> package with position control. I could not find a way to slow down the closing movement of the gripper.</p> <p>I searched for examples and the <a href="https://github.com/ros-controls/gazebo_ros2_control/blob/0dc19ab5561f7ef6b6d9addee55a4b01c56de126/gazebo_ros2_control_demos/config/gripper_controller.yaml#L6" rel="nofollow noreferrer">most similar example</a> uses the <a href="https://control.ros.org/humble/doc/ros2_controllers/forward_command_controller/doc/userdoc.html" rel="nofollow noreferrer">Forward Command Controller</a>, however it still has sudden movements like this: <img src="https://control.ros.org/humble/_images/gripper.gif" alt="License: Apache 2.0" /></p> <p>How can I achieve a firm closing movement with <code>ros2_control</code> gripper controller with position control?</p>
Which controller from `ros2_control` is appropriate for firmly grabbing a box with a 1-DOF gripper in Gazebo Classic?
<p>You certainly <em>can</em> change the destination of any files produced by CMake (using, for example, the <a href="https://cmake.org/cmake/help/latest/command/configure_file.html" rel="nofollow noreferrer"><code>configure_file()</code> command</a>).</p> <p>But... <em>should</em> you? I'm not convinced that you should. I think you'll find you have cleaner code if you allow messages to be explicitly stored alongside only other messages. Further, having a standard behavior for generated files is very useful for other developers: anyone using your package will assume that messages will take place in a standard location. Even in the cases where nobody else will use your code, the ROS tools you're running on your computer will often make this assumption.</p> <p>As an experiment, try changing the files manually (using the <code>mv</code> command or your file explorer) and see what breaks. I think you'll find that this ends up being messier than you initially bargained for.</p>
103985
2023-09-07T12:11:33.333
|ros2|messages|custom-message|
<p>When creating custom message types in ROS1 (noetic), I can store the <code>*.msg</code> files in a subfolder named <code>msg</code>. In the CMake file, I just type the name of the file without <code>msg/</code> in <code>add_message_files(...)</code>. The resulting message type is named as <code>&lt;pkg_name&gt;/&lt;file-name (without .msg)&gt;</code></p> <p>When creating interfaces in ROS2 (foxy), I have to type the file name in my CMake file including the relative path in <code>rosidl_generate_interfaces(...)</code> like <code>msg/&lt;filename.msg&gt;</code>. The resulting interface name also includes <code>msg</code>: <code>&lt;pkg_name&gt;/msg/&lt;file-name (without .msg)&gt;</code>, but actually I don't want the exact path as an interface name.</p> <p>So my question is: Is it possible to store the files in the <code>msg</code> folder for a better folder structure but set the name of the resulting interface differently?</p>
Set interface name without msg in ROS2
<p>The solution is:</p> <p>in the <code>launch.py</code> file: <code>from launch_ros.actions import Node</code></p>
103996
2023-09-07T22:00:49.493
|ros2|webots|
<p>when we launched the following example in the Webots-ros2 tutorial, we got the following error, could you help us to get rid of that problem, thanks.</p> <p>The example link: <a href="https://docs.ros.org/en/humble/Tutorials/Advanced/Simulators/Webots/Setting-Up-Simulation-Webots-Advanced.html" rel="nofollow noreferrer">Setting up a robot simulation (Advanced)</a></p> <p><strong>ntukenmez3@ae-icps-407120:~/ros2_ws/src$</strong> <code>ros2 launch my_package robot_launch.py</code></p> <pre><code>[INFO] [launch]: All log files can be found below /home/ntukenmez3/.ros/log/2023-09-07-17-39-57-599365-ae-icps-407120-1653965 [INFO] [launch]: Default logging verbosity is set to INFO WARNING: No valid Webots directory specified in `ROS2_WEBOTS_HOME` and `WEBOTS_HOME`, fallback to default installation folder /usr/local/webots. [ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: name 'Node' is not defined </code></pre> <hr /> <p><strong>my_robot_driver.py:</strong></p> <pre><code>import rclpy from geometry_msgs.msg import Twist HALF_DISTANCE_BETWEEN_WHEELS = 0.045 WHEEL_RADIUS = 0.025 class MyRobotDriver: def init(self, webots_node, properties): self.__robot = webots_node.robot self.__left_motor = self.__robot.getDevice('left wheel motor') self.__right_motor = self.__robot.getDevice('right wheel motor') self.__left_motor.setPosition(float('inf')) self.__left_motor.setVelocity(0) self.__right_motor.setPosition(float('inf')) self.__right_motor.setVelocity(0) self.__target_twist = Twist() rclpy.init(args=None) self.__node = rclpy.create_node('my_robot_driver') self.__node.create_subscription(Twist, 'cmd_vel', self.__cmd_vel_callback, 1) def __cmd_vel_callback(self, twist): self.__target_twist = twist def step(self): rclpy.spin_once(self.__node, timeout_sec=0) forward_speed = self.__target_twist.linear.x angular_speed = self.__target_twist.angular.z command_motor_left = (forward_speed - angular_speed * HALF_DISTANCE_BETWEEN_WHEELS) / WHEEL_RADIUS command_motor_right = (forward_speed + angular_speed * HALF_DISTANCE_BETWEEN_WHEELS) / WHEEL_RADIUS self.__left_motor.setVelocity(command_motor_left) self.__right_motor.setVelocity(command_motor_right) </code></pre> <p><strong>obstacle_avoider.py:</strong></p> <pre><code>import rclpy from rclpy.node import Node from sensor_msgs.msg import Range from geometry_msgs.msg import Twist MAX_RANGE = 0.15 class ObstacleAvoider(Node): def __init__(self): super().__init__('obstacle_avoider') self.__publisher = self.create_publisher(Twist, 'cmd_vel', 1) self.create_subscription(Range, 'left_sensor', self.__left_sensor_callback, 1) self.create_subscription(Range, 'right_sensor', self.__right_sensor_callback, 1) def __left_sensor_callback(self, message): self.__left_sensor_value = message.range def __right_sensor_callback(self, message): self.__right_sensor_value = message.range command_message = Twist() command_message.linear.x = 0.1 if self.__left_sensor_value &lt; 0.9 * MAX_RANGE or self.__right_sensor_value &lt; 0.9 * MAX_RANGE: command_message.angular.z = -2.0 self.__publisher.publish(command_message) def main(args=None): rclpy.init(args=args) avoider = ObstacleAvoider() rclpy.spin(avoider) # Destroy the node explicitly # (optional - otherwise it will be done automatically # when the garbage collector destroys the node object) avoider.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p><strong>my_robot.urdf:</strong></p> <pre><code>&lt;?xml version=&quot;1.0&quot; ?&gt; &lt;robot name=&quot;My robot&quot;&gt; &lt;webots&gt; &lt;device reference=&quot;ds0&quot; type=&quot;DistanceSensor&quot;&gt; &lt;ros&gt; &lt;topicName&gt;/left_sensor&lt;/topicName&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;/ros&gt; &lt;/device&gt; &lt;device reference=&quot;ds1&quot; type=&quot;DistanceSensor&quot;&gt; &lt;ros&gt; &lt;topicName&gt;/right_sensor&lt;/topicName&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;/ros&gt; &lt;/device&gt; &lt;plugin type=&quot;my_package.my_robot_driver.MyRobotDriver&quot; /&gt; &lt;/webots&gt; &lt;/robot&gt; </code></pre> <p><strong>robot_launch.py:</strong></p> <pre><code>import os import launch from launch import LaunchDescription from ament_index_python.packages import get_package_share_directory from webots_ros2_driver.webots_launcher import WebotsLauncher from webots_ros2_driver.webots_controller import WebotsController def generate_launch_description(): package_dir = get_package_share_directory('my_package') robot_description_path = os.path.join(package_dir, 'resource', 'my_robot.urdf') webots = WebotsLauncher( world=os.path.join(package_dir, 'worlds', 'my_world.wbt') ) my_robot_driver = WebotsController( robot_name='my_robot', parameters=[ {'robot_description': robot_description_path}, ] ) obstacle_avoider = Node( package='my_package', executable='obstacle_avoider', ) return LaunchDescription([ webots, my_robot_driver, obstacle_avoider, launch.actions.RegisterEventHandler( event_handler=launch.event_handlers.OnProcessExit( target_action=webots, on_exit=[launch.actions.EmitEvent(event=launch.events.Shutdown())], ) ) ]) </code></pre> <p><strong>setup.py:</strong></p> <pre><code>from setuptools import find_packages, setup package_name = 'my_package' data_files = [] data_files.append(('share/ament_index/resource_index/packages', ['resource/' + package_name])) data_files.append(('share/' + package_name + '/launch', ['launch/robot_launch.py'])) data_files.append(('share/' + package_name + '/worlds', ['worlds/my_world.wbt'])) data_files.append(('share/' + package_name + '/resource', ['resource/my_robot.urdf'])) data_files.append(('share/' + package_name, ['package.xml'])) setup( name=package_name, version='0.0.0', packages=[package_name], data_files=data_files, install_requires=['setuptools'], zip_safe=True, maintainer='user', maintainer_email='user.name@mail.com', description='TODO: Package description', license='TODO: License declaration', tests_require=['pytest'], entry_points={ 'console_scripts': [ 'my_robot_driver = my_package.my_robot_driver:main', 'obstacle_avoider = my_package.obstacle_avoider:main' ], }, ) </code></pre>
name 'Node' is not defined
<p>In general, it is preferred to create a new Message type, in your case something like <code>Area.msg</code>, and in your Service return a list of Areas.<br /> Then, in your client, you can print it out as you wish.</p> <p>You should be able though to send and print strings with new lines; remember, if your Service type looks like this:</p> <pre><code>--- string areas </code></pre> <p>then you need to print the <code>areas</code> variable:</p> <pre class="lang-py prettyprint-override"><code>print(response.areas) </code></pre>
104008
2023-09-08T09:07:42.150
|ros|ros-melodic|custom-message|services|
<p>I'm working on ROS MELODIC.</p> <p>I would like to return as a service response a string containing a list of areas with some data. The problem here is that I wanted to format the output so on the client side, the message could be seen clear such as:</p> <pre><code>Area {i}: Data &lt;...&gt; Area {i}: Data &lt;...&gt; </code></pre> <p>I have tried either with normal string or array (string[])</p> <p>So my problem here is that I can't print \n or something like that in order to see each element as a new line in the output on the client. I don't know if the problem is that this cannot be achieved through this (since the message response is printed as a list), or that I'm missing something.</p> <p>Also, feel free to correct me if I didn't write my post correctly, I do want to check all the recommendations but I wanted to post this so I can get an answer as soon as possible.</p>
Formatting rosservice response
<p>That functionality was only very recently merged, so probably the packages haven't been updated yet. If you can't wait for the updated packages, you can compile Gazebo from source. This is not particularly difficult, just follow <a href="https://gazebosim.org/docs/harmonic/install_ubuntu_src" rel="nofollow noreferrer">the instructions</a>.</p>
104009
2023-09-08T09:09:49.980
|gazebo|gazebo-plugin|
<p>Environment: OS: Linux Ubuntu 22.04 gazebo version: garden</p> <p>Problem: When I‘m following the tutorial <a href="https://github.com/gazebosim/gz-sim/blob/gz-sim7/tutorials/apply_force_torque.md" rel="nofollow noreferrer">here</a>, I can't find Apply Force Torque plugin <a href="https://i.stack.imgur.com/6xagN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6xagN.png" alt="enter image description here" /></a></p> <p>Does my gazebo need update or there's something wrong?</p>
Can't find Apply Force Torque plugin in gazebo garden
<p>Is your model listed under Models/AMR in gazebo?</p> <p>Have a look at ~/.gazebo/server-xxx/default.log</p> <p>I have the same behavior with your file, because I don't have access to the STL files. Maybe this is the problem with your setup, too</p> <pre><code>(1694588803 305452291) [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [model://AMR/meshes/base_link.STL] (1694588803 305476776) [Wrn] [SystemPaths.cc:459] File or path does not exist [&quot;&quot;] [model://AMR/meshes/base_link.STL] </code></pre>
104012
2023-09-08T12:16:04.330
|ros2|urdf|gazebo-11|spawn-model|
<p>I have the following AMR.urdf file</p> <pre class="lang-xml prettyprint-override"><code>&lt;robot name=&quot;AMR&quot;&gt; &lt;link name=&quot;base_footprint&quot;/&gt; &lt;joint name=&quot;base_joint&quot; type=&quot;fixed&quot;&gt; &lt;parent link=&quot;base_footprint&quot;/&gt; &lt;child link=&quot;base_link&quot;/&gt; &lt;origin xyz=&quot;0.0 0.0 0.21&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;/joint&gt; &lt;link name=&quot;base_link&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.001608 1.7089E-05 -0.037394&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;6.4118&quot; /&gt; &lt;inertia ixx=&quot;0.056928&quot; ixy=&quot;3.7366E-05&quot; ixz=&quot;-0.000651&quot; iyy=&quot;0.058024&quot; iyz=&quot;-1.0318E-08&quot; izz=&quot;0.091726&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/base_link.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.066666 0.003921 1 1&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/base_link.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;link name=&quot;lidar1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.0025954 0.00035629 -0.010164&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.02126&quot; /&gt; &lt;inertia ixx=&quot;2.4452E-06&quot; ixy=&quot;3.2059E-09&quot; ixz=&quot;-6.3369E-07&quot; iyy=&quot;3.8209E-06&quot; iyz=&quot;-1.2436E-08&quot; izz=&quot;4.3721E-06&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/lidar1.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0 0 0 1&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/lidar1.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;lidar_fixed1&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;-0.14596 -0.10031 -0.03&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;lidar1&quot; /&gt; &lt;axis xyz=&quot;0 0 0&quot; /&gt; &lt;/joint&gt; &lt;link name=&quot;lidar2&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.0025954 -0.00035629 -0.010164&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.02126&quot; /&gt; &lt;inertia ixx=&quot;2.4452E-06&quot; ixy=&quot;3.2059E-09&quot; ixz=&quot;6.3369E-07&quot; iyy=&quot;3.8209E-06&quot; iyz=&quot;1.2436E-08&quot; izz=&quot;4.3721E-06&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/lidar2.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0 0 0 1&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/lidar2.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;fixed_lidar2&quot; type=&quot;fixed&quot;&gt; &lt;origin xyz=&quot;0.14596 0.10031 -0.03&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;lidar2&quot; /&gt; &lt;axis xyz=&quot;0 0 0&quot; /&gt; &lt;/joint&gt; &lt;link name=&quot;right_wheel&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-7.7318E-07 0.0060585 0.1&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.051919&quot; /&gt; &lt;inertia ixx=&quot;3.4107E-05&quot; ixy=&quot;8.1903E-11&quot; ixz=&quot;1.0913E-12&quot; iyy=&quot;6.685E-05&quot; iyz=&quot;-6.5152E-14&quot; izz=&quot;3.4106E-05&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/right_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.2470 0.2196 0.2196 0.79&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/right_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;right_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.0025 -0.1013 -0.1&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;right_wheel&quot; /&gt; &lt;axis xyz=&quot;0 -1 0&quot; /&gt; &lt;!--&lt;limit effort=&quot;0&quot; velocity=&quot;0&quot; /&gt;--&gt; &lt;/joint&gt; &lt;link name=&quot;left_wheel&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-7.7318E-07 -0.0059585 0.1&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.051919&quot; /&gt; &lt;inertia ixx=&quot;3.4107E-05&quot; ixy=&quot;-8.1903E-11&quot; ixz=&quot;-1.0913E-12&quot; iyy=&quot;6.685E-05&quot; iyz=&quot;-6.5152E-14&quot; izz=&quot;3.4106E-05&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/left_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.2470 0.2196 0.2196 0.79&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/left_wheel.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;left_joint&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.0025 0.1012 -0.1&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;left_wheel&quot; /&gt; &lt;axis xyz=&quot;0 -1 0&quot; /&gt; &lt;!--&lt;limit effort=&quot;0&quot; velocity=&quot;0&quot; /&gt;--&gt; &lt;/joint&gt; &lt;link name=&quot;caster_wheel_1&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.01689 -6.9165E-05 -0.03779&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.033984&quot; /&gt; &lt;inertia ixx=&quot;5.8935E-06&quot; ixy=&quot;7.4544E-08&quot; ixz=&quot;-7.5376E-07&quot; iyy=&quot;1.1637E-05&quot; iyz=&quot;2.6501E-08&quot; izz=&quot;8.0534E-06&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/caster_wheel_1.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.2470 0.2196 0.2196 0.79&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/caster_wheel_1.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;caster_j1&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-0.096789 0.112 -0.1215&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;caster_wheel_1&quot; /&gt; &lt;axis xyz=&quot;0 0 1&quot; /&gt; &lt;/joint&gt; &lt;link name=&quot;caster_wheel_2&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.01689 -6.9165E-05 -0.03779&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.033984&quot; /&gt; &lt;inertia ixx=&quot;5.8935E-06&quot; ixy=&quot;7.4544E-08&quot; ixz=&quot;-7.5376E-07&quot; iyy=&quot;1.1637E-05&quot; iyz=&quot;2.6501E-08&quot; izz=&quot;8.0534E-06&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/caster_wheel_2.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.2470 0.2196 0.2196 0.79&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/caster_wheel_2.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;caster_j2&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;-0.096789 -0.112 -0.1215&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;caster_wheel_2&quot; /&gt; &lt;axis xyz=&quot;0 0 1&quot; /&gt; &lt;/joint&gt; &lt;link name=&quot;caster_wheel_3&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;0.01689 6.9165E-05 -0.03779&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;0.033984&quot; /&gt; &lt;inertia ixx=&quot;5.8935E-06&quot; ixy=&quot;7.4544E-08&quot; ixz=&quot;7.5376E-07&quot; iyy=&quot;1.1637E-05&quot; iyz=&quot;-2.6501E-08&quot; izz=&quot;8.0534E-06&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/caster_wheel_3.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.2470 0.2196 0.2196 0.79&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/caster_wheel_3.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;caster_j3&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.082915 0.11207 -0.1215&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;caster_wheel_3&quot; /&gt; &lt;axis xyz=&quot;0 0 1&quot; /&gt; &lt;/joint&gt; &lt;link name=&quot;caster_wheel_4&quot;&gt; &lt;inertial&gt; &lt;origin xyz=&quot;-0.001608 1.7089E-05 -0.037394&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;mass value=&quot;6.4118&quot; /&gt; &lt;inertia ixx=&quot;0.056928&quot; ixy=&quot;3.7366E-05&quot; ixz=&quot;-0.000651&quot; iyy=&quot;0.058024&quot; iyz=&quot;-1.0318E-08&quot; izz=&quot;0.091726&quot; /&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/caster_wheel_4.STL&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;&quot;&gt; &lt;color rgba=&quot;0.2470 0.2196 0.2196 0.79&quot; /&gt; &lt;/material&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0.05&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://AMR/meshes/caster_wheel_4.STL&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;caster_j4&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.082915 -0.11207 -0.1215&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;base_link&quot; /&gt; &lt;child link=&quot;caster_wheel_4&quot; /&gt; &lt;axis xyz=&quot;0 0 1&quot; /&gt; &lt;/joint&gt; &lt;/robot&gt; </code></pre> <p>I try to spawn the URDF into gazebo by following the command.</p> <p><code>ros2 run gazebo_ros spawn_entity.py -entity AMR -file /home/dell/catkin_ros2_ws/src/AMR/urdf/AMR.urdf -x 0 -y 0 -z 0</code></p> <pre><code>[INFO] [1694174949.993357631] [spawn_entity]: Spawn Entity started [INFO] [1694174949.993858462] [spawn_entity]: Loading entity XML from file /home/dell/catkin_ros2_ws/src/AMR/urdf/AMR.urdf [INFO] [1694174949.994878476] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30 [INFO] [1694174949.995208811] [spawn_entity]: Waiting for service /spawn_entity [INFO] [1694174949.999390617] [spawn_entity]: Calling service /spawn_entity [INFO] [1694174950.277502483] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [AMR] </code></pre> <p>Terminal show Successfully spawned but their is no robot spawn in gazebo <a href="https://i.stack.imgur.com/49Cht.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/49Cht.png" alt="IMAGE" /></a></p>
ros2 run gazebo_ros spawn_entity.py does not spawn urdf to gazebo
<p>I think that you're looking for the <a href="https://docs.ros.org/en/api/rosbag_storage/html/c++/classrosbag_1_1MessageInstance.html#a369b32708a1a8bdaad133a47152a4885" rel="nofollow noreferrer"><code>instantiate</code> method</a> on the rosbag <code>MessageInstance</code></p> <p>There's a very minimal example <a href="https://docs.ros.org/en/api/rosbag_storage/html/c++/" rel="nofollow noreferrer">here</a></p> <pre><code>BOOST_FOREACH(rosbag::MessageInstance const m, view) { std_msgs::Int32::ConstPtr i = m.instantiate&lt;std_msgs::Int32&gt;(); ... </code></pre> <p>And more examples <a href="http://wiki.ros.org/rosbag/Code%20API" rel="nofollow noreferrer">here</a> and a <a href="http://wiki.ros.org/rosbag/Cookbook" rel="nofollow noreferrer">cookbook of examples using the rosbag API</a>.</p>
104017
2023-09-08T15:08:48.130
|ros|c++|rosbag|
<p>I want to deserialize messages from a Bag file and publishing part of their contents with ROS for further processing.</p> <p>I read a bagfile with the ROS C++ API. I know exactly the content (topic names and types) of my messages at compile time, such that I want to deserialize it into common ROS defined classes (e.g. the ones defined here <a href="https://docs.ros.org/en/noetic/api/sensor_msgs/html/index-msg.html" rel="nofollow noreferrer">https://docs.ros.org/en/noetic/api/sensor_msgs/html/index-msg.html</a>) at runtime. Here some code:</p> <pre><code>#include &lt;rosbag/bag.h&gt; #include &lt;rosbag/view.h&gt; //other content rosbag::Bag bag; bag.open(&quot;foo.bag&quot;, rosbag::bagmode::Read); std::vector&lt;std::string&gt; topics{&quot;camera1/camera_info&quot;}; rosbag::View view(bag, rosbag::TopicQuery(topics)); for(auto const m : view) { const std::string&amp; topic_name = m.getTopic(); std::cout &lt;&lt; topic_name &lt;&lt; std::endl; std_msgs::String::ConstPtr s = m.instantiate&lt;std_msgs::String&gt;(); if (s != NULL) std::cout &lt;&lt; s-&gt;data &lt;&lt; std::endl; // I want the data in s as a string to be serialized into an instance // of the type CameraInfo located in // path/ros/distro/sensor_msgs/CameraInfo.h shipping with ROS. CameraInfo ci = is_there_any_os_solution(s); //? } bag.close(); </code></pre> <p>I tried to find something on this direction but I just found libraries deserializing contents unknown at compile time.</p> <p>Could anyone give some hints?</p>
How to deserialize ROS messages from Bag to ROS defined types in C++?
<p>I finally fixed it by increasing some parameters. Thank you so much for your answers ✌️</p> <p>Edit: I increased the loop search maximum distance: 10000</p>
104026
2023-09-08T22:55:13.793
|ros2|slam|
<p>It’s sometimes really frustrating. I used slam for a really big map and suddenly it didn’t scan the map correctly. So I had to start again. Yesterday i spended 30 min (the map is really big) and suddenly it duplicated the corridor I reconized that it failed at the same place.</p> <p>First try (picture): cooridor duplicated <a href="https://i.imgur.com/zb6wbuj.jpg" rel="nofollow noreferrer">https://i.imgur.com/zb6wbuj.jpg</a></p> <p>Second try(picture): robot supposed to be at the left not at the right (wrong position) <a href="https://i.imgur.com/aXEUqPS.jpg" rel="nofollow noreferrer">https://i.imgur.com/aXEUqPS.jpg</a></p> <p>Loop closure don’t work properly? <a href="https://i.imgur.com/zuLt32c.jpg" rel="nofollow noreferrer">https://i.imgur.com/zuLt32c.jpg</a></p> <p>My Problem:</p> <p>Everytime i tried to close the loop , the map shifting. I also tried cartographer but its also not working.</p> <p>Here are my parameters(config file):</p> <pre><code> slam_toolbox: ros__parameters: # Plugin params solver_plugin: solver_plugins::CeresSolver # solver_plugins::G2oSolver, solver_plugins::SpaSolver, solver_plugins::CeresSolver ceres_linear_solver: SPARSE_NORMAL_CHOLESKY # ITERATIVE_SCHUR, SPARSE_SCHUR, SPARSE_NORMAL_CHOLESKY ceres_preconditioner: JACOBI # IDENTITY, JACOBI, SCHUR_JACOBI ceres_trust_strategy: DOGLEG # LEVENBERG_MARQUARDT, DOGLEG ceres_dogleg_type: SUBSPACE_DOGLEG # TRADITIONAL_DOGLEG, SUBSPACE_DOGLEG ceres_loss_function: HuberLoss # None, HuberLoss, CauchyLoss # ROS Parameters odom_frame: odom map_frame: map base_frame: base_footprint scan_topic: /scan mode: mapping # mapping, localization # if you'd like to immediately start continuing a map at a given pose # or at the dock, but they are mutually exclusive, if pose is given # will use pose #map_file_name: test_steve # map_start_pose: [0.0, 0.0, 0.0] #map_start_at_dock: true debug_logging: false throttle_scans: 1 transform_publish_period: 0.01 #if 0 never publishes odometry map_update_interval: 1.0 resolution: 0.04 max_laser_range: 10.0 #for rastering images minimum_time_interval: 0.01 transform_timeout: 0.1 tf_buffer_duration: 10.0 stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps enable_interactive_mode: true # General Parameters use_scan_matching: true use_scan_barycenter: true minimum_travel_distance: 0.2 minimum_travel_heading: 0.2 scan_buffer_size: 25 scan_buffer_maximum_scan_distance: 5.0 link_match_minimum_response_fine: 0.1 link_scan_maximum_distance: 0.5 loop_search_maximum_distance: 3.0 do_loop_closing: true loop_match_minimum_chain_size: 10 loop_match_maximum_variance_coarse: 3.0 loop_match_minimum_response_coarse: 0.35 loop_match_minimum_response_fine: 0.45 # Correlation Parameters - Correlation Parameters correlation_search_space_dimension: 2.7 correlation_search_space_resolution: 0.0125 correlation_search_space_smear_deviation: 0.01 # Correlation Parameters - Loop Closure Parameters loop_search_space_dimension: 8.0 loop_search_space_resolution: 0.05 loop_search_space_smear_deviation: 0.03 # Scan Matcher Parameters distance_variance_penalty: 0.5 angle_variance_penalty: 0.01 fine_search_angle_offset: 0.00349 coarse_search_angle_offset: 0.349 coarse_angle_resolution: 0.0349 minimum_angle_penalty: 0.01 minimum_distance_penalty: 0.5 use_response_expansion: true </code></pre> <p>After these parameters didn't worked out fo me i tried to change some of them but unfortuneately it still not working:</p> <pre><code>slam_toolbox: ros__parameters: # Plugin params solver_plugin: solver_plugins::CeresSolver # solver_plugins::G2oSolver, solver_plugins::SpaSolver, solver_plugins::CeresSolver ceres_linear_solver: SPARSE_NORMAL_CHOLESKY # ITERATIVE_SCHUR, SPARSE_SCHUR, SPARSE_NORMAL_CHOLESKY ceres_preconditioner: JACOBI # IDENTITY, JACOBI, SCHUR_JACOBI ceres_trust_strategy: DOGLEG # LEVENBERG_MARQUARDT, DOGLEG ceres_dogleg_type: SUBSPACE_DOGLEG # TRADITIONAL_DOGLEG, SUBSPACE_DOGLEG ceres_loss_function: HuberLoss # None, HuberLoss, CauchyLoss # ROS Parameters odom_frame: odom map_frame: map base_frame: base_footprint scan_topic: /scan mode: mapping # mapping, localization # if you'd like to immediately start continuing a map at a given pose # or at the dock, but they are mutually exclusive, if pose is given # will use pose #map_file_name: test_steve # map_start_pose: [0.0, 0.0, 0.0] #map_start_at_dock: true debug_logging: false throttle_scans: 1 #transform_publish_period: 0.01 #if 0 never publishes odometry transform_publish_period: 0.02 #map_update_interval: 1.0 map_update_interval: 5.0 #resolution: 0.04 resolution: 0.05 #max_laser_range: 10.0 #for rastering images max_laser_range: 45.0 #minimum_time_interval: 0.01 minimum_time_interval: 0.5 #transform_timeout: 0.1 transform_timeout: 0.2 #tf_buffer_duration: 10.0 tf_buffer_duration: 30.0 stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps enable_interactive_mode: true # General Parameters use_scan_matching: true use_scan_barycenter: true minimum_travel_distance: 0.2 minimum_travel_heading: 0.2 #scan_buffer_size: 25 scan_buffer_size: 10 #scan_buffer_maximum_scan_distance: 5.0 scan_buffer_maximum_scan_distance: 10.0 link_match_minimum_response_fine: 0.1 #link_scan_maximum_distance: 0.5 link_scan_maximum_distance: 1.5 do_loop_closing: false #loop_match_minimum_chain_size: 10 loop_match_minimum_chain_size: 3 loop_match_maximum_variance_coarse: 3.0 loop_match_minimum_response_coarse: 0.35 loop_match_minimum_response_fine: 0.45 # Correlation Parameters - Correlation Parameters #correlation_search_space_dimension: 2.7 correlation_search_space_dimension: 0.5 correlation_search_space_resolution: 0.0125 #correlation_search_space_smear_deviation: 0.01 correlation_search_space_smear_deviation: 0.1 # Correlation Parameters - Loop Closure Parameters #loop_search_space_dimension: 8.0 loop_search_space_dimension: 7.0 loop_search_space_resolution: 0.05 loop_search_space_smear_deviation: 0.03 #loop_search_maximum_distance: 3.0 loop_search_maximum_distance: 5.0 # Scan Matcher Parameters distance_variance_penalty: 0.5 angle_variance_penalty: 0.01 angle_variance_penalty: 1.0 fine_search_angle_offset: 0.00349 coarse_search_angle_offset: 0.349 coarse_angle_resolution: 0.0349 minimum_angle_penalty: 0.01 minimum_angle_penalty: 0.9 minimum_distance_penalty: 0.5 use_response_expansion: true </code></pre> <p>Thank you for you attention and your time !</p>
ROS2 SLAM doesn’t scan the map properly
<p>Besides the heat of vaporisation noted by JRTG, realise you need to heat all the water to boiling point(or at least a significant portion of it), not just the amount of water that must be boiled. So at this point the energy requirements are roughly 1000x your initial.</p> <p>Also consider how quickly that assembly will lose heat to the environment. This will require more energy so you're well above 1000x initial.</p> <p>You can get the theoretical lowest value by using E = mGh. mass x gravity x distance moved vertically. That is the amount of energy added to the thing being lifted. That value assumes 100% efficiency and a massless actuator. I'm guessing that method as you describe it is less than 5% efficient.</p>
104032
2023-09-09T13:43:54.013
|air-muscle|
<p>There is a type of McKibben air-muscle called &quot;untethered artificial muscles&quot;, this type in specific has a liquid inside of it that is heated through an specific method, generating steam that in turn generates pressure inside the muscle, finally making an actuation.</p> <p><a href="https://youtu.be/lOAr2nK2NLI" rel="nofollow noreferrer">Here</a> is a video of an untethered artificial muscle that boils the water through magnetic induction.</p> <hr /> <p>I was trying to calculate how much energy I would need to input in one order to achieve full actuation. However, I used the unit of Calorie, which is a unit of energy required to heat 1 gram of water by 1ºC.</p> <p>And it gave me an incredibly low value of 0.06 watts to fully actuate the muscle, which seems unusually low, so I would like to double check.</p> <hr /> <p>So, assuming that a muscle with 1 inch of inner diameter and 30cm of length is full of water and a heating element, I would have more or less 0.152 liters of water.</p> <p>Since 1 liter of water generates 1600 liters of steam at room pressure, in order to make 0.152 liters 5 times to achieve 5 bar/atm of pressure, I would need 0.76 liters of steam.</p> <p>(1 liter of water)/ (1600 liters of steam) = (x liters of water) / (0.76 liters of steam)</p> <p>x = 0.000475 liters of water</p> <p>So, since to heat 1 gram of water in 1ºC I would need 1 calorie, this means that in order to heat 0.475 milliliters (or 0.475 grams) of water, I would need</p> <p>0.475x124 = 58.9 calories = 0,06845489 watt-hour of energy.</p> <p>The &quot;124&quot; comes from the heating of water from 27ºC to 150ºC, so an increase in 124 degrees. The 150 ºC is due to the fact that the boiling temperature of water increases to 150ºC at 5 atm/bar of pressure.</p> <hr /> <p>Does the math checks out or I'm really making some awful math mistake? I don't really know how else to check the math.</p>
How much Watt-hour would be necessary to fully actuate a thermal air-muscle?
<p>This appears to be a recent break with a particular version of setuptools which has been reported in <a href="https://github.com/pypa/setuptools/issues/4046" rel="nofollow noreferrer">pypa/setuptools#4046</a> and <a href="https://github.com/colcon/colcon-python-setup-py/issues/56" rel="nofollow noreferrer">colcon/colcon-python-setup-py#56</a>.</p> <p>A working mitigation is to upgrade the setuptools version in the ROS2 shell to <code>&gt;68.2.0</code> with the following command:</p> <pre class="lang-bash prettyprint-override"><code># replace iron with your installed version of ROS2 source /opt/ros/iron/local_setup.bash python3 -m pip install -U setuptools&gt;68.2.0 </code></pre> <p>After this, you should be able to build.</p>
104054
2023-09-11T10:12:39.410
|ros2|python|build|colcon|
<p>I am trying to build the example repository of ROS 2 Humble according to the <a href="https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Colcon-Tutorial.html#" rel="nofollow noreferrer">tutorial</a>. But the command <code>colcon build --symlink-install</code> gives the following error for all python packages. I am on Ubuntu 22.04.</p> <p>What could be the reason for that?</p> <pre><code>Failed &lt;&lt;&lt; examples_rclpy_pointcloud_publisher [0.86s, exited with code 1] --- stderr: launch_testing_examples Traceback (most recent call last): File &quot;/usr/lib/python3/dist-packages/colcon_core/executor/__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;/usr/lib/python3/dist-packages/colcon_core/task/__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;/usr/lib/python3/dist-packages/colcon_ros/task/ament_python/build.py&quot;, line 51, in build setup_py_data = get_setup_data(self.context.pkg, env) File &quot;/usr/lib/python3/dist-packages/colcon_core/task/python/__init__.py&quot;, line 20, in get_setup_data return dict(pkg.metadata[key](env)) File &quot;/usr/lib/python3/dist-packages/colcon_ros/package_augmentation/ros_ament_python.py&quot;, line 57, in getter return get_setup_information( File &quot;/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py&quot;, line 241, in get_setup_information _setup_information_cache[hashable_env] = _get_setup_information( File &quot;/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py&quot;, line 293, in _get_setup_information return ast.literal_eval(output) File &quot;/usr/lib/python3.10/ast.py&quot;, line 64, in literal_eval node_or_string = parse(node_or_string.lstrip(&quot; \t&quot;), mode='eval') File &quot;/usr/lib/python3.10/ast.py&quot;, line 50, in parse return compile(source, filename, mode, flags, File &quot;&lt;unknown&gt;&quot;, line 1 {'package_data': {}, 'dist_files': [], 'src_root': None, 'dependency_links': [], 'setup_requires': [], 'eager_resources': None, 'entry_points': {'console_scripts': []}, 'exclude_package_data': None, 'extras_require': {}, 'include_package_data': None, 'install_requires': ['setuptools'], 'namespace_packages': None, 'packages': ['launch_testing_examples'], 'python_requires': None, 'test_loader': None, 'test_runner': None, 'test_suite': None, 'tests_require': ['pytest'], 'use_2to3': None, 'zip_safe': True, 'verbose': 1, 'dry_run': 0, 'help': 0, 'command_packages': None, 'script_name': 'setup.py', 'script_args': ['--dry-run'], 'command_options': {'develop': {'script_dir': ('setup.cfg', '<span class="math-container">$base/lib/launch_testing_examples')}, 'install': {'install_scripts': ('setup.cfg', '$</span>base/lib/launch_testing_examples')}}, 'package_dir': {}, 'py_modules': None, 'libraries': None, 'headers': None, 'ext_package': None, 'include_dirs': None, 'extra_path': None, 'scripts': None, 'data_files': [('share/ament_index/resource_index/packages', ['resource/launch_testing_examples']), ('share/launch_testing_examples', ['package.xml'])], 'password': '', 'command_obj': {}, 'have_run': {}, 'want_user_cfg': True, 'metadata': {'name': 'launch_testing_examples', 'version': '0.15.1', 'author': None, 'author_email': None, 'maintainer': 'Aditya Pande, Shane Loretz', 'maintainer_email': 'aditya.pande@openrobotics.org, shane@openrobotics.org', 'url': None, 'license': 'Apache License 2.0', 'description': 'Examples of simple launch tests', 'long_description': None, 'keywords': None, 'platforms': None, 'classifiers': None, 'download_url': None, 'provides': None, 'requires': None, 'obsoletes': None, 'long_description_content_type': None, 'project_urls': {}, 'license_file': None, '_normalized_install_requires': {'setuptools': &lt;Requirement('setuptools')&gt;}, '_normalized_extras_require': {}}} ^ SyntaxError: invalid syntax </code></pre> <p>I reinstalled ROS 2 but it did not resolve the problem. What else could I try?</p>
Building example library of ROS 2
<p>You forgot</p> <pre><code>from launch_ros.actions import Node </code></pre> <p>in your <em>robot_launch.py</em> file</p>
104068
2023-09-11T19:41:04.157
|ros2|webots|
<p>we are working on Webots environment with ROS2. when we launched the following example in the Webots-ros2 tutorial, we got the following error, could you help us to overcome that problem, thanks.</p> <p>The example link: <a href="https://docs.ros.org/en/humble/Tutorials/Advanced/Simulators/Webots/Setting-Up-Simulation-Webots-Advanced.html" rel="nofollow noreferrer">Setting up a robot simulation (Advanced)</a></p> <p><strong>ntukenmez3@ae-icps-407120:~/ros2_ws/src$</strong> <code>ros2 launch my_package robot_launch.py</code></p> <pre><code>[INFO] [launch]: All log files can be found below /home/ntukenmez3/.ros/log/2023-09-07-17-39-57-599365-ae-icps-407120-1653965 [INFO] [launch]: Default logging verbosity is set to INFO WARNING: No valid Webots directory specified in `ROS2_WEBOTS_HOME` and `WEBOTS_HOME`, fallback to default installation folder /usr/local/webots. [ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: name 'Node' is not defined </code></pre> <hr /> <p><strong>my_robot_driver.py:</strong></p> <pre><code>import rclpy from geometry_msgs.msg import Twist HALF_DISTANCE_BETWEEN_WHEELS = 0.045 WHEEL_RADIUS = 0.025 class MyRobotDriver: def init(self, webots_node, properties): self.__robot = webots_node.robot self.__left_motor = self.__robot.getDevice('left wheel motor') self.__right_motor = self.__robot.getDevice('right wheel motor') self.__left_motor.setPosition(float('inf')) self.__left_motor.setVelocity(0) self.__right_motor.setPosition(float('inf')) self.__right_motor.setVelocity(0) self.__target_twist = Twist() rclpy.init(args=None) self.__node = rclpy.create_node('my_robot_driver') self.__node.create_subscription(Twist, 'cmd_vel', self.__cmd_vel_callback, 1) def __cmd_vel_callback(self, twist): self.__target_twist = twist def step(self): rclpy.spin_once(self.__node, timeout_sec=0) forward_speed = self.__target_twist.linear.x angular_speed = self.__target_twist.angular.z command_motor_left = (forward_speed - angular_speed * HALF_DISTANCE_BETWEEN_WHEELS) / WHEEL_RADIUS command_motor_right = (forward_speed + angular_speed * HALF_DISTANCE_BETWEEN_WHEELS) / WHEEL_RADIUS self.__left_motor.setVelocity(command_motor_left) self.__right_motor.setVelocity(command_motor_right) </code></pre> <p><strong>obstacle_avoider.py:</strong></p> <pre><code>import rclpy from rclpy.node import Node from sensor_msgs.msg import Range from geometry_msgs.msg import Twist MAX_RANGE = 0.15 class ObstacleAvoider(Node): def __init__(self): super().__init__('obstacle_avoider') self.__publisher = self.create_publisher(Twist, 'cmd_vel', 1) self.create_subscription(Range, 'left_sensor', self.__left_sensor_callback, 1) self.create_subscription(Range, 'right_sensor', self.__right_sensor_callback, 1) def __left_sensor_callback(self, message): self.__left_sensor_value = message.range def __right_sensor_callback(self, message): self.__right_sensor_value = message.range command_message = Twist() command_message.linear.x = 0.1 if self.__left_sensor_value &lt; 0.9 * MAX_RANGE or self.__right_sensor_value &lt; 0.9 * MAX_RANGE: command_message.angular.z = -2.0 self.__publisher.publish(command_message) def main(args=None): rclpy.init(args=args) avoider = ObstacleAvoider() rclpy.spin(avoider) # Destroy the node explicitly # (optional - otherwise it will be done automatically # when the garbage collector destroys the node object) avoider.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p><strong>my_robot.urdf:</strong></p> <pre><code>&lt;?xml version=&quot;1.0&quot; ?&gt; &lt;robot name=&quot;My robot&quot;&gt; &lt;webots&gt; &lt;device reference=&quot;ds0&quot; type=&quot;DistanceSensor&quot;&gt; &lt;ros&gt; &lt;topicName&gt;/left_sensor&lt;/topicName&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;/ros&gt; &lt;/device&gt; &lt;device reference=&quot;ds1&quot; type=&quot;DistanceSensor&quot;&gt; &lt;ros&gt; &lt;topicName&gt;/right_sensor&lt;/topicName&gt; &lt;alwaysOn&gt;true&lt;/alwaysOn&gt; &lt;/ros&gt; &lt;/device&gt; &lt;plugin type=&quot;my_package.my_robot_driver.MyRobotDriver&quot; /&gt; &lt;/webots&gt; &lt;/robot&gt; </code></pre> <p><strong>robot_launch.py:</strong></p> <pre><code>import os import launch from launch import LaunchDescription from ament_index_python.packages import get_package_share_directory from webots_ros2_driver.webots_launcher import WebotsLauncher from webots_ros2_driver.webots_controller import WebotsController def generate_launch_description(): package_dir = get_package_share_directory('my_package') robot_description_path = os.path.join(package_dir, 'resource', 'my_robot.urdf') webots = WebotsLauncher( world=os.path.join(package_dir, 'worlds', 'my_world.wbt') ) my_robot_driver = WebotsController( robot_name='my_robot', parameters=[ {'robot_description': robot_description_path}, ] ) obstacle_avoider = Node( package='my_package', executable='obstacle_avoider', ) return LaunchDescription([ webots, my_robot_driver, obstacle_avoider, launch.actions.RegisterEventHandler( event_handler=launch.event_handlers.OnProcessExit( target_action=webots, on_exit=[launch.actions.EmitEvent(event=launch.events.Shutdown())], ) ) ]) </code></pre> <p><strong>setup.py:</strong></p> <pre><code>from setuptools import find_packages, setup package_name = 'my_package' data_files = [] data_files.append(('share/ament_index/resource_index/packages', ['resource/' + package_name])) data_files.append(('share/' + package_name + '/launch', ['launch/robot_launch.py'])) data_files.append(('share/' + package_name + '/worlds', ['worlds/my_world.wbt'])) data_files.append(('share/' + package_name + '/resource', ['resource/my_robot.urdf'])) data_files.append(('share/' + package_name, ['package.xml'])) setup( name=package_name, version='0.0.0', packages=[package_name], data_files=data_files, install_requires=['setuptools'], zip_safe=True, maintainer='user', maintainer_email='user.name@mail.com', description='TODO: Package description', license='TODO: License declaration', tests_require=['pytest'], entry_points={ 'console_scripts': [ 'my_robot_driver = my_package.my_robot_driver:main', 'obstacle_avoider = my_package.obstacle_avoider:main' ], }, ) </code></pre>
ROS2: name 'Node' is not defined
<p>A plugin for a ros node (which rviz is) is usually not built using an isolated build. I suggest that you review the <code>TeleopPanel</code> rviz tutorial at this url (but ignore the part where it refers to the older <code>rosmake</code> command):</p> <p><a href="http://docs.ros.org/en/kinetic/api/rviz_plugin_tutorials/html/" rel="nofollow noreferrer">http://docs.ros.org/en/kinetic/api/rviz_plugin_tutorials/html/</a></p> <p>The fully buildable code is available at:</p> <p><a href="https://github.com/ros-visualization/visualization_tutorials.git" rel="nofollow noreferrer">https://github.com/ros-visualization/visualization_tutorials.git</a></p> <p>It builds with catkin_make. Make sure you are using the correct branch e.g. noetic-devel.</p>
104073
2023-09-12T07:54:50.107
|ros-noetic|qtcreator|qt5|rviz-plugins|
<p>I'm having trouble making Rviz teleop plugin using Qtcreator. I'm using Noetic and Ubuntu 20.04.</p> <p>The codes is not complete yet, for now I just want to see teleop GUI on Rviz. I'm using <code>catkin_make_isolated --install</code> build system</p> <p>Error message: <code>[ERROR] [1694503592.866043597]: PluginlibFactory: The plugin for class 'rviz_teleop_plugin/QtTeleopPanel' failed to load. Error: Could not find library corresponding to plugin rviz_teleop_plugin/QtTeleopPanel. Make sure the plugin description XML file has the correct name of the library and that the library actually exists. </code></p> <p>files: package name: rviz_teleop_plugin</p> <ol> <li>CMakeLists.txt</li> <li>package.xml</li> <li>plugin_description.xml</li> <li>src/qt_teleop_ui,cpp</li> <li>include/rviz_teleop_plugin/qt_teleop_ui.h</li> </ol> <pre><code>cmake_minimum_required(VERSION 3.0.2) project(rviz_teleop_plugin) find_package(catkin REQUIRED COMPONENTS geometry_msgs nav_msgs roscpp rospy rviz sensor_msgs std_msgs ) find_package(Qt5 COMPONENTS Core Widgets REQUIRED) find_package(Qt5Widgets REQUIRED) find_package(Qt5Core REQUIRED) find_package(Qt5OpenGL REQUIRED) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} -fPIC&quot;) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(QT_LIBRARIES Qt5::Widgets) add_definitions(-DQT_NO_KEYWORDS) catkin_package( INCLUDE_DIRS include LIBRARIES rviz_teleop_plugin CATKIN_DEPENDS geometry_msgs nav_msgs roscpp rospy rviz sensor_msgs std_msgs # DEPENDS system_lib ) include_directories( include <span class="math-container">${catkin_INCLUDE_DIRS} $</span>{Qt5Widgets_INCLUDE_DIRS} ) link_directories(${catkin_LIBRARY_DIRS}) qt5_wrap_cpp(MOC_FILES include/rviz_teleop_plugin/qt_teleop_ui.h ) set(SOURCE_FILES src/qt_teleop_ui.cpp ${MOC_FILES} ) add_library(<span class="math-container">${PROJECT_NAME} $</span>{SOURCE_FILES} ) add_dependencies(rviz_teleop_plugin <span class="math-container">${PROJECT_NAME_EXPORTED_TARGETS} $</span>{catkin_EXPORTED_TARGETS}) target_link_libraries(<span class="math-container">${PROJECT_NAME} Qt5::Widgets $</span>{QT_LIBRARIES} ${catkin_LIBRARIES} ) install(TARGETS <span class="math-container">${PROJECT_NAME} ARCHIVE DESTINATION $</span>{CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION <span class="math-container">${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION $</span>{CATKIN_PACKAGE_BIN_DESTINATION} ) install(DIRECTORY include/<span class="math-container">${PROJECT_NAME}/ rviz DESTINATION $</span>{CATKIN_PACKAGE_INCLUDE_DESTINATION} ) install(FILES plugin_description.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) set_target_properties(rviz_teleop_plugin PROPERTIES OUTPUT_NAME &quot;rviz_teleop_plugin&quot;) </code></pre> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;package format=&quot;2&quot;&gt; &lt;name&gt;rviz_teleop_plugin&lt;/name&gt; &lt;version&gt;0.0.0&lt;/version&gt; &lt;description&gt;The rviz_teleop_plugin package&lt;/description&gt; &lt;maintainer email=&quot;cabmintt@gmail.com&quot;&gt;minseojeong&lt;/maintainer&gt; &lt;license&gt;TODO&lt;/license&gt; &lt;buildtool_depend&gt;catkin&lt;/buildtool_depend&gt; &lt;build_depend&gt;geometry_msgs&lt;/build_depend&gt; &lt;build_depend&gt;nav_msgs&lt;/build_depend&gt; &lt;build_depend&gt;roscpp&lt;/build_depend&gt; &lt;build_depend&gt;rospy&lt;/build_depend&gt; &lt;build_depend&gt;rviz&lt;/build_depend&gt; &lt;build_depend&gt;sensor_msgs&lt;/build_depend&gt; &lt;build_depend&gt;std_msgs&lt;/build_depend&gt; &lt;build_depend&gt;qt_gui_cpp&lt;/build_depend&gt; &lt;build_depend&gt;qtbase5-dev&lt;/build_depend&gt; &lt;build_depend&gt;libqt5-core&lt;/build_depend&gt; &lt;build_depend&gt;libqt5-gui&lt;/build_depend&gt; &lt;build_depend&gt;libqt5-widgets&lt;/build_depend&gt; &lt;build_export_depend&gt;geometry_msgs&lt;/build_export_depend&gt; &lt;build_export_depend&gt;nav_msgs&lt;/build_export_depend&gt; &lt;build_export_depend&gt;roscpp&lt;/build_export_depend&gt; &lt;build_export_depend&gt;rospy&lt;/build_export_depend&gt; &lt;build_export_depend&gt;rviz&lt;/build_export_depend&gt; &lt;build_export_depend&gt;sensor_msgs&lt;/build_export_depend&gt; &lt;build_export_depend&gt;std_msgs&lt;/build_export_depend&gt; &lt;build_export_depend&gt;qt_gui_cpp&lt;/build_export_depend&gt; &lt;build_export_depend&gt;qtbase5-dev&lt;/build_export_depend&gt; &lt;build_export_depend&gt;libqt5-core&lt;/build_export_depend&gt; &lt;build_export_depend&gt;libqt5-gui&lt;/build_export_depend&gt; &lt;build_export_depend&gt;libqt5-widgets&lt;/build_export_depend&gt; &lt;exec_depend&gt;geometry_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;nav_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;roscpp&lt;/exec_depend&gt; &lt;exec_depend&gt;rospy&lt;/exec_depend&gt; &lt;exec_depend&gt;rviz&lt;/exec_depend&gt; &lt;exec_depend&gt;sensor_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;std_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;qt_gui_cpp&lt;/exec_depend&gt; &lt;exec_depend&gt;qtbase5-dev&lt;/exec_depend&gt; &lt;exec_depend&gt;libqt5-core&lt;/exec_depend&gt; &lt;exec_depend&gt;libqt5-gui&lt;/exec_depend&gt; &lt;exec_depend&gt;libqt5-widgets&lt;/exec_depend&gt; &lt;export&gt; &lt;rviz plugin=&quot;${prefix}/plugin_description.xml&quot;/&gt; &lt;/export&gt; &lt;/package&gt; </code></pre> <pre><code>&lt;!-- &lt;library path=&quot;lib/librviz_teleop_plugin&quot;&gt; --&gt; &lt;library path=&quot;install_isolated/lib/librviz_teleop_plugin.so&quot;&gt; &lt;class name=&quot;rviz_teleop_plugin/QtTeleopPanel&quot; type=&quot;rviz_teleop_plugin::QtTeleopPanel&quot; base_class_type=&quot;rviz::Panel&quot;&gt; &lt;description&gt; A Teleop Panel to control the robot. &lt;/description&gt; &lt;qtgui&gt; &lt;name&gt;rviz_teleop_plugin/QtTeleopPanel&lt;/name&gt; &lt;class&gt;rviz_teleop_plugin::QtTeleopPanel&lt;/class&gt; &lt;label&gt;Teleop Panel&lt;/label&gt; &lt;/qtgui&gt; &lt;/class&gt; &lt;/library&gt; </code></pre> <pre><code>#include &lt;QtWidgets/QVBoxLayout&gt; #include &lt;QtWidgets/QApplication&gt; #include &lt;QtWidgets/QLabel&gt; #include &lt;QtWidgets/QDoubleSpinBox&gt; // #include &lt;QtWidgets/QPainter&gt; // #include &lt;QtWidgets/QLineEdit&gt; #include &lt;QtCore/QVariant&gt; #include &lt;QtWidgets/QAction&gt; #include &lt;QtWidgets/QMainWindow&gt; #include &lt;QtWidgets/QMenu&gt; #include &lt;QtWidgets/QMenuBar&gt; #include &lt;QtWidgets/QPushButton&gt; #include &lt;QtWidgets/QStatusBar&gt; #include &lt;QtWidgets/QWidget&gt; #include &lt;QtWidgets/QSlider&gt; #include &lt;ros/ros.h&gt; #include &lt;geometry_msgs/Twist.h&gt; // #include &lt;rviz/panel.h&gt; #include &quot;rviz_teleop_plugin/qt_teleop_ui.h&quot; class QtTeleopPanel; namespace rviz_teleop_plugin { QtTeleopPanel::QtTeleopPanel(QWidget* parent) : rviz::Panel(parent), // : QWidget(parent), nh_(&quot;~&quot;), cmd_vel_pub_(nh_.advertise&lt;geometry_msgs::Twist&gt;(&quot;cmd_vel&quot;, 1)) { QVBoxLayout* layout = new QVBoxLayout; QLabel* X_label = new QLabel(&quot;X ::&quot;); QDoubleSpinBox* X_doubleSpinBox = new QDoubleSpinBox; X_doubleSpinBox-&gt;setMaximum(1.0); X_doubleSpinBox-&gt;setSingleStep(0.01); QLabel* Y_label = new QLabel(&quot;Y ::&quot;); QDoubleSpinBox* Y_doubleSpinBox = new QDoubleSpinBox; Y_doubleSpinBox-&gt;setMaximum(1.0); Y_doubleSpinBox-&gt;setSingleStep(0.01); QPushButton* Send_Button = new QPushButton(&quot;Send&quot;); QPushButton* Up_Button = new QPushButton(&quot;UP&quot;); QPushButton* Stop_Button = new QPushButton(&quot;Stop&quot;); QPushButton* Down_Button = new QPushButton(&quot;Down&quot;); QPushButton* Left_Button = new QPushButton(&quot;Left&quot;); QPushButton* Right_Button = new QPushButton(&quot;Right&quot;); QLabel* Linear_label = new QLabel(&quot;Linear vel&quot;); QDoubleSpinBox* Linear_doubleSpinBox = new QDoubleSpinBox; Linear_doubleSpinBox-&gt;setMaximum(1.0); Linear_doubleSpinBox-&gt;setSingleStep(0.01); QLabel* Angular_label = new QLabel(&quot;Angular vel&quot;); QDoubleSpinBox* Angular_doubleSpinBox = new QDoubleSpinBox; Angular_doubleSpinBox-&gt;setMaximum(1.0); Angular_doubleSpinBox-&gt;setSingleStep(0.1); layout-&gt;addWidget(X_label); layout-&gt;addWidget(X_doubleSpinBox); layout-&gt;addWidget(Y_label); layout-&gt;addWidget(Y_doubleSpinBox); layout-&gt;addWidget(Send_Button); layout-&gt;addWidget(Up_Button); layout-&gt;addWidget(Stop_Button); layout-&gt;addWidget(Down_Button); layout-&gt;addWidget(Left_Button); layout-&gt;addWidget(Right_Button); layout-&gt;addWidget(Linear_label); layout-&gt;addWidget(Linear_doubleSpinBox); layout-&gt;addWidget(Angular_label); layout-&gt;addWidget(Angular_doubleSpinBox); QWidget::setLayout(layout); QObject::connect(Up_Button, SIGNAL(clicked()), this, SLOT(on_Up_Button_pressed())); QObject::connect(Down_Button, SIGNAL(clicked()), this, SLOT(on_Down_Button_pressed())); QObject::connect(Left_Button, SIGNAL(clicked()), this, SLOT(on_Left_Button_pressed())); QObject::connect(Right_Button, SIGNAL(clicked()), this, SLOT(on_Right_Button_pressed())); QObject::connect(Stop_Button, SIGNAL(clicked()), this, SLOT(on_Stop_Button_pressed())); QObject::connect(Send_Button, SIGNAL(clicked(bool)), this, SLOT(on_Send_Button_clicked(bool))); QObject::connect(X_doubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(on_X_doubleSpinBox_valueChanged(double))); QObject::connect(Y_doubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(on_Y_doubleSpinBox_valueChanged(double))); QObject::connect(Linear_doubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(on_Linear_doubleSpinBox_valueChanged(double))); QObject::connect(Angular_doubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(on_Angular_doubleSpinBox_valueChanged(double))); } void QtTeleopPanel::on_Up_Button_pressed() { geometry_msgs::Twist cmd_vel; cmd_vel.linear.x = this-&gt;Linear_doubleSpinBox-&gt;value(); cmd_vel.angular.z = this-&gt;Angular_doubleSpinBox-&gt;value(); cmd_vel_pub_.publish(cmd_vel); } void QtTeleopPanel::on_Down_Button_pressed() { geometry_msgs::Twist cmd_vel; cmd_vel.linear.x = -this-&gt;Linear_doubleSpinBox-&gt;value(); cmd_vel.angular.z = -this-&gt;Angular_doubleSpinBox-&gt;value(); cmd_vel_pub_.publish(cmd_vel); } void QtTeleopPanel::on_Left_Button_pressed() { geometry_msgs::Twist cmd_vel; cmd_vel.linear.x = 0.0; cmd_vel.angular.z = this-&gt;Angular_doubleSpinBox-&gt;value(); cmd_vel_pub_.publish(cmd_vel); } void QtTeleopPanel::on_Right_Button_pressed() { geometry_msgs::Twist cmd_vel; cmd_vel.linear.x = 0.0; cmd_vel.angular.z = -this-&gt;Angular_doubleSpinBox-&gt;value(); cmd_vel_pub_.publish(cmd_vel); } void QtTeleopPanel::on_Stop_Button_pressed() { geometry_msgs::Twist cmd_vel; cmd_vel.linear.x = 0.0; cmd_vel.angular.z = 0.0; cmd_vel_pub_.publish(cmd_vel); } void QtTeleopPanel::on_Send_Button_clicked(bool checked) { } void QtTeleopPanel::on_X_doubleSpinBox_valueChanged(double arg1) { } void QtTeleopPanel::on_Y_doubleSpinBox_valueChanged(double arg1) { } void QtTeleopPanel::on_Linear_doubleSpinBox_valueChanged(double arg1) { } void QtTeleopPanel::on_Angular_doubleSpinBox_valueChanged(double arg1) { } } // namespae #include &lt;pluginlib/class_list_macros.h&gt; PLUGINLIB_EXPORT_CLASS(rviz_teleop_plugin::QtTeleopPanel, rviz::Panel) </code></pre> <pre><code>/******************************************************************************** ** Form generated from reading UI file 'qt_teleop.ui' ** ** Created by: Qt User Interface Compiler version 5.12.8 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ // #ifndef QT_TELEOP_UI_H // #define QT_TELEOP_UI_H #ifndef QT_TELEOP_UI_H #define QT_TELEOP_UI_H #include &lt;QtCore/QVariant&gt; #include &lt;QtWidgets/QAction&gt; #include &lt;QtWidgets/QApplication&gt; #include &lt;QtWidgets/QDoubleSpinBox&gt; #include &lt;QtWidgets/QLabel&gt; #include &lt;QtWidgets/QMainWindow&gt; #include &lt;QtWidgets/QMenu&gt; #include &lt;QtWidgets/QMenuBar&gt; #include &lt;QtWidgets/QPushButton&gt; #include &lt;QtWidgets/QStatusBar&gt; #include &lt;QtWidgets/QWidget&gt; #include &lt;QtWidgets/QSlider&gt; #include &lt;QtWidgets/QVBoxLayout&gt; #include &lt;ros/ros.h&gt; #include &lt;geometry_msgs/Twist.h&gt; #include &lt;rviz/panel.h&gt; // QT_BEGIN_NAMESPACE namespace rviz_teleop_plugin { // class QtTeleopPanel : public QWidget class QtTeleopPanel : public rviz::Panel { Q_OBJECT public: QtTeleopPanel(QWidget *parent = 0); // ~QtTeleopPanel(); public Q_SLOTS: void on_Up_Button_pressed(); void on_Down_Button_pressed(); void on_Left_Button_pressed(); void on_Right_Button_pressed(); void on_Stop_Button_pressed(); void on_Send_Button_clicked(bool checked); void on_X_doubleSpinBox_valueChanged(double arg1); void on_Y_doubleSpinBox_valueChanged(double arg1); void on_Linear_doubleSpinBox_valueChanged(double arg1); void on_Angular_doubleSpinBox_valueChanged(double arg1); private: ros::NodeHandle nh_; ros::Publisher cmd_vel_pub_; QWidget *centralwidget; QLabel *X_label; QDoubleSpinBox *X_doubleSpinBox; QLabel *Y_label; QDoubleSpinBox *Y_doubleSpinBox; QPushButton *Send_Button; QPushButton *Up_Button; QPushButton *Stop_Button; QPushButton *Down_Button; QPushButton *Left_Button; QPushButton *Right_Button; QDoubleSpinBox *Linear_doubleSpinBox; QLabel *Linear_label; QLabel *Angular_label; QDoubleSpinBox *Angular_doubleSpinBox; QMenuBar *menubar; QMenu *menuteleop_panel; QStatusBar *statusbar; }; } // end namespace // QT_END_NAMESPACE #endif // QT_TELEOP_UI_H </code></pre>
[ROS1 Noetic]Qt5 Rviz plugin
<p>So, I found an answer:</p> <p>There is option in SolidWorks - add origin of coordinate.</p> <p><a href="https://i.stack.imgur.com/VmCuY.png" rel="nofollow noreferrer" title="Add origin of coordinate"><img src="https://i.stack.imgur.com/VmCuY.png" alt="Add origin of coordinate" title="Add origin of coordinate" /></a></p> <p>You can choose initial point and axises.</p> <p><a href="https://i.stack.imgur.com/qfsXE.png" rel="nofollow noreferrer" title="Choose initial point and axes"><img src="https://i.stack.imgur.com/qfsXE.png" alt="Choose initial point and axes" title="Choose initial point and axes" /></a></p> <p>And as you save file as .stl,</p> <p><a href="https://i.stack.imgur.com/PxYVD.png" rel="nofollow noreferrer" title="Save file as .stl"><img src="https://i.stack.imgur.com/PxYVD.png" alt="Save file as .stl" title="Save file as .stl" /></a></p> <p>In options, at the bottom of window, you can choose your new origin of coordinate.</p> <p><a href="https://i.stack.imgur.com/CElS8.png" rel="nofollow noreferrer" title="Choose your new origin of coordinate"><img src="https://i.stack.imgur.com/CElS8.png" alt="Choose your new origin of coordinate" title="Choose your new origin of coordinate" /></a></p>
104075
2023-09-12T08:40:38.183
|ros|xacro|ros-noetic|solidworks|tf|
<p>I'm having troubles with model origin of coordinates location in relation to STL models. All ones are outside the models. I tried to move it to center of mass in SolidWorks, but it didn't fix the problem. It causes different issues like my wheels spin around origin of coordinates, not around own axis.</p> <p>It's my wheel xacro:</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;robot name=&quot;pushkin&quot; xmlns:xacro=&quot;http://www.ros.org/wiki/xacro&quot;&gt; &lt;!-- right_wheel --&gt; &lt;link name=&quot;pushkin_right_wheel&quot;&gt; &lt;inertial&gt; &lt;!-- &lt;origin xyz=&quot;1.9255E-10 -0.00056576 1.0414E-10&quot; rpy=&quot;0 0 0&quot;/&gt; --&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;mass value=&quot;0.050464&quot;/&gt; &lt;inertia ixx=&quot;2.0701E-05&quot; ixy=&quot;3.8089E-14&quot; ixz=&quot;-1.3584E-15&quot; iyy=&quot;3.5827E-05&quot; iyz=&quot;2.1838E-15&quot; izz=&quot;2.0701E-05&quot;/&gt; &lt;/inertial&gt; &lt;visual&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://pushkin_description/meshes/pushkin_right_wheel.STL&quot; scale=&quot;0.01 0.01 0.01&quot; /&gt; &lt;/geometry&gt; &lt;material name=&quot;Green&quot; /&gt; &lt;/visual&gt; &lt;collision&gt; &lt;origin xyz=&quot;0 0 0&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;geometry&gt; &lt;mesh filename=&quot;package://pushkin_description/meshes/pushkin_right_wheel.STL&quot; scale=&quot;0.01 0.01 0.01&quot; /&gt; &lt;/geometry&gt; &lt;/collision&gt; &lt;/link&gt; &lt;joint name=&quot;right_wheel_to_base&quot; type=&quot;continuous&quot;&gt; &lt;origin xyz=&quot;0.11 0.5137 -0.135&quot; rpy=&quot;0 0 0&quot; /&gt; &lt;parent link=&quot;pushkin_base&quot; /&gt; &lt;child link=&quot;pushkin_right_wheel&quot; /&gt; &lt;axis xyz=&quot;0 1 0&quot; /&gt; &lt;/joint&gt; &lt;/robot&gt; </code></pre> <p><a href="https://i.stack.imgur.com/mRFf2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mRFf2.png" alt="origins of coordinates are outside the models" /></a></p>
ROS Noetic. How can I manage origin of coordinates for each STL model in Rviz?
<p>The answer is in the <a href="https://colcon.readthedocs.io/en/released/developer/environment.html#workspace-level" rel="nofollow noreferrer">colcon documentation</a>:</p> <ul> <li><code>local_setup.bash</code> adds only that workspace to <code>COLCON_PREFIX_PATH</code>,</li> <li><code>setup.bash</code> adds all workspaces to <code>COLCON_PREFIX_PATH</code> that were in the <code>COLCON_PREFIX_PATH</code> at the time of build.</li> </ul> <p>So my best practice is to:</p> <ul> <li>Open a separate terminal to compile,</li> <li>Source only those workspaces that are strictly needed,</li> <li>Use that terminal only to compile.</li> </ul> <p>This avoids that I recompiled in a terminal where I had sourced other workspaces (e.g. PlotJuggler) and then all of these other workspaces unnecessarily end up in the <code>setup.bash</code>.</p>
104076
2023-09-12T08:43:19.680
|ros2|colcon|setup.bash|
<p>I recently found (to my great surprise) that upon issuing '<code>source install/setup.bash</code>' for my ROS 2 install (built from source), that both Gazebo Sim and ros_gz_bridge were also sourced automatically.</p> <p>So I had a look at the ROS 2 <code>install/setup.bash</code> script, and indeed it mentions:</p> <pre><code># This script extends the environment with the environment of other prefix # paths which were sourced when this file was generated as well as all packages # contained in this prefix path. </code></pre> <p>So probably I did the following:</p> <ul> <li>Compile and source ROS 2,</li> <li>Compile and source Gazebo Sim,</li> <li>Compile and source ros_gz_bridge,</li> <li>Compile ROS 2 again.</li> </ul> <p>I wonder if many people are aware of that behavior. In any case I did not know of this automatic chaining, nor was expecting it, as:</p> <ul> <li><p>In above case, it is obviously undesirable that the ROS 2 <code>setup.bash</code> script would chain the Gazebo and ros_gz_bridge scripts,</p> </li> <li><p>But even in other cases this can be undesired. E.g. the ros_gz_bridge obviously depends on ROS 2 and Gazebo Sim, but even then I might want to source a different ROS 2 install (e.g. with some local changes, irrelevant to ros_gz_bridge). So I don't necessarily want the ros_gz_bridge to automatically source the ROS 2 install that was sourced at build time.</p> </li> </ul> <p>Is there some documentation / configuration options / known best practices wrt. this behavior?</p> <p>Or is it just mandatory to actively consider the sourced prefixes before each invocation of <code>colcon build</code>?</p>
Configuration or best practices wrt. automatic chaining of `setup.bash` prefix paths from `colcon build`
<p>I think I more or less solved it. I redid my steps in Windows Sandbox, to test from a fresh system, and I found the following:</p> <ol> <li>Download ROS2 binaries without anything else. Unpacked into <code>C:\dev\ros2_humble</code> <ul> <li>Running <code>Scripts\ros2.exe</code> now gives my infamous error &quot;failed to create process.&quot;</li> <li><code>local_setup.ps1</code> now fails of course, as no Python is available.</li> </ul> </li> <li>Install Python 3.8.3 with default settings, under <code>C:\Program Files\Python38</code>, <strong>without</strong> adding to path (to mimic my PC with multiple Python versions). <ul> <li>Same results in the previous step.</li> <li>Running <code>&amp; &quot;C:\Program Files\Python38\python.exe&quot; Scripts\ros2-script.py</code> gives errors about missing packages (of course).</li> </ul> </li> <li>Install requirements: <code>&amp; &quot;C:\Program Files\Python38\python.exe -m pip install ...</code> <ul> <li><code>&amp; &quot;C:\Program Files\Python38\python.exe&quot; Scripts\ros2-script.py</code> now seems to work fine, without errors!</li> <li><code>ros2.exe</code> still gives &quot;failed to create process.&quot;. But that I could understand, Python isn't available yet.</li> </ul> </li> <li>Add system Python to <code>PATH</code> <ul> <li><code>python Scripts\ros2-script.py</code> now also works</li> <li><code>ros2.exe</code> still fails with the same error</li> </ul> </li> </ol> <p>Then either:</p> <ol> <li>Create a symbolic link: <code>mklink /D &quot;C:\Python38&quot; &quot;C:\Program Files\Python38&quot;</code> <ul> <li>Running <code>ros2.exe</code> now actually works! It seems it really relies on the hardcoded Python path.</li> </ul> </li> </ol> <p>or</p> <ol> <li>Edit <code>Scripts\ros2-script.py</code> and replace the hash-bang path at the top <code>C:\Python38\python.exe</code> with <code>C:\Program Files\Python38\python.exe</code> <ul> <li>Running <code>ros2.exe</code> now <em>also</em> works! I had no idea the .exe was actually relying on the hash-bang path.</li> </ul> </li> </ol> <p>Finally I wanted to test with Python virtual environments. I rolled back to step #2 (with only Ros2 unpacked and a fresh Python install).</p> <ol> <li>Create venv, in <code>C:\dev\ros2_humble\</code>: <code>&amp; &quot;C:\Program Files\Python38\python.exe&quot; -m venv .venv</code></li> <li>Activate it: <code>.\venv\Scripts\activate.ps1</code></li> <li>Check it and prepare it: <code>python --version</code> and <code>python -m pip install ...</code></li> <li>Now <em>also</em> activate the ros2 environment: <code>local_setup.ps1</code> <ul> <li><code>python Scripts\ros2-script.py</code> now works!</li> <li>But <code>ros2.exe</code> still fails... It depends on the fixed paths.</li> </ul> </li> <li>Edit <code>*-script.py</code> such that the line 1 path says <code>#!C:\dev\ros2_humble\.venv\Scripts\python.exe</code> <ul> <li>And now finally <code>ros2.exe</code> just works, from an isolated environment!</li> </ul> </li> </ol> <h2>So in a nutshell:</h2> <ul> <li>The hash-bang path from <code>*-script.py</code> <strong>must</strong> match with the intended Python executable</li> <li><code>local_setup.ps1</code> but be active, i.e. <code>PYTHONPATH</code> must include the <code>site-packages</code> from ros2 <strong>and</strong> the interpreter library path (either system or a venv)</li> </ul> <p>And the error</p> <pre><code>failed to create process. </code></pre> <p>was entirely due to the script hash-bang not being available.</p>
104081
2023-09-12T13:14:33.133
|ros2|windows10|
<p>I am trying to install ROS2 &quot;Humble Hawksbill&quot; on Windows 10, but when done and trying to run <code>ros2</code> I get the error:</p> <blockquote> <p>failed to create process.</p> </blockquote> <p>I get the same result when activating the ROS environment first with <code>local_setup</code>.</p> <p>I followed the instructions here: <a href="https://docs.ros.org/en/humble/Installation/Windows-Install-Binary.html#install-python" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Installation/Windows-Install-Binary.html#install-python</a><br /> The only difference is I have Python 3.8.10. Other system info:</p> <pre><code>&gt; systeminfo.exe Host Name: xxxx OS Name: Microsoft Windows 10 Pro OS Version: 10.0.19045 N/A Build 19045 OS Manufacturer: Microsoft Corporation OS Configuration: Member Workstation OS Build Type: Multiprocessor Free Registered Owner: sa-install Registered Organization: Demcon Product ID: 00330-80000-00000-AA932 Original Install Date: 15-4-2022, 05:14:30 System Boot Time: 12-9-2023, 10:41:29 System Manufacturer: HP System Model: HP ZBook Fury 15.6 inch G8 Mobile Workstation PC System Type: x64-based PC Processor(s): 1 Processor(s) Installed. [01]: Intel64 Family 6 Model 141 Stepping 1 GenuineIntel ~2304 Mhz BIOS Version: HP T95 Ver. 01.08.20, 14-3-2022 Windows Directory: C:\windows System Directory: C:\windows\system32 Boot Device: \Device\HarddiskVolume1 System Locale: en-gb;English (United Kingdom) Input Locale: en-us;English (United States) Time Zone: (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna Total Physical Memory: 16'048 MB Available Physical Memory: 6'033 MB Virtual Memory: Max Size: 28'336 MB Virtual Memory: Available: 11'376 MB Virtual Memory: In Use: 16'960 MB Page File Location(s): C:\pagefile.sys Domain: xxxx Logon Server: xxxx Hotfix(s): 20 Hotfix(s) Installed. </code></pre> <p>There are some similar questions already, but their accepted answers did not help me:</p> <ul> <li><a href="https://robotics.stackexchange.com/questions/99699/ros2-galactic-binary-installation-on-windows-10-failed-to-create-process">Ros2 Galactic binary installation on Windows 10: failed to create process</a></li> <li><a href="https://robotics.stackexchange.com/questions/85979/failed-to-create-ros2-process">failed to create ROS2 process</a></li> </ul> <p>EDIT: I just realized that calling ROS2 from Python <em>does</em> work:</p> <pre><code>&gt; python Scripts\ros2-script.py usage: ros2 ... </code></pre> <p>But running the .exe gives the error:</p> <pre><code>&gt; ros2.exe failed to create process. </code></pre>
ROS2 Humble on Windows - "failed to create process."
<p>Can you give more details, if you are making your own package. If yes, then you need to write your own launch file accordingly so that all the parameters/files parses correctly.</p> <p>Please also refer to the launch file for the urdf_tutorials at: <a href="https://github.com/ros/urdf_tutorial/blob/ros2/launch/display.launch.py" rel="nofollow noreferrer">https://github.com/ros/urdf_tutorial/blob/ros2/launch/display.launch.py</a></p>
104086
2023-09-12T16:05:26.247
|ros2|rviz|urdf|
<p>this is the urdf file that i am using in RViz</p> <pre><code>&lt;?xml version=&quot;1.0&quot; ?&gt; </code></pre> <pre><code>&lt;material name=&quot;blue&quot;&gt; &lt;color rgba=&quot;0.0 0.0 0.5 1.0&quot;/&gt; &lt;/material&gt; &lt;material name=&quot;grey&quot;&gt; &lt;color rgba=&quot;0.0 0.5 0.5 1.0&quot;/&gt; &lt;/material&gt; &lt;link name=&quot;B&quot;&gt; &lt;visual&gt; &lt;geometry&gt; &lt;box size=&quot;0.6 0.4 0.2&quot;/&gt; &lt;/geometry&gt; &lt;origin xyz=&quot;0 0 0.1&quot; rpy=&quot;0 0 0&quot;/&gt; &lt;material name=&quot;blue&quot;/&gt; &lt;/visual&gt; &lt;/link&gt; </code></pre> <p>I don't know why is &quot;&quot; and &quot;&quot; is not showing in the file but I am getting this output</p> <p><a href="https://i.stack.imgur.com/isDIc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/isDIc.png" alt="enter image description here" /></a></p> <p>using this command</p> <pre><code>ros2 launch urdf_tutorial display.launch.py model:=shitbot.urdf </code></pre>
RViz is not working properly and showing extra joint
<p>Parameters are a property of and associated with a specific <code>Node</code> instances. They are independent of what executable the node is contained within.</p> <p>Are you wondering about command line syntax for running nodes?</p> <p>If so there's the <a href="https://design.ros2.org/articles/ros_command_line_arguments.html" rel="nofollow noreferrer">design document of the command line synax</a> for setting parameters on the command line and how to address them to a specific node.</p> <p>Edit:</p> <p>I would recommend reading the parameters overview: <a href="https://docs.ros.org/en/rolling/Concepts/Basic/About-Parameters.html" rel="nofollow noreferrer">https://docs.ros.org/en/rolling/Concepts/Basic/About-Parameters.html</a></p> <p>Declaring parameters is implemented to allow nodes to clearly define their API and allow for enforcement/errors if you go out of bounds. Set and get methods will fail if they don't match the declared parameter names and/or types.</p> <blockquote> <p>For example, declaring a parameter on the command line alone doesn't (necessarily?) make the node actually have that parameter.</p> </blockquote> <p>Note that the command line is setting parameters. Declaring parameters has to happen in the code. Declared parameters don't have to be set.</p> <p>If you disable the need to declare the parameters (<code>allow_undeclared_parameters = true</code>) then the parameters are basically a blackboard with get and set methods with key value pairs.</p>
104089
2023-09-12T17:49:59.540
|ros2|parameters|
<p>The <a href="https://design.ros2.org/articles/ros_parameters.html#parameter-initialization" rel="nofollow noreferrer">ROS 2 Design document for the Parameter API</a>, does not give a description of the details of ROS 2 parameter initialization after specifying them on the command line.</p> <p>Specifically, what happens &quot;under the hood&quot; after a parameter is specified on the command line. In other words, how does specifying a parameter on the command line interplay with <code>Node</code> member functions like <code>declare_parameter()</code> or similar? For example, declaring a parameter on the command line alone doesn't (necessarily?) make the node actually have that parameter.</p> <p>I recognize this question comes close to asking about implementation details, but I do believe that it's not unreasonable to think that these sort of details belong in API space.</p>
How are ROS 2 parameters initialized once specified on the command line?
<p>Well I ended up with passing on the launch files as individual launch configs:</p> <pre><code> default_parameters_file = shared_folder / 'config' / 'default_configs.yaml' override_parameters_file = some_folder / 'configs.yaml' default_parameters_file_config = LaunchConfiguration('default_parameters_file', default=default_parameters_file) override_parameters_file_config = LaunchConfiguration('override_parameters_file', default=override_parameters_file) run_odometry_config = LaunchConfiguration('run_odometry', default=True) sub_launch = GroupAction( actions=[ PushRosNamespace( namespace=&quot;some_namespace&quot; ), IncludeLaunchDescription( launch_description_source=PythonLaunchDescriptionSource( launch_file_path=sub_launch_file) ), launch_arguments=[ (&quot;default_parameters_file&quot;, default_parameters_file_config), (&quot;override_parameters_file&quot;, override_parameters_file_config), (&quot;run_odometry&quot;, run_odometry_config) ] ) ] ) </code></pre> <p>I would have liked a more flexible solution allowing any amount of parameter files, but that became too messy and this serves my purposes too.</p>
104103
2023-09-13T11:16:49.010
|ros2|roslaunch|ros-humble|
<p>I have two launch files: a main launch file, and a sub launch file. The main launch file invokes the sub launch file with</p> <pre><code> run_odometry = LaunchConfiguration('run_odometry', default=True) sub_launch = GroupAction( actions=[ PushRosNamespace( namespace='some_namespace' ), IncludeLaunchDescription( launch_description_source=PythonLaunchDescriptionSource( launch_file_path=sub_launch_file) ), launch_arguments=[ ('run_odometry', run_odometry) ] ) ] ) </code></pre> <p>The sub launch then defines some node parameters:</p> <pre><code> default_parameters_file = shared_folder / 'config' / 'default_configs.yaml' override_parameters_file = some_folder / 'configs.yaml' parameters = [default_parameters_file, override_parameters_file] run_odometry = LaunchConfiguration('run_odometry', default=True) </code></pre> <p>and passes those parameters to several nodes, like for instance:</p> <pre><code> odometry_node = Node( condition=IfCondition(run_odometry), package='odometry', executable='odometry_node', output='screen', parameters=parameters ) </code></pre> <p>But now I'd like to move <code>parameters</code> from the sub launch file to the main launch file and call the sub launch file with something like:</p> <pre><code> default_parameters_file = shared_folder / 'config' / 'default_configs.yaml' override_parameters_file = some_folder / 'configs.yaml' parameters = LaunchConfiguration('parameters', default=[default_parameters_file, override_parameters_file]) run_odometry = LaunchConfiguration('run_odometry', default=True) sub_launch = GroupAction( actions=[ PushRosNamespace( namespace=&quot;some_namespace&quot; ), IncludeLaunchDescription( launch_description_source=PythonLaunchDescriptionSource( launch_file_path=sub_launch_file) ), launch_arguments=[ ('parameters', parameters), ('run_odometry', run_odometry) ] ) ] ) </code></pre> <p>Then in the sub launch file have something like:</p> <pre><code> parameters = LaunchConfiguration('parameters') run_odometry = LaunchConfiguration('run_odometry', default=True) </code></pre> <p>and again</p> <pre><code> odometry_node = Node( condition=IfCondition(run_odometry), package='visual_odometry', executable='visual_odometry_node', output='screen', parameters=parameters ) </code></pre> <p>But that doesn't work: <code>'Node' expected 'parameters' to be one of [&lt;class 'list'&gt;], but got '&lt;launch.substitutions.launch_configuration.LaunchConfiguration object at 0x7f48e2dd6290&gt;' of type '&lt;class 'launch.substitutions.launch_configuration.LaunchConfiguration'&gt;'</code></p> <p>The error makes sense, but I don't know how to make this work. There's hardly any documentation on this. Any ideas? Thanks in advance!</p>
How to pass parameters to included launch description?
<p>I believe the current state-of-the-art attaches the object to the gripper via Gazebo when the object is in proximity, so the ideal solution that I am looking for does not seem to exist. I will use the workarounds that I listed in my question.</p> <p>I hope other solutions will be posted here in future. According to <a href="https://github.com/JenniferBuehler/gazebo-pkgs/wiki/The-Gazebo-grasp-fix-plugin" rel="nofollow noreferrer">Jennifer Buehler in the Gazebo grasp fix plugin wiki</a> solutions without workarounds may exist:</p> <blockquote> <p>... It may be possible to get the robot to grasp the object still, by adjusting the material properties of object and gripper. ...</p> </blockquote>
104111
2023-09-13T16:58:15.007
|gazebo|ros-control|ros-humble|gripper|grasping|
<p>I am searching for a working example of a gripper that can hold an object in Gazebo / Gazebo Classic. The example should ideally:</p> <ul> <li>use a 1-DOF gripper with two fingers where one is mimicked</li> <li>use Python for controlling</li> <li>use only minimal number of libraries</li> </ul> <p>I tried:</p> <ul> <li>using <code>ros2_control</code>, however <a href="https://robotics.stackexchange.com/questions/103967/which-controller-from-ros2-control-is-appropriate-for-firmly-grabbing-a-box-wi">the Humble version has problems with effort-based control and mimicked fingers</a>.</li> <li>following <a href="https://classic.gazebosim.org/tutorials?tut=simple_gripper&amp;cat=build_robot" rel="nofollow noreferrer">Gazebo Tutorial: Make a Simple Gripper</a>, however I could not hold the object, it slips.</li> </ul> <p>Slipping objects from the gripper in Gazebo seem to be a popular problem and I found some workarounds that basically attach the object/s to the gripper (vacuum or two fingers):</p> <ul> <li><a href="https://github.com/IFRA-Cranfield/IFRA_LinkAttacher" rel="nofollow noreferrer">IFRA Link Attacher</a></li> <li><a href="https://github.com/JenniferBuehler/gazebo-pkgs/blob/master/gazebo_grasp_plugin/src/GazeboGraspFix.cpp" rel="nofollow noreferrer">Gazebo Grasp Fix</a> — <a href="https://www.youtube.com/watch?v=CWr09TJvOO8" rel="nofollow noreferrer">here is a ROS1 video tutorial that uses it</a></li> <li><a href="https://github.com/usnistgov/ARIAC/blob/66a0470be3d7f92201ff40ddeb5f74de14659ba1/ariac_plugins/src/vacuum_gripper_plugin.cpp#L198-L203" rel="nofollow noreferrer">Code from a competition named ARIAC</a></li> </ul> <p>There is also an <a href="https://robotics.snowcron.com/robotics_ros2/robotic_arm_fixing_gripper_intro.htm" rel="nofollow noreferrer">alternative approach that periodically sets the position of the object</a> to make the object seem fixed.</p> <p>I don't want to overcomplicate the project using extra Gazebo workaround code.</p> <p>Finally <a href="https://moveit.picknik.ai/humble/doc/tutorials/pick_and_place_with_moveit_task_constructor/pick_and_place_with_moveit_task_constructor.html" rel="nofollow noreferrer">Moveit2 contains a pick and place example</a>, however this is based on C++.</p> <p>Do you know a minimal basic example project of a gripper holding an object that meets my expectations?</p>
Basic example project of a gripper holding an object in Gazebo
<p>Most of the times I've seen this done, the robot uses the navigation stack to get &quot;close&quot; to the cart (usually a designated pose in front of the cart), and then uses a custom perception + control loop to actually &quot;dock&quot; with the cart.</p> <p>There has been a <a href="https://github.com/ros-planning/navigation2/issues/1975" rel="nofollow noreferrer">long-standing ticket</a> aimed at a more generic docking controller for Nav2 - but as of yet, no real progress. That ticket does have lots of resources around docking control algorithms (and pointers to some possible open source implementations that might be a starting point for you).</p>
104112
2023-09-13T17:59:31.100
|ros2|nav2|
<p>Just starting with Nav2, and curious if there is any example on picking carts after reaching pose from under without being detecting as obstacle ? (Was considering about retro-reflectors on carts)</p> <p>Would appreciate any thoughts or suggestions !</p>
Nav2 Cart/Shelf Pick
<p>Unfortunately, you cannot remap on <code>record</code> side in ROS2 version of rosbag. But you can do that on <code>play</code> side: <code>ros2 bag play /path/to/bag --remap scan_filtered:=scan</code></p>
104118
2023-09-14T08:42:38.637
|ros2|rosbag-record|rosbag2|
<p>Hello dear ROS Developers,</p> <p>I am trying to record a ros2 bag in my humble, i am having the /scan_filtered topic, now i want to record the /scan_filtered topic in a bag, but it should store inside the bag in the name of /scan topic. In ros1 I'll achieve this using remapping. But in ros2 i need help</p>
ROS 2 Bag Record with Topic Remapping
<p>This depends on the actual resolution of the texture image used for the plane and the size of the plane. To improve the resolution of the pen drawings you have therefore two options:</p> <ol> <li>Double the resolution of the grass image (using for example Gimp and scale-up the image to double the resolution, then save it). This should double the resolution of the pen drawings. You can do this as many times as needed to reach the desired resolution.</li> <li>Reduce the <code>size</code> of the <code>Plane</code>. This should help as the texture won't be that much stretched up.</li> </ol> <p><em>Disclaimer: I am a <a href="https://github.com/cyberbotics/webots" rel="nofollow noreferrer">Webots</a> developer working at <a href="https://cyberbotics.com" rel="nofollow noreferrer">Cyberbotics</a>.</em></p>
104134
2023-09-14T23:27:27.070
|webots|
<p>I'm using the Pen device at the moment but I'm trying to get the resolution better finer so I can see smoother curves.</p> <p><a href="https://i.stack.imgur.com/xFT3H.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xFT3H.jpg" alt="enter image description here" /></a></p> <p>I'm currently just using the Webots Grass appearance. Is scaling the used texture or something like that the only way to improve the lines? The Webots documentation says &quot;The precision of the painting action mainly depends on the subdivision field of the Geometry node. A high subdivision value increases the number of polygons used to represent the geometry and thus allows a more precise texture mapping, but it will also slow down the rendering of the scene.&quot;, but I'm using a plane with the Webots Grass texture and there is no subdivision option in the geometry of a Plane.</p> <p>Any thoughts?</p> <p>Thanks</p>
How do I increase the resolution of the Webots Pen device?
<p>With the definition of <code>cloud_icp</code> from your first post, you just declare a pointer of type<code>¹</code></p> <pre><code>pcl::PointCloud&lt;pcl::PointXYZ&gt; </code></pre> <p>However, its not pointing to an existing <code>pcl::PointCloud&lt;pcl::PointXYZ&gt;</code> Pointcloud and thus your program crashes when entering the function.<br /> The approach from your own answer</p> <pre><code>cloud_icp = pcl::PointCloud&lt;pcl::PointXYZ&gt;::Ptr (new pcl::PointCloud&lt;pcl::PointXYZ&gt;(360,1)); </code></pre> <p>creates an underlying Pointcloud.</p> <p><code>¹</code>: More precisely, it is a smart pointer of type <a href="https://pointclouds.org/documentation/classpcl_1_1_point_cloud.html" rel="nofollow noreferrer"><code>std::shared_ptr&lt;pcl::PointCloud&lt;pcl::PointXYZ&gt;&gt;</code></a>.</p>
104136
2023-09-15T00:36:52.543
|ros2|pcl|ros-humble|
<p>I am getting a segmentation fault with pcl::transformPointCloud.</p> <p>This is all I am getting on the terminal:</p> <pre><code>ros2 run cpp_tests icp_test initialized 101201 Transforming [ros2run]: Segmentation fault </code></pre> <p>My PCL version is 1.12.1.</p> <p>The line that is causing the error is:</p> <pre><code>pcl::transformPointCloud(*cloud_in, *cloud_icp, icp_transform); </code></pre> <p>cloud_in and cloud_icp are both <code>pcl::PointCloud&lt;pcl::PointXYZ&gt;::Ptr</code>, and icp_transform is obtained from PCL and is <code>Eigen::Matrix4f</code>. cloud_in had the input cloud in it, cloud_icp would be empty (it was defined as <code>pcl::PointCloud&lt;pcl::PointXYZ&gt;::Ptr cloud_icp;</code> but not used before this point).</p> <p>I would like to solve this issue or find a workaround. As far as I can tell, I have only PCL 1.12.1 on my system. I am using ROS2 humble on Ubuntu 22.04. This was compiled using <code>colcon build --symlink-install</code> and compiled without any errors.</p> <p>Thanks.</p>
Segmentation fault with PCL when transforming point clouds
<p>If the planned path could reach the same position twice, there is no unique &quot;minimum distance&quot; you could use to get the path parameter, whatever distance-function you will choose.</p> <p>In this case you have to remember the path parameter for the old path at the time of stopping. In the case of the trajectory (which is path + time parameterization), the time-from-start is what you need.</p> <p>I'm not familiar with noetic, so I can't tell you how exactly to implement this.</p>
104140
2023-09-15T11:00:23.170
|ros|moveit|motion-planning|trajectory|
<p>I'm trying to implement a function to pause the execution of a trajectory, and then re-plan a trajectory following the remaining path. The framework I'm using is moveit noetic.</p> <p><code>moveit_msgs::RobotTrajectory</code> contains waypoints that are supposedly &quot;intermediate joint positions&quot; with velocity and acceleration. If I stop the execution of a trajectory at an arbitrary moment and take the current joint positions after the pause, it won't match any of the waypoints in the trajectory.</p> <p>This is expected, since waypoints have its resolution and it won't cover all possible joint positions in between. My question is, how to find the closest waypoint, given the current joint position? As I'm trying to replan a new trajectory with the &quot;remainder&quot; of waypoints, it's critical to find the right (index) of the waypoint to &quot;resume&quot; from.</p> <p>I find the smallest Cartesian distance between the current joint position and all waypoints from the original trajectory, and the waypoint who has the shortest distance from current position is the chosen waypoint to start replanning from. This approach kinda works, but sometimes it's not accurate enough, and the replanned trajectory will have a drastic move between the current position to the recovered waypoint.</p> <p>In general, how to find the right waypoint to resume from? How to replan a smooth trajectory that follows the same path from the remainder of the original trajectory? Any advice or suggestion is greatly appreciated.</p>
Trajectory waypoints are not exactly the same as joint positions. How to find the closest waypoint?
<p> Which one of these is not like the others, which one of these just doesn’t belong </p> <p>You can see the WPF action is CamelCase while the rest are snake_case. We fixed that ages ago in the modern Nav2 distributions, but the WPF in the simple navigator is expecting it to be the corrected version.</p> <p>It should be a one-line change in the python class to adjust the action interface string to the “broken” CamelCase version.</p>
104148
2023-09-15T20:28:30.670
|ros-foxy|
<p>I have a question:</p> <h2>What I want to achieve</h2> <p>In rviz2 (foxy) is the waypoint mode in the nav2 panel but I want to interact programmatically with the waypoint mode.</p> <h2>My Problem</h2> <p>I using foxy as distro. Unfortuneately, simple_commander don't exist for foxy.</p> <h2>My Approach</h2> <p>Therefore, I copy paste the simple commander folder (from humble) inside of my nav2 package of my workspace (I build nav2 stack from source). Colcon build gave me some errors and warning. I fixed them all step by step. I added some actions and msg in the nav2_msg package. For example, if you open robot_navigator.py, you'll see in import AssistedTeleop in line 26 it's whited out. After I added the necessary files, it's not whited out anymore and the error/warning disappear.</p> <p>Now colcon build works without an error or warnings. I can also set the initial pose and send a single goal programmatically. However, the simple commander waypoint mode don't work. Its always showing:</p> <pre><code>[INFO] [1694809146.773522212] [basic_navigator]: Nav2 is ready for use! [INFO] [1694809147.776931425] [basic_navigator]: 'FollowWaypoints' action server not available, waiting... [INFO] [1694809148.779486553] [basic_navigator]: 'FollowWaypoints' action server not available, waiting... [INFO] [1694809149.782442363] [basic_navigator]: 'FollowWaypoints' action server not available, waiting... [INFO] [1694809150.785148441] [basic_navigator]: 'FollowWaypoints' action server not available, waiting... [INFO] [1694809151.787991259] [basic_navigator]: 'FollowWaypoints' action server not available, waiting... </code></pre> <p>Moreover, the action /FollowWaypoint is available (ROS2 action list):</p> <pre><code>robot@robot:~$ ros2 action list /FollowWaypoints /assisted_teleop /backup /compute_path_through_poses /compute_path_to_pose /follow_path /follow_waypoints /navigate_through_poses /navigate_to_pose /smooth_path /spin /wait </code></pre> <h2>My Question</h2> <p>I forgot something?</p>
Simple Commander Waypoints Foxy
<p>Ok, so here is some investigation and test results I've got so far, resolving most doubts I've had:</p> <ul> <li>to match the current PointCloud2 scan and adjust SLAM position to global map, there is a <a href="https://github.com/irapkaist/scancontext" rel="nofollow noreferrer">ScanContext</a> package and its integration to Lio-Sam, <a href="https://github.com/gisbi-kim/SC-LIO-SAM" rel="nofollow noreferrer">SC-LIO-SAM</a>. What they do is to generate context descriptors for both pre-recorded pointcloud and real-time scan match. As alternative there is similar to AMCL (2D scans) nav2 system, which works with 3D scans: <a href="https://github.com/at-wat/mcl_3dl" rel="nofollow noreferrer">mcl_3dl</a>, I'll give it a try as well, but it looks a bit more complicated though.</li> <li>For obstacle layer to be inflated on the fly from PointCloud, there is an <a href="http://wiki.ros.org/costmap_2d/hydro/obstacles" rel="nofollow noreferrer">embedded processor in costmap_2d</a>, which needs to specify params for the PointCloud2 observable source. However, for me it doesn't work for some reason, and I tested with <a href="https://github.com/ros-perception/pointcloud_to_laserscan" rel="nofollow noreferrer">PointCloud to LaserScan converter</a>. Works pretty straightforward, flattening the pointcloud to the classic laserscan. It is clear that with this approach some data might get lost in some scenarios, but works for me (for now).</li> </ul> <p>With this transformations the task is getting reduced to the standard nav2 scenarios, and standard planners (I'm using Smac Hybrid-A* Planner) and controllers (Regulated Pure Pursuit, in my case) start to behave correctly.</p> <p>Hope this will help somebody as well.</p>
104157
2023-09-16T10:29:41.197
|navigation|ros2|slam|costmap|nav2|
<p>This is my very first question in this community. So, I'm a bit stuck. Given data: I got akkerman mode robot with 3D Lidar, 9-Axis IMU + GNSS, ROS2 Humble, Nav2 stack. After a while, achieved LIO-SAM SLAM to work correctly, it scans and maintains localization well. A also got a global map pointcloud (cleaned), but till the moment used it only to generate the global costmap for nav2. Now, I don't understand how:</p> <ul> <li>relate the SLAM result from LIO-SAM to the global map ( I guess there must be some intermediate service to recognize the context)</li> <li>generate local costmap in realtime from LIO-SAM data</li> <li>push it all together to nav2 planners and controllers</li> <li>in general, how to make it work all together.</li> </ul> <p>My urdf does include all the elements together, but I don't see how to get 3D pointcloud to be transformed in 2D /scan for nav2 to work as expected. May be there is some tutorial which explains it all, but can't find it, unfortunately. I guess this is very common setup ?</p> <p>And yes, all the middleware layer transforming /cmd_vel to the actual robot movements is implemented correctly (tested with high-level transformations).</p>
ROS2 Humble, 3D Lidar, LIO-SAM slam and nav2: how to make it work together with global map?
<p>This xml tag has nothing to do with ros publish/subscribe. ros1 provides a simple key/value property database called the &quot;parameter server&quot;.</p> <p>For this tag, <code>param</code> specifies the property name you want to create (or overwrite) on the parameter server. If the property name does not start with a <code>/</code>, the string is prepended with the current node namespace.</p> <p>For the example you show, the full parameter property name is: <code>/joint_state_publisher/source_list</code>.</p> <p>This property is assigned the value: <code>[&quot;hand_model/joint_states&quot;]</code></p> <p>The value in a rosparam tag is defined to be yaml, so the square brackets cause this value to be parsed as a yaml list <strong>before</strong> it is stored to the parameter server.</p> <p>If you just want to store a basic literal string, int or float value, most people use the <code>&lt;param .../&gt;</code> tag instead (which does not perform this yaml parsing.)</p>
104159
2023-09-16T13:03:12.620
|roslaunch|rosparam|
<p>I don't know what <code>&lt;rosparam param=&quot;source_list&quot;&gt;</code> means and barely found a clear description of it, especially on the official website. Here is the snippet I found online</p> <pre><code> &lt;node name=&quot;joint_state_publisher&quot; pkg=&quot;joint_state_publisher&quot; type=&quot;joint_state_publisher&quot;&gt; &lt;rosparam param=&quot;source_list&quot;&gt;[&quot;hand_model/joint_states&quot;]&lt;/rosparam&gt; &lt;/node&gt; </code></pre> <p>Is <code>source_list</code> a description of the data transmitted via topic <code>hand_model/joint_states</code>?</p> <p>A detailed explanation would be appreciated! Thanks!</p>
rosparam param="source_list"
<p>The picture shows a barrel cam.</p> <p>The <code>--C</code> is a cam follower.</p> <p>The cam is very likely a custom part.</p> <p>You could try to have the cam 3d printed.</p>
104173
2023-09-17T02:59:17.787
|hardware|
<p><a href="https://i.stack.imgur.com/0yffB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0yffB.jpg" alt="enter image description here" /></a></p> <p>This is a part to a toy that as you can see is pretty well damaged. I'd like to get a replacement but I dont know what this is even called. From this picture, google lens found something called a &quot;reversing screw&quot; which looks similar. I also found results for &quot;scrolling camshaft&quot; and &quot;worm shaft&quot; that look kind of like this too. Its about 3 inches from end to end and has a hex channel in the center where the motor attaches.</p> <p>The part is connected to an electric motor that spins it. There is a square plastic part with a hole in the middle that moves up and down on this part. This movement is via a small metal semicircular &quot;fork&quot; that looks like <code>--C</code> where the <code>C</code> part moves in the grooves of this piece and the <code>--</code> part is in the square plastic.</p> <p>While I was inspecting the damage on this part, I managed to lose the <code>--C</code> so I need to replace that as well, but I cant find any name for it. Since these are small mechanical parts driven by an electric motor I figured this may be the best audience to ask. Can someone put a name to the piece shown and/or the <code>--C</code> so I can try to locate replacements?</p>
What are these parts called?
<p>I had this exact issue as well (Ubuntu, Humble) - for some reason a reboot resolved it. Go figure.</p>
104178
2023-09-17T08:51:22.907
|gazebo|ros2|gazebo-11|launch-file|ros-gazebo|
<p>I am launching gazebo with <code>ros2 launch gazebo_ros gazebo.launch.py</code> Gazebo is not launched and is showing the following error:</p> <pre><code>[INFO] [launch]: All log files can be found below /home/dell/.ros/log/2023-09-17-13-44-45-896306-ubuntu22-8940 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [gzserver-1]: process started with pid [8941] [INFO] [gzclient-2]: process started with pid [8943] [gzserver-1] gzserver: symbol lookup error: /opt/ros/humble/lib/libtrajectory_msgs__rosidl_typesupport_introspection_cpp.so: undefined symbol: _ZN36rosidl_typesupport_introspection_cpp31get_message_type_support_handleIN13geometry_msgs3msg10Transform_ISaIvEEEEEPK29rosidl_message_type_support_tv [ERROR] [gzserver-1]: process has died [pid 8941, exit code 127, cmd 'gzserver -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so']. [ERROR] [gzclient-2]: process has died [pid 8943, exit code 255, cmd 'gzclient']. </code></pre> <p>all packages and plugins for gazebo-ros are installed by <code>sudo apt install ros-humble-gazebo-*</code></p>
process has died [pid 8941, exit code 127, cmd 'gzserver -slibgazebo_ros_init.so
<p>I think you just need to run a &quot;sudo apt update&quot; to get the latest versions of available Debians.</p> <p>The file name you referenced does not currently exist on the server - but a version with the later build date code of 20230822 does exist - so I think your apt cache is out of date.</p>
104189
2023-09-18T07:54:30.303
|ros2|ros-humble|
<p>I am trying to upgrade my packages but when I run <code>apt upgrade</code> I am getting the following error:</p> <pre><code>E: Failed to fetch http://packages.ros.org/ros2/ubuntu/pool/main/r/ros-humble-rviz2/ros-humble-rviz2_11.2.7-1jammy.20230814.171234_amd64.deb 404 Not Found [IP: 2605:bc80:3010::134 80] </code></pre> <p>Did the gpg keys expired or got changed? I checked the github repo and the last change was 2 years ago, so I am not sure what is happening.</p> <p>Any ideas?</p> <p>BTW: I am using ubuntu 22.04 + ROS Humble</p> <p><strong>EDIT 1:</strong></p> <p><code>apt update</code> output:</p> <pre><code>$ sudo apt update Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease Hit:2 https://download.docker.com/linux/ubuntu jammy InRelease Get:3 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64 InRelease [1.484 B] Hit:4 https://repo.steampowered.com/steam stable InRelease Hit:5 https://updates.signal.org/desktop/apt xenial InRelease Hit:6 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease Hit:7 https://app.eduvpn.org/linux/v4/deb focal InRelease Hit:8 http://archive.ubuntu.com/ubuntu jammy InRelease Hit:9 http://packages.ros.org/ros2/ubuntu jammy InRelease Hit:10 https://ppa.launchpadcontent.net/pipewire-debian/pipewire-upstream/ubuntu jammy InRelease Hit:11 https://repo.vaticle.com/repository/apt trusty InRelease Hit:12 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:13 http://packages.osrfoundation.org/gazebo/ubuntu-stable jammy InRelease Hit:14 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Hit:15 http://archive.ubuntu.com/ubuntu jammy-security InRelease Fetched 1.484 B in 1s (1.942 B/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 73 packages can be upgraded. Run 'apt list --upgradable' to see them. </code></pre> <p><strong>Solution</strong></p> <p>I had to manually delete the apt cache. I tried running <code>apt clean</code> but it didn't work.</p> <pre><code>sudo rm /var/lib/apt/lists/* </code></pre>
Failed to fetch http://packages.ros.org/ros2 (404 not found)
<p>So answering my own question,</p> <p>To make the parameters available to the node, they first need to be declared inside the node.</p> <p>Hence, the node should be something like:</p> <pre><code>class MyNodeClass(Node): &quot;&quot;&quot; A node example &quot;&quot;&quot; def __init__(self): super().__init__(&quot;my_node&quot;) self.declare_parameters( namespace='', parameters=[ ('some_int', 18), ('some_bool', False), ]) ... ... ... </code></pre> <p>Once they get declared here in the node, then the launch file takes the parameters in the yaml file into account. Now when I launch my launch file, and then in another terminal do <code>ros2 param get /my_node some_int</code>, I get the answer <code>Integer value is: 42</code>, Which shows the yaml file value overwrote the one in the node.</p>
104192
2023-09-18T12:13:58.733
|ros|ros2|roslaunch|python|ros-humble|
<p>I have tried all the solutions I've seen on forums but none seems to work, I've spent already several days on this and really hope someone can spot my mistake rapidly.</p> <p>I have the following launch file (reduced to the minimum) <em>my_launch_file.launch.py</em>:</p> <pre><code>import os from launch import LaunchDescription from launch.substitutions import LaunchConfiguration from ament_index_python.packages import get_package_share_directory from launch_ros.actions import Node def generate_launch_description(): param_file = os.path.join(get_package_share_directory('my_pkg'), 'config/my_params.yaml') return LaunchDescription([ Node( package=&quot;my_pkg&quot;, executable=&quot;my_node&quot;, parameters=[LaunchConfiguration(param_file)], ) ]) </code></pre> <p>And then I have a parameters file named <em>my_params.yaml</em>:</p> <pre><code>my_node: ros__parameters: some_int: 42 some_bool: true </code></pre> <p>I built my package, verified that the launch file and node is built correctly, and that the my_params.yaml file is at the correct location. However, when I launch my file, I get:</p> <pre><code>user@user-PC:~$ ros2 launch my_pkg my_launch_file.launch.py [INFO] [launch]: All log files can be found below /home/user/.ros/log/2023-09-18-15-07-27-467850-user-PC [INFO] [launch]: Default logging verbosity is set to INFO [ERROR] [launch]: Caught exception in launch (see debug for traceback): launch configuration '/home/user/ros2_ws/install/my_pkg/share/my_pkg/config/my_params.yaml' does not exist </code></pre> <p>I confirm again that the my_params.yaml file is there, I verified every single character of the path. I also confirm that I sourced the setup.bash from /opt/ros/humble, and the one from ~/ros2_ws/install. Also, the node works and launches correctly if I don't add the parameters file.</p> <p>Can't find why this is happening, please help! Thanks in advance!</p> <p>Setup: ROS2 Humble, Ubuntu 22.04</p> <hr /> <p>EDIT: I modified the launch file by removing the <em>LaunchConfiguration</em>. Now it looks like this:</p> <pre><code>import os from launch import LaunchDescription from launch.substitutions import LaunchConfiguration from ament_index_python.packages import get_package_share_directory from launch_ros.actions import Node def generate_launch_description(): param_file = os.path.join(get_package_share_directory('my_pkg'), 'config/my_params.yaml') return LaunchDescription([ Node( package=&quot;my_pkg&quot;, executable=&quot;my_node&quot;, parameters=[param_file], ) ]) </code></pre> <p>This way, there is no more error in the terminal, but when I do <code>ros2 param list /my_node</code>, I get no parameters, so it still doesn't work.</p>
How to add parameters to a node via a yaml file using a python launch file in ROS2?
<p>I think I found the issue, in the topic param for global_costmap I had <code>merged_laser/scan</code>, I changed it to <code>/merged_laser/scan</code> and is working now. :)</p>
104198
2023-09-18T14:14:19.720
|ros-humble|nav2|obstacle-avoidance|
<p>I am having problems with Nav2 in my mobile robot and hope someone can help me.</p> <p>I set up my robot for simulation, created the map with the SLAM toolbox and configured Nav2 for navigation, however if I put an additional obstacle in the simulation the global costmap doesnt updates as it is supposed to do (see the following image).</p> <p><a href="https://i.stack.imgur.com/xDPjG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xDPjG.png" alt="obstacle error" /></a></p> <p>I changed the scan topic for local and global costmaps in the params file to the topic my robot is publishing, but doesnt work. I found a post in ROS Discourse about a Nav2 problem with Fast-DDS (<a href="https://discourse.ros.org/t/nav2-issues-with-humble-binaries-due-to-fast-dds-rmw-regression/26128" rel="nofollow noreferrer">[Nav2] Issues with Humble Binaries due to Fast-DDS RMW Regression</a>) so I switched to Cyclone-DDS as suggested following the instructions found in the ROS Humble documentation (<a href="https://docs.ros.org/en/humble/Installation/DDS-Implementations/Working-with-Eclipse-CycloneDDS.html" rel="nofollow noreferrer">Eclipse Cyclone DDS</a>) but it is still not working.</p> <p>This is my params file in case you need it:</p> <pre class="lang-yaml prettyprint-override"><code>amcl: ros__parameters: use_sim_time: True alpha1: 0.2 alpha2: 0.2 alpha3: 0.2 alpha4: 0.2 alpha5: 0.2 base_frame_id: &quot;base_footprint&quot; beam_skip_distance: 0.5 beam_skip_error_threshold: 0.9 beam_skip_threshold: 0.3 do_beamskip: false global_frame_id: &quot;map&quot; lambda_short: 0.1 laser_likelihood_max_dist: 2.0 laser_max_range: 100.0 laser_min_range: -1.0 laser_model_type: &quot;likelihood_field&quot; max_beams: 60 max_particles: 2000 min_particles: 500 odom_frame_id: &quot;odom&quot; pf_err: 0.05 pf_z: 0.99 recovery_alpha_fast: 0.0 recovery_alpha_slow: 0.0 resample_interval: 1 robot_model_type: &quot;nav2_amcl::DifferentialMotionModel&quot; save_pose_rate: 0.5 sigma_hit: 0.2 tf_broadcast: true transform_tolerance: 1.0 update_min_a: 0.2 update_min_d: 0.25 z_hit: 0.5 z_max: 0.05 z_rand: 0.5 z_short: 0.05 scan_topic: scan bt_navigator: ros__parameters: use_sim_time: True global_frame: map robot_base_frame: base_link odom_topic: /odom bt_loop_duration: 10 default_server_timeout: 20 # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. plugin_lib_names: - nav2_compute_path_to_pose_action_bt_node - nav2_compute_path_through_poses_action_bt_node - nav2_smooth_path_action_bt_node - nav2_follow_path_action_bt_node - nav2_spin_action_bt_node - nav2_wait_action_bt_node - nav2_assisted_teleop_action_bt_node - nav2_back_up_action_bt_node - nav2_drive_on_heading_bt_node - nav2_clear_costmap_service_bt_node - nav2_is_stuck_condition_bt_node - nav2_goal_reached_condition_bt_node - nav2_goal_updated_condition_bt_node - nav2_globally_updated_goal_condition_bt_node - nav2_is_path_valid_condition_bt_node - nav2_initial_pose_received_condition_bt_node - nav2_reinitialize_global_localization_service_bt_node - nav2_rate_controller_bt_node - nav2_distance_controller_bt_node - nav2_speed_controller_bt_node - nav2_truncate_path_action_bt_node - nav2_truncate_path_local_action_bt_node - nav2_goal_updater_node_bt_node - nav2_recovery_node_bt_node - nav2_pipeline_sequence_bt_node - nav2_round_robin_node_bt_node - nav2_transform_available_condition_bt_node - nav2_time_expired_condition_bt_node - nav2_path_expiring_timer_condition - nav2_distance_traveled_condition_bt_node - nav2_single_trigger_bt_node - nav2_goal_updated_controller_bt_node - nav2_is_battery_low_condition_bt_node - nav2_navigate_through_poses_action_bt_node - nav2_navigate_to_pose_action_bt_node - nav2_remove_passed_goals_action_bt_node - nav2_planner_selector_bt_node - nav2_controller_selector_bt_node - nav2_goal_checker_selector_bt_node - nav2_controller_cancel_bt_node - nav2_path_longer_on_approach_bt_node - nav2_wait_cancel_bt_node - nav2_spin_cancel_bt_node - nav2_back_up_cancel_bt_node - nav2_assisted_teleop_cancel_bt_node - nav2_drive_on_heading_cancel_bt_node - nav2_is_battery_charging_condition_bt_node bt_navigator_navigate_through_poses_rclcpp_node: ros__parameters: use_sim_time: True bt_navigator_navigate_to_pose_rclcpp_node: ros__parameters: use_sim_time: True controller_server: ros__parameters: use_sim_time: True controller_frequency: 20.0 min_x_velocity_threshold: 0.001 min_y_velocity_threshold: 0.5 min_theta_velocity_threshold: 0.001 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.26 max_vel_y: 0.0 max_vel_theta: 1.0 min_speed_xy: 0.0 max_speed_xy: 0.26 min_speed_theta: 0.0 # Add high threshold velocity for turtlebot 3 issue. # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75 acc_lim_x: 2.5 acc_lim_y: 0.0 acc_lim_theta: 3.2 decel_lim_x: -2.5 decel_lim_y: 0.0 decel_lim_theta: -3.2 vx_samples: 20 vy_samples: 5 vtheta_samples: 20 sim_time: 1.7 linear_granularity: 0.05 angular_granularity: 0.025 transform_tolerance: 0.2 xy_goal_tolerance: 0.25 trans_stopped_velocity: 0.25 short_circuit_trajectory_evaluation: True stateful: True critics: [&quot;RotateToGoal&quot;, &quot;Oscillation&quot;, &quot;BaseObstacle&quot;, &quot;GoalAlign&quot;, &quot;PathAlign&quot;, &quot;PathDist&quot;, &quot;GoalDist&quot;] BaseObstacle.scale: 0.02 PathAlign.scale: 32.0 PathAlign.forward_point_distance: 0.1 GoalAlign.scale: 24.0 GoalAlign.forward_point_distance: 0.1 PathDist.scale: 32.0 GoalDist.scale: 24.0 RotateToGoal.scale: 32.0 RotateToGoal.slowing_factor: 5.0 RotateToGoal.lookahead_time: -1.0 local_costmap: local_costmap: ros__parameters: update_frequency: 5.0 publish_frequency: 2.0 global_frame: odom robot_base_frame: base_link use_sim_time: True rolling_window: true width: 3 height: 3 resolution: 0.05 footprint: &quot;[[0.34, 0.24], [0.34, -0.24], [-0.34, -0.24], [-0.34, 0.24]]&quot; plugins: [&quot;voxel_layer&quot;, &quot;inflation_layer&quot;] inflation_layer: plugin: &quot;nav2_costmap_2d::InflationLayer&quot; cost_scaling_factor: 3.0 inflation_radius: 0.55 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: /merged_laser/scan max_obstacle_height: 2.0 clearing: True marking: True data_type: &quot;LaserScan&quot; raytrace_max_range: 3.0 raytrace_min_range: 0.0 obstacle_max_range: 2.5 obstacle_min_range: 0.0 static_layer: plugin: &quot;nav2_costmap_2d::StaticLayer&quot; map_subscribe_transient_local: True always_send_full_costmap: True global_costmap: global_costmap: ros__parameters: update_frequency: 1.0 publish_frequency: 1.0 global_frame: map robot_base_frame: base_link use_sim_time: True robot_radius: 0.35 resolution: 0.05 track_unknown_space: true plugins: [&quot;static_layer&quot;, &quot;obstacle_layer&quot;, &quot;inflation_layer&quot;] obstacle_layer: plugin: &quot;nav2_costmap_2d::ObstacleLayer&quot; enabled: True observation_sources: scan scan: topic: merged_laser/scan max_obstacle_height: 2.0 clearing: True marking: True data_type: &quot;LaserScan&quot; raytrace_max_range: 3.0 raytrace_min_range: 0.0 obstacle_max_range: 2.5 obstacle_min_range: 0.0 static_layer: plugin: &quot;nav2_costmap_2d::StaticLayer&quot; map_subscribe_transient_local: True inflation_layer: plugin: &quot;nav2_costmap_2d::InflationLayer&quot; cost_scaling_factor: 3.0 inflation_radius: 0.55 always_send_full_costmap: True map_server: ros__parameters: use_sim_time: True # Overridden in launch by the &quot;map&quot; launch configuration or provided default value. # To use in yaml, remove the default &quot;map&quot; value in the tb3_simulation_launch.py file &amp; provide full path to map below. yaml_filename: &quot;&quot; map_saver: ros__parameters: use_sim_time: True save_map_timeout: 5.0 free_thresh_default: 0.25 occupied_thresh_default: 0.65 map_subscribe_transient_local: True planner_server: ros__parameters: expected_planner_frequency: 20.0 use_sim_time: True planner_plugins: [&quot;GridBased&quot;] GridBased: plugin: &quot;nav2_navfn_planner/NavfnPlanner&quot; tolerance: 0.5 use_astar: false allow_unknown: true smoother_server: ros__parameters: use_sim_time: True smoother_plugins: [&quot;simple_smoother&quot;] simple_smoother: plugin: &quot;nav2_smoother::SimpleSmoother&quot; tolerance: 1.0e-10 max_its: 1000 do_refinement: True behavior_server: ros__parameters: costmap_topic: local_costmap/costmap_raw footprint_topic: local_costmap/published_footprint cycle_frequency: 10.0 behavior_plugins: [&quot;spin&quot;, &quot;backup&quot;, &quot;drive_on_heading&quot;, &quot;assisted_teleop&quot;, &quot;wait&quot;] spin: plugin: &quot;nav2_behaviors/Spin&quot; backup: plugin: &quot;nav2_behaviors/BackUp&quot; drive_on_heading: plugin: &quot;nav2_behaviors/DriveOnHeading&quot; wait: plugin: &quot;nav2_behaviors/Wait&quot; assisted_teleop: plugin: &quot;nav2_behaviors/AssistedTeleop&quot; global_frame: odom robot_base_frame: base_link transform_tolerance: 0.1 use_sim_time: true simulate_ahead_time: 2.0 max_rotational_vel: 1.0 min_rotational_vel: 0.4 rotational_acc_lim: 3.2 robot_state_publisher: ros__parameters: use_sim_time: True waypoint_follower: ros__parameters: use_sim_time: True loop_rate: 20 stop_on_failure: false waypoint_task_executor_plugin: &quot;wait_at_waypoint&quot; wait_at_waypoint: plugin: &quot;nav2_waypoint_follower::WaitAtWaypoint&quot; enabled: True waypoint_pause_duration: 200 velocity_smoother: ros__parameters: use_sim_time: True smoothing_frequency: 20.0 scale_velocities: False feedback: &quot;OPEN_LOOP&quot; max_velocity: [0.26, 0.0, 1.0] min_velocity: [-0.26, 0.0, -1.0] max_accel: [2.5, 0.0, 3.2] max_decel: [-2.5, 0.0, -3.2] odom_topic: &quot;odom&quot; odom_duration: 0.1 deadband_velocity: [0.0, 0.0, 0.0] velocity_timeout: 1.0 </code></pre> <p>Thanks in advance for the help!</p>
Nav2 obstacle avoidance not working in Humble
<p>Yes, multiple sets of dynamic_reconfigure parameters are supported for a single ros node. You need to create a Server for each path that has this kind of parameter. You can reuse a .cfg class name for different paths if you want to.</p> <p>An example is move_base, which provides dynamic parameters for multiple items within its /move_base namespace. Each path is associated to a separate dynamic_reconfigure::Server object. The following lines of code are from file <a href="https://github.com/ros-planning/navigation/blob/noetic-devel/dwa_local_planner/src/dwa_planner_ros.cpp" rel="nofollow noreferrer">dwa_planner_ros.cpp in the navigation.git repo</a>, where <code>name</code> is a relative path like &quot;DWAPlannerROS&quot;:</p> <pre><code>ros::NodeHandle private_nh(&quot;~/&quot; + name); dsrv_ = new dynamic_reconfigure::Server&lt;DWAPlannerConfig&gt;(private_nh); </code></pre> <p>Take a look at the rest of that file to get the full picture.</p>
104202
2023-09-18T14:44:36.340
|ros|dynamic-reconfigure|
<p>Not positive I have the terminology right, but the idea is that I have a ROS 1 node that can have multiple &quot;layers&quot; of namespaces for some of the parameters. So the parameter list is something like:</p> <pre><code>/perception_node/map_size /perception_node/sensor_1/max_range /perception_node/sensor_2/max_range </code></pre> <p>It doesn't <em>have</em> to be set up this way, the key here is that there are multiple &quot;sensor&quot; objects that have the same parameter names, but can have different values. And the sensor names themselves should ideally be configurable from the launch file or a YAML file.</p> <p>I'm able to get it up and running so that it all initializes correctly, I can have a sensor struct like this:</p> <pre><code>struct Sensor { string sensor_name; // &lt; This gets set in the constructor float max_range; void configure(ros::NodeHandle &amp; nodeHandle) { max_range = nodeHandle.param(sensor_name + &quot;/max_range&quot;); } }; </code></pre> <p>And that works, but I'd really like to use <a href="http://wiki.ros.org/dynamic_reconfigure" rel="nofollow noreferrer">dynamic reconfigure</a> with this setup too. I've used dynamic reconfigure before on other projects, so I know the basics of creating a &quot;.cfg&quot; file and everything.</p> <p>But dynamic reconfigure doesn't seem to like parameter names with &quot;/&quot; symbols in them, at least when I tried the following it failed to compile:</p> <pre><code>gen = ParameterGenerator() gen.add(&quot;sensor_1/max_range&quot;, float_t ...etc.... </code></pre> <p>My initial idea was that since the &quot;.cfg&quot; file is (I think) really a python file, I could do something clever here and read the sensor names from a configuration file rather than hard coding it like in the above example.</p> <p>I also tried using groups, but it looks like you're not allowed to use the same parameter name more than once even if you do this:</p> <pre><code>sensor_1_params = gen.addGroup(&quot;sensor_1&quot;) sensor_1_params.add(&quot;max_range&quot;, float_t ...etc... sensor_2_params = gen.addGroup(&quot;sensor_2&quot;) sensor_2_params.add(&quot;max_range&quot;, float_t ...etc... #Nope! This fails to compile too </code></pre> <p>The only thing I can think of right now is to get rid of the slashes, so that the parameters are called something like &quot;sensor_1_max_range&quot; and &quot;sensor_2_max_range&quot; and so on. The issue being that it would make the config callback kind of ugly, because on the C++ side I'd have to do something like:</p> <pre><code>if (sensor_name == &quot;sensor_1&quot;) { max_range = config.sensor_1_max_range; } else if (sensor_name == &quot;sensor_2&quot;) { max_range = config.sensor_2_max_range; } // And many more lines... </code></pre> <p>I also feel like this kind of defeats the purpose of having the sensor names in a configuration file, because now any time we want to add or remove sensors we need to edit the configuration file AND the C++ code.</p> <p>So, I guess I'm wondering is it possible to actually do something like what I want? Have people had to deal with this before? Or am I better off restructuring things?</p>
In ROS, is it possible to do dynamic reconfigure with "nested" parameters?
<p>People integrate into <code>move_base</code> for software engineering reasons: <code>move_base</code> provides a convenient common interface and integration with local/global planning, goal management, failure recovery, and command velocity calculations. You certainly could write your own code to wrap your planner in the same way as <code>move_base</code>, but why would you when there is already a widely used and supported system for it?</p> <p>I think you may be partly assuming that a planner is capable of moving the robot. It isn't: a planner (such as TEB) simply plans. You then need to interpret that path as a series of commands to be sent to the robot. <code>move_base</code> handles this (in addition to the other nice-to-have features like failure recovery).</p>
104203
2023-09-18T14:56:44.087
|navigation|move-base|path-planning|planner|teb-local-planner|
<p>I am working on path planning and path tracking for a while and I wonder, can TEB local planner (or any other local planner on ROS, DWA lets say) function without <em>move_base</em>?</p> <p>I mean do I have to use <em>move_base/nav_stack</em> if I want to develop a good and complex local planner like TEB? If not, why everyone integrates their planners as plug-ins to <em>move_base</em>?</p>
Can TEB or Other Local Planners Work Without move_base?
<p>It looks like there is a community port that has been merged into the &quot;ros2&quot; branch of the main repository for this project - <a href="https://github.com/ros-perception/imu_pipeline/pull/17" rel="nofollow noreferrer">https://github.com/ros-perception/imu_pipeline/pull/17</a>. That pull request also includes some details of how the ROS 2 version is different from what was in ROS 1 (mainly dropping older message type support)</p> <p>However, it hasn't been released as Debians so you'll have to build from source.</p>
104207
2023-09-18T17:06:06.417
|ros2|
<p>I'm converting a ROS1 project to ROS2. One of its dependencies is the <a href="http://wiki.ros.org/imu_transformer" rel="nofollow noreferrer">imu_transformer</a> package, which is supported in ROS1 all the way to Noetic, but has not been ported to ROS2 as of Iron.</p> <p>Is there a reason for that? Has TF2 been updated to include proper IMU message transformation between reference frames? Or is it just that the <code>imu_transformer</code> package hasn't been ported over yet?</p>
Equivalent of imu_transformer for ROS2?
<p>MoveIt uses joint_trajectory_controller to process the trajectory. I'm not sure now if it uses the topic or the action interface. If the latter is the case, you cannot directly subscribe to a topic.</p> <p>rviz and gazebo get the data by different means. rviz show the robot_model from tf2-data, which are sent from robot_state_publisher in a typical ros2_control setup. The publisher itself gets joint_states from <a href="https://control.ros.org/master/doc/ros2_controllers/joint_state_broadcaster/doc/userdoc.html" rel="nofollow noreferrer">joint_state_broadcaster</a>.</p> <p>Gazebo classic (or gazebo), which is a simulation of the physical system, uses <a href="https://control.ros.org/master/doc/gazebo_ros2_control/doc/index.html" rel="nofollow noreferrer">gazebo_ros2_control</a> or <a href="https://control.ros.org/master/doc/gz_ros2_control/doc/index.html" rel="nofollow noreferrer">gz_ros2_control</a> as hardware component. Hardware components and ros2_controllers interchange data by means of a shared memory, you cannot directly access data. But joint_trajectory_controller publishes a topic <a href="https://control.ros.org/master/doc/ros2_controllers/joint_trajectory_controller/doc/userdoc.html#publishers" rel="nofollow noreferrer">~/controller_state</a> where you can find the data.</p> <p>To write a driver (called hardware component) with ros2_control framework, have a look at the <a href="https://control.ros.org/master/doc/ros2_control_demos/doc/index.html" rel="nofollow noreferrer">demo section</a> of the documentation.</p>
104212
2023-09-18T19:36:26.353
|ros2|moveit|follow-joint-trajectory|jointtrajectory|ros2-control|
<p>I want to echo the topic responsible for sending <strong>Joint_trajectory</strong> to the simulation environment (rviz, gazebo). However, I can't read this data. I would like to use this data for sending to the hardware interface for a real robot.</p> <pre><code>OS Version: Ubuntu 22.04 ROS Version: ROS Humble ROS Packages: - Fanuc CRX-10iA/L description, - MoveIt2 package via moveit setup assistant </code></pre> <p>Thank you for your time!!!</p>
Which topic does Moveit2 send to robot simulation(rviz, gazebo) to accomplish desired motion execution?
<p>After extensive troubleshooting, I've identified and resolved the problem. The solution involves <strong>two critical steps</strong>:</p> <p><strong>1 Map Creation in GIMP</strong>:</p> <p>While creating a map in GIMP, saving it in the appropriate format, such as .pgm is essential. However, another crucial detail: the map must be saved in <strong>ASCII format</strong>. <a href="https://i.stack.imgur.com/RsDsE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RsDsE.png" alt="enter image description here" /></a></p> <p>If not saved in this format, the map doesn't populate correctly with the 255 value (White). Instead, it gets filled with question mark points (???????????), as illustrated in the attached figure (the right side is the right one in ASCII format). <a href="https://i.stack.imgur.com/tecQU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tecQU.png" alt="enter image description here" /></a></p> <p><strong>2-Map Resolution Adjustment:</strong></p> <p>The initial resolution of the map was set at 1.0. Surprisingly, the planner couldn't compute a path at this resolution. <strong>By reducing the resolution to 0.5,</strong> the planner was able to calculate a path, effectively resolving the &quot;plan with zero length&quot; issue. <a href="https://i.stack.imgur.com/ab0DA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ab0DA.png" alt="enter image description here" /></a></p> <p>With these adjustments, the primary navigation issue was addressed. However, <strong>I've now encountered a new challenge related to the local planner</strong>. I've provided a detailed description of this new problem in this subsequent post:</p> <p><a href="https://robotics.stackexchange.com/questions/104250/challenges-with-local-planner-in-ros2-navigation2-ineffectual-obstacle-avoidanc">Challenges with Local Planner in ROS2 Navigation2: Ineffectual Obstacle Avoidance and Potential Self-Detection</a></p> <p>Any assistance or insights regarding this would be greatly appreciated as I aim to conclude this project simulation successfully.</p>
104215
2023-09-19T02:53:21.997
|ros2|mapping|gps|path-planning|nav2|
<p>I've been working on a project using the Navigation2 stack to navigate a robot through <strong>GPS waypoints</strong>. When using a <strong>pre-built map</strong>, the robot successfully navigates to all waypoints. However, I encounter issues when <strong>I switch to an empty map</strong>.</p> <p><strong>Tutorials Followed:</strong> I have followed the tutorials by Ricardo Tellez (with Clearpath robotics, but they closed their open source project repo now to the outdoor nav product which uses ros2) on GPS integration within the Nav stack and tried to adjust it for the Nav2 stack (I have disabled SLAM and AMCL as the tutorial does not use them) :</p> <p><a href="https://www.youtube.com/watch?v=ZomR1tVziLM&amp;t=2155s" rel="nofollow noreferrer">ROS Extra Class #1: Outdoors Robot Navigation for Agricultural Robots Using ROS</a> <a href="https://www.youtube.com/watch?v=cmOplaq8cHc&amp;t=3547s" rel="nofollow noreferrer">How to use GPS to do autonomous robot navigation? // ROS Extra Class #2</a></p> <p><strong>Or is it possible use NAV2+GPS without any map ?</strong> (even empty) as suggested in this answer: <a href="https://robotics.stackexchange.com/questions/93412/navigation-without-pre-built-map-for-collision-free-movement">Navigation Without Pre-Built Map for Collision-Free Movement</a></p> <p>Despite following these tutorials, I'm still stuck on this issue.</p> <p>Working Scenario: <strong>With a pre-built map, the robot navigates successfully to all waypoints</strong>. Here's a video showcasing the successful navigation: <a href="https://www.youtube.com/watch?v=Co1__Ym2sk4" rel="nofollow noreferrer">GPS Waypoint Follower Planner NAV2 Stack (Previous Mapped Area) </a>.</p> <p>Issue Scenario: When <strong>using an empty map</strong>, the robot starts showing warnings and errors related to path planning and <strong>does not move, remaining stuck</strong>. Here's the output I get:</p> <blockquote> <p>[controller_server-7] [WARN] ... Received plan with zero length [controller_server-7] [ERROR] ... Controller patience exceeded [controller_server-7] [WARN] ... [ActionServer] Aborting handle. [recoveries_server-9] [INFO] ... Attempting spin</p> </blockquote> <p>Here's a video showcasing the issues with the empty map: <a href="https://youtu.be/WnBd-8VPA4Y" rel="nofollow noreferrer">GPS follower Empty map (Issue with Plan length = 0)</a></p> <p><strong>Request:</strong> I'm looking for insights into why the Navigation2 stack behaves differently with an empty map compared to a pre-built one. Any suggestions or best practices for navigating in an unknown environment using Navigation2 or/and SLAM would be greatly appreciated.</p> <p>I've already read this feature request discussion: <a href="https://github.com/ros-planning/navigation2/issues/2517" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/issues/2517</a> , but I confess I did not deeply understand how to adjust, trick or find a solution for my case:</p> <p>Thank you for your time and assistance!</p>
GPS+Navigation2 : Issues navigating with an empty map after success with a pre-built map: "Received plan with zero length"
<p>Let's ignore the &quot;robot&quot; part of this (for the time being) and focus instead on the math problem, since that's really the part you care about here.</p> <p>There's some list of actual points visited by the IMU: <span class="math-container">$$ P^A=\{p^A_0, p^A_1, \dots p^A_n\} $$</span></p> <p>(I'm assuming here that a 'point' is just an <span class="math-container">$\langle X, Y \rangle$</span> tuple.)</p> <p>And there's a corresponding list of measured points visited by the IMU: <span class="math-container">$$ P^M=\{p^M_0, p^M_1, \dots p^M_n\} $$</span></p> <p>Because it's dead reckoning, the measured and actual start points are the same, but there is drift over time so the final points are not the same. Your goal is now to adjust all of the measured points in some constant way until <span class="math-container">$p^M_0 = p^A_0$</span>.</p> <p>Your approach to this has been to consider yaw, which is good thinking but I'm not convinced it's totally necessary. With the representation I've described here, we can treat your problem as an example of the 2-dimensional curve fitting problem. That's a good thing: there are <a href="https://stackoverflow.com/questions/529184/simple-multidimensional-curve-fitting#529463">plenty</a> <a href="https://en.wikipedia.org/wiki/Polynomial_regression" rel="nofollow noreferrer">different</a> <a href="https://scipython.com/blog/non-linear-least-squares-fitting-of-a-two-dimensional-data/" rel="nofollow noreferrer">approaches</a> to this, and <a href="https://www.cs.jhu.edu/%7Emisha/Fall05/Papers/fang95.pdf" rel="nofollow noreferrer">some of them</a> get pretty fancy.</p> <p>But personally, I wouldn't bother with anything too complicated: we can use a Monte-Carlo approach to come to the right answer through a process of randomly guessing the drift and refining the guess until the end point becomes suitably accurate.</p> <p>Here's a python example, where ground truth points are generated, an accumulative IMU drift is applied to produce measured values, and then a Monte-Carlo method is used to come up with a pretty good guess:</p> <pre class="lang-py prettyprint-override"><code>import numpy as np import matplotlib.pyplot as plt # selecting a random imu drift, which the monte-carlo approach will not be made # aware of imu_drift = np.random.normal(0, 0.5, 1)[0] actual_points = np.random.normal(0, 1, (10, 2)) cumulative_drift = imu_drift * np.arange(10) cumulative_drift = cumulative_drift.repeat(2).reshape((-1, 2)) drifted_points = actual_points + cumulative_drift # now that we have ground truth and measured data, let's # try a monte-carlo approach to estimate the imu drift # we will use the mean squared error as the cost function best_estimate = None best_cost = None best_corrected_points = None costs = [] for imu_drift_guess in np.arange(-1, 1, 0.01): cumulative_drift = imu_drift_guess * np.arange(10) cumulative_drift = cumulative_drift.repeat(2).reshape((-1, 2)) this_guess = actual_points + cumulative_drift cost = np.mean((this_guess - actual_points) ** 2) costs.append(cost) if best_cost is None or cost &lt; best_cost: best_cost = cost best_estimate = imu_drift_guess best_corrected_points = this_guess.copy() assert best_corrected_points is not None print(f&quot;actual imu drift: {imu_drift}&quot;) print(f&quot;best estimate: {best_estimate}&quot;) # line plot of the points with numbered labels for n in range(len(actual_points)): plt.text(actual_points[n, 0], actual_points[n, 1], str(n)) plt.text(drifted_points[n, 0], drifted_points[n, 1], str(n)) plt.plot(actual_points[:, 0], actual_points[:, 1], &quot;o-&quot;, label=&quot;actual&quot;, linewidth=3) plt.plot(drifted_points[:, 0], drifted_points[:, 1], &quot;o-&quot;, label=&quot;drifted&quot;) plt.plot( best_corrected_points[:, 0], best_corrected_points[:, 1], &quot;o--&quot;, label=&quot;corrected&quot; ) plt.legend() # and also a plot of the cost function plt.figure() plt.plot(np.arange(-1, 1, 0.01), costs) plt.xlabel(&quot;imu drift guess&quot;) plt.ylabel(&quot;cost&quot;) plt.show() </code></pre>
104223
2023-09-19T16:11:32.240
|imu|yaw|dead-reckoning|
<p>I am working with IMU data (accelerometer, magnetometer and gyroscope) in order to estimate the path done by the object that contained the IMU. I am using dead reckoning for this. I am trying to estimate the path done only using the initial coordinates in latitude and longitude. However i have been now giving the last coordinate of the real path. I was hoping that knowing the last coordinate I could help adjust my estimation so that it ends on the last coordinate but I am not sure how to do that. I am using the Madgwick filter in order to obtain a quaternion and from there obtain the <strong>yaw</strong>. With the yaw I can then get the new position using the formula bellow:</p> <blockquote> <p>Formula: φ2 = asin( sin φ1 ⋅ cos δ + cos φ1 ⋅ sin δ ⋅ cos θ ) λ2 = λ1</p> <ul> <li>atan2( sin θ ⋅ sin δ ⋅ cos φ1, cos δ − sin φ1 ⋅ sin φ2 ) where φ is latitude, λ is longitude, θ is the yaw (clockwise from north), δ is the angular distance d/R; d being the distance travelled, R the earth’s radius</li> </ul> </blockquote> <p>How can I implement now the last position to better my result and make sure that my estimated positions end up around the last coordinate? Is it possible? I though about calculating the bearing between the initial coordinate and the last coordinate and use that bearing to adjust the calculated yaw. Something like:</p> <blockquote> <p>Formula for bearing: θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ ) where φ1,λ1 is the start point, φ2,λ2 the end point (Δλ is the difference in longitude)</p> </blockquote> <p>and then adjust the yaw obtained from the quaternion by summing the bearing (in radians)</p> <p>But it didn't work. I also thought about calculating the bearing between each estimated value and the last coordinate and just go updating it to then adjust the yaw value. However when I implement this the results are not the ones I expect. I am not a mathematician so bearing and yaw angles are kinda messing my head here. Any idea of the best way to do this?</p> <p>EDIT: Sharing this image in the hopes it becomes clearer. [![enter image description here][1]][1] Ignore the red dots. But the orange line is the real path done with the IMU and the blue line is the estimated path using dead reckoning and the initial coordinate. What I wish to do is, knowing now the last real point, how can i make sure that my estimated last point does not end there but it adjusts so it ends in the last real point. I put the black line to kinda represent the direction i want my estimation to go. What I tried put a straight line for the end coordinate but that is not what I want.</p> <p>[![enter image description here][2]][2]</p>
Adjust bearing knowing initial and last coordinate in dead reckoning
<p>Yes, look at the behavior tree XML you're using. You can set the rate there (or even make it a blackboard parameter so it can be adjusted on the fly).</p> <p>What's nice about this is that you can not only change the rate, but change when or why it recomputes (or doesn't recompute) the path! This is one of the common entry-level modifications of the BT to enable different navigation behavior. Hopefully you find even more to make your application even better!</p> <p>The controller frequency is totally unrelated to the planner replanning frequency, they are not coupled at all.</p>
104234
2023-09-20T11:39:30.593
|ros2|ros-humble|nav2|
<p>I have been testing out the Nav 2 stack in ROS 2 (humble) and was wondering if there is a method control the frequency at which the global plan is being updated. I am aware of the <code>controller_frequency</code> parameter in the controller server , but upon changing that value both the global plan and the local planner run at the same frequency causing odd behavior. Is there an alternative parameter that could decouple the global plan updates from the local planner ?</p>
Global plan update frequency Nav 2 [ROS 2]
<p>This is simply a differential drive robot; you may simply use the differential drive motion model. The asymmetry is of no real concern to MPPI/Smac, just make sure you provide the appropriate footprint.</p> <p>I don't know if there's some additional subtlety or problems you're hinting at needing that this doesn't provide, but that seems like the obvious solution :-)</p>
104238
2023-09-20T15:16:40.787
|path-planning|ros-humble|nav2|
<p>I'm employing the Smac Hybrid-A* Planner along with the Model Predictive Path Integral Controller for point-to-point navigation of a forklift, both indoors and outdoors. Notably, this forklift features a differential drive mechanism with two front wheels and an independently rotating rear wheel, mirroring a tricycle's kinematics. Additionally, I've opted for the &quot;reeds shepp&quot; method, addressing scenarios where in-place rotations aren't feasible.</p> <p>Can I develop a custom motion model compatible with both the smac-planner and mppi-controller?</p> <p>Any advice or guidelines on navigating these challenges would be greatly appreciated.</p> <p>Thank you.</p>
custom motion model for smac & mppi
<p>It turns out that all I had to do was follow the instructions in the error message itself, that is try the <code>--force-discover</code> option:</p> <pre><code>$ rqt --force-discover </code></pre> <p>After which the Robot Steering plugin was visible in RQT and could be loaded normally. Subsequent calls of <code>rqt</code> without the option also worked correctly.</p>
104241
2023-09-20T18:46:34.580
|ros2|rqt|
<p>I have a ROS2 Iron environment installed from the <code>ros-iron-desktop</code> package. The Robot Steering plugin isn't visible in RQT, even after installing <code>ros-iron-rqt-robot-steering</code>. Trying to start it on its own fails with the below error message:</p> <pre><code>$ rqt_robot_steering QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user' qt_gui_main() found no plugin matching &quot;rqt_robot_steering.robot_steering.RobotSteering&quot; try passing the option &quot;--force-discover&quot; Warning: class_loader.ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded. at line 127 in ./src/class_loader.cpp </code></pre>
Robot Steering plugin not visible in RQT
<p>Completely answered here: <a href="https://robotics.stackexchange.com/questions/104301/local-planner-not-extending-beyond-robots-footprint-boundaries-to-distort-globa/104309#104309">Local Planner Not Extending Beyond Robot&#39;s Footprint Boundaries to Distort Global Planner&#39;s Path</a></p> <p>Result:</p> <p><a href="https://i.stack.imgur.com/6Fegd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Fegd.png" alt="Avoiding Obstacles with GPS Follower" /></a> Now, we need fine-tuning to optimize the behavior.</p>
104250
2023-09-21T06:41:24.257
|teb-local-planner|nav2|local-costmap|avoid-obstacle|laser-filters|
<p>I'm currently facing challenges with the local planner in ROS2's Navigation stack, which is <strong>ineffectively distorting the global plan to avoid obstacles</strong> as displayed in these videos:</p> <p><a href="https://www.youtube.com/watch?v=g3BiKpJ2GV8" rel="nofollow noreferrer">GPS ok But Local Planner does not avoid obstacles</a> <a href="https://www.youtube.com/watch?v=-hUfrYxRUVA" rel="nofollow noreferrer">Pre mapped spod issue local planner- collision</a></p> <p>. The behavior observed is that the local planner seems to be caught in a loop, making continuous minor adjustments around the robot's footprint, reminiscent of <strong>a spiral pattern</strong>. <a href="https://i.stack.imgur.com/mmXNE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mmXNE.png" alt="enter image description here" /></a></p> <p>I'm unsure about the root cause and how to configure the planner for optimal performance properly.</p> <p>Here's my configuration file for the path planner: <a href="https://pastebin.com/5B52hKH4" rel="nofollow noreferrer">https://pastebin.com/5B52hKH4</a>.</p> <p>I've tried all the documented global planners in nav2: Smac Planner Hybrid, Lattice, Dubins, and Reedshep. My current setup uses the default DWB as the local planner:</p> <pre><code>FollowPath: plugin: &quot;dwb_core::DWBLocalPlanner&quot; debug_trajectory_details: True </code></pre> <p>And for the global planner:</p> <pre><code>GridBased: plugin: &quot;nav2_smac_planner/SmacPlannerHybrid&quot; downsample_costmap: false downsampling_factor: 1 tolerance: 1.0 allow_unknown: true cost_scaling_factor: 0.9 neutral_cost: 50 max_iterations: 1000000 max_on_approach_iterations: 1000 max_planning_time: 10.0 motion_model_for_search: &quot;DUBIN&quot; </code></pre> <p>One hypothesis I have is that the <strong>LiDARs might be detecting parts of the robot</strong> (e.g., the truck) as obstacles, leading the robot to attempt to <strong>avoid its own &quot;shadow&quot;</strong>. This behavior can be observed in this video <a href="https://www.youtube.com/watch?v=tz0ExUVdzPw&amp;t=102s" rel="nofollow noreferrer">Nav2 Smac Planner: Dubin Ackerman Local Planner Inadequate for Large Truck Robot</a></p> <p><a href="https://i.stack.imgur.com/A0xlB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A0xlB.png" alt="enter image description here" /></a></p> <p>To address this, I attempted <strong>to filter out the scan beams</strong> that detect this part of the truck, hoping it would mitigate the issue. However, this approach didn't yield the desired results, as the robot <strong>still displayed the same erratic behavior</strong>, as shown in this video <a href="https://www.youtube.com/watch?v=xM4txltYsxA" rel="nofollow noreferrer">Laser Scan Filtering avoid false positives (Error) NAV2</a></p> <p><a href="https://i.stack.imgur.com/jHaxu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jHaxu.png" alt="enter image description here" /></a></p> <p>Does anyone have insights or suggestions on <strong>how to effectively configure the local planner to deviate from the global plan for obstacle avoidance?</strong> Filtering the laser scan didn't seem to be effective. Are there other methods or configurations I should consider? Additionally, <strong>has anyone tried using TEB with nav2?</strong> Does it offer better performance in such scenarios? If yes, How to configure it/ integrate it with Nav2?</p>
Challenges with Local Planner in ROS2 Navigation2: Ineffectual Obstacle Avoidance and Potential Self-Detection
<p>The &quot;easy&quot; solution would be to use a footprint that covers the robot in any configuration - the downside is that footprint is likely quite large and if you are planning in confined areas, that won't work well (but likely does work out of the box with Nav2 and the SMAC hybrid planner).</p> <p>I'm not sure that any of the existing planners would support a more accurate approach out of the box - you're actually getting closer to the type of planning that is done for manipulators than mobile bases. In that case, I would start with something like the SMAC Lattice Planner - and add the central pivot angle as one of the lattice state variables - so you would effectively have x/y/theta/pivot as the state space. In addition to updating the collision checking to use the pivot angle to define the footprint, you would also have to update the motion primitives. While this would likely entail quite a bit of work, you should be able to better define the actual kinematics of the mobile platform (since it is not actually an Ackermann platform, which is what the Hybrid A* is expecting).</p>
104252
2023-09-21T07:46:01.493
|ros-humble|motion|nav2|
<p>I'm employing the Smac Hybrid-A* Planner along with the Model Predictive Path Integral Controller for point-to-point navigation of an wheel-loader/LHD vehicle. The challenge is that there's a central pivot point, disrupting a consistent footprint. Therefore, during a three-point turn, the footprint doesn't maintain a parallel or rectangular shape, as shown in the figure below.<a href="https://i.stack.imgur.com/3a9Ni.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3a9Ni.png" alt="Kinematic drawing of wheel-loader/LHD vehicle" /></a></p> <p>Given that this vehicle will navigate within a confined space and weighs 25 tons, it's essential to have an accurate footprint.</p> <p>Any advice or guidelines on navigating this challenge would be greatly appreciated.</p> <p>Thank you.</p>
Dynamical footprint in Nav2
<p>I just realized the controller response is actually <code>?S 1\rS=0\r</code> so with my code I am only getting the first part of the message, so to fix this I just added another serial <code>ReadLine</code> to get both parts of the message like this:</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;sstream&gt; #include &lt;iostream&gt; #include &lt;libserial/SerialPort.h&gt; int main(){ LibSerial::SerialPort serial_comm_; float enc1; float enc2; serial_comm_.Open(&quot;/dev/ttyACM0&quot;); serial_comm_.SetBaudRate(LibSerial::BaudRate::BAUD_115200); serial_comm_.FlushIOBuffers(); std::stringstream msg_to_send; msg_to_send &lt;&lt; &quot;?S 1_&quot;; serial_comm_.Write(msg_to_send.str()); std::string command = &quot;&quot;; std::string response = &quot;&quot;; try { serial_comm_.ReadLine(command, '\r', 1000); serial_comm_.ReadLine(response, '\r', 1000); std::cout &lt;&lt; command &lt;&lt; std::endl; std::cout &lt;&lt; response &lt;&lt; std::endl; } catch(const LibSerial::ReadTimeout&amp;) { std::cerr &lt;&lt; &quot;The ReadByte() call has timed out.&quot; &lt;&lt; std::endl; } serial_comm_.Close(); return 0; } </code></pre> <p>Maybe there is a more elegant way to solve this issue but this works for me at the moment.</p>
104264
2023-09-21T15:42:53.223
|c++|serial|motor-controller|
<p>I am trying to communicate with a Roboteq FBL2360TE brushless motor controller using serial communication, according with the controller's user manual if I send a <code>?S 1_</code> command to request the encoder velocity in RPMs I should get something like <code>S=0</code>, but instead I am getting the same command I sent. This is an example code I am using to test:</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;sstream&gt; #include &lt;iostream&gt; #include &lt;libserial/SerialPort.h&gt; int main(){ LibSerial::SerialPort serial_comm_; float enc1; float enc2; serial_comm_.Open(&quot;/dev/ttyACM0&quot;); serial_comm_.SetBaudRate(LibSerial::BaudRate::BAUD_115200); serial_comm_.FlushIOBuffers(); std::stringstream msg_to_send; msg_to_send &lt;&lt; &quot;?S 1_&quot;; serial_comm_.Write(msg_to_send.str()); std::string response = &quot;&quot;; try { serial_comm_.ReadLine(response, '\r', 1000); std::cout &lt;&lt; response &lt;&lt; std::endl; } catch(const LibSerial::ReadTimeout&amp;) { std::cerr &lt;&lt; &quot;The ReadByte() call has timed out.&quot; &lt;&lt; std::endl; } serial_comm_.Close(); return 0; } </code></pre> <p>Thanks in advance for the help!</p>
Not getting the correct response from the controller serial communication
<p>I have found the mistake, I have renamed my yaml and png map files and forgot to adjust the new png name in the yaml file. Thank you very much for the help still akchobby!</p>
104269
2023-09-21T17:42:13.400
|ros2|mapping|turtlebot2|nav2|
<p><a href="https://i.stack.imgur.com/QtPsP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QtPsP.png" alt="enter image description here" /></a>I'm currently using the TurtleBot2 on Ubuntu 22.04 Humble and successfully generated a map with <code>ros2 launch nav2_bringup navigation_launch.py</code>. I was able to use the command <code>ros2 launch nav2_bringup bringup_launch.py map:=/name/of/path.yaml</code> several times (it was showing the map sometimes and wasnt showing the map sometimes aswell) but now whenever I am launching the command it tells me</p> <blockquote> <p>[component_container_isolated-1] [INFO] [1695317742.382350265] [global_costmap.global_costmap]: Timed out waiting for transform from base_link to map to become available, tf error: Invalid frame ID &quot;map&quot; passed to canTransform argument target_frame - frame does not exist</p> </blockquote> <p>Opening the rviz config /nav2_bringup/rviz2/nav2_default_view.rviz results in Rviz2 telling me, that no map is received. I was trying to change the QoS aswell, which didnt have an impact at all.</p> <p>I have looked into rqt_graph and /map was connected to global_cost_map, also I checked rqt and /map was not receiving any messages when I have monitored it in rqt.</p> <p>Can someone help me out please?</p>
ROS2 Map not received when using nav2_bringup
<p>This is one of the strange (undocumented?) things of Gazebo Sim: there is an element <code>&lt;background&gt;</code> in the <code>&lt;scene&gt;</code> element in the SDF, but also a <code>&lt;background_color&gt;</code> element in the configuration of the <code>MinimalScene</code> plugin.</p> <p>I don't know when the former is used, but the latter does set the background color:</p> <h3>To set from the SDF</h3> <p>Have a look at the <a href="https://github.com/gazebosim/gz-sim/blob/gz-sim7/examples/worlds/empty_gui.sdf" rel="nofollow noreferrer">empty_gui.sdf</a> example world:</p> <p>If you follow <a href="https://github.com/gazebosim/gz-sim/blob/e007fa2c0b2e795ab1b74c75e48962b8dfacedba/examples/worlds/empty_gui.sdf#L6-L15" rel="nofollow noreferrer">instructions 1. and 2.</a> you will see that the scene initially loads with background color as specified by the <a href="https://github.com/gazebosim/gz-sim/blob/e007fa2c0b2e795ab1b74c75e48962b8dfacedba/examples/worlds/empty_gui.sdf#L51" rel="nofollow noreferrer">MinimalScene <code>&lt;background_color&gt;</code></a>. Try changing it: the numbers represent RGB, with value between 0.0 and 1.0.</p> <p>Upon load of the Scene Manager plugin per instruction 2., the background color is replaced by a sky texture, which can be avoided by removing <a href="https://github.com/gazebosim/gz-sim/blob/e007fa2c0b2e795ab1b74c75e48962b8dfacedba/examples/worlds/empty_gui.sdf#L59" rel="nofollow noreferrer">this line</a>. So strangely, the <code>&lt;sky&gt;</code> setting of the <code>&lt;scene&gt;</code> entry <em>does</em> have an effect, whereas the <a href="https://github.com/gazebosim/gz-sim/blob/e007fa2c0b2e795ab1b74c75e48962b8dfacedba/examples/worlds/empty_gui.sdf#L58" rel="nofollow noreferrer"><code>&lt;background&gt;</code> setting</a> does <em>not</em>.</p> <h3>To set from the gui config file</h3> <p>Alternatively, the same <code>&lt;background_color&gt;</code> setting can be done in the gui config file. The default file is located at <code>${HOME}/.gz/sim/7/gui.config</code>. A custom config file can be loaded by starting Gazebo Sim with:</p> <p><code>gz sim --gui-config &lt;path_to_config_file&gt;</code></p> <p>The current config can be saved from Gazebo Sim by clicking the horizontal lines icon at the top left and choosing <code>Save client configuration as</code>.</p> <h3>To set programmatically</h3> <p>If you'd want to change the background color programmatically, take a look at <a href="https://gazebosim.org/api/sim/8/rendering_plugins.html" rel="nofollow noreferrer">this tutorial</a> and corresponding <a href="https://github.com/gazebosim/gz-sim/tree/main/examples/plugin/rendering_plugins" rel="nofollow noreferrer">source code</a>. Note the difference between the server-side scene (used by Gazebo Sim sensors) and the gui-side scene.</p>
104275
2023-09-22T02:09:11.830
|gazebo|
<p>My current .sdf file looks like the following. my goal is to set the background to a specific colour by changing this sdf file. Found online &quot;solutions&quot; state that this can be done by setting the background variable in the <a href="http://sdformat.org/spec?elem=scene" rel="nofollow noreferrer">scene tag</a>. However I can't see any changes when this is done. The only thing i can think of is maybe its being overridden by some other value, but the verbose output seems fine.</p> <pre><code>&lt;?xml version=&quot;1.0&quot; ?&gt; &lt;sdf version='1.9'&gt; &lt;world name='default'&gt; &lt;physics name='1ms' type='ignored'&gt; &lt;max_step_size&gt;0.001&lt;/max_step_size&gt; &lt;real_time_factor&gt;1&lt;/real_time_factor&gt; &lt;real_time_update_rate&gt;1000&lt;/real_time_update_rate&gt; &lt;/physics&gt; &lt;scene&gt; &lt;ambient&gt;0 0 0 0&lt;/ambient&gt; &lt;background&gt;0 0 0 0&lt;/background&gt; &lt;shadows&gt;true&lt;/shadows&gt; &lt;grid&gt;true&lt;/grid&gt; &lt;/scene&gt; &lt;light name='sun' type='directional'&gt; &lt;pose&gt;0 0 10 0 -0 0&lt;/pose&gt; &lt;cast_shadows&gt;true&lt;/cast_shadows&gt; &lt;intensity&gt;1&lt;/intensity&gt; &lt;direction&gt;-0.5 0.1 -0.9&lt;/direction&gt; &lt;diffuse&gt;0.8 0.8 0.8 1&lt;/diffuse&gt; &lt;specular&gt;0.2 0.2 0.2 1&lt;/specular&gt; &lt;attenuation&gt; &lt;range&gt;1000&lt;/range&gt; &lt;linear&gt;0.01&lt;/linear&gt; &lt;constant&gt;0.90000000000000002&lt;/constant&gt; &lt;quadratic&gt;0.001&lt;/quadratic&gt; &lt;/attenuation&gt; &lt;spot&gt; &lt;inner_angle&gt;0&lt;/inner_angle&gt; &lt;outer_angle&gt;0&lt;/outer_angle&gt; &lt;falloff&gt;0&lt;/falloff&gt; &lt;/spot&gt; &lt;/light&gt; &lt;/world&gt; &lt;/sdf&gt; </code></pre> <p><a href="https://i.stack.imgur.com/lMNet.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lMNet.png" alt="Picture of simulation without correct background colour" /></a></p>
gazebo garden, how to set background colour
<p>This question is interesting. Look at this video of Doug using AI and a kinect sensor to locate objects and generate the transforms that locate the objects in the space around the camera(robot).</p> <p><a href="https://www.youtube.com/watch?v=fXJYmJOaSxQ" rel="nofollow noreferrer">https://www.youtube.com/watch?v=fXJYmJOaSxQ</a></p> <p><a href="https://github.com/douglasrizzo/dodo_detector" rel="nofollow noreferrer">https://github.com/douglasrizzo/dodo_detector</a></p> <p>The range that the kinect works at may not be suitable for your uses and it may struggle with transparent things as well, but this should get you thinking. Intel makes a similar sensor that may have more suitable functional ranges.</p> <p>Regarding your question if this will work...everything is impossible until someone tries. If your true goal is just to pick up trash, put on some gloves and start picking up trash. If this is a way to learn about technology and robotics, it's a fantastic idea and you'll learn more than you thought possible. It's a pretty significant idea and will involve significant effort to get something working. In my mind a robot that can pick up paper but misses the bottles is still a great robot. I'm not sure you should lose sleep over the misses, focus on the gets.</p> <p>Apologies for not answering the question about getting lidar to see glass. If you're really set on this, take a look at <strong>thermal imagers</strong>. Glass is opaque (and reflective) in the range that thermal imagers work at. There may be something there but the reflectiveness likely creates new issues.</p> <p>Also look at <strong>stereo cameras</strong>. They can locate objects and give you distance, but expensive.</p>
104295
2023-09-22T23:21:13.747
|sensors|lidar|
<p>I am wanting to create a robot that can pick up trash. I am planning on taking a picture of the trash, using an ai i've trained to detect the trash, using opencv to find the contour of the trash, and then lining the contour up with a pointcloud generated by LiDAR to determine where the object is in space and its dimensions. However, I know that LiDAR can't accurately see glass or plastic. Is there a way to sense transparent objects with LiDAR? If there isn't any reasonable way to, are there any other sensors that can sense glass? I am aware of ultrasonic, but I'm under the impression that it won't be able to create a point cloud accurate for what i'd be needing, if at all. I also am aware of infrared, but I was under the impression that some plastics are transparent to infrared. I also don't know if it can generate a point cloud for what I need. I found some things about 3d scanning, which said to spray paint it before scanning, but that wouldn't work in this situation. Also, I'm not experienced with robotics, so if this won't work at all, please tell me :).</p>
How to detect transparent objects (glass, plastic, etc.) with LiDAR (or what sensors can)?
<p>After extensive debugging and parameter tuning, I identified the root cause of the issue and made significant improvements to the robot's path planning and obstacle avoidance behavior.</p> <p><strong>Turning Radius:</strong> The primary issue was related to the <strong>minimum_turning_radius parameter</strong>. Initially, it was set to a very low value (0.00001), telling the planner that the robot could make near-instantaneous turns. This is unrealistic for most non-holonomic robots. The planner started generating paths the robot could feasibly follow by adjusting this parameter to a more realistic value (2.0), leading to more predictable behavior.</p> <p><strong>Unknown Space Treatment:</strong> I also adjusted the unknown_cost_value parameter in the global_costmap. By default, unknown spaces are often treated as obstacles, causing the robot to stop when it encounters an unknown area. By setting this value to 120 (between free and lethal), the planner cautiously treats unknown areas but doesn't completely avoid them. This adjustment was <strong>particularly beneficial in dynamic environments, allowing the robot to replan paths based on new obstacle data</strong>.</p> <p>With these changes, the robot now successfully avoids obstacles. However, <strong>there's still room for improvement</strong>. While the robot can navigate smaller obstacles like an ambulance, <strong>it struggles with larger obstacles like a bus.</strong> In such scenarios, the robot doesn't expand its search to farther regions to find a feasible path around the obstacle. Instead, it stops, which, while safe, isn't the most efficient behavior.</p> <p><strong>This video shows the fix for this issue</strong>: <a href="https://www.youtube.com/watch?v=r4QZt6_dG7o" rel="nofollow noreferrer">GPS waypoints follower +obstacle avoidance NAV2</a></p> <p>Result:</p> <p><a href="https://i.stack.imgur.com/VFeEj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VFeEj.png" alt="Avodiding Obstacle: Replan Path Dynamically " /></a></p> <p>Next Steps: To further enhance the robot's obstacle avoidance capabilities, I plan to:</p> <p><strong>Experiment with different combinations of path planner plugins (both local and global) to find the most suitable one for my robot and environment. Fine-tune the costmap layers, especially the inflation layer, to ensure the robot maintains a safe distance from obstacles.</strong> Adjust other parameters like the costmap resolution to make the obstacle avoidance more robust. In summary, while the current setup significantly improves the initial configuration, there's still work to achieve optimal performance, especially in complex environments with large obstacles.</p>
104301
2023-09-23T09:53:03.090
|base-local-planner|teb-local-planner|global-planner|nav2|footprint|
<p>I've been facing an issue with the local planner in my ROS2 navigation setup. The core of the problem seems to be that the <strong>local planner does not extend sufficiently outside the robot's footprint boundaries</strong>. This results in the local planner not having adequate &quot;contact&quot; with the local costmap, <strong>preventing it from effectively distorting the global planner's path when encountering obstacles</strong>.</p> <p>I've visualized this behavior in several videos, which can be viewed here:</p> <p><a href="https://youtu.be/OW2o4EJTrrY" rel="nofollow noreferrer">SMAC DUBIN + TEB</a></p> <p><a href="https://youtu.be/OW2o4EJTrrY" rel="nofollow noreferrer">SMAC REEDS-SHEEP + DWB</a></p> <p><strong>Setup and Observations:</strong></p> <p>Robot Configuration: My robot is a truck with specific dimensions and footprint. The footprint is defined as: footprint: &quot;[[-4.8025, -1.739], [4.8025, -1.739], [4.8025, 1.739], [-4.8025, 1.739]]&quot;.</p> <p><strong>Planners Tested:</strong></p> <p>Global Planners: Smac (Dubin and REED-SHEP) , ThetaStar, NAVFN Local Planners: DWB and TEB</p> <p>Pictures (<strong>LOCAL PLANNER IS IN BLUE, GLOBAL IN RED</strong>): The global planner crosses the footprint boundary (<strong>green rectangle)</strong>, but the local planner does not.</p> <p><a href="https://i.stack.imgur.com/J5GLD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J5GLD.png" alt="enter image description here" /></a></p> <p><a href="https://i.stack.imgur.com/e8Dg4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e8Dg4.png" alt="enter image description here" /></a></p> <p>Behavior Observed:</p> <p>Regardless of the combination of global and local planners, <strong>the local planner seems entirely submissive to the global planner's path</strong>.</p> <p><strong>Instead of deforming the global path to avoid obstacles, the local planner follows it.</strong></p> <p><strong>Attempts to Resolve:</strong></p> <p>I've tried adjusting various parameters related to the local and global planners, including footprint configurations, costmap resolutions, and planner-specific parameters. I've also experimented with different motion models and cost functions. Despite these efforts, the core issue remains unresolved. Request:</p> <p>I'm seeking assistance in understanding and resolving this behavior. <strong>It's crucial for the local planner to effectively distort the global path when necessary</strong>, ensuring safe and efficient navigation. Any insights, suggestions, or recommendations would be greatly appreciated.</p>
Local Planner Not Extending Beyond Robot's Footprint Boundaries to Distort Global Planner's Path
<p>This is a <a href="https://github.com/gazebosim/gz-transport/issues/263" rel="nofollow noreferrer">known issue</a>, fixed by <a href="https://github.com/gazebosim/gz-transport/pull/379" rel="nofollow noreferrer">this PR</a>.</p> <p>So this will be fixed in the upcoming Harmonic release, as well as in Garden (and I assume also Fortress), when updated packages are released. If you can't wait for that, you can compile from source per <a href="https://gazebosim.org/docs/garden/install_ubuntu_src" rel="nofollow noreferrer">these instructions</a>.</p> <p>Note though that only the topic <em>list</em> is affected. I.e. it is not because they are not listed, that there are no listeners. If you publish to the correct topic, it should work just fine. If you're not sure about the correct topic name: often the subscription topic is listed in the debug log output.</p>
104316
2023-09-24T18:43:40.500
|gazebo|joint|gazebo-11|gazebo-ignition|joints|
<p>I am trying to get the Joint Position Controller working with either Gazebo Fortress of Gazebo Garden. For the former I start the demo simulation with:</p> <pre><code>ign gazebo -v 4 joint_position_controller.sdf </code></pre> <p>Then check for available topics with:</p> <pre><code>ign topic -l </code></pre> <p>And none of the joint command topics are listed.</p> <p>I see equivalent results with Gazebo Garden, and with the Joint Controller Plugin, and I have also reproduced this with all of the demo worlds that come with those versions of Gazebo and also with NAO Joint Control here <a href="https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/NAO%20joint%20control" rel="nofollow noreferrer">https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/NAO%20joint%20control</a></p> <p>Interestingly, for that last one, the GUI does allow me to control the joints.</p> <p>Is this a bug or am I doing something wrong? Please help.</p>
Joint Position Controller Plugin doesn't subscribe to any topics
<p>We're working on adding something like this in the coming weeks to months as part of a collaboration with a client company. Stay tuned!</p>
104317
2023-09-24T19:23:17.190
|ros2|nav2|
<p>I'm building my lawnmower robot using ROS2 and Nav2, and everything is working correctly. However, I can't seem to find any information on how to implement full coverage path planning using Nav2 in ROS2. While Nav2 helps me detect and avoid obstacles, I'm struggling to find guidance on achieving full coverage. Does anyone with more expertise have any suggestions?</p>
Full Coverage Path with ROS2 and Nav2
<p>Welcome to Robotics Stack Exchange!</p> <p>If <code>my_ros_pkg</code> and <code>MyService.srv</code> are the name of the ROS package and name of the service file, respectively, please use the following line to import the service:</p> <pre><code>from my_ros_pkg.srv import MyService, MyServiceRequest, MyServiceResponse </code></pre>
104324
2023-09-25T08:03:11.263
|ros|python|rospy|rosservice|ros-noetic|
<p>I have created a simple custom ROS service for ROS Noetic. My import line is:</p> <pre><code>from fishbot_ros.srv import chess_service, chess_serviceResponse </code></pre> <p>The file structure is like this:</p> <pre><code>. └── parent ├── src │   └── chess_node.py └── srv └── chess_service.srv </code></pre> <p>The service is generated correctly and is viewable by <code>rossrv show</code>. I have cleaned <code>devel</code> and <code>build</code> subfolders and then executed <code>catkin make</code>.</p> <p>My CMakeLists.txt has the following sections:</p> <pre><code>find_package(catkin REQUIRED COMPONENTS rospy message_generation std_msgs ) add_service_files( FILES chess_service.srv ) </code></pre> <p>My package.xml has the following:</p> <pre><code> &lt;buildtool_depend&gt;catkin&lt;/buildtool_depend&gt; &lt;build_depend&gt;rospy&lt;/build_depend&gt; &lt;build_export_depend&gt;rospy&lt;/build_export_depend&gt; &lt;build_export_depend&gt;std_msgs&lt;/build_export_depend&gt; &lt;exec_depend&gt;rospy&lt;/exec_depend&gt; &lt;exec_depend&gt;std_msgs&lt;/exec_depend&gt; &lt;build_depend&gt;message_generation&lt;/build_depend&gt; &lt;exec_depend&gt;message_runtime&lt;/exec_depend&gt; </code></pre> <p>Please help me understand what I'm doing wrong. I did this for a different project a while ago, and I've done everything the same.</p>
Custom ROS Service Cannot be Imported
<p>I encountered the same issue while following the ROS 2 service client tutorial. Initially, I attempted the workaround suggested in this <a href="https://answers.ros.org/question/402985/ros2-following-basic-serviceclient-tutorial-executables-doesnt-seems-to-install/" rel="nofollow noreferrer">ROSanswers post</a>, but it didn't resolve my problem.</p> <p>The root cause of the issue was the presence of the <code>setuptools_scm</code> package. Colcon was using <code>setuptools_scm</code> instead of the traditional <code>setuptools</code>. To determine if you have <code>setuptools_scm</code> installed, you can use the following command:</p> <pre class="lang-bash prettyprint-override"><code>pip3 list | grep setuptools </code></pre> <p>In my case, I completely removed the package because it wasn't useful for me.</p> <pre class="lang-bash prettyprint-override"><code>pip3 uninstall setuptools-scm </code></pre> <p>In addition, make sure that you are using <code>setuptools 58.2.0</code>. In case you can install this specific version.</p> <pre class="lang-bash prettyprint-override"><code>pip3 install setuptools==58.2.0 </code></pre> <p>This worked for me. Let me know if encounter any issues.</p>
104326
2023-09-25T08:27:59.640
|ros2|build|colcon|git|
<p>I started to learn ros2, installed ros2 humble, have followed the tutorial of the channel <a href="https://www.youtube.com/watch?v=iBGZ8LEvkCY&amp;list=PLLSegLrePWgJudpPUof4-nVFHGkB62Izy&amp;index=4" rel="nofollow noreferrer">Robotics Back-End</a> before and I was able to successfully create a node.</p> <p>After some time I wanted to visit the tutorial again and started working on it, but I have been facing &quot;listing git files failed - pretending there aren't any&quot; error on colcon build. I had my_robot_controller node before and I wanted to add a fresh new node called my_robot_controller_2.</p> <p>This is the output of <code>colcon build --event-handlers console_direct+</code> command on the workspace</p> <pre><code>Starting &gt;&gt;&gt; my_robot_controller Starting &gt;&gt;&gt; my_robot_controller_2 running develop running develop running egg_info writing ../../build/my_robot_controller/my_robot_controller.egg-info/PKG-INFO writing dependency_links to ../../build/my_robot_controller/my_robot_controller.egg-info/dependency_links.txt writing entry points to ../../build/my_robot_controller/my_robot_controller.egg-info/entry_points.txt writing requirements to ../../build/my_robot_controller/my_robot_controller.egg-info/requires.txt writing top-level names to ../../build/my_robot_controller/my_robot_controller.egg-info/top_level.txt running egg_info writing ../../build/my_robot_controller_2/my_robot_controller_2.egg-info/PKG-INFO writing dependency_links to ../../build/my_robot_controller_2/my_robot_controller_2.egg-info/dependency_links.txt writing entry points to ../../build/my_robot_controller_2/my_robot_controller_2.egg-info/entry_points.txt writing requirements to ../../build/my_robot_controller_2/my_robot_controller_2.egg-info/requires.txt writing top-level names to ../../build/my_robot_controller_2/my_robot_controller_2.egg-info/top_level.txt listing git files failed - pretending there aren't any listing git files failed - pretending there aren't any reading manifest file '../../build/my_robot_controller/my_robot_controller.egg-info/SOURCES.txt' writing manifest file '../../build/my_robot_controller/my_robot_controller.egg-info/SOURCES.txt' running build running build_py running install running install_lib running install_data running install_egg_info removing '/home/u28i31/ros2_ws/install/my_robot_controller/lib/python3.10/site-packages/my_robot_controller-0.0.0-py3.10.egg-info' (and everything under it) Copying ../../build/my_robot_controller/my_robot_controller.egg-info to /home/u28i31/ros2_ws/install/my_robot_controller/lib/python3.10/site-packages/my_robot_controller-0.0.0-py3.10.egg-info running install_scripts reading manifest file '../../build/my_robot_controller_2/my_robot_controller_2.egg-info/SOURCES.txt' writing manifest file '../../build/my_robot_controller_2/my_robot_controller_2.egg-info/SOURCES.txt' running build running build_py running install running install_lib running install_data running install_egg_info removing '/home/u28i31/ros2_ws/install/my_robot_controller_2/lib/python3.10/site-packages/my_robot_controller_2-0.0.0-py3.10.egg-info' (and everything under it) Copying ../../build/my_robot_controller_2/my_robot_controller_2.egg-info to /home/u28i31/ros2_ws/install/my_robot_controller_2/lib/python3.10/site-packages/my_robot_controller_2-0.0.0-py3.10.egg-info running install_scripts Installing draw_circle script to /home/u28i31/ros2_ws/install/my_robot_controller/lib/my_robot_controller Installing test_node script to /home/u28i31/ros2_ws/install/my_robot_controller/lib/my_robot_controller writing list of installed files to '/home/u28i31/ros2_ws/build/my_robot_controller/install.log' writing list of installed files to '/home/u28i31/ros2_ws/build/my_robot_controller_2/install.log' --- stderr: my_robot_controller listing git files failed - pretending there aren't any --- Finished &lt;&lt;&lt; my_robot_controller [1.81s] --- stderr: my_robot_controller_2 listing git files failed - pretending there aren't any --- Finished &lt;&lt;&lt; my_robot_controller_2 [1.81s] Summary: 2 packages finished [1.97s] 2 packages had stderr output: my_robot_controller my_robot_controller_2 </code></pre> <p>This is the result of <code>pip3 list | grep colcon</code></p> <pre><code>colcon-argcomplete 0.3.3 colcon-bash 0.4.2 colcon-cd 0.1.1 colcon-cmake 0.2.27 colcon-common-extensions 0.3.0 colcon-core 0.12.1 colcon-defaults 0.2.8 colcon-devtools 0.2.3 colcon-installed-package-information 0.1.0 colcon-library-path 0.2.1 colcon-metadata 0.2.5 colcon-mixin 0.2.3 colcon-notification 0.2.15 colcon-output 0.2.13 colcon-override-check 0.0.1 colcon-package-information 0.3.3 colcon-package-selection 0.2.10 colcon-parallel-executor 0.2.4 colcon-pkg-config 0.1.0 colcon-powershell 0.3.7 colcon-python-setup-py 0.2.8 colcon-recursive-crawl 0.2.1 colcon-ros 0.3.23 colcon-test-result 0.3.8 colcon-zsh 0.4.0 </code></pre> <p>A previous solution suggests to change the dashes in <code>setup.cfg</code> files to underscores but they are already with underscores.</p> <pre><code>[develop] script_dir=<span class="math-container">$base/lib/my_package [install] install_scripts=$</span>base/lib/my_package </code></pre> <p>If it helps, these lines are in my ~/.bashrc</p> <pre><code>source &lt;(ng completion script) source /opt/ros/humble/setup.bash source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash source ~/ros2_ws/install/setup.bash </code></pre> <p>Is there anything that I am missing?</p>
colcon build on ROS2 humble outputs "listing git files failed - pretending there aren't any"
<p>To have those environment variables exported in every command line automatically, the easiest thing to do is to add <code>export VARIABLE_NAME=VALUE</code> for each one at the end of the <code>~/.bashrc</code> file.</p> <p>After saving, you need to open a new terminal window or call <code>source ~/.bashrc</code> for the changes to take effect.</p> <p><strong>Edit:</strong></p> <p>You shouldn't have to export those variables by yourself as those are taken care of by the <code>setup.bash</code> script inside your ros humble instalation.</p> <p>Please make sure you have your ros installation sourced in <code>~/.bashrc</code> via <code>source /opt/ros/humble/setup.bash</code></p> <p><a href="https://wiki.ros.org/ROS/EnvironmentVariables" rel="nofollow noreferrer">Docs here</a></p>
104333
2023-09-25T21:04:58.737
|ros2|ros-humble|environment-variables|
<p>I carefully followed the install instructions for installing ROS2 Humble binary.</p> <p><a href="https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html</a></p> <p>The install had no errors. And I did the talker-listener test to make sure.</p> <p>But none of the ROS environment variables are set.</p> <p>When I type <code>printenv</code> I don't see <code>ROS_VERSION=2</code>,<code>ROS_PYTHON_VERSION=3</code> or <code>ROS_DISTRO=humble</code>.</p> <p>The tutorials page just says to go back to the installation page or get help from the community. So here I am :)</p> <p>Thanks in advance!</p>
ROS Environment variables not set after new Humble install on Ubuntu 22.04
<p>I've accidentally stumbled upon an answer to this issue while reading the OpenVINS <a href="https://docs.openvins.com/gs-tutorial.html#gs-tutorial-ros2" rel="nofollow noreferrer">docs</a>.</p> <pre><code>from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, OpaqueFunction from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node launch_args = [ DeclareLaunchArgument(name='config', default_value='default', description='description'), ] def launch_setup(context): config = LaunchConfiguration('config').perform(context) # Here you'll get the runtime config value node1 = Node(package = '...', executable = '...', parameters =[{'config': LaunchConfiguration('config')}]) return [node1] def generate_launch_description(): opfunc = OpaqueFunction(function = launch_setup) ld = LaunchDescription(launch_args) ld.add_action(opfunc) return ld </code></pre> <p>Basically you need to create an <a href="https://github.com/ros2/launch/blob/rolling/launch/launch/actions/opaque_function.py" rel="nofollow noreferrer">OpaqueFunction</a> that recieves the correct runtime context -&gt; This allows for correctly evaluating the <code>LaunchConfiguration.perform(Context)</code> function.</p> <p>You can then act upon the runtime config value in whatever way you like.</p>
104340
2023-09-26T08:27:19.700
|ros2|python|launch-file|ros2-launch|
<p>I've came across an interesting issue.</p> <p>Is it possible to get the value of the LaunchArgument inside the python launch file?</p> <p>Take the following scenario:</p> <pre><code>... def generate_launch_description(): input_topic_arg = DeclareLaunchArgument(name=&quot;input_topic&quot;, default_value=TextSubstitution(text=default_topic)) --&gt; get the &quot;input_topic&quot; launch argument string here somehow &lt;-- return LaunchDescription([ input_topic_arg, Node( package='demo_package', executable='demo_node', output='screen', parameters=[{&quot;input_topic&quot;: LaunchConfiguration('input_topic')}] ]) </code></pre> <p>I've went through the LaunchArgument source code and found that is impossible to get the value directly from the <code>input_topic_arg</code> variable as the <strong>LaunchArgument</strong> code passes its default directly into <strong>LanchConfiguration</strong>.</p> <p>That leaves us with only one option and that is forcing the value out of the <code>LaunchConfiguration('input_topic')</code> object. This class has a <code>perform(LaunchContext)</code> function that is designed to return the parameter value, but it requires the <strong>LaunchContext</strong> which was used in the launch file.</p> <p>So the question is: Given this is the way to get to the <strong>LaunchArgument</strong>, is there a way of getting the implicitly defined Context which has been used to construct <strong>LaunchConfiguration</strong>?</p>
Getting the value of LaunchArgument inside python Launch file
<p>The timestamp of the data is associated with the time of observation. The default behavior of most elements of processing is to maintain that timestamp through the processing. This is important information to keep the data referenced globally.</p> <p>If you change the timestamp on the registered point cloud to match the camera image naively by just adjusting the timestamp, if you have moving coordinate frames in your system, you will likely observe that it will no longer be registered exactly the same as the original point cloud in rviz.</p> <p>To resolve this you need to transform the point cloud to compensate for any potential motion during the delta T. And to compute that motion you need to be able to make an assumption about what coordinate frame the point cloud is static in during that transition. What you'll note is that this is exactly what the <a href="https://docs.ros.org/en/rolling/Tutorials/Intermediate/Tf2/Time-Travel-With-Tf2-Cpp.html" rel="nofollow noreferrer">tf2 library advanced API provides</a>.</p> <blockquote> <p>Is there a built-in option to do so? Or do we really need to add a second node to make this happen?</p> </blockquote> <p>There's not just &quot;built-in option&quot; to do this is that you need more information and context that is often use case specific in it's application.</p> <p>You haven't explained your use case or motivation. And I would suggest that you consider asking a question about your higher level design and why you're looking to change the timestamp. From what I can read here this sounds like an <a href="https://xyproblem.info/" rel="nofollow noreferrer">X-Y problem</a> to me overall.</p>
104342
2023-09-26T12:04:23.200
|ros2|ros-humble|depth-registered|
<p>We're use the code underneath to register depth images with color images. With this code a registered depth image keeps the time stamp of its original depth image.</p> <p>However, since the depth image is now registered with the color image, I'd like the registered depth image to adopt the timestamp of the color image as well. Is there a built-in option to do so? Or do we really need to add a second node to make this happen?</p> <pre><code> register_node = ComposableNodeContainer( name='container', namespace='', package='rclcpp_components', executable='component_container', composable_node_descriptions=[ ComposableNode( package='depth_image_proc', plugin='depth_image_proc::RegisterNode', name='register_node', remappings=[ ('depth/image_rect', DEPTH_IMAGE_TOPIC), ('depth/camera_info', DEPTH_CAMERA_INFO_TOPIC), ('rgb/camera_info', COLOR_CAMERA_INFO_TOPIC), ('depth_registered/image_rect', DEPTH_IMAGE_REGISTERED_TOPIC), ('depth_registered/camera_info', DEPTH_CAMERA_INFO_REGISTERED_TOPIC) ], parameters=[ {'queue_size': 20} ] ), ComposableNode( package='depth_image_proc', plugin='depth_image_proc::PointCloudXyzNode', name='point_cloud_xyz_node', remappings=[ ('camera_info', DEPTH_CAMERA_INFO_REGISTERED_TOPIC), ('image_rect', DEPTH_IMAGE_REGISTERED_TOPIC), ('points', DEPTH_POINTS_TOPIC) ] ) ], output='screen', ) </code></pre>
Have registered depth image adopt color image timestamp
<p>catkin is the build system used in ROS 1 - ament replaces it in ROS 2. The package you are trying to build might have a different git branch, or different repo possibly, that is designed for ROS 2. It is also possible that this package just doesn't have a ROS 2 port (yet).</p>
104345
2023-09-26T16:22:36.770
|catkin|colcon|ros-humble|
<p>I tried to build a packages type ros.catkin with colcon on Ubuntu22.04,ROS2 Humble.</p> <pre><code>$ colcon info path: . type: ros.catkin name: rrt_exploration dependencies: build: catkin geometry_msgs message_generation nav_msgs roscpp rospy std_msgs tf visualization_msgs run: geometry_msgs message_runtime nav_msgs roscpp rospy std_msgs tf visualization_msgs metadata: maintainers: ['Hassan Umari &lt;oh91@windowslive.com&gt;'] version: 1.0.0 </code></pre> <p>but,I get the following error.</p> <pre><code> CMake Error at CMakeLists.txt:7 (find_package): By not providing &quot;Findcatkin.cmake&quot; in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by &quot;catkin&quot;, but CMake did not find one. Could not find a package configuration file provided by &quot;catkin&quot; with any of the following names: catkinConfig.cmake catkin-config.cmake Add the installation prefix of &quot;catkin&quot; to CMAKE_PREFIX_PATH or set &quot;catkin_DIR&quot; to a directory containing one of the above files. If &quot;catkin&quot; provides a separate development package or SDK, be sure it has been installed. </code></pre> <p>I want colcon to be able to use catkin so I want to build this package. I tried referring to <a href="https://robotics.stackexchange.com/questions/87368/why-qtcreator-cannot-find-catkin-packagessolved">Why qtcreator cannot find catkin packages?[SOLVED]</a>, but it doesn't solve the problem. There is no &quot;catkin&quot; folder in /opt/ros/humble.</p> <p>It was working fine when I did the ROS2 humble<a href="https://docs-ros-org.translate.goog/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html?_x_tr_sl=auto&amp;_x_tr_tl=ja&amp;_x_tr_hl=ja" rel="nofollow noreferrer">enter link description here</a> and tutorialbot3 tutorials(<a href="https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/#gazebo-simulation" rel="nofollow noreferrer">https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/#gazebo-simulation</a>). Maybe becauce These packages include packages type:ros.cmake,ros.ament_cmake, but do not include packages type:ros.catkin.</p>
colcon cannot build packages type:ros.catkin
<p>This may be the same bug I reported years ago which is triggered when using a UDP connection. The ros_comm code has a buffer overflow, and I provided a patch to fix it.</p> <p><a href="https://github.com/ros/ros_comm/issues/2164" rel="nofollow noreferrer">https://github.com/ros/ros_comm/issues/2164</a></p> <p>But as far as I know, the maintainers never applied my patch.</p>
104346
2023-09-26T17:11:36.400
|ros|roslaunch|rostopic|communication|ros-noetic|
<p>I've been encountering a rather puzzling issue related to the length of a Rostopic name in my ROS (Robot Operating System) setup, and I'm hoping someone can shed some light on it.</p> <p>Here's the situation: I have 2 nodes (rbf_node_desired_position_pcmvn_stdp_analysis_05_ and rbf_node_desired_acceleration_pcmvn_stdp_analysis_05_ as you can see below), each with different names but all sharing the same node type (rbf_node_sync_compactDelay_EventDriven). These nodes publish data to a common Rostopic (edlut_ros_simulation_input_spike_pcmvn_stdp_analysis_05_). Additionally, I have another node that subscribes to this same Rostopic to process the data (edlut_simulator_node_pcmvn_stdp_analysis_05_). However, I've noticed a peculiar problem: this processing node can only successfully read messages published by 1 out of the 2 nodes (only messages published by rbf_node_desired_position_pcmvn_stdp_analysis_05_), despite all 2 nodes are publishing correctly to the Rostopic (I checked it with <code>rostopic echo rostopicname</code>).</p> <p>The peculiar part is that this problem appears to be associated with the length of the Rostopic name (edlut_ros_simulation_input_spike_pcmvn_stdp_analysis_05_). When the Rostopic name has a length of 56, 58 or 60 characters, this issue arises, causing the processing node to miss messages from one of the nodes. However, when I change the Rostopic name length to 55, 57, 59, 61, 62 or 63 characters using any arbitrary string, everything functions perfectly, and all four nodes' messages are received and processed as expected.</p> <p>Another solution is to change the length of the Rosnode name (rbf_node_desired_acceleration_pcmvn_stdp_analysis_05_) of the problematic node from 53 characters to 54.</p> <p>I'm uncertain whether this behavior is due to a limitation related to the length of Rostopic or Rosnode names or if there might be some internal handling or conversion of names within ROS that's causing this behavior.</p> <p>Has anyone else encountered a similar issue or can offer insights into why the Rostopic name length might be affecting the communication between nodes in this manner? Any help or suggestions would be greatly appreciated.</p> <p>Thank you in advance for your assistance!</p> <p>EXTRA (to reproduce the problem): launch file used:</p> <pre><code>&lt;launch&gt; &lt;!-- GLOBAL PARAMETERS --&gt; &lt;param name=&quot;master_clock_topic&quot; value=&quot;/clock&quot; type=&quot;str&quot; /&gt; &lt;!-- SYNCHRONIZER NODE It synchronizes all the other nodes so they all run at the sime time stamps. -Clock_topics: clock signals published by the other nodes for synchronization purposes -Checking_frequency: rate (Hz) at which the synchronizer checks if the other nodes have finished the current time step -Step_time: size (seconds) of every simulated time step --&gt; &lt;node pkg=&quot;edlut_baxter&quot; name=&quot;synchronizer_node_pcmvn_stdp_analysis_05_&quot; type=&quot;synchronizer_node&quot; output=&quot;screen&quot;&gt; &lt;param name=&quot;clock_topic&quot; value=&quot;edlut_ros/clockConfirmation_pcmvn_stdp_analysis_05_&quot; type=&quot;str&quot; /&gt; &lt;param name=&quot;number_of_nodes&quot; value=&quot;3&quot; type=&quot;int&quot; /&gt; &lt;param name=&quot;checking_frequency&quot; value=&quot;10000.0&quot; type=&quot;double&quot; /&gt; &lt;param name=&quot;step_time&quot; value=&quot;0.002&quot; type=&quot;double&quot; /&gt; &lt;/node&gt; &lt;!-- RBF DESIRED POSITION encoding module --&gt; &lt;node pkg=&quot;edlut_baxter&quot; name=&quot;rbf_node_desired_position_pcmvn_stdp_analysis_05_&quot; type=&quot;rbf_node_sync_compactDelay_EventDriven&quot; output=&quot;screen&quot; clear_params=&quot;true&quot;&gt; &lt;param name=&quot;output_topic&quot; value=&quot;edlut_ros_simulation_input_spike_pcmvn_stdp_analysis_05_&quot; type=&quot;str&quot; /&gt; &lt;param name=&quot;clock_topic&quot; value=&quot;edlut_ros/clockConfirmation_pcmvn_stdp_analysis_05_&quot; type=&quot;str&quot; /&gt; &lt;rosparam param=&quot;neuron_index_list&quot;&gt; [0] &lt;/rosparam&gt; &lt;param name=&quot;sampling_frequency&quot; value=&quot;500.0&quot; type=&quot;double&quot; /&gt; &lt;param name=&quot;checking_frequency&quot; value=&quot;1000.0&quot; type=&quot;double&quot; /&gt; &lt;/node&gt; &lt;!-- RBF DESIRED ACCELERATION encoding module --&gt; &lt;node pkg=&quot;edlut_baxter&quot; name=&quot;rbf_node_desired_acceleration_pcmvn_stdp_analysis_05_&quot; type=&quot;rbf_node_sync_compactDelay_EventDriven&quot; output=&quot;screen&quot; clear_params=&quot;true&quot;&gt; &lt;param name=&quot;output_topic&quot; value=&quot;edlut_ros_simulation_input_spike_pcmvn_stdp_analysis_05_&quot; type=&quot;str&quot; /&gt; &lt;param name=&quot;clock_topic&quot; value=&quot;edlut_ros/clockConfirmation_pcmvn_stdp_analysis_05_&quot; type=&quot;str&quot; /&gt; &lt;rosparam param=&quot;neuron_index_list&quot;&gt; [25] &lt;/rosparam&gt; &lt;param name=&quot;sampling_frequency&quot; value=&quot;500.0&quot; type=&quot;double&quot; /&gt; &lt;param name=&quot;checking_frequency&quot; value=&quot;1000.0&quot; type=&quot;double&quot; /&gt; &lt;/node&gt; &lt;!-- subscriber NODE --&gt; &lt;node pkg=&quot;edlut_baxter&quot; name=&quot;edlut_simulator_node_pcmvn_stdp_analysis_05_&quot; type=&quot;simulator_node2&quot; output=&quot;screen&quot;&gt; &lt;param name=&quot;input_topic&quot; value=&quot;edlut_ros_simulation_input_spike_pcmvn_stdp_analysis_05_&quot; type=&quot;str&quot; /&gt; &lt;param name=&quot;clock_topic&quot; value=&quot;edlut_ros/clockConfirmation_pcmvn_stdp_analysis_05_&quot; type=&quot;str&quot; /&gt; &lt;/node&gt; &lt;/launch&gt; </code></pre> <p>synchronizer_node code:</p> <pre><code>// This is the synchronizer node. It controls that all nodes follow the same // time evolution when running on simulation time. // It waits for all nodes to have finished the current time step. Once they are // all done, it tells them to execute the next time step, and so on. #include &quot;ros/ros.h&quot; #include &quot;ros/console.h&quot; #include &lt;ros/callback_queue.h&gt; #include &quot;rosgraph_msgs/Clock.h&quot; #include &lt;ros/subscribe_options.h&gt; #include &quot;std_msgs/Bool.h&quot; #include &lt;cstring&gt; #include &lt;ctime&gt; #include &lt;limits&gt; #include &lt;signal.h&gt; #include &lt;stdlib.h&gt; #include &lt;cstdlib&gt; #include &lt;sys/types.h&gt; #include &lt;csignal&gt; static bool stop_simulation; void rosShutdownHandler(int sig) { stop_simulation = true; } class ExternalClock{ private: ros::Time received_time; bool first_received; int counter; public: ExternalClock(): received_time(0.0), first_received(false), counter(0) {} void ClockCallback (const rosgraph_msgs::Clock&amp; msg){ this-&gt;counter+=1; if (this-&gt;received_time&lt;msg.clock){ this-&gt;received_time = msg.clock; } return; } ros::Time GetLastConfirmedTime(){ return this-&gt;received_time; } bool FirstReceived(){ return this-&gt;first_received; } int GetCounter(){ return this-&gt;counter; } void ResetCounter(){ this-&gt;counter = 0; } }; int main(int argc, char **argv) { // Set up ROS. ros::init(argc, argv, &quot;synchronizer&quot;, ros::init_options::NoSigintHandler); if( ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Info) ) { ros::console::notifyLoggerLevelsChanged(); } ros::NodeHandle nh; signal(SIGINT, rosShutdownHandler); // Declare variables that can be modified by launch file or command line. std::string synchronizing_topic, master_clock_topic; ros::Subscriber synchronizing_subscriber; // std::vector&lt;ExternalClock *&gt; clock_objects; ExternalClock external_clock = ExternalClock(); unsigned int num_topics; double checking_frequency, step_time; ros::Publisher time_publisher; // struct timespec startt, endt; stop_simulation = false; // Number of external nodes to synchronize int number_of_nodes; // Initialize node parameters from launch file or command line. // Use a private node handle so that multiple instances of the node can be run simultaneously // while using different parameters. ros::NodeHandle private_node_handle_(&quot;~&quot;); private_node_handle_.getParam(&quot;clock_topic&quot;, synchronizing_topic); private_node_handle_.getParam(&quot;number_of_nodes&quot;, number_of_nodes); private_node_handle_.getParam(&quot;checking_frequency&quot;, checking_frequency); private_node_handle_.getParam(&quot;step_time&quot;, step_time); // Get global parameter use_sim_time nh.getParam(&quot;master_clock_topic&quot;, master_clock_topic); // Set callback queue ros::CallbackQueue CallbackQueue; nh.setCallbackQueue(&amp;CallbackQueue); // Include the private node handle in the callback queue for the dynamic reconfigure server private_node_handle_.setCallbackQueue(&amp;CallbackQueue); synchronizing_subscriber = nh.subscribe(synchronizing_topic, 1000, &amp;ExternalClock::ClockCallback, &amp;external_clock); // Publisher to advertise synchronizer node clock signal. This is the clock signal that all the nodes will follow time_publisher = nh.advertise&lt;rosgraph_msgs::Clock&gt;(master_clock_topic, 100); ROS_INFO(&quot;Synchronizer node initialized.&quot;); ros::WallRate rate(checking_frequency); ros::WallRate init_rate(1.0); ros::Time next_time (0.0), last_sent_time(0.0); bool all_first_received = false; // Message to advertise current synchronized time rosgraph_msgs::Clock current_time; // Publish start simulation time 0.0 current_time.clock = ros::Time(0.0); ROS_DEBUG(&quot;Synchronizer: Publishing simulation time %f&quot;, current_time.clock.toSec()); time_publisher.publish(current_time); // Wait until all nodes have published 0.0 time and the synchronizer has received it // The synchronizer node keeps publishing 0.0 time until all nodes are synchronized while(external_clock.GetCounter() != number_of_nodes){ //ROS_INFO(&quot;FIRST COUNTER = %i&quot;, external_clock.GetCounter()); CallbackQueue.callAvailable(ros::WallDuration(0.01)); ROS_DEBUG(&quot;Synchronizer: Publishing simulation time %f&quot;, current_time.clock.toSec()); time_publisher.publish(current_time); } external_clock.ResetCounter(); ROS_DEBUG(&quot;Synchronizer: Node synchronized&quot;); // Time stamp for statistical purposes ros::WallTime start = ros::WallTime::now(); int sim_colgada_counter=0; // Synchronizer loop while (!stop_simulation){ CallbackQueue.callAvailable(ros::WallDuration(0.004)); unsigned int finished_nodes = external_clock.GetCounter(); ROS_DEBUG(&quot;Finished nodes %i&quot;,finished_nodes); sim_colgada_counter=sim_colgada_counter+1; // When all nodes have finished the current time step, the synchronizer publishes the next time step if (finished_nodes == number_of_nodes){ ROS_DEBUG(&quot;sim_colgada_counter= %i&quot;, sim_colgada_counter); next_time += ros::Duration(step_time); ROS_DEBUG(&quot;Synchronizer: All nodes finished. Sending new time stamp %f&quot;,next_time.toSec()); current_time.clock = next_time; time_publisher.publish(current_time); ROS_DEBUG(&quot;Synchronizer: Publishing next time %f&quot;, next_time.toSec()); external_clock.ResetCounter(); sim_colgada_counter=0; } if (sim_colgada_counter&gt;30000){ std::system(&quot;rosnode kill --all&quot;); } } ROS_INFO(&quot;Ending Synchronizer node&quot;); // Time statistics ros::Time sim_time = current_time.clock; ros::WallTime end = ros::WallTime::now(); ros::WallDuration total = end - start; ROS_INFO(&quot;Elapsed time : %f&quot;, total.toSec()); ROS_INFO(&quot;Simulated Time : %f&quot;, sim_time.toSec()); ROS_INFO(&quot;Simulation ratio: %f&quot;, sim_time.toSec() / total.toSec()); // Shutdown node ros::shutdown(); return 0; } // end main() </code></pre> <p>simulator_node2 code</p> <pre><code>// This is the EDLUT simulator node. #include &lt;ros/callback_queue.h&gt; #include &quot;ros/ros.h&quot; #include &quot;std_msgs/Time.h&quot; #include &quot;log4cxx/logger.h&quot; #include &quot;edlut_baxter/ExternalClock.h&quot; #include &lt;edlut_baxter/Spike_group.h&gt; #include &lt;cstring&gt; #include &lt;ctime&gt; #include &lt;limits&gt; #include &lt;signal.h&gt; static bool stop_simulation; void rosShutdownHandler(int sig) { stop_simulation = true; } void SpikeCallback(const edlut_baxter::Spike_group::ConstPtr&amp; msg){ for (int i=0; i&lt;msg-&gt;neuron_index.size(); i++){ ROS_DEBUG(&quot;EDLUT: Received spike: time %f and neuron %d. Current time: %f.&quot;, msg-&gt;time[i], msg-&gt;neuron_index[i], ros::Time::now().toSec()); } } int main(int argc, char **argv) { // Set up ROS. ros::init(argc, argv, &quot;edlut_simulator&quot;, ros::init_options::NoSigintHandler); log4cxx::LoggerPtr my_logger = log4cxx::Logger::getLogger(ROSCONSOLE_DEFAULT_NAME); my_logger-&gt;setLevel(ros::console::g_level_lookup[ros::console::levels::Debug]); ros::NodeHandle nh; ros::Subscriber input_subscriber; signal(SIGINT, rosShutdownHandler); // Declare variables that can be modified by launch file or command line. std::string input_topic, clock_topic, master_clock_topic; ros::Publisher time_publisher; ros::Subscriber clock_subscriber; ExternalClock ext_clock; ros::CallbackQueue CallbackQueue; nh.setCallbackQueue(&amp;CallbackQueue); struct timespec startt, controlt, endt; stop_simulation = false; // Initialize node parameters from launch file. ros::NodeHandle private_node_handle_(&quot;~&quot;); private_node_handle_.getParam(&quot;input_topic&quot;, input_topic); private_node_handle_.getParam(&quot;clock_topic&quot;, clock_topic); nh.getParam(&quot;master_clock_topic&quot;, master_clock_topic); ros::SubscribeOptions subscriberOptions = ros::SubscribeOptions::create&lt;edlut_baxter::Spike_group&gt;( input_topic, 10000, boost::bind(SpikeCallback, _1), ros::VoidPtr(), &amp;CallbackQueue); subscriberOptions.transport_hints = ros::TransportHints().unreliable().reliable().tcpNoDelay(true); input_subscriber = nh.subscribe(subscriberOptions); //Subscribe to synchronizer node clock and Publish edlut's node clock //ROS_DEBUG(&quot;Simulator: Subscribing to topic /clock&quot;); clock_subscriber = nh.subscribe(master_clock_topic, 1000, &amp;ExternalClock::ClockCallback, &amp;ext_clock); // Initialize the publisher in clock topic time_publisher = nh.advertise&lt;rosgraph_msgs::Clock&gt;(clock_topic, 1000, true); //ROS_DEBUG(&quot;Simulator: Publishing simulation time to topic %s&quot;,clock_topic.c_str()); ros::Time InitSimulationRosTime; InitSimulationRosTime = ros::Time(0.0); clock_t starttotalt=clock(); clock_gettime(CLOCK_REALTIME, &amp;startt); ros::Time last_print_time (0.0), time(0.0), last_sent_time(0.0); ros::WallRate rate(1000.0); ros::WallRate init_rate(1.0); // Wait until the first signal has been received from the synchronizer node while(!ext_clock.FirstReceived()){ CallbackQueue.callAvailable(ros::WallDuration(0.001)); rosgraph_msgs::Clock current_time; current_time.clock = ros::Time(0.0); //ROS_DEBUG(&quot;Simulator: Publishing simulation time %f&quot;, time.toSec()); time_publisher.publish(current_time); init_rate.sleep(); } time = ext_clock.GetLastConfirmedTime() +ros::Duration(0.05); //ROS_DEBUG(&quot;Simulator: Node synchronized&quot;); while (!stop_simulation){ CallbackQueue.callAvailable(ros::WallDuration(0.003)); //ROS_DEBUG(&quot;Simulator: Running simulation until time %f&quot;, time.toSec()); if (time&gt;=last_print_time+ros::Duration(1.0)){ //ROS_INFO(&quot;EDLUT Simulator: Simulating until time %f&quot;, time.toSec()); last_print_time = time; } if (time!=last_sent_time){ // Publish the simulation time rosgraph_msgs::Clock current_time; current_time.clock = time; //ROS_DEBUG(&quot;Simulator: Publishing simulation time %f&quot;, time.toSec()); time_publisher.publish(current_time); last_sent_time = time; } CallbackQueue.callAvailable(ros::WallDuration(0.003)); ros::Time new_time = ext_clock.GetLastConfirmedTime() +ros::Duration(0.05); if (new_time&gt;time){ time = new_time; //ROS_DEBUG(&quot;Simulator: Updating simulation time until %f&quot;, time.toSec()); } } clock_gettime(CLOCK_REALTIME, &amp;endt); ros::shutdown(); return 0; } </code></pre> <p>rbf_node_sync_compactDelay_EventDriven code:</p> <pre><code> // This is the RBF node. #include &lt;ros/ros.h&gt; #include &lt;ros/callback_queue.h&gt; #include &quot;rosgraph_msgs/Clock.h&quot; #include &quot;edlut_baxter/ExternalClock.h&quot; #include &lt;edlut_baxter/AnalogCompact.h&gt; #include &lt;edlut_baxter/Spike_group.h&gt; #include &lt;edlut_baxter/Spike.h&gt; #include &lt;edlut_baxter/LearningState.h&gt; #include &lt;cstring&gt; #include &lt;ctime&gt; #include &lt;limits&gt; #include &lt;signal.h&gt; #include &lt;iostream&gt; #include &lt;vector&gt; static bool stop_node; /* * Create a class */ void rosShutdownHandler(int sig) { stop_node = true; } int main(int argc, char **argv) { // Set up ROS. ros::init(argc, argv, &quot;rbf&quot;, ros::init_options::NoSigintHandler); if( ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug) ) { ros::console::notifyLoggerLevelsChanged(); } ros::NodeHandle nh; signal(SIGINT, rosShutdownHandler); // Declare variables that can be modified by launch file or command line. std::string input_topic, output_topic, clock_topic, master_clock_topic; std::vector&lt;int&gt; neuron_index; double sampling_frequency, checking_frequency; ros::Publisher time_publisher; ros::Subscriber clock_subscriber; ExternalClock ext_clock; stop_node = false; // Initialize node parameters from launch file or command line. // Use a private node handle so that multiple instances of the node can be run simultaneously // while using different parameters. ros::NodeHandle private_node_handle_(&quot;~&quot;); private_node_handle_.getParam(&quot;output_topic&quot;, output_topic); private_node_handle_.getParam(&quot;clock_topic&quot;, clock_topic); private_node_handle_.getParam(&quot;neuron_index_list&quot;, neuron_index); private_node_handle_.getParam(&quot;sampling_frequency&quot;, sampling_frequency); private_node_handle_.getParam(&quot;checking_frequency&quot;, checking_frequency); nh.getParam(&quot;master_clock_topic&quot;, master_clock_topic); double sampling_period = 1.0 / sampling_frequency; ROS_DEBUG(&quot;output topic %s \n&quot;, output_topic.c_str()); // Create the subscriber ros::CallbackQueue CallbackQueue; nh.setCallbackQueue(&amp;CallbackQueue); clock_subscriber = nh.subscribe(master_clock_topic, 1000, &amp;ExternalClock::ClockCallback, &amp;ext_clock); time_publisher = nh.advertise&lt;rosgraph_msgs::Clock&gt;(clock_topic, 1000, true); // Create the output spike publisher ros::Publisher output_publisher_group = nh.advertise&lt;edlut_baxter::Spike_group&gt;(output_topic, 1e9); ROS_DEBUG(&quot;RBF: Publisher created&quot;); ros::Rate rate(sampling_frequency); ros::Time time(0.0), last_sent_time(0.0); ros::WallRate sim_rate(checking_frequency); ros::WallRate init_rate(1.0); while(!ext_clock.FirstReceived()){ CallbackQueue.callAvailable(ros::WallDuration(0.001)); rosgraph_msgs::Clock current_time; current_time.clock = ros::Time(0.0); //ROS_DEBUG(&quot;RBF: Publishing simulation time %f&quot;, time.toSec()); time_publisher.publish(current_time); init_rate.sleep(); } time = ext_clock.GetLastConfirmedTime(); while (!stop_node){ CallbackQueue.callAvailable(ros::WallDuration(0.003)); ros::Time new_time = ext_clock.GetLastConfirmedTime(); if (new_time&gt;time){ ros::Duration new_sampling_period = new_time - time; time = new_time; edlut_baxter::Spike_group spike_group; //creo vector std::vector&lt;unsigned int&gt; array_neuron; //añado numero de neurona cogido del launch array_neuron.push_back(neuron_index[0]); spike_group.neuron_index = array_neuron; //creo vector std::vector&lt;double&gt; array_time; //añado tiempo array_time.push_back(time.toSec()); spike_group.time = array_time; for (size_t i = 0; i &lt; spike_group.neuron_index.size(); ++i) { ROS_DEBUG(&quot;RBF publish neuron_index[%zu] = %u, time[%zu] = %f&quot;, i, spike_group.neuron_index[i], i, spike_group.time[i]); } output_publisher_group.publish(spike_group); } if (time!=last_sent_time){ // Publish the simulation time rosgraph_msgs::Clock current_time; current_time.clock = time; time_publisher.publish(current_time); last_sent_time = time; } sim_rate.sleep(); } ros::shutdown(); return 0; } </code></pre> <p>package.xml</p> <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt; &lt;package&gt; &lt;name&gt;edlut_baxter&lt;/name&gt; &lt;version&gt;0.0.0&lt;/version&gt; &lt;description&gt;The edlut_baxter package&lt;/description&gt; &lt;!-- One maintainer tag required, multiple allowed, one person per tag --&gt; &lt;!-- Example: --&gt; &lt;!-- &lt;maintainer email=&quot;jane.doe@example.com&quot;&gt;Jane Doe&lt;/maintainer&gt; --&gt; &lt;maintainer email=&quot;jesusgarrido@ugr.es&quot;&gt;Jesus Garrido&lt;/maintainer&gt; &lt;!-- One license tag required, multiple allowed, one license per tag --&gt; &lt;!-- Commonly used license strings: --&gt; &lt;!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 --&gt; &lt;license&gt;TODO&lt;/license&gt; &lt;buildtool_depend&gt;catkin&lt;/buildtool_depend&gt; &lt;build_depend&gt;roscpp&lt;/build_depend&gt; &lt;build_depend&gt;rospy&lt;/build_depend&gt; &lt;build_depend&gt;std_msgs&lt;/build_depend&gt; &lt;build_depend&gt;message_generation&lt;/build_depend&gt; &lt;build_depend&gt;baxter_core_msgs&lt;/build_depend&gt; &lt;build_depend&gt;gazebo_ros_control&lt;/build_depend&gt; &lt;build_depend&gt;gazebo_ros&lt;/build_depend&gt; &lt;run_depend&gt;roscpp&lt;/run_depend&gt; &lt;run_depend&gt;rospy&lt;/run_depend&gt; &lt;run_depend&gt;std_msgs&lt;/run_depend&gt; &lt;run_depend&gt;baxter_core_msgs&lt;/run_depend&gt; &lt;run_depend&gt;message_generation&lt;/run_depend&gt; &lt;run_depend&gt;message_runtime&lt;/run_depend&gt; &lt;run_depend&gt;gazebo_ros&lt;/run_depend&gt; &lt;run_depend&gt;gazebo_ros_control&lt;/run_depend&gt; &lt;!-- The export tag contains other, unspecified, tags --&gt; &lt;export&gt; &lt;!-- Other tools can request additional information be placed here --&gt; &lt;gazebo_ros plugin_path=&quot;<span class="math-container">${prefix}/lib" gazebo_media_path="$</span>{prefix}&quot; /&gt; &lt;/export&gt; &lt;/package&gt; </code></pre> <p>CMakeLists.txt</p> <pre><code>cmake_minimum_required(VERSION 3.0.2) #ros noetic http://wiki.ros.org/noetic/Migration include ($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) project(edlut_baxter) find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation message_filters gazebo_ros dynamic_reconfigure baxter_core_msgs ) # Depend on system install of Gazebo find_package(GAZEBO REQUIRED) set(CMAKE_CXX_FLAGS &quot;<span class="math-container">${CMAKE_CXX_FLAGS} $</span>{GAZEBO_CXX_FLAGS}&quot;) ## System dependencies are found with CMake's conventions find_package(Boost REQUIRED COMPONENTS system thread) find_package(OpenMP REQUIRED) if(OPENMP_FOUND) message(STATUS &quot;OPENMP FOUND&quot;) set(OpenMP_FLAGS <span class="math-container">${OpenMP_CXX_FLAGS}) # or if you use C: $</span>{OpenMP_C_FLAGS} set(OpenMP_LIBS gomp) endif() set(WITH_CUDA TRUE) #This line sets a CMake variable WITH_CUDA to TRUE. This variable is used later to conditionally include CUDA support. if(WITH_CUDA) find_package(CUDA REQUIRED) if (CUDA_FOUND) message(STATUS &quot;CUDA FOUND&quot;) set(CUDA_LIBS cudart) set(CUDA_LIB_PATH ${CUDA_TOOLKIT_ROOT_DIR}/lib64) endif() endif() ## Generate messages in the 'msg' folder add_message_files( FILES Analog.msg AnalogCompact.msg Spike.msg Spike_group.msg LearningState.msg AnalogCompactDelay.msg Time.msg FullStateCompact.msg FullStateCompactDelay.msg AnalogCompact_AgonistAntagonist.msg MarkerKinematicsCompact.msg ) ## Generate added messages and services with any dependencies listed here generate_messages( DEPENDENCIES std_msgs ) ################################################ ## Declare ROS dynamic reconfigure parameters ## ################################################ ## To declare and build dynamic reconfigure parameters within this ## package, follow these steps: ## * In the file package.xml: ## * add a build_depend and a run_depend tag for &quot;dynamic_reconfigure&quot; ## * In this file (CMakeLists.txt): ## * add &quot;dynamic_reconfigure&quot; to ## find_package(catkin REQUIRED COMPONENTS ...) ## * uncomment the &quot;generate_dynamic_reconfigure_options&quot; section below ## and list every .cfg file to be processed ## Generate dynamic reconfigure parameters in the 'cfg' folder generate_dynamic_reconfigure_options( cfg/DynParameters.cfg cfg/DynParameters_2Entries.cfg cfg/SynchronizerDynParameters.cfg cfg/MaeDynParameters.cfg cfg/WeightsDynParameters.cfg cfg/JointSpringsExample.cfg cfg/InterpolatorDynParameters.cfg cfg/DelayGeneratorDynParameters.cfg cfg/JointsPD.cfg # cfg/DynReconf2.cfg ) ################################### ## catkin specific configuration ## ################################### ## The catkin_package macro generates cmake config files for your package ## Declare things to be passed to dependent projects ## INCLUDE_DIRS: uncomment this if you package contains header files ## LIBRARIES: libraries you create in this project that dependent projects also need ## CATKIN_DEPENDS: catkin_packages dependent projects also need ## DEPENDS: system dependencies of this project that dependent projects also need catkin_package( # INCLUDE_DIRS include # LIBRARIES edlut_baxter # CATKIN_DEPENDS roscpp rospy std_msgs CATKIN_DEPENDS roscpp rospy std_msgs message_runtime baxter_core_msgs # DEPENDS system_lib ) ########### ## Build ## ########### ## Specify additional locations of header files ## Your package locations should be listed before other locations # include_directories(include) include_directories( <span class="math-container">${catkin_INCLUDE_DIRS} $</span>ENV{EDLUT_INSTALL_DIR}/include /home/baxter/ros_ws/devel/include include <span class="math-container">${Boost_INCLUDE_DIRS} $</span>{GAZEBO_INCLUDE_DIRS} ) link_directories( /usr/local/lib <span class="math-container">${Boost_LIBRARY_DIRS} $</span>{CUDA_LIB_PATH} ${GAZEBO_LIBRARY_DIRS} ) ## Declare a C++ executable add_executable(simulator_node2 src/simulator_node2.cpp) add_executable(synchronizer_node src/synchronizer_node.cpp) add_executable(rbf_node_sync_compactDelay_EventDriven src/rbf_node_sync_compactDelay_EventDriven.cpp) target_compile_options(simulator_node2 PRIVATE ${OpenMP_FLAGS} -fPIC) ## Add cmake target dependencies of the executable ## same as for the library above add_dependencies(simulator_node2 edlut_baxter_generate_messages_cpp) add_dependencies(synchronizer_node edlut_baxter_generate_messages_cpp) add_dependencies(rbf_node_sync_compactDelay_EventDriven edlut_baxter_generate_messages_cpp) ## Specify libraries to link a library or executable target against target_link_libraries(simulator_node2 <span class="math-container">${catkin_LIBRARIES} $</span>ENV{EDLUT_INSTALL_DIR}/lib/libedlut.a <span class="math-container">${OpenMP_LIBS} $</span>{CUDA_LIBS} ) target_link_libraries(synchronizer_node <span class="math-container">${catkin_LIBRARIES} $</span>{GAZEBO_LIBRARIES} ) target_link_libraries(rbf_node_sync_compactDelay_EventDriven <span class="math-container">${catkin_LIBRARIES} $</span>{OpenMP_LIBS} ) <span class="math-container">```</span> </code></pre>
Issue with Rostopic Name Length Affecting Node Communication
<p>Sourcing the Gazebo's setup by running <code>source /usr/share/gazebo/setup.bash</code> solves the issue.</p>
104352
2023-09-26T19:13:27.313
|ros2|gazebo-11|
<p>I've install ros2 rolling, navigation2, slam_toolbox, Gazebo 11, and the turtelbot3 in my Docker container. Running this Gazebo launch <code>ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py</code> returns these error messages:</p> <pre><code>[INFO] [launch]: All log files can be found below /home/y/.ros/log/2023-09-26-21-01-10-628365-pop23-1122 [INFO] [launch]: Default logging verbosity is set to INFO urdf_file_name : turtlebot3_waffle.urdf urdf_file_name : turtlebot3_waffle.urdf [INFO] [gzserver-1]: process started with pid [1125] [INFO] [gzclient-2]: process started with pid [1127] [INFO] [robot_state_publisher-3]: process started with pid [1129] [INFO] [spawn_entity.py-4]: process started with pid [1131] [robot_state_publisher-3] [INFO] [1695754871.582602597] [robot_state_publisher]: Robot initialized [spawn_entity.py-4] [INFO] [1695754871.982227902] [spawn_entity]: Spawn Entity started [spawn_entity.py-4] [INFO] [1695754871.982449226] [spawn_entity]: Loading entity XML from file /opt/ros/rolling/share/turtlebot3_gazebo/models/turtlebot3_waffle/model.sdf [spawn_entity.py-4] [INFO] [1695754871.983068964] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30 [spawn_entity.py-4] [INFO] [1695754871.983301368] [spawn_entity]: Waiting for service /spawn_entity [gzserver-1] ALSA lib confmisc.c:855:(parse_card) cannot find card '0' [gzserver-1] ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory [gzserver-1] ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings [gzserver-1] ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory [gzserver-1] ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name [gzserver-1] ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory [gzserver-1] ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory [gzserver-1] ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default [gzserver-1] AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory [spawn_entity.py-4] [INFO] [1695754872.741016925] [spawn_entity]: Calling service /spawn_entity [gzserver-1] [INFO] [1695754872.823695242] [turtlebot3_imu]: &lt;initial_orientation_as_reference&gt; is unset, using default value of false to comply with REP 145 (world as orientation reference) [spawn_entity.py-4] [INFO] [1695754872.890246420] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [waffle] [gzserver-1] [INFO] [1695754873.002695193] [turtlebot3_diff_drive]: Wheel pair 1 separation set to [0.287000m] [gzserver-1] [INFO] [1695754873.002724088] [turtlebot3_diff_drive]: Wheel pair 1 diameter set to [0.066000m] [gzserver-1] [INFO] [1695754873.003448619] [turtlebot3_diff_drive]: Subscribed to [/cmd_vel] [gzserver-1] [INFO] [1695754873.005967828] [turtlebot3_diff_drive]: Advertise odometry on [/odom] [gzserver-1] [INFO] [1695754873.008795563] [turtlebot3_diff_drive]: Publishing odom transforms between [odom] and [base_footprint] [gzserver-1] [INFO] [1695754873.015334446] [turtlebot3_joint_state]: Going to publish joint [wheel_left_joint] [gzserver-1] [INFO] [1695754873.015355489] [turtlebot3_joint_state]: Going to publish joint [wheel_right_joint] [INFO] [spawn_entity.py-4]: process has finished cleanly [pid 1131] [gzclient-2] gzclient: /usr/include/boost/smart_ptr/shared_ptr.hpp:728: typename boost::detail::sp_member_access&lt;T&gt;::type boost::shared_ptr&lt;T&gt;::operator-&gt;() const [with T = gazebo::rendering::Camera; typename boost::detail::sp_member_access&lt;T&gt;::type = gazebo::rendering::Camera*]: Assertion `px != 0' failed. [ERROR] [gzclient-2]: process has died [pid 1127, exit code -6, cmd 'gzclient']. </code></pre> <p>Based on my analysis, the Gazebo client has crashed due to the assertion. But what can be the reason? or this is because I missed something in the configuration? Why does the Gazebo server need ALSA lib?</p> <p>Note, if I execute this command <code>ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False</code> from the nav2 documentation in the getting started section, it works. I can see the robot and the lidar scan in the Gazebo simulator.</p>
How to analyse this Gazebo with turtlebot3 on ROS2 Rolling?
<p>The explanation has been found in <a href="https://frankaemika.github.io/libfranka/structfranka_1_1RobotState.html" rel="nofollow noreferrer">there</a>.</p> <p><strong>EDIT</strong>:</p> <p><code>O_T_EE</code>: Measured end-effector pose in base frame.</p> <p><code>O_T_EE_d</code>: Last desired end-effector pose of motion generation in the base frame.</p> <p><code>F_T_EE</code>: End-effector frame pose in flange frame.</p> <p><code>F_T_NE</code>: Nominal end-effector frame pose in flange frame.</p> <p><code>NE_T_EE</code>: End-effector frame pose in nominal end-effector frame.</p> <p><code>EE_T_K</code>: Stiffness frame pose in end-effector frame.</p> <p><code>m_ee</code>: Configured mass of the end effector.</p> <p><code>I_ee</code>: Configured rotational inertia matrix of the end effector load with respect to center of mass.</p> <p><code>F_x_Cee</code>: Configured center of mass of the end effector load with respect to flange frame.</p> <p><code>m_load</code>: Configured mass of the external load.</p> <p><code>I_load</code>: Configured rotational inertia matrix of the external load with respect to center of mass.</p> <p><code>F_x_Cload</code>: Configured center of mass of the external load with respect to flange frame.</p> <p><code>m_total</code>: Sum of the mass of the end effector and the external load.</p> <p><code>I_total</code>: Combined rotational inertia matrix of the end effector load and the external load with respect to the center of mass.</p> <p><code>F_x_Ctotal</code>: Combined center of mass of the end effector load and the external load with respect to flange frame.</p> <p><code>elbow</code>: Elbow configuration.</p> <p><code>elbow_d</code>: Desired elbow configuration.</p> <p><code>elbow_c</code>: Commanded elbow configuration.</p> <p><code>delbow_c</code>: Commanded elbow velocity.</p> <p><code>ddelbow_c</code>: Commanded elbow acceleration.</p> <p><code>tau_J</code>: Measured link-side joint torque sensor signals.</p> <p><code>tau_J_d</code>: Desired link-side joint torque sensor signals without gravity.</p> <p><code>dtau_J</code>: Derivative of measured link-side joint torque sensor signals.</p> <p><code>q</code>: Measured joint position.</p> <p><code>q_d</code>: Desired joint position.</p> <p><code>dq</code>: Measured joint velocity.</p> <p><code>dq_d</code>: Desired joint velocity.</p> <p><code>ddq_d</code>: Desired joint acceleration.</p>
104354
2023-09-27T03:08:07.143
|ros-noetic|rosmessage|
<p>Has anyone ever tried to understand the meaning of each parameter in <a href="https://github.com/frankaemika/franka_ros/blob/5f90395ef000e0c998fb7aff8f127b9bd3773962/franka_msgs/msg/FrankaState.msg" rel="nofollow noreferrer">FrankaState.msg</a>? After reading the official documentation, I only understand some of them, such as <code>O_T_EE</code> and <code>F_T_EE</code>. What do the rest of these parameters mean and how do I find out?</p> <p>Thanks!</p>
franka_ros message meaning
<p>Pull your config file from the humble branch, not the main branch (which targets Rolling). Your issue is API updates made to more recent distributions are not in Humble. Mirror from the humble branch instead.</p>
104365
2023-09-27T12:43:59.433
|ros2|roslaunch|python3|
<p>I want to make some modifications to the <a href="https://github.com/ros-planning/navigation2/blob/main/nav2_bringup/README.md" rel="nofollow noreferrer">nav2_bringup</a> package. Therefore, I just copied the nav2_bringup package put it in the workspace and ran the <a href="https://navigation.ros.org/getting_started/index.html#getting-started" rel="nofollow noreferrer">Turtlebot 3</a> simulator. The following error occurred. Without copies, no errors, all work fine.</p> <p><a href="https://github.com/ros-planning/navigation2/blob/main/nav2_bringup/README.md" rel="nofollow noreferrer">https://github.com/ros-planning/navigation2/blob/main/nav2_bringup/README.md</a></p> <p><code>[ERROR] [launch]: Caught exception in launch (see debug for traceback): cannot import name 'PushROSNamespace' from 'launch_ros.actions' (/opt/ros/humble/lib/python3.10/site- packages/launch_ros/actions/__init__.py)</code></p>
can not mirror the nav2_bringup package
<p>Have you tried using the <code>--ros-args --log-level DEBUG</code> when you start the Controller Manager node? If you are using a launch file, it would mean that you would need to add <code>arguments=['--ros-args', '--log-level', 'DEBUG']</code> to the Controller Manager Node. This should enable the Controller Manager node to log in DEBUG mode.</p>
104368
2023-09-27T14:14:34.553
|ros2|ros2-control|
<p>I use ros2_control with my own hardware interface. In this interface, I log some stuff in DEBUG. I would like to set log level to DEBUG in my launch file so that I can see these logs.</p> <p>In other words, how can I set it for a controller launched using the spawner executable from controller_manager package ?</p> <p>Thanks in advance for your answer.</p>
Change log level ros2_control hardware interface
<p>Make sure your flags are correct. In my case, I used DCMAKE_CXX_FLAGS=&quot;w&quot; and not DCMAKE_CXX_FLAGS=&quot;-w&quot;. As Tully pointed out, this could have been resolved by posting the command I used to cause the error. The &quot;w&quot; in the error message kept glaring at me as if it was telling me &quot;hey, dummy, look here.&quot;</p>
104378
2023-09-28T02:55:08.057
|ros|c++|colcon|
<p>I just updated my Ubuntu 22.04 installation with ROS 2 rolling on it and now when I try to rebuild my ROS packages I get an error message that it can't compile a simple test program:</p> <pre><code>CMake Error at /home/john/.local/lib/python3.10/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeTestCXXCompiler.cmake:60 (message): The C++ compiler &quot;/usr/bin/c++&quot; is not able to compile a simple test program. It fails with the following output: Change Dir: '/home/john/floyd2_ws/build/moveit_msgs/CMakeFiles/CMakeScratch/TryCompile-cr7niU' Run Build Command(s): /home/john/.local/lib/python3.10/site-packages/cmake/data/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_00a33/fast /usr/bin/gmake -f CMakeFiles/cmTC_00a33.dir/build.make CMakeFiles/cmTC_00a33.dir/build gmake[1]: Entering directory '/home/john/floyd2_ws/build/moveit_msgs/CMakeFiles/CMakeScratch/TryCompile-cr7niU' Building CXX object CMakeFiles/cmTC_00a33.dir/testCXXCompiler.cxx.o /usr/bin/c++ w -o CMakeFiles/cmTC_00a33.dir/testCXXCompiler.cxx.o -c /home/john/floyd2_ws/build/moveit_msgs/CMakeFiles/CMakeScratch/TryCompile-cr7niU/testCXXCompiler.cxx c++: warning: w: linker input file unused because linking not done c++: error: w: linker input file not found: No such file or directory gmake[1]: *** [CMakeFiles/cmTC_00a33.dir/build.make:78: CMakeFiles/cmTC_00a33.dir/testCXXCompiler.cxx.o] Error 1 gmake[1]: *** Deleting file 'CMakeFiles/cmTC_00a33.dir/testCXXCompiler.cxx.o' gmake[1]: Leaving directory '/home/john/floyd2_ws/build/moveit_msgs/CMakeFiles/CMakeScratch/TryCompile-cr7niU' gmake: *** [Makefile:127: cmTC_00a33/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project) </code></pre> <p>I'm at a complete loss as to what to do. I tried removing the build directory but I still get the error.</p>
C++ can not build simple test program after update (Ubuntu 22.04/ROS 2 Rolling)
<p>Based on what is described , you seem to missing a fundamental way in which the /tf tree in ROS should be used. Ideally you have use a tf listener to lookup transforms at a certain time, as long as the time stamp requested is not exceeding the latest on the tf buffer you will get a transform.</p> <p>Answering your question, an implementation would be one node/class which has both the <code>message_filters::sync::ApproximateTime</code> and <code>tf2_ros::TransformListener</code> accessible and hence you can use the <code>tfBuffer.lookupTransform</code> function where needed.</p> <p>An important sidenote about the tf tree buffer, if requested an arbitrary timestamp (not exceeding the latest in the buffer) it performs SLERP interpolation between to give the transform. (More info <a href="https://stackoverflow.com/questions/61882186/retrieve-interpolated-transform-from-tf2-rosbuffer">here</a>)</p>
104380
2023-09-28T05:06:55.410
|subscribe|message-filters|approximatetime|message-filter|tf|
<p>I am trying to use a <a href="http://wiki.ros.org/message_filters/ApproximateTime" rel="nofollow noreferrer">message_filters::sync::ApproximateTime</a> subscriber in a C++ node that must subscribe to 2 custom messages (which have a <a href="http://docs.ros.org/en/melodic/api/std_msgs/html/msg/Header.html" rel="nofollow noreferrer">Header</a> each), <a href="http://docs.ros.org/en/melodic/api/nav_msgs/html/msg/OccupancyGrid.html" rel="nofollow noreferrer">nav_msgs/OccupancyGrid Message</a>, and a <a href="http://docs.ros.org/en/melodic/api/tf/html/msg/tfMessage.html" rel="nofollow noreferrer">tf/tfMessage Message</a>. The main point is I also want to subscribe to the /tf topic along with the other messages because my goal is to use data with approximate timestamp coherence; essentially get data at roughly the same time.</p> <p><strong>Edit:</strong> Why I want to subscribe to the tf topic simultaneously: I want to know the robot's pose with respect to the map frame because I detect landmarks in the map frame. I want to know if these landmarks are within the robot's 2D laserscanner's sensing radius. I understand that the /odom topic is the true position of the robot from Gazebo, and my SLAM layer is providing the transforms /tf, so I should use /tf instead of /odom.</p> <p>However, I see that message_filters::sync::ApproximateTime can only work with messages which have a Header, and tf message does not have a header. I have 1 callback for the message_filters::sync::ApproximateTime subscriber and I want to also view the tf message at this time, how can I subscribe to the tf data? <strong>I am looking for ideas on how to program this in C++</strong>. So far I have 2 ideas:</p> <ol> <li><p>Create a custom message which has the exact definition of tf but with a Header. Subscribe to /tf topic, modify the tf message by added a Header with a timestamp, and publish this custom message. The problem with this is I have more overhead, takes up more processing, and communication bandwidth between the nodes increases.</p> </li> <li><p>In addition to the message_filters::sync::ApproximateTime subscriber callback, use another callback in the same node that subscribes to /tf, use C++ object oriented programming (OOP) to let the two callbacks communicate with each other to know when all data is received so further processing can be done. The problem with this is it seems complicated and I am unsure if I can get an OOP C++ version of this running quickly.</p> </li> </ol>
Subscribe to geometry_msgs/TransformStamped (tf) Message with message_filters ApproximateTime subscriber
<p>From the source code it appears you can use the tag <code>gz_frame_id</code> or the older <code>ignition_frame_id</code> (deprecated) as a child of the <code>sensor</code> tag.</p> <p>The relevant source code is <a href="https://github.com/gazebosim/gz-sensors/blob/ec52913e608ce8f64053650bfcced84a70ca12e2/src/Sensor.cc#L158" rel="nofollow noreferrer">here</a>.</p>
104392
2023-09-28T17:09:00.037
|ros2|imu|gazebo-ignition|ignition-fortress|
<p>I am trying to setup a robot in Gazebo Fortress, under ROS2 Humble in Ubuntu 22.04. This robot has 6 wheels, a lidar and an IMU. I have setup the xacro files and I am able to spawn the robot into Gazebo and get laser and IMU readings.</p> <p>However, the frame of the IMU messages is not correct. This is my IMU gazebo code in its corresponding xacro file:</p> <pre><code> &lt;gazebo reference=&quot;<span class="math-container">${prefix}_$</span>{imu_name}&quot;&gt; &lt;material&gt;Gazebo/Black&lt;/material&gt; &lt;gravity&gt;true&lt;/gravity&gt; &lt;sensor name=&quot;<span class="math-container">${prefix}_imu_sensor" type="imu"&gt; &lt;always_on&gt;true&lt;/always_on&gt; &lt;update_rate&gt;25&lt;/update_rate&gt; &lt;visualize&gt;false&lt;/visualize&gt; &lt;topic&gt;$</span>{prefix}/imu&lt;/topic&gt; &lt;plugin filename=&quot;libignition-gazebo-imu-system.so&quot; name=&quot;ignition::gazebo::systems::Imu&quot;&gt; &lt;/plugin&gt; &lt;pose&gt;0 0 0 0 0 0&lt;/pose&gt; &lt;/sensor&gt; &lt;/gazebo&gt; </code></pre> <p>I have tried to add <code>frameID</code> to the plugin parameters, as I did in Gazebo Classic, but it didn't work. My questions are:</p> <ol> <li>How to change the frame published in the messages?</li> <li>What parameters are available for the IMU plugin? Is there any documentation or where can I read the source code?</li> </ol> <p>Thank you!</p>
Setting frame of IMU message in Gazebo Fortress
<p>You haven't specified which Gazebo you mean.</p> <p>Gazebo Classic has support for this <a href="https://github.com/gazebosim/gazebo-classic/pull/3294" rel="nofollow noreferrer">since version 11.13</a> using command-line argument <code>--initial_sim_time 10.0</code> . Before 11.14, there was a bug that reset of simulation resets the time to zero. This was fixed in 11.14.</p> <p>(New) Gazebo has support for this <a href="https://github.com/gazebosim/gz-sim/pull/1801/files" rel="nofollow noreferrer">since version 7.5 (Garden) and 8.0 (Harmonic)</a> using command-line argument <code>--initial-sim-time 10.0</code> (notice the difference to Classic). Reset should work correctly.</p> <hr /> <p>The best way to fight against negative timestamps is preventing them in the usual math operations. Any time you write <code>time1 - duration &gt;= time2</code>, you should rewrite it to <code>time1 &gt;= time2 + duration</code>. This way, unless duration is negative, you prevent going to negative timestamps. But of course, sometimes this can't be avoided. And also a lot of already released code doesn't have this close-to-zero-time hardening and will fail.</p> <hr /> <p>Maybe not a problem for the OP who only needs to set simtime to 10 seconds, but if anyone has the idea of starting the simulation with current UNIX timestamp - this is possible, but at least in Gazebo Classic, I've seen some unexpected behavior mostly regarding rendering sensors (and also the GUI field for simtime kind of overflows). But I haven't yet had time to figure out the problem with sensors exactly... If you ask what is this good for, one example could be detailed simulation of a magnetometer, which needs to load precomupted magnetic field models which depend on the current year. Also, GNSS positions need to know the epoch to be precisely referenced to ground.</p>
104397
2023-09-28T22:13:30.753
|ros|gazebo|
<p>Similar to this question: <a href="https://answers.ros.org/question/310797/start-gazebo-simulation-with-non-zero-clock-time/" rel="nofollow noreferrer">https://answers.ros.org/question/310797/start-gazebo-simulation-with-non-zero-clock-time/</a></p> <p>When gazebo starts up it starts its clock at 0, which can cause problems with code that does math on times, i.e. subtracting 10 seconds from a timestamp that is less than 10 epoch seconds will cause an error.</p> <p>Does gazebo support any mechanism to change the initial clock stamp?</p>
How can you start gazebo with a non-0 simulated clock time?
<p>I am not aware of any (official) <em>existing</em> functionality to accomplish this functionality in Gazebo &quot;out of the box&quot;. If you are brave and willing to write a Gazebo-ROS plugin, <a href="https://classic.gazebosim.org/tutorials?tut=gui_overlay&amp;cat=user_input" rel="nofollow noreferrer">Gazebo supports GUI Plugins</a> and <a href="https://classic.gazebosim.org/tutorials?tut=system_plugin&amp;cat=write_plugin" rel="nofollow noreferrer">System Plugins</a> and there are a few ways to get mouse events (e.g. <a href="https://github.com/gazebosim/gazebo-classic/blob/fc2643c139a9f9627f235295c760a6afc348b0af/gazebo/rendering/Scene.cc#L1208" rel="nofollow noreferrer">this</a> and <a href="https://github.com/gazebosim/gz-gui/blob/c93dd146eb0c3d631bbf7b8ecb0e4f35013a7126/src/plugins/minimal_scene/MinimalScene.cc#L380" rel="nofollow noreferrer">this</a>)</p> <p>You could also look at what others have previously tried in these Gazebo Answers questions. Both seem highly relevant to what you're looking to do, but mileage may vary with your version of ROS/Gazebo:</p> <ul> <li><a href="https://answers.gazebosim.org//question/9050/setting-goal-position-with-gazebo/" rel="nofollow noreferrer">https://answers.gazebosim.org//question/9050/setting-goal-position-with-gazebo/</a></li> <li><a href="https://answers.gazebosim.org//question/5091/get-mouse-click-location-and-event/" rel="nofollow noreferrer">https://answers.gazebosim.org//question/5091/get-mouse-click-location-and-event/</a></li> </ul> <p>Otherwise, the typical ROS approach is to set goals from RViz. This <em>is</em> supported &quot;out of the box&quot; and you will find plenty of tutorials/help to get that working (e.g. <a href="http://wiki.ros.org/navigation/Tutorials/Using%20rviz%20with%20the%20Navigation%20Stack" rel="nofollow noreferrer">here</a>).</p>
104404
2023-09-29T10:19:55.750
|ros-melodic|python|gazebo-9|
<p>I want to get the coordinates of a point (x and y coordinates) using the mouse on the gazebo client to navigate my robot to this clicked point. Please help me, I'm newbie!</p>
Is it possible to get x and y coordinates in gazebo world with mouse click?
<p>To my knowledge the only way to get the <code>LaunchConfiguration</code> parameter value at runtime (not the default parameter value) is to use <code>OpaqueFunction</code>.</p> <p>The problem is you need to get the right context used to build the LaunchDescription and as far as I know this is the only way to expose it.</p> <p>A short example is <a href="https://robotics.stackexchange.com/questions/104340/getting-the-value-of-launchargument-inside-python-launch-file">here</a>.</p>
104405
2023-09-29T10:27:18.000
|ros-humble|parameters|launch-file|
<p>I just want to have a log message with the parameter value, and I can't find how to.</p> <pre class="lang-py prettyprint-override"><code> return LaunchDescription([ arg_i, LogInfo(msg=LaunchConfiguration('i')), # this one has the value, but I want it in a string LogInfo(msg=f&quot;i = '{ LaunchConfiguration('i') }'&quot;), # here I have the object string, not the param value ]) </code></pre> <p>-&gt; I don't want to use the <em>OpaqueFunction</em> to have my log.</p> <p>In case this is not possible, I have another similar problem, I want to use the param value in a mathematical operation, and use the result as a node argument :</p> <pre class="lang-py prettyprint-override"><code>i = LaunchConfiguration(&quot;i&quot;) spawner = Node( package=&quot;ros_gz_sim&quot;, executable=&quot;create&quot;, arguments=[ &quot;-Y&quot;, str( int(i) * (math.pi/4)), ], <span class="math-container">```</span> </code></pre>
How to get launch parameter (LaunchConfiguration) value in string?
<p>This was somehow fixed and was related to Cmake: <a href="https://github.com/ms-iot/ROSOnWindows/issues/448#issuecomment-1766756522" rel="nofollow noreferrer">https://github.com/ms-iot/ROSOnWindows/issues/448#issuecomment-1766756522</a></p>
104407
2023-09-29T14:39:02.457
|ros2|colcon|
<p>I am experiencing problems with colcon build. I am running it in x64 Native Tools Command Prompt for VS 2019 as admin. I get this error for every colcon build i was trying to create.</p> <p>I am using ROS2 foxy for Windows. View the full Error Message below:</p> <pre><code>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional&gt;c:\opt\ros\foxy\x64\setup.bat C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional&gt;cd \dev\ros2_ws C:\dev\ros2_ws&gt;colcon build --symlink-install --merge-install [0.790s] root DEBUG Using proactor: IocpProactor Starting &gt;&gt;&gt; examples_rclcpp_minimal_action_client [0.804s] colcon.colcon_ros.prefix_path.catkin WARNING The path 'C:\opt\ros\foxy\x64\tools\vcpkg\installed\x64-windows' in the environment variable CMAKE_PREFIX_PATH doesn't exist Starting &gt;&gt;&gt; examples_rclcpp_minimal_action_server Starting &gt;&gt;&gt; examples_rclcpp_minimal_client Starting &gt;&gt;&gt; examples_rclcpp_minimal_composition Starting &gt;&gt;&gt; examples_rclcpp_minimal_publisher Starting &gt;&gt;&gt; examples_rclcpp_minimal_service Starting &gt;&gt;&gt; examples_rclcpp_minimal_subscriber Starting &gt;&gt;&gt; examples_rclcpp_minimal_timer Starting &gt;&gt;&gt; examples_rclcpp_multithreaded_executor Starting &gt;&gt;&gt; examples_rclpy_executors Starting &gt;&gt;&gt; examples_rclpy_minimal_action_client Starting &gt;&gt;&gt; examples_rclpy_minimal_action_server --- stderr: examples_rclcpp_minimal_action_client Traceback (most recent call last): File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py&quot;, line 59, in build rc = await extension.build( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 87, in build rc = await self._reconfigure(args, env) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 174, in _reconfigure completed = await run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 177, in run completed = await colcon_core_subprocess_run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 81, in run rc, _, _ = await _async_check_call( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 139, in _async_check_call process = await create_subprocess( File &quot;asyncio\subprocess.py&quot;, line 236, in create_subprocess_exec File &quot;asyncio\base_events.py&quot;, line 1630, in subprocess_exec File &quot;asyncio\windows_events.py&quot;, line 385, in _make_subprocess_transport File &quot;asyncio\base_subprocess.py&quot;, line 36, in __init__ File &quot;asyncio\windows_events.py&quot;, line 881, in _start File &quot;asyncio\windows_utils.py&quot;, line 153, in __init__ File &quot;subprocess.py&quot;, line 854, in __init__ File &quot;subprocess.py&quot;, line 1307, in _execute_child PermissionError: [WinError 5] Zugriff verweigert --- Failed &lt;&lt;&lt; examples_rclcpp_minimal_action_client [0.80s, exited with code 1] --- stderr: examples_rclcpp_minimal_action_server Traceback (most recent call last): File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py&quot;, line 59, in build rc = await extension.build( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 87, in build rc = await self._reconfigure(args, env) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 174, in _reconfigure completed = await run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 177, in run completed = await colcon_core_subprocess_run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 81, in run rc, _, _ = await _async_check_call( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 139, in _async_check_call process = await create_subprocess( File &quot;asyncio\subprocess.py&quot;, line 236, in create_subprocess_exec File &quot;asyncio\base_events.py&quot;, line 1630, in subprocess_exec File &quot;asyncio\windows_events.py&quot;, line 385, in _make_subprocess_transport File &quot;asyncio\base_subprocess.py&quot;, line 36, in __init__ File &quot;asyncio\windows_events.py&quot;, line 881, in _start File &quot;asyncio\windows_utils.py&quot;, line 153, in __init__ File &quot;subprocess.py&quot;, line 854, in __init__ File &quot;subprocess.py&quot;, line 1307, in _execute_child PermissionError: [WinError 5] Zugriff verweigert --- Failed &lt;&lt;&lt; examples_rclcpp_minimal_action_server [0.73s, exited with code 1] --- stderr: examples_rclcpp_minimal_client Traceback (most recent call last): File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py&quot;, line 59, in build rc = await extension.build( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 87, in build rc = await self._reconfigure(args, env) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 174, in _reconfigure completed = await run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 177, in run completed = await colcon_core_subprocess_run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 81, in run rc, _, _ = await _async_check_call( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 139, in _async_check_call process = await create_subprocess( File &quot;asyncio\subprocess.py&quot;, line 236, in create_subprocess_exec File &quot;asyncio\base_events.py&quot;, line 1630, in subprocess_exec File &quot;asyncio\windows_events.py&quot;, line 385, in _make_subprocess_transport File &quot;asyncio\base_subprocess.py&quot;, line 36, in __init__ File &quot;asyncio\windows_events.py&quot;, line 881, in _start File &quot;asyncio\windows_utils.py&quot;, line 153, in __init__ File &quot;subprocess.py&quot;, line 854, in __init__ File &quot;subprocess.py&quot;, line 1307, in _execute_child PermissionError: [WinError 5] Zugriff verweigert --- Failed &lt;&lt;&lt; examples_rclcpp_minimal_client [0.67s, exited with code 1] --- stderr: examples_rclcpp_minimal_composition Traceback (most recent call last): File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py&quot;, line 59, in build rc = await extension.build( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 87, in build rc = await self._reconfigure(args, env) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 174, in _reconfigure completed = await run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 177, in run completed = await colcon_core_subprocess_run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 81, in run rc, _, _ = await _async_check_call( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 139, in _async_check_call process = await create_subprocess( File &quot;asyncio\subprocess.py&quot;, line 236, in create_subprocess_exec File &quot;asyncio\base_events.py&quot;, line 1630, in subprocess_exec File &quot;asyncio\windows_events.py&quot;, line 385, in _make_subprocess_transport File &quot;asyncio\base_subprocess.py&quot;, line 36, in __init__ File &quot;asyncio\windows_events.py&quot;, line 881, in _start File &quot;asyncio\windows_utils.py&quot;, line 153, in __init__ File &quot;subprocess.py&quot;, line 854, in __init__ File &quot;subprocess.py&quot;, line 1307, in _execute_child PermissionError: [WinError 5] Zugriff verweigert --- Failed &lt;&lt;&lt; examples_rclcpp_minimal_composition [0.61s, exited with code 1] --- stderr: examples_rclcpp_minimal_publisher Traceback (most recent call last): File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py&quot;, line 59, in build rc = await extension.build( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 87, in build rc = await self._reconfigure(args, env) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 174, in _reconfigure completed = await run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 177, in run completed = await colcon_core_subprocess_run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 81, in run rc, _, _ = await _async_check_call( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 139, in _async_check_call process = await create_subprocess( File &quot;asyncio\subprocess.py&quot;, line 236, in create_subprocess_exec File &quot;asyncio\base_events.py&quot;, line 1630, in subprocess_exec File &quot;asyncio\windows_events.py&quot;, line 385, in _make_subprocess_transport File &quot;asyncio\base_subprocess.py&quot;, line 36, in __init__ File &quot;asyncio\windows_events.py&quot;, line 881, in _start File &quot;asyncio\windows_utils.py&quot;, line 153, in __init__ File &quot;subprocess.py&quot;, line 854, in __init__ File &quot;subprocess.py&quot;, line 1307, in _execute_child PermissionError: [WinError 5] Zugriff verweigert --- Failed &lt;&lt;&lt; examples_rclcpp_minimal_publisher [0.58s, exited with code 1] --- stderr: examples_rclcpp_minimal_service Traceback (most recent call last): File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py&quot;, line 59, in build rc = await extension.build( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 87, in build rc = await self._reconfigure(args, env) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 174, in _reconfigure completed = await run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 177, in run completed = await colcon_core_subprocess_run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 81, in run rc, _, _ = await _async_check_call( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 139, in _async_check_call process = await create_subprocess( File &quot;asyncio\subprocess.py&quot;, line 236, in create_subprocess_exec File &quot;asyncio\base_events.py&quot;, line 1630, in subprocess_exec File &quot;asyncio\windows_events.py&quot;, line 385, in _make_subprocess_transport File &quot;asyncio\base_subprocess.py&quot;, line 36, in __init__ File &quot;asyncio\windows_events.py&quot;, line 881, in _start File &quot;asyncio\windows_utils.py&quot;, line 153, in __init__ File &quot;subprocess.py&quot;, line 854, in __init__ File &quot;subprocess.py&quot;, line 1307, in _execute_child PermissionError: [WinError 5] Zugriff verweigert --- Failed &lt;&lt;&lt; examples_rclcpp_minimal_service [0.51s, exited with code 1] --- stderr: examples_rclcpp_minimal_subscriber Traceback (most recent call last): File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py&quot;, line 59, in build rc = await extension.build( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 87, in build rc = await self._reconfigure(args, env) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 174, in _reconfigure completed = await run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 177, in run completed = await colcon_core_subprocess_run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 81, in run rc, _, _ = await _async_check_call( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 139, in _async_check_call process = await create_subprocess( File &quot;asyncio\subprocess.py&quot;, line 236, in create_subprocess_exec File &quot;asyncio\base_events.py&quot;, line 1630, in subprocess_exec File &quot;asyncio\windows_events.py&quot;, line 385, in _make_subprocess_transport File &quot;asyncio\base_subprocess.py&quot;, line 36, in __init__ File &quot;asyncio\windows_events.py&quot;, line 881, in _start File &quot;asyncio\windows_utils.py&quot;, line 153, in __init__ File &quot;subprocess.py&quot;, line 854, in __init__ File &quot;subprocess.py&quot;, line 1307, in _execute_child PermissionError: [WinError 5] Zugriff verweigert --- Failed &lt;&lt;&lt; examples_rclcpp_minimal_subscriber [0.47s, exited with code 1] --- stderr: examples_rclcpp_minimal_timer Traceback (most recent call last): File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py&quot;, line 59, in build rc = await extension.build( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 87, in build rc = await self._reconfigure(args, env) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 174, in _reconfigure completed = await run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 177, in run completed = await colcon_core_subprocess_run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 81, in run rc, _, _ = await _async_check_call( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 139, in _async_check_call process = await create_subprocess( File &quot;asyncio\subprocess.py&quot;, line 236, in create_subprocess_exec File &quot;asyncio\base_events.py&quot;, line 1630, in subprocess_exec File &quot;asyncio\windows_events.py&quot;, line 385, in _make_subprocess_transport File &quot;asyncio\base_subprocess.py&quot;, line 36, in __init__ File &quot;asyncio\windows_events.py&quot;, line 881, in _start File &quot;asyncio\windows_utils.py&quot;, line 153, in __init__ File &quot;subprocess.py&quot;, line 854, in __init__ File &quot;subprocess.py&quot;, line 1307, in _execute_child PermissionError: [WinError 5] Zugriff verweigert --- Failed &lt;&lt;&lt; examples_rclcpp_minimal_timer [0.39s, exited with code 1] --- stderr: examples_rclcpp_multithreaded_executor Traceback (most recent call last): File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\executor\__init__.py&quot;, line 91, in __call__ rc = await self.task(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 93, in __call__ return await task_method(*args, **kwargs) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_ros\task\ament_cmake\build.py&quot;, line 59, in build rc = await extension.build( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 87, in build rc = await self._reconfigure(args, env) File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_cmake\task\cmake\build.py&quot;, line 174, in _reconfigure completed = await run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\task\__init__.py&quot;, line 177, in run completed = await colcon_core_subprocess_run( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 81, in run rc, _, _ = await _async_check_call( File &quot;c:\opt\ros\foxy\x64\lib\site-packages\colcon_core\subprocess.py&quot;, line 139, in _async_check_call process = await create_subprocess( File &quot;asyncio\subprocess.py&quot;, line 236, in create_subprocess_exec File &quot;asyncio\base_events.py&quot;, line 1630, in subprocess_exec File &quot;asyncio\windows_events.py&quot;, line 385, in _make_subprocess_transport File &quot;asyncio\base_subprocess.py&quot;, line 36, in __init__ File &quot;asyncio\windows_events.py&quot;, line 881, in _start File &quot;asyncio\windows_utils.py&quot;, line 153, in __init__ File &quot;subprocess.py&quot;, line 854, in __init__ File &quot;subprocess.py&quot;, line 1307, in _execute_child PermissionError: [WinError 5] Zugriff verweigert --- Failed &lt;&lt;&lt; examples_rclcpp_multithreaded_executor [0.33s, exited with code 1] Aborted &lt;&lt;&lt; examples_rclpy_executors [1.16s] Aborted &lt;&lt;&lt; examples_rclpy_minimal_action_server [1.00s] Aborted &lt;&lt;&lt; examples_rclpy_minimal_action_client [1.08s] Summary: 0 packages finished [2.03s] 9 packages failed: examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server examples_rclcpp_minimal_client examples_rclcpp_minimal_composition examples_rclcpp_minimal_publisher examples_rclcpp_minimal_service examples_rclcpp_minimal_subscriber examples_rclcpp_minimal_timer examples_rclcpp_multithreaded_executor 3 packages aborted: examples_rclpy_executors examples_rclpy_minimal_action_client examples_rclpy_minimal_action_server 9 packages had stderr output: examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server examples_rclcpp_minimal_client examples_rclcpp_minimal_composition examples_rclcpp_minimal_publisher examples_rclcpp_minimal_service examples_rclcpp_minimal_subscriber examples_rclcpp_minimal_timer examples_rclcpp_multithreaded_executor 4 packages not processed [WinError 5] Zugriff verweigert </code></pre> <p>Does someone has any ideas on how to resolve this?</p>
ROS2: colcon build --symlink-install --merge-install PermissionError WinError5
<p><strong>Short answer:</strong></p> <p>Re. separate log files:</p> <p>It is not currently possible to log to two separate files from one node. To realize this, you'd have to implement an alternative <a href="https://github.com/ros2/rcl_logging" rel="nofollow noreferrer">rcl_logging_interface</a>.</p> <p>(Multiple nodes in different processes do log to different files but that is not your use case.)</p> <p>Re. disabling logging to stdout:</p> <p>It is possible to disable output to stdout with the ros-args flag <code>--disable-stdout-logs</code>. E.g. for the <a href="https://github.com/ros2/demos/tree/rolling/demo_nodes_cpp" rel="nofollow noreferrer">demo_nodes_cpp example</a>:</p> <pre><code>ros2 run demo_nodes_cpp list_parameters --ros-args --disable-stdout-logs </code></pre> <p>In case of the DEBUG loglevel, some messages for <code>rcl</code> and <code>rclcpp</code> are still shown, e.g.:</p> <pre><code>ros2 run demo_nodes_cpp list_parameters --ros-args --log-level DEBUG --disable-stdout-logs </code></pre> <p>If you don't need DEBUG loglevel for <code>rcl</code> and <code>rclcpp</code> (e.g. you only need DEBUG for your nodes), then the stray stdout logmessages can avoided by specifying non-DEBUG loglevels for <code>rcl</code> and <code>rclcpp</code>:</p> <pre><code>ros2 run demo_nodes_cpp list_parameters --ros-args --log-level DEBUG --disable-stdout-logs --log-level rcl:=INFO --log-level rclcpp:=INFO </code></pre> <p><strong>Longer answer:</strong></p> <blockquote> <p>Setting up a second logger is straightforward, as one can just call <code>rclcpp::get_logger('&lt;logger-name&gt;')</code>.</p> </blockquote> <p>This is indeed what you'd expect based on the class name 'Logger', but it is not correct. An <code>rclcpp::Logger</code> does not perform any logging, it is just a <a href="https://github.com/ros2/rclcpp/blob/7c1143dc1502d5dda99a3dfa17124a72dbaea90c/rclcpp/include/rclcpp/logger.hpp#L92" rel="nofollow noreferrer">small class</a> mainly holding a name and providing some methods such as <code>set_level(Level level)</code>, but nothing more. The logging is done solely through the log macros, e.g. <code>RCLCPP_INFO()</code>, which resolve to <code>rcutils</code> function calls.</p> <p>A while ago, I dug through the whole logging code and wrote down an almost complete walktrough <a href="https://github.com/jrutgeer/ROS2_assorted_docs/blob/main/ROS2_core/ROS2_logging.md" rel="nofollow noreferrer">in this document</a>. Mind you, this is more or less a literal chronological writedown of digging through the code (i.e. not ideally structured as documentation) and there have been some changes to the code since I wrote that document, so it is not fully up to date anymore. Nevertheless: afaik it still is the best documentation on rclcpp logging currently availabe.</p> <p>I won't go through the details here, but <a href="https://github.com/jrutgeer/ROS2_assorted_docs/blob/main/ROS2_core/ROS2_logging.md#rcl-output-handlers" rel="nofollow noreferrer">this section</a> describes the three current output handlers: to console / publish on topic rosout / to file. The 'to file' output handler is described in <a href="https://github.com/jrutgeer/ROS2_assorted_docs/blob/main/ROS2_core/ROS2_logging.md#external-library-spdlog" rel="nofollow noreferrer">this subsection</a>. To allow for logging to multiple files you'd need to adapt the <code>rcl_logging_spdlog</code> library or write a similar library and load that as the log handler.</p>
104409
2023-09-29T16:44:59.263
|ros2|ros-humble|rclcpp|
<p>For a specific ROS2 (humble) node that I'm working on I want to add a second logger that just logs to a file (preferably its own). Setting up a second logger is straightforward, as one can just call <code>rclcpp::get_logger('&lt;logger-name&gt;')</code>. I could, however, not find any way to set the logger up so that it just logs to its own file. I do not want the logger to log to the terminal at all.</p> <p>Thanks!</p>
ROS2 CPP file only second logger
<p>Wrist 1 is also always parallel on the UR robots.</p> <p>As far as I know, if you're only considering two joints in isolation, the manipulator loses rank when they become coaxial.</p> <p>That can't really happen with the first four joints, since the link lengths preclude exact coincidence and the wrist cluster would hit the base/shoulder before the wrist 1 axis gets close to coincident with the shoulder lift axis.</p> <p>This article illustrates the singularities of this style of arm, including both Mecademic and UR examples:</p> <p><a href="https://www.mecademic.com/academic_articles/singularities-6-axis-robot-arm/" rel="nofollow noreferrer">https://www.mecademic.com/academic_articles/singularities-6-axis-robot-arm/</a></p> <p>The video linked from there is great:</p> <p><a href="https://youtu.be/6Wmw4lUHlX8" rel="nofollow noreferrer">https://youtu.be/6Wmw4lUHlX8</a></p> <p>If the last axis ends up parallel with the others then you get the wrist singularity. I hit that frequently when I was experimenting with joystick teleop with a UR.</p> <p>The native UR controller limits the robot motion with that keep-out cylinder coaxial with the base, which I believe is to slow and stop the robot as it approaches the shoulder singularity.</p>
104419
2023-09-30T11:53:39.027
|manipulator|jacobian|singularity|
<p>I thought I understood the Jacobian and singularities pretty well, but then I was asked: UR robots (and others) have 2 joints that are always in parallel. Doesn't this put the robot at a singularity because the Jacobian is rank-deficient?</p> <p>On the other hand, I've printed the condition number of UR robots and it's not so large. Typically under 30. So what am I missing; how is it that the condition number is not large <em>all the time</em>?</p> <p>Parallel axes marked in red: <a href="https://i.stack.imgur.com/orfiX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/orfiX.png" alt="enter image description here" /></a></p>
UR robots always have 2 parallel axes. Why not at a singularity?
<p>For object detection in a point cloud, I'll propose a process for you to follow instead of just providing links. I assume you don't have experience with machine learning and that is driving your question. If I'm wrong about that, my apologies.</p> <p>I would turn the 3D point cloud into a depth map oriented with the viewer at the lidar. This would give you a 2D 'image' with each pixel representing depth. Use an available ML object detection algo like 2D YOLO that is pretrained and well documented. Study the tutorials, get it working, and then train the last few layers on training data you would label by hand.</p> <p><a href="https://learnopencv.com/train-yolov8-on-custom-dataset/" rel="nofollow noreferrer">https://learnopencv.com/train-yolov8-on-custom-dataset/</a></p> <p>The results from 2D processing like YOLO may or may not be good enough for your case but at least you have learned a bit about machine learning, have your PC setup for machine learning, and understand labeling data sets.</p> <p>Having experience with the easy stuff above, what you find with google will be easier to understand: <a href="https://cs230.stanford.edu/projects_fall_2019/reports/26232893.pdf" rel="nofollow noreferrer">https://cs230.stanford.edu/projects_fall_2019/reports/26232893.pdf</a></p> <p><a href="https://www.mathworks.com/help/lidar/ug/object-detection-with-point-clouds.html" rel="nofollow noreferrer">https://www.mathworks.com/help/lidar/ug/object-detection-with-point-clouds.html</a></p> <p><a href="https://medium.com/@regis.loeb/playing-with-point-clouds-for-3d-object-detection-eff1d98e526a" rel="nofollow noreferrer">https://medium.com/@regis.loeb/playing-with-point-clouds-for-3d-object-detection-eff1d98e526a</a></p> <p><a href="https://towardsdatascience.com/lidar-point-cloud-based-3d-object-detection-implementation-with-colab-part-1-of-2-e3999ea8fdd4" rel="nofollow noreferrer">https://towardsdatascience.com/lidar-point-cloud-based-3d-object-detection-implementation-with-colab-part-1-of-2-e3999ea8fdd4</a></p> <p><a href="https://www.mdpi.com/2076-3417/13/11/6754" rel="nofollow noreferrer">https://www.mdpi.com/2076-3417/13/11/6754</a></p> <p>All of this is to explain that you're not going to get a suitable answer without some underlying understanding of the subject. If you want to use ML for object detection, learn about object detection and machine learning first, then try to leverage the work of those coming before you.</p> <p>I have integrated YOLOV4 running on DARKNET into a ROS2 node for realtime 2D custom-object detection, but I started with learning the DARKNET separately and only after I was comfortable with it, did I think about integrating with ROS. It was more work than I expected (but I suck at software and it may be faster for you).</p>
104420
2023-09-30T12:06:41.883
|gazebo|ros2|pointcloud|3d-object-recognition|
<p>I am working on a &quot;<em><strong>Dynamic Object detection</strong></em>&quot; problem using just point cloud and deep learning algorithms. I have to use a static depth camera/ static lidar in the environment. The environment includes a certain number of dynamic objects like a Human, a car, etc., and also static objects, and the lidar is fixed at a point in the environment. How can I create a point cloud for such an environment? What should be the general approach for detecting the object?</p> <p>If anyone can suggest to me a good starting point for working with lidar in gazebo and ros2, that would be also highly appreciated. Thank you!</p>
Point cloud using static lidar
<p>I found the root cause of the issue, but not the correct solution for it. At the end I will add workaround solution for people checking this.</p> <p>Address range 224.x.x.x - 233.x.x.x acts as multicast address range.</p> <p>I downloaded this repository <a href="https://github.com/troglobit/mtools/" rel="nofollow noreferrer">https://github.com/troglobit/mtools/</a> on both the machines and compiled simple c programs using make.</p> <ul> <li>Machine 1: ./msend -g 224.0.0.255 -p 22224</li> <li>Machine 2: ./mreceive -g 224.0.0.255 -p 22224</li> </ul> <p>I was able to receive the multicast messages. Now when I try to send the multicast messages using any multicast address other than following range then I multicast communication didn't happen working multicast range for my network is 224.0.0.0 -&gt; 224.0.0.255</p> <p>Using wireshark I found that Fast DDS sends the RTPS information on multicast address like <code>233.255.0.1</code> and this address was not working as multicast on my network (I am not sure how to resolve this)</p> <p>I tried changing the mutlicast locators in Fast DDS to different address but attempt was unsuccessful. 2 Solutions exists for this issue</p> <ol> <li>Make <code>233.255.0.1</code> work as multicast address -&gt; fix network setup somehow</li> <li>Change default address for RTPS protocol (from <code>233.255.0.1</code> to 224.0.0.x)</li> </ol> <p>I could not find any solution to above in time constraints so I went with following workaround</p> <p>--- host pc</p> <pre><code>export RMW_IMPLEMENTATION=rmw_fastrtps_cpp export FASTRTPS_DEFAULT_PROFILES_FILE=~/fast-rtps.xml export ROS_STATIC_PEERS=&quot;localhost;192.168.29.79&quot; </code></pre> <p>-- host pc : fast-rtps.xml ----</p> <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt; &lt;profiles xmlns=&quot;http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles&quot;&gt; &lt;participant profile_name=&quot;unicast_connection&quot; is_default_profile=&quot;true&quot;&gt; &lt;rtps&gt; &lt;builtin&gt; &lt;metatrafficUnicastLocatorList&gt; &lt;locator/&gt; &lt;/metatrafficUnicastLocatorList&gt; &lt;initialPeersList&gt; &lt;locator&gt; &lt;udpv4&gt; &lt;address&gt;192.168.29.79&lt;/address&gt; &lt;/udpv4&gt; &lt;/locator&gt; &lt;/initialPeersList&gt; &lt;/builtin&gt; &lt;/rtps&gt; &lt;/participant&gt; &lt;/profiles&gt; </code></pre> <p>--- raspi</p> <pre><code>export RMW_IMPLEMENTATION=rmw_fastrtps_cpp export FASTRTPS_DEFAULT_PROFILES_FILE=~/fast-rtps.xml export ROS_STATIC_PEERS=&quot;localhost;192.168.29.91&quot; </code></pre> <p>-- raspi : fast-rtps.xml ----</p> <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt; &lt;profiles xmlns=&quot;http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles&quot;&gt; &lt;participant profile_name=&quot;unicast_connection&quot; is_default_profile=&quot;true&quot;&gt; &lt;rtps&gt; &lt;builtin&gt; &lt;metatrafficUnicastLocatorList&gt; &lt;locator/&gt; &lt;/metatrafficUnicastLocatorList&gt; &lt;initialPeersList&gt; &lt;locator&gt; &lt;udpv4&gt; &lt;address&gt;192.168.29.91&lt;/address&gt; &lt;/udpv4&gt; &lt;/locator&gt; &lt;/initialPeersList&gt; &lt;/builtin&gt; &lt;/rtps&gt; &lt;/participant&gt; &lt;/profiles&gt; </code></pre>
104435
2023-10-01T11:05:47.863
|ros2|
<p>I have raspberry pi 4B robot and host machine. I have install ros2 iron and was trying simple demo_node talker/listener to verify connectivity. Receiver doesn't get any messages from the talker node at all.</p> <p>Observations/debugging so far</p> <ol> <li><code>ufw</code> is inactive on both the machine</li> <li>I can ping from both machines to and fro successfully</li> <li>Verified that 4136 MULTICAST is enabled</li> <li>Tried changing RMW from fast-rtps to cyclonedds</li> <li>Tried using ros2 humble, but same issue.</li> <li>multicast send/receive is also not working</li> </ol> <p>What else I can do debug/resolve this issue ?</p> <hr /> <p><strong>Edit:</strong></p> <ol> <li>Operating System: ubuntu 22 server on RPI 4B, host machine: ubuntu desktop 22</li> </ol>
ROS2 Talker Listener node not working
<p>The key is</p> <blockquote> <p>'[crazyflie_publisher-1] ModuleNotFoundError: No module named 'transforms3d'</p> </blockquote> <p>This is a common python error, which means that the module 'transform3d' is missing in your python environment.</p> <p>You will need to do</p> <blockquote> <p>pip3 install transforms3d</p> </blockquote> <p>This could have perhaps also been solved by running <a href="https://docs.ros.org/en/humble/Tutorials/Intermediate/Rosdep.html" rel="nofollow noreferrer">ROSdep</a>, as that <a href="https://github.com/knmcguire/crazyflie_ros2_experimental/blob/f2b78f9a085e7421c0dfea02c383644819514410/crazyflie_ros2/package.xml#L15" rel="nofollow noreferrer">package had that as a dependency</a>.</p> <p>Edit: Also make sure that you are using the right Python version for ROS the package was installed for. This can happen if you have multiple installs of Python on your machine (see <a href="https://robotics.stackexchange.com/questions/94176/how-do-i-specify-the-version-of-python3-for-ros2">this post</a> as well)</p> <p>P.S. Just a reference for the others watching this, this is the repository of question with the same issue it is referring too:</p> <p><a href="https://github.com/knmcguire/crazyflie_ros2_experimental/issues/9" rel="nofollow noreferrer">https://github.com/knmcguire/crazyflie_ros2_experimental/issues/9</a></p>
104443
2023-10-01T20:40:21.333
|ros2|ros-humble|
<p>my problem is basically about <code>tf_fransformations</code> package. I installed and changed all dependencies according to <a href="https://index.ros.org/p/tf_transformations/" rel="nofollow noreferrer">enter link description here</a>, but it is not working. I used <code>transforms3d</code> to import the related things. Could you help us about that problem. I added the related code in our python files below, If needs I can share more, thanks.</p> <p><strong>terminal output:</strong></p> <p><strong>ntukenmez3@ae-icps-407120:~/Documents/2023-crazy-flie/crazyflie_ros2_experimental/crazyflie_ros2$</strong> ros2 launch crazyflie_ros2 crazyflie_publisher_launch.py</p> <p><strong>[INFO] [launch]:</strong> All log files can be found below /home/ntukenmez3/.ros/log/2023-10-01-16-07-47-625647-ae-icps-407120-3378000</p> <p><strong>[INFO] [launch]:</strong> Default logging verbosity is set to INFO</p> <p><strong>[INFO] [crazyflie_publisher-1]:</strong> process started with pid [3378004]</p> <p>[crazyflie_publisher-1] Traceback (most recent call last):</p> <p>[crazyflie_publisher-1] File &quot;/home/ntukenmez3/Documents/2023-crazy-flie/crazyflie_ros2_experimental/crazyflie_ros2/install/crazyflie_ros2/lib/crazyflie_ros2/crazyflie_publisher&quot;, line 33, in</p> <p>[crazyflie_publisher-1] sys.exit(load_entry_point('crazyflie-ros2==0.0.0', 'console_scripts', 'crazyflie_publisher')())</p> <p>[crazyflie_publisher-1] File &quot;/home/ntukenmez3/Documents/2023-crazy-flie/crazyflie_ros2_experimental/crazyflie_ros2/install/crazyflie_ros2/lib/crazyflie_ros2/crazyflie_publisher&quot;, line 25, in importlib_load_entry_point</p> <p>[crazyflie_publisher-1] return next(matches).load()</p> <p>[crazyflie_publisher-1] File &quot;/usr/lib/python3.10/importlib/metadata/init.py&quot;, line 171, in load</p> <p>[crazyflie_publisher-1] module = import_module(match.group('module'))</p> <p>[crazyflie_publisher-1] File &quot;/usr/lib/python3.10/importlib/init.py&quot;, line 126, in import_module</p> <p>[crazyflie_publisher-1] return _bootstrap._gcd_import(name[level:], package, level)</p> <p>[crazyflie_publisher-1] File &quot;&quot;, line 1050, in _gcd_import</p> <p>[crazyflie_publisher-1] File &quot;&quot;, line 1027, in _find_and_load</p> <p>[crazyflie_publisher-1] File &quot;&quot;, line 1006, in _find_and_load_unlocked</p> <p>[crazyflie_publisher-1] File &quot;&quot;, line 688, in _load_unlocked</p> <p>[crazyflie_publisher-1] File &quot;&quot;, line 883, in exec_module</p> <p>[crazyflie_publisher-1] File &quot;&quot;, line 241, in _call_with_frames_removed</p> <p>[crazyflie_publisher-1] File &quot;/home/ntukenmez3/Documents/2023-crazy-flie/crazyflie_ros2_experimental/crazyflie_ros2/install/crazyflie_ros2/lib/python3.10/site-packages/crazyflie_ros2/crazyflie_publisher.py&quot;, line 6, in</p> <p>[crazyflie_publisher-1] from transforms3d import *</p> <p>[crazyflie_publisher-1] ModuleNotFoundError: <strong>No module named 'transforms3d'</strong></p> <p><strong>[ERROR] [crazyflie_publisher-1]:</strong> process has died [pid 3378004, exit code 1, cmd '/home/ntukenmez3/Documents/2023-crazy-flie/crazyflie_ros2_experimental/crazyflie_ros2/install/crazyflie_ros2/lib/crazyflie_ros2/crazyflie_publisher --ros-args'].</p> <p><strong>Python files:</strong></p> <p>1.<strong>crazyflie_publisher.py</strong>:</p> <pre><code>import rclpy from rclpy.node import Node from std_msgs.msg import String from geometry_msgs.msg import Pose #from tf_transformations import euler_from_quaternion from transforms3d import * from tf2_ros import TransformBroadcaster from geometry_msgs.msg import TransformStamped from sensor_msgs.msg import Range from sensor_msgs.msg import LaserScan from nav_msgs.msg import Odometry from geometry_msgs.msg import Twist import cflib.crtp # noqa from cflib.crazyflie import Crazyflie from cflib.crazyflie.log import LogConfig from cflib.utils import uri_helper from cflib.crazyflie.syncCrazyflie import SyncCrazyflie from cflib.positioning.motion_commander import MotionCommander import math from math import pi URI = uri_helper.uri_from_env(default='radio://0/80/2M/E7E7E7E7E7') FLYING = True def radians(degrees): return degrees * math.pi / 180.0 class CrazyfliePublisher(Node): def __init__(self, link_uri): super().__init__('crazyflie_publisher') #self.pose_publisher = self.create_publisher(Pose, 'pose', 10) self.range_publisher = self.create_publisher(Range, 'zrange', 10) self.laser_publisher = self.create_publisher(LaserScan, 'scan', 10) self.odom_publisher = self.create_publisher(Odometry, 'odom', 10) self.create_subscription(Twist, 'cmd_vel', self.cmd_vel_callback, 1) self.tfbr = TransformBroadcaster(self) self._cf = Crazyflie(rw_cache='./cache') self._cf.connected.add_callback(self._connected) self._cf.disconnected.add_callback(self._disconnected) self._cf.connection_failed.add_callback(self._connection_failed) self._cf.connection_lost.add_callback(self._connection_lost) self._cf.open_link(link_uri) self.ranges= [0.0, 0.0, 0.0, 0.0, 0.0] self.create_timer(1.0/30.0, self.publish_laserscan_data) if FLYING: timer_period = 0.1 # seconds self.create_timer(timer_period, self.sendHoverCommand) self.hover = {'x': 0.0, 'y': 0.0, 'z': 0.0, 'yaw': 0.0, 'height': 0.3} self._cf.commander.send_hover_setpoint( self.hover['x'], self.hover['y'], self.hover['yaw'], self.hover['height']) def publish_laserscan_data(self): msg = LaserScan() msg.header.stamp = self.get_clock().now().to_msg() msg.header.frame_id = 'base_link' msg.range_min = 0.01 msg.range_max = 3.49 msg.ranges = self.ranges msg.angle_min = 0.5 * 2*pi msg.angle_max = -0.5 * 2*pi msg.angle_increment = -1.0*pi/2 self.laser_publisher.publish(msg) def sendHoverCommand(self): hover_height = self.hover['height'] + self.hover['z']*0.1 self._cf.commander.send_hover_setpoint( self.hover['x'], self.hover['y'], self.hover['yaw'], hover_height) self.hover['height'] = hover_height def _connected(self, link_uri): self.get_logger().info('Connected!') self._lg_stab = LogConfig(name='Stabilizer', period_in_ms=100) self._lg_stab.add_variable('stateEstimate.x', 'float') self._lg_stab.add_variable('stateEstimate.y', 'float') self._lg_stab.add_variable('stateEstimate.z', 'float') self._lg_stab.add_variable('stabilizer.roll', 'float') self._lg_stab.add_variable('stabilizer.pitch', 'float') self._lg_stab.add_variable('stabilizer.yaw', 'float') self._lg_range = LogConfig(name='Range', period_in_ms=100) self._lg_range.add_variable('range.zrange', 'uint16_t') self._lg_range.add_variable('range.front', 'uint16_t') self._lg_range.add_variable('range.right', 'uint16_t') self._lg_range.add_variable('range.left', 'uint16_t') self._lg_range.add_variable('range.back', 'uint16_t') try: self._cf.log.add_config(self._lg_stab) self._lg_stab.data_received_cb.add_callback(self._stab_log_data) self._lg_stab.error_cb.add_callback(self._stab_log_error) self._lg_stab.start() self._cf.log.add_config(self._lg_range) self._lg_range.data_received_cb.add_callback(self._range_log_data) self._lg_range.error_cb.add_callback(self._range_log_error) self._lg_range.start() except KeyError as e: print('Could not start log configuration,' '{} not found in TOC'.format(str(e))) except AttributeError: print('Could not add Stabilizer log config, bad configuration.') def _disconnected(): print('disconnected') def _connection_failed(self, link_uri, msg): print('connection_failed') def _connection_lost(self, link_uri, msg): print('connection_lost') def _range_log_error(self, logconf, msg): &quot;&quot;&quot;Callback from the log API when an error occurs&quot;&quot;&quot; print('Error when logging %s: %s' % (logconf.name, msg)) def _range_log_data(self, timestamp, data, logconf): &quot;&quot;&quot;Callback from a the log API when data arrives&quot;&quot;&quot; for name, value in data.items(): print(f'{name}: {value:3.3f} ', end='') print() t_range = TransformStamped() q = tf_transformations.quaternion_from_euler(0, radians(90), 0) t_range.header.stamp = self.get_clock().now().to_msg() t_range.header.frame_id = 'base_link' t_range.child_frame_id = 'crazyflie_flowdeck' t_range.transform.rotation.x = q[0] t_range.transform.rotation.y = q[1] t_range.transform.rotation.z = q[2] t_range.transform.rotation.w = q[3] self.tfbr.sendTransform(t_range) zrange = float(data.get('range.zrange'))/1000.0 msg = Range() msg.header.stamp = self.get_clock().now().to_msg() msg.header.frame_id = 'crazyflie_flowdeck' msg.field_of_view = radians(4.7) msg.radiation_type = Range().INFRARED msg.min_range = 0.01 msg.max_range = 3.5 msg.range = zrange ##self.range_publisher.publish(msg) max_range = 3.49 front_range = float(data.get('range.front'))/1000.0 left_range = float(data.get('range.left'))/1000.0 back_range = float(data.get('range.back'))/1000.0 right_range = float(data.get('range.right'))/1000.0 if front_range &gt; max_range: front_range = float(&quot;inf&quot;) if left_range &gt; max_range: left_range = float(&quot;inf&quot;) if right_range &gt; max_range: right_range = float(&quot;inf&quot;) if back_range &gt; max_range: back_range = float(&quot;inf&quot;) self.ranges = [back_range, left_range, front_range, right_range, back_range] def cmd_vel_callback(self, twist): self.target_twist = twist self.hover['x'] = twist.linear.x self.hover['y'] = twist.linear.y self.hover['z'] = twist.linear.z self.hover['yaw'] = -1* math.degrees(twist.angular.z) def _stab_log_error(self, logconf, msg): &quot;&quot;&quot;Callback from the log API when an error occurs&quot;&quot;&quot; print('Error when logging %s: %s' % (logconf.name, msg)) def _stab_log_data(self, timestamp, data, logconf): &quot;&quot;&quot;Callback from a the log API when data arrives&quot;&quot;&quot; &quot;&quot;&quot;for name, value in data.items(): print(f'{name}: {value:3.3f} ', end='') print()&quot;&quot;&quot; msg = Odometry() x = data.get('stateEstimate.x') y = data.get('stateEstimate.y') z = data.get('stateEstimate.z') roll = radians(data.get('stabilizer.roll')) pitch = radians(-1.0 * data.get('stabilizer.pitch')) yaw = radians(data.get('stabilizer.yaw')) msg.pose.pose.position.x = x msg.pose.pose.position.y = y msg.pose.pose.position.z = z q = tf_transformations.quaternion_from_euler(roll, pitch, yaw) msg.pose.pose.orientation.x = q[0] msg.pose.pose.orientation.y = q[1] msg.pose.pose.orientation.z = q[2] msg.pose.pose.orientation.w = q[3] self.odom_publisher.publish(msg) q_base = tf_transformations.quaternion_from_euler(0, 0, yaw)crazyflie_publisher.py: t_base = TransformStamped() t_base.header.stamp = self.get_clock().now().to_msg() t_base.header.frame_id = 'odom' t_base.child_frame_id = 'base_footprint' t_base.transform.translation.x = x t_base.transform.translation.y = y t_base.transform.translation.z = 0.0 t_base.transform.rotation.x = q_base[0] t_base.transform.rotation.y = q_base[1] t_base.transform.rotation.z = q_base[2] t_base.transform.rotation.w = q_base[3] self.tfbr.sendTransform(t_base) t_odom = TransformStamped() t_odom.header.stamp = self.get_clock().now().to_msg() t_odom.header.frame_id = 'odom' t_odom.child_frame_id = 'base_footprint' q_odom = tf_transformations.quaternion_from_euler(0, 0, 0) t_odom.transform.translation.x = 0.0 t_odom.transform.translation.y = 0.0 t_odom.transform.translation.z = 0.1 t_odom.transform.rotation.x = q_odom[0] t_odom.transform.rotation.y = q_odom[1] t_odom.transform.rotation.z = q_odom[2] t_odom.transform.rotation.w = q_odom[3] #self.tfbr.sendTransform(t_odom) t_cf = TransformStamped() q_cf = tf_transformations.quaternion_from_euler(roll, pitch, 0) t_cf.header.stamp = self.get_clock().now().to_msg() t_cf.header.frame_id = 'base_footprint' t_cf.child_frame_id = 'base_link' t_cf.transform.translation.x = 0.0 t_cf.transform.translation.y = 0.0 t_cf.transform.translation.z = z t_cf.transform.rotation.x = q_cf[0] t_cf.transform.rotation.y = q_cf[1] t_cf.transform.rotation.z = q_cf[2] t_cf.transform.rotation.w = q_cf[3] self.tfbr.sendTransform(t_cf) def main(args=None): cflib.crtp.init_drivers() rclpy.init(args=args) crazyflie_publisher = CrazyfliePublisher(URI) rclpy.spin(crazyflie_publisher) crazyflie_publisher.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() </code></pre> <p>2.<strong>package.xml:</strong></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;crazyflie_ros2&lt;/name&gt; &lt;version&gt;0.0.0&lt;/version&gt; &lt;description&gt;Publishing Crazyflie Logging Variables&lt;/description&gt; &lt;maintainer email=&quot;kimberly@bitcraze.io&quot;&gt;knmcguire&lt;/maintainer&gt; &lt;license&gt;MIT&lt;/license&gt; &lt;exec_depend&gt;python3-cflib&lt;/exec_depend&gt; &lt;exec_depend&gt;rclpy&lt;/exec_depend&gt; &lt;exec_depend&gt;std_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;geometry_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;transforms3d&lt;/exec_depend&gt; &lt;exec_depend&gt;python-transforms3d-pip&lt;/exec_depend&gt; &lt;exec_depend&gt;tf2_ros&lt;/exec_depend&gt; &lt;exec_depend&gt;sensor_msgs&lt;/exec_depend&gt; &lt;exec_depend&gt;nav_msgs&lt;/exec_depend&gt; &lt;test_depend&gt;ament_copyright&lt;/test_depend&gt; &lt;test_depend&gt;ament_flake8&lt;/test_depend&gt; &lt;test_depend&gt;ament_pep257&lt;/test_depend&gt; &lt;test_depend&gt;python3-pytest&lt;/test_depend&gt; &lt;export&gt; &lt;build_type&gt;ament_python&lt;/build_type&gt; &lt;/export&gt; &lt;/package&gt; </code></pre> <p>3.<strong>setup.py:</strong></p> <pre><code>from setuptools import setup import os from glob import glob package_name = 'crazyflie_ros2' data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), ] def package_files(data_files, directory_list): paths_dict = {} for directory in directory_list: for (path, directories, filenames) in os.walk(directory): for filename in filenames: file_path = os.path.join(path, filename) install_path = os.path.join('share', package_name, path) if install_path in paths_dict.keys(): paths_dict[install_path].append(file_path) else: paths_dict[install_path] = [file_path] for key in paths_dict.keys(): data_files.append((key, paths_dict[key])) return data_files setup( name=package_name, version='0.0.0', packages=[package_name], data_files=package_files(data_files, [ 'resource/', 'launch/']), install_requires=['setuptools'], zip_safe=True, maintainer='knmcguire', maintainer_email='kimberly@bitcraze.io', description='Publishing Crazyflie Logging Variable', license='MIT', tests_require=['pytest'], entry_points={ 'console_scripts': [ 'crazyflie_publisher = crazyflie_ros2.crazyflie_publisher:main', ], }, ) </code></pre>
Crazyflie-Ros2 connection
<p>Unfortunately, there is no clean way to pass it through launch file, while using <code>moveit_configs_utils.launches</code>. This was raised previously in an <a href="https://github.com/ros-planning/moveit2/issues/1810#issuecomment-1353538795" rel="nofollow noreferrer">issue</a> and <code>use_sim_time</code> technically supposed to be added <a href="https://github.com/ros-planning/moveit2/blob/5dd0d5e63c9dae08976656cb1c8473ca7a34c058/moveit_configs_utils/moveit_configs_utils/launches.py#L225" rel="nofollow noreferrer">here</a> in the source code. That said, here is an engineered solution around this:</p> <pre class="lang-py prettyprint-override"><code>from moveit_configs_utils import MoveItConfigsBuilder from moveit_configs_utils.launches import * def generate_move_group_launch(moveit_config): ld = LaunchDescription() ld.add_action(DeclareBooleanLaunchArg(&quot;debug&quot;, default_value=False)) ld.add_action( DeclareBooleanLaunchArg(&quot;allow_trajectory_execution&quot;, default_value=True) ) ld.add_action( DeclareBooleanLaunchArg(&quot;publish_monitored_planning_scene&quot;, default_value=True) ) # load non-default MoveGroup capabilities (space separated) ld.add_action(DeclareLaunchArgument(&quot;capabilities&quot;, default_value=&quot;&quot;)) # inhibit these default MoveGroup capabilities (space separated) ld.add_action(DeclareLaunchArgument(&quot;disable_capabilities&quot;, default_value=&quot;&quot;)) # do not copy dynamics information from /joint_states to internal robot monitoring # default to false, because almost nothing in move_group relies on this information ld.add_action(DeclareBooleanLaunchArg(&quot;monitor_dynamics&quot;, default_value=False)) should_publish = LaunchConfiguration(&quot;publish_monitored_planning_scene&quot;) move_group_configuration = { &quot;publish_robot_description_semantic&quot;: True, &quot;allow_trajectory_execution&quot;: LaunchConfiguration(&quot;allow_trajectory_execution&quot;), # Note: Wrapping the following values is necessary so that the parameter value can be the empty string &quot;capabilities&quot;: ParameterValue( LaunchConfiguration(&quot;capabilities&quot;), value_type=str ), &quot;disable_capabilities&quot;: ParameterValue( LaunchConfiguration(&quot;disable_capabilities&quot;), value_type=str ), # Publish the planning scene of the physical robot so that rviz plugin can know actual robot &quot;publish_planning_scene&quot;: should_publish, &quot;publish_geometry_updates&quot;: should_publish, &quot;publish_state_updates&quot;: should_publish, &quot;publish_transforms_updates&quot;: should_publish, &quot;monitor_dynamics&quot;: False, &quot;use_sim_time&quot;: True } move_group_params = [ moveit_config.to_dict(), move_group_configuration, ] add_debuggable_node( ld, package=&quot;moveit_ros_move_group&quot;, executable=&quot;move_group&quot;, commands_file=str(moveit_config.package_path / &quot;launch&quot; / &quot;gdb_settings.gdb&quot;), output=&quot;screen&quot;, parameters=move_group_params, extra_debug_args=[&quot;--debug&quot;], # Set the display variable, in case OpenGL code is used internally additional_env={&quot;DISPLAY&quot;: &quot;:0&quot;}, ) return ld def generate_launch_description(): moveit_config = MoveItConfigsBuilder(&quot;ur&quot;, package_name=&quot;ur_moveit&quot;).to_moveit_configs() return generate_move_group_launch(moveit_config) </code></pre> <p>You can observe how <code>use_sim_time: True</code> has been passed with the <code>move_group_configuration</code> dictionary.</p>
104444
2023-10-01T22:08:21.407
|gazebo|moveit|ros-humble|
<p>I am having a problem trying to use Moveit2 in simulation, I created the Moveit config package for my robot arm using the setup assistant, but the generated <code>move_group.launcy.py</code> file looks like this:</p> <pre class="lang-py prettyprint-override"><code>from moveit_configs_utils import MoveItConfigsBuilder from moveit_configs_utils.launches import generate_move_group_launch def generate_launch_description(): moveit_config = MoveItConfigsBuilder(&quot;ur&quot;, package_name=&quot;flower_catcher_moveit_config&quot;).to_moveit_configs() return generate_move_group_launch(moveit_config) </code></pre> <p>The problem with this format is that there is no way for me to set the <code>use_sim_time</code> parameter to true, and that causes the path execution to fail with this error:</p> <pre class="lang-bash prettyprint-override"><code>[move_group-7] [INFO] [1696192877.744131744] [moveit_ros.current_state_monitor]: Didn't receive robot state (joint angles) with recent timestamp within 1.000000 seconds. Requested time 1696192876.744054, but latest received state has time 148.003000. </code></pre> <p>I kind of solved the problem by setting the parameter afterward with the command</p> <pre class="lang-bash prettyprint-override"><code>ros2 param set /move_group use_sim_time true </code></pre> <p>However, I want to know if there is a way to set this parameter in the launch file.</p> <p>Thanks!</p>
Use sim time with Moveit
<p>The error means that can_transform is being invoked with an empty string as the frame_id. As there doesn't appear to be any issues with your transform tree it's mostly likely that the data in your dataset that you're playing back does not have the <code>frame_id</code> fields properly set.</p>
104474
2023-10-03T10:03:25.577
|ros|rviz|ubuntu|python|pointcloud|
<p>I'm trying to see a point cloud in Rviz but when I add the topic to de Displays i get an error (Rviz) and in the terminal where i opened Rviz I get the following message:</p> <p><strong>Invalid argument passed to canTransform argument source_frame in tf2 frame_ids cannot be empty</strong></p> <p>I'm working with OpenDR, specifically with the 3D object detection module.</p> <p><strong>Warning in terminal:</strong></p> <p><a href="https://i.stack.imgur.com/NTwwe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NTwwe.png" alt="Warning in terminal" /></a></p> <p><strong>Rviz error:</strong></p> <p><a href="https://i.stack.imgur.com/ph0Eg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ph0Eg.png" alt="Rviz error" /></a></p> <p>I'm trying to see other people's responses with the same issue, I have already tried it everything but this information is not valid for me.</p> <p>The output of rostopic echo /tf:</p> <h2>transforms:</h2> <pre><code>header: seq: 0 stamp: secs: 1696351719 nsecs: 943305939 frame_id: &quot;map&quot; child_frame_id: &quot;base_link&quot; transform: translation: x: 0.0 y: 0.0 z: 0.0 rotation: x: 0.0 y: 0.0 z: 0.0 w: 1.0** </code></pre> <p>for rostopic echo /opendr/dataset_point_cloud the output is:</p> <pre><code>header: seq: 10053 stamp: secs: 1696352933 nsecs: 3319978 frame_id: '' points: &quot;&lt;array type: geometry_msgs/Point32, length: 18911&gt;&quot; channels: &quot;&lt;array type: sensor_msgs/ChannelFloat32, length: 1&gt;&quot; </code></pre>
Invalid argument passed to canTransform argument source_frame in tf2 frame_ids cannot be empty
<p>So you want to take a ros2 PointCloud2 message and write it to a .pcd file.</p> <p>There is a existing ros1/ros2 package called <code>pcl_ros</code>. The src code for both is in this <a href="https://github.com/ros-perception/perception_pcl" rel="nofollow noreferrer">github repo</a>, but I don't know the current status of the port to ros2. This package has a ros node named <code>pointcloud_to_pcd</code> that writes PointCloud2 messages into .pcd files.</p>
104475
2023-10-03T10:13:13.090
|ros2|pcl|pointcloud|lidar|gazebo-ignition|
<p>I am working on a project whose main objective is to check the sensors that can perceive the environment and implement those in gazebo environment. so i am trying to implement lidar sensor and generate point cloud of the outdoor environment. Can anyone guide me <strong>how to generate a point cloud of an outdoor environment in Ignition Gazebo Fortress</strong>?</p>
Point cloud in gazebo environment
<p>This looks more like a <code>g++</code> issue than a MoveIt issue. I base my statement on the error message, which says</p> <blockquote> <p>c++: fatal error: Killed signal terminated program cc1plus</p> </blockquote> <p>You can maybe try updating your compiler to the latest version: <code>sudo apt install build-essential</code> and then try to build again.</p> <p>Also, can you try out a simple build? That would involve not using the <code>--mixin release</code> part of it. AFAIK, the default build type should be release, in order to be optimised for runtime. This would eliminate any extra sources of problems.</p> <p>It might also be a memory issue, as pointed out in <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107483" rel="nofollow noreferrer">this</a> particular thread. You can try running <code>dmesg</code> right after the build fails to see if it complains about being out of memory or something similar.</p>
104483
2023-10-03T14:05:53.630
|ros2|moveit|ubuntu|colcon|
<p>First, let me make an observation unrelated to my question: After going through most of the getting started documentation (<a href="https://moveit.picknik.ai/main/doc/tutorials/getting_started/getting_started.html" rel="nofollow noreferrer">https://moveit.picknik.ai/main/doc/tutorials/getting_started/getting_started.html</a>), I think it'd be better to base the documentation off of pre-compiled packages, and then move to building your own binaries if it becomes necessary. I'm pretty sure I already had most of the packages I needed installed before I started the MoveIt documentation, so the build errors I've been running into are probably unnecessary. And most have probably been caused by using a WSL2 Ubuntu install on windows, which has a few minor differences (such as a shared PATH environment variable).</p> <p>That said, I'm running through the MoveIt getting started documentation (in a Windows WSL2 instance) and can't get past the compile step:</p> <p><code>colcon build --mixin release</code></p> <p>There's the following error:</p> <pre><code>... [Processing: moveit_setup_app_plugins, moveit_setup_controllers, moveit_setup_core_plugins, moveit_setup_srdf_plugins, moveit_task_constructor_visualization] [Processing: moveit_setup_app_plugins, moveit_setup_controllers, moveit_setup_core_plugins, moveit_setup_srdf_plugins, moveit_task_constructor_visualization] [Processing: moveit_setup_app_plugins, moveit_setup_controllers, moveit_setup_core_plugins, moveit_setup_srdf_plugins, moveit_task_constructor_visualization] --- stderr: moveit_task_constructor_visualization c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [motion_planning_tasks/src/CMakeFiles/motion_planning_tasks_rviz_plugin.dir/build.make:203: motion_planning_tasks/src/CMakeFiles/motion_planning_tasks_rviz_plugin.dir/remote_task_model.cpp.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [motion_planning_tasks/src/CMakeFiles/motion_planning_tasks_rviz_plugin.dir/build.make:245: motion_planning_tasks/src/CMakeFiles/motion_planning_tasks_rviz_plugin.dir/task_panel.cpp.o] Error 1 c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [motion_planning_tasks/src/CMakeFiles/motion_planning_tasks_rviz_plugin.dir/build.make:217: motion_planning_tasks/src/CMakeFiles/motion_planning_tasks_rviz_plugin.dir/task_display.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:450: motion_planning_tasks/src/CMakeFiles/motion_planning_tasks_rviz_plugin.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2 --- Failed &lt;&lt;&lt; moveit_task_constructor_visualization [3min 1s, exited with code 2] Aborted &lt;&lt;&lt; moveit_setup_core_plugins [9min 32s] Aborted &lt;&lt;&lt; moveit_setup_controllers [9min 36s] Aborted &lt;&lt;&lt; moveit_setup_srdf_plugins [9min 37s] Aborted &lt;&lt;&lt; moveit_setup_app_plugins [9min 38s] Summary: 54 packages finished [11min 41s] 1 package failed: moveit_task_constructor_visualization 4 packages aborted: moveit_setup_app_plugins moveit_setup_controllers moveit_setup_core_plugins moveit_setup_srdf_plugins 5 packages had stderr output: moveit_configs_utils moveit_setup_controllers moveit_setup_core_plugins moveit_setup_srdf_plugins moveit_task_constructor_visualization 5 packages not processed <span class="math-container">```</span> </code></pre>
Compile error in Moveit "Getting started" documentation
<p>You can modify that by setting this parameter in ompl_planning.yaml config file:</p> <pre><code>move_group: planner_configs: - RRTConnectkConfigDefault longest_valid_segment_fraction: 0.005 default_planner_config: RRTConnectkConfigDefault </code></pre> <p>For example, in the case above the planner is set to generate waypoints every 5mm</p>
104495
2023-10-04T06:25:02.937
|ros2|moveit|
<p>I have a problem where when I try to generate a small trajectory (under 1 mm of distance).</p> <p>The planner I use (default OMPL with RRTConect) only generates 1 waypoint and thus my robot will not move.</p> <p>Things I have tried so far:</p> <ol> <li><p>Send the goal to the planner using moveit_msgs/tolerances with a tolerance way smaller than needed (it doesn't seem to work).</p> </li> <li><p>creating a custom trajectory and applying post-processing time parameterization (this didn't work due to some points having the exact same time and then the controllers rejecting this trajectory)</p> </li> <li><p>working with the custom trajectory without the post-processing time parameterization (this worked semi-well but clearly isn't the desired way to operate)</p> </li> </ol> <p>Is there any way to guarantee OMPL would generate more waypoints in a small trajectory?</p>
Moveit2 can't generate "small" trajectories
<p>Since I don't have any reputation yet to comment I'll just add this as a separate answer. The documentation for the crazyswarm2 project is here with the installation instructions, to make sure that the packages are in the right folders.</p> <p><a href="https://imrclab.github.io/crazyswarm2/installation.html" rel="nofollow noreferrer">https://imrclab.github.io/crazyswarm2/installation.html</a></p> <p>Motion_capture_tracking_interfaces is part of a different package on which crazyswarm2 depends on.</p> <p>This question was also asked on the project github discussions as well: <a href="https://robotics.stackexchange.com/questions/104512/ros2-crazyswarm2/104544#104544">ros2-crazyswarm2</a>, for more background information.</p> <p>(I'm a co-maintainer at crazyswarm2).</p>
104512
2023-10-04T19:41:16.333
|ros2|
<p>We'd like to use crazyswarm2 packages. However we got below error about <code>motion_capture</code> stuff. How to figure out that problem, thanks.</p> <pre><code>ntukenmez3@ae-icps-407120:~/Documents/crazyswarm2$ source /opt/ros/humble/setup.bash ntukenmez3@ae-icps-407120:~/Documents/crazyswarm2$ colcon build Starting &gt;&gt;&gt; crazyflie_interfaces Finished &lt;&lt;&lt; crazyflie_interfaces [7.81s] Starting &gt;&gt;&gt; crazyflie_py Starting &gt;&gt;&gt; crazyflie Starting &gt;&gt;&gt; crazyflie_sim Finished &lt;&lt;&lt; crazyflie_py [0.87s] Starting &gt;&gt;&gt; crazyflie_examples Finished &lt;&lt;&lt; crazyflie_sim [1.11s] --- stderr: crazyflie CMake Error at CMakeLists.txt:18 (find_package): By not providing &quot;Findmotion_capture_tracking_interfaces.cmake&quot; in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by &quot;motion_capture_tracking_interfaces&quot;, but CMake did not find one. Could not find a package configuration file provided by &quot;motion_capture_tracking_interfaces&quot; with any of the following names: motion_capture_tracking_interfacesConfig.cmake motion_capture_tracking_interfaces-config.cmake Add the installation prefix of &quot;motion_capture_tracking_interfaces&quot; to CMAKE_PREFIX_PATH or set &quot;motion_capture_tracking_interfaces_DIR&quot; to a directory containing one of the above files. If &quot;motion_capture_tracking_interfaces&quot; provides a separate development package or SDK, be sure it has been installed. --- Failed &lt;&lt;&lt; crazyflie [1.43s, exited with code 1] Aborted &lt;&lt;&lt; crazyflie_examples [0.79s] Summary: 3 packages finished [9.71s] 1 package failed: crazyflie 1 package aborted: crazyflie_examples 1 package had stderr output: crazyflie </code></pre>
ros2-crazyswarm2
<p>There's a <a href="https://github.com/gazebosim/gz-sim/blob/gz-sim8/tutorials/detachable_joints.md" rel="nofollow noreferrer">remark in the tutorial</a> that models should not be colliding when the detachable joint is made. See also <a href="https://github.com/gazebosim/gz-sim/pull/1687#pullrequestreview-1440781144" rel="nofollow noreferrer">this discussion</a> in the pull request.</p> <p>So I think the behavior you experience is due to this.</p> <p>An alternative, instead of checking for <em>contact</em>, you could check for <em>distance</em> and create the joint when the object is close enough.</p> <p>Or, in a similar previous question I suggested <a href="https://robotics.stackexchange.com/questions/25095/gazebo-garden-how-to-get-colliding-entities-with-gpu-lidar-sensor-ray/25099#25099">to use a PerformerDetector</a>. This reports when an object enters a specific volume. I have not tried this yet, but the idea is that you could place a small detection volume at the center of your gripper and get notified if (and which) object overlaps with that region. And then you can create the joint with that object.</p> <p>Note that there is a remark to that answer that the &quot;PerformerDetector uses axis aligned boxes&quot;. Not sure what that means and why it would be an issue.</p>
104517
2023-10-05T04:45:40.590
|gazebo|gazebo-plugin|
<p>I am trying to simulate the control of a caught heavy object in gazebo garden. To do so I have a plugin that creates a detachable fixed joint between the object and the end-effector of my robot once collision occurs, the issue is that when the joint is created the velocity of the object dramatically increases, while also changing direction. I originally believed that is was due to incorrect inertia parameters, however most other tests / collisions work as expected so I assume something is going wrong with the joint creation.</p> <p>A synopsis of how my system works is that there is a collision sensor on the end effector, which triggers with contact with a specific object, it sends a boolean value to a topic that this plugin subscribes to, which then creates the joint between the 2 links, so long as the plugin had first been enabled.</p> <p>this plugin takes heavy inspiration from the <a href="https://github.com/gazebosim/gz-sim/blob/f6efeefb4ab99284d1a053061235f8c2fa02a5da/src/systems/detachable_joint/DetachableJoint.cc#L4" rel="nofollow noreferrer">detachable joint system</a> inside the <a href="https://github.com/gazebosim/gz-sim/tree/gz-sim7" rel="nofollow noreferrer">gz_sim repo</a></p> <p>gazebo Versions:</p> <ul> <li>sim: 7.5.0</li> <li>plugin: 2.0.1</li> <li>transport 12.2.0</li> </ul> <pre class="lang-cpp prettyprint-override"><code>#include &lt;detachable_joint_creator.hpp&gt; #include &lt;gz/plugin/Register.hh&gt; #include &lt;gz/transport/Node.hh&gt; #include &lt;functional&gt; #include &lt;gz/sim/components/DetachableJoint.hh&gt; #include &lt;gz/sim/Model.hh&gt; #include &lt;gz/sim/Joint.hh&gt; #include &lt;gz/sim/Link.hh&gt; using namespace monke_plugins; JointCreator::JointCreator(): dataPtr(new JointCreatorPrivate) { } JointCreator::~JointCreator(){ } void JointCreator::Configure(const gz::sim::Entity &amp;_entity, const std::shared_ptr&lt;const sdf::Element&gt; &amp; _sdf, gz::sim::EntityComponentManager &amp;_ecm, gz::sim::EventManager &amp;/*_eventMgr*/ ){ // Initialise the Plugin via sdf elements gzmsg &lt;&lt; &quot;loading JointCreator plugin\n&quot;; if(_sdf-&gt;HasElement(&quot;parent&quot;)){ this-&gt;dataPtr-&gt;end_effector_link_name = _sdf-&gt;Get&lt;std::string&gt;(&quot;parent&quot;); } else{ gzerr &lt;&lt; &quot;[parent] link name not specified in sdf \n&quot;; return; } gz::sim::Model model(_entity); this-&gt;dataPtr-&gt;end_effector_entity = model.LinkByName(_ecm, this-&gt;dataPtr-&gt;end_effector_link_name); if (this-&gt;dataPtr-&gt;end_effector_entity == gz::sim::kNullEntity) { gzerr &lt;&lt; &quot;Could not find link named &quot;&lt;&lt; this-&gt;dataPtr-&gt;end_effector_link_name &lt;&lt; std::endl; return; } if(_sdf-&gt;HasElement(&quot;contact_sensor_topic&quot;)){ this-&gt;dataPtr-&gt;contact_sensor_topic = _sdf-&gt;Get&lt;std::string&gt;(&quot;contact_sensor_topic&quot;); std::function&lt;void(const gz::msgs::Contacts &amp;)&gt; callback = [this](gz::msgs::Contacts msg){this-&gt;ContactSensorCallback(msg);}; if(!this-&gt;dataPtr-&gt;transport_node-&gt;Subscribe&lt;gz::msgs::Contacts&gt;(this-&gt;dataPtr-&gt;contact_sensor_topic,callback)){ gzerr &lt;&lt; &quot;Failed to subscribe to topic [&quot; &lt;&lt; this-&gt;dataPtr-&gt;contact_sensor_topic &lt;&lt; &quot;] \n&quot;; return; } //? idk if advertising a subscription works this-&gt;dataPtr-&gt;transport_node-&gt;Advertise&lt;gz::msgs::Contacts&gt;(this-&gt;dataPtr-&gt;contact_sensor_topic); } else{ gzerr &lt;&lt; &quot;detachable_joint plugin has no SDF Element contact_sensor_topic&quot;; return; } if(_sdf-&gt;HasElement(&quot;command_topic&quot;)){ this-&gt;dataPtr-&gt;command_topic = _sdf-&gt;Get&lt;std::string&gt;(&quot;command_topic&quot;); std::function&lt;void(const gz::msgs::Boolean &amp;)&gt; callback = [this](gz::msgs::Boolean msg){this-&gt;CommandCallback(msg);}; if(!this-&gt;dataPtr-&gt;transport_node-&gt;Subscribe&lt;gz::msgs::Boolean&gt;(this-&gt;dataPtr-&gt;command_topic,callback)){ gzerr &lt;&lt; &quot;Failed to subscribe to topic [&quot; &lt;&lt; this-&gt;dataPtr-&gt;command_topic &lt;&lt; &quot;] \n&quot;; return; } //? idk if advertising a subscription works this-&gt;dataPtr-&gt;transport_node-&gt;Advertise&lt;gz::msgs::Boolean&gt;(this-&gt;dataPtr-&gt;command_topic); } else{ gzerr &lt;&lt; &quot;detachable_joint plugin has no SDF Element command_topic&quot;; return; } if(_sdf-&gt;HasElement(&quot;triggered_topic&quot;)){ this-&gt;dataPtr-&gt;triggered_topic = _sdf-&gt;Get&lt;std::string&gt;(&quot;triggered_topic&quot;); this-&gt;dataPtr-&gt;publisher = std::make_unique&lt;gz::transport::Node::Publisher&gt;(this-&gt;dataPtr-&gt;transport_node-&gt;Advertise&lt;gz::msgs::Boolean&gt;(this-&gt;dataPtr-&gt;triggered_topic)); } else{ gzerr &lt;&lt; &quot;detachable_joint plugin has no SDF Element triggered_topic&quot;; return; } } void JointCreator::PostUpdate(const gz::sim::UpdateInfo &amp;_info, const gz::sim::EntityComponentManager &amp;_ecm){ if(_info.paused){return;} //if sim is paused. // gzmsg &lt;&lt; &quot;JointCreator::PostUpdate - &quot; &lt;&lt; _info.simTime.count() &lt;&lt; std::endl; } void JointCreator::PreUpdate(const gz::sim::UpdateInfo &amp;_info, gz::sim::EntityComponentManager &amp;_ecm){ if(_info.paused){return;} //if sim is paused. auto Contact = [this](){return(this-&gt;dataPtr-&gt;contacted_entity != gz::sim::kNullEntity);}; if(this-&gt;dataPtr-&gt;PluginActive &amp;&amp; !this-&gt;dataPtr-&gt;JointCreated &amp;&amp; Contact()){ //! CREATE JOINT // if the joint is active, it has not been created, and contact is made, then create the joint this-&gt;dataPtr-&gt;joint = _ecm.CreateEntity(); auto parentLink = _ecm.ParentEntity(this-&gt;dataPtr-&gt;contacted_entity); //create a new link as the parent entity of the obejct we're trying to grab _ecm.CreateComponent( this-&gt;dataPtr-&gt;joint, gz::sim::components::DetachableJoint({this-&gt;dataPtr-&gt;end_effector_entity,parentLink,&quot;fixed&quot;}) ); gzdbg &lt;&lt; &quot;created detachable joint between end effector &amp; [&quot; &lt;&lt; this-&gt;dataPtr-&gt;contacted_entity&lt;&lt; &quot;] @ &quot; &lt;&lt; _info.simTime.count() &lt;&lt;&quot;\n&quot;; gz::msgs::Boolean msg; msg.set_data(true); this-&gt;dataPtr-&gt;publisher-&gt;Publish(msg); this-&gt;dataPtr-&gt;JointCreated = true; } if(!this-&gt;dataPtr-&gt;PluginActive &amp;&amp; this-&gt;dataPtr-&gt;JointCreated){//! DESTROY JOINT // if the joint is not active and the joint has been created, then destroy the joint. _ecm.RequestRemoveEntity(this-&gt;dataPtr-&gt;joint,true); this-&gt;dataPtr-&gt;joint = gz::sim::kNullEntity; gzdbg &lt;&lt; &quot;deleted detachable joint between end effector &amp; [&quot;&lt;&lt; this-&gt;dataPtr-&gt;child_entity &lt;&lt; &quot;] @ &quot; &lt;&lt; _info.simTime.count() &lt;&lt;&quot;\n&quot;; gz::msgs::Boolean msg; msg.set_data(false); this-&gt;dataPtr-&gt;publisher-&gt;Publish(msg); this-&gt;dataPtr-&gt;JointCreated = false; } } void JointCreator::CommandCallback(const gz::msgs::Boolean &amp; _msg){ gzmsg &lt;&lt; &quot;JointCreator received command msg [&quot; &lt;&lt; _msg.data() &lt;&lt; &quot;]\n&quot;; this-&gt;dataPtr-&gt;PluginActive = _msg.data(); } void JointCreator::ContactSensorCallback(const gz::msgs::Contacts &amp; _msg){ if(_msg.contact_size()){ gzmsg &lt;&lt; &quot;JointCreator received contact msg with object: [&quot; &lt;&lt; _msg.contact(0).collision2().id() &lt;&lt; &quot;]\n&quot;; auto contact = _msg.contact(0); this-&gt;dataPtr-&gt;contacted_entity = contact.collision2().id(); } else{ this-&gt;dataPtr-&gt;contacted_entity = gz::sim::kNullEntity; } } GZ_ADD_PLUGIN( monke_plugins::JointCreator, gz::sim::System, monke_plugins::JointCreator::ISystemPreUpdate, // sample_system::JointCreator::ISystemUpdate, monke_plugins::JointCreator::ISystemPostUpdate, monke_plugins::JointCreator::ISystemConfigure ) // GZ_ADD_PLUGIN_ALIAS(sample_system::JointCreator,&quot;gz::sim:systems::JointCreator&quot;) <span class="math-container">```</span> </code></pre>
Gazebo Garden Detachable Joint with moving object causing massive velocity errors
<p>Maybe a good first step is to convert to PointCloud2 using the snippet from <a href="https://github.com/ros2/common_interfaces/blob/master/sensor_msgs/include/sensor_msgs/point_cloud_conversion.hpp" rel="nofollow noreferrer"><code>convertPointCloudtoPointCloud2</code></a> from the package <code>sensor_msgs</code>.</p> <p>then you can use <code>pcl_conversions::moveToPCL</code> or <code>pcl_conversions::toPCL</code></p>
104522
2023-10-05T11:35:07.330
|c++|pcl|pointcloud|tf2|ros-foxy|
<p>I am receiving a <code>sensor_msgs::msg::PointCloud</code> (base_link frame) in my callback. I want to transform this PointCloud to the camera frame, so that I can do a projection of that point cloud view.</p> <p>I am having problems to convert a <code>sensor_msgs::msg::PointCloud</code> into a <code>pcl::PointCloud&lt;pcl::PointXYZ&gt; cloud;</code> with ROS 2 Foxy. How can I do it?</p> <p>My CPP code:</p> <pre><code>void my_callback(const sensor_msgs::msg::PointCloud::SharedPtr msg) { // cloud_in should be the PointCloud message pcl::PointCloud&lt;pcl::PointXYZ&gt; cloud_in; pcl::PointCloud&lt;pcl::PointXYZ&gt; cloud_out; geometry_msgs::msg::TransformStamped transform; try { transform = tfBuffer_-&gt;lookupTransform(&quot;camera_frame&quot;, msg-&gt;header.frame_id, tf2::TimePointZero); pcl_ros::transformPointCloud(cloud_in, cloud_out, transform); } catch (tf2::TransformException &amp;ex) { RCLCPP_ERROR(this-&gt;get_logger(), &quot;Transform error: %s&quot;, ex.what()); return; } } </code></pre>
Transform PointCloud message
<p>For the more general case, refer to <a href="https://robotics.stackexchange.com/questions/24926/how-do-people-create-complex-models-worlds-in-the-gazebo/24927#24927">this previous question</a>. This is not specifically aimed at modeling buildings though.</p> <p>Re. buildings: there are plenty tutorials <a href="https://www.google.com/search?q=blender+model+a+house+from+2d+floorplan&amp;oq=blender+model+a+house+from+2d+floorplan" rel="nofollow noreferrer">e.g. for Blender</a> but I think this would still involve more work than using the building editor. However, you could install both Gazebo Classic and Gazebo Fortress, create the SDF using the building editor and then use that SDF in Fortress?</p> <p>Alternative is to <a href="https://www.google.com/search?q=PBR+low+poly+model+house" rel="nofollow noreferrer">buy a model online</a> and use that. Though you will typically need to clean up the model and reapply the textures in Blender and then bake the textures and/or light map if you want realistic rendering. This is <strong>a lot</strong> of work, certainly if you have never done that yet and need to find out how everything works. But the result can be really nice. E.g. see the demo shown in the <a href="https://vimeo.com/868835608" rel="nofollow noreferrer">release video</a> of Gazebo Harmonic.</p>
104528
2023-10-05T12:18:08.370
|gazebo|ros2|simulation|simulator-gazebo|gazebo-simulator|
<p>I've recently transitioned to using <strong>Gazebo Fortress</strong> and noticed that it lacks a built-in <strong>building editor feature</strong>, which was a beneficial tool in Gazebo Classic. This editor was essential for creating custom environments for my robotics simulations.</p> <p>For those who have been working with Ignition Fortress or have faced similar challenges:</p> <ol> <li><p>What are the most recommended alternatives or tools you've used to design environments for Gazebo Ignition?</p> </li> <li><p>Are there any best practices or specific workflows you've adopted to bridge this gap? Has anyone found a workaround or method to integrate environments from other tools effectively into Ignition?</p> </li> </ol> <p>I'm particularly interested in solutions that are tried and tested in real-world projects, as this would provide insights into their robustness.</p>
Alternatives to Gazebo Fortress (Building Editor) Feature?
<p>The problem was because OpenSSL-Win64's bin folder was not added to the PATH. Adding it to the PATH fixes the issue.</p>
104529
2023-10-05T12:19:45.720
|ros2|installation|
<p>I installed ROS Humble on a machine following the <a href="https://docs.ros.org/en/humble/Installation/Windows-Install-Binary.html" rel="nofollow noreferrer">installation steps</a>.</p> <p>Now, I want to help people installing this version of ROS on different machines without having to follow the whole installation steps. My company policy unfortunately do not allow me to use docker.</p> <p>Then I simply:</p> <ul> <li><p>created a target folder (<code>ros2_depends</code>)</p> </li> <li><p>copied to <code>ros2_depends</code> all the dependencies installed on the first machine (chocolatey, CMake and OpenSSL-Win64 folders)</p> </li> <li><p>copied this folder to the target machine with ROS2</p> </li> <li><p>updated the <code>PATH</code> and other variables such as <code>CHOCO_PATH</code> or <code>OPENSSL_CONF</code> to point to <code>ros2_depends</code> folder.</p> </li> <li><p>also copied <code>C:\Python38</code> directly from the first machine to the new machine (as some ROS files like <code>ros2-script.py</code> assumes Python is located in <code>C:\Python38</code>, no choice with this one, could not make it part of <code>ros2_depends</code>)</p> </li> </ul> <p>Then, when I try to run ROS2 (<code>ros2 run demo_nodes_py listener</code>), I got the error:</p> <pre><code>Traceback (most recent call last): File &quot;C:\ROS2\ros2-windows\lib\demo_nodes_py\listener-script.py&quot;, line 33, in &lt;module&gt; sys.exit(load_entry_point('demo-nodes-py==0.20.3', 'console_scripts', 'listener')()) File &quot;C:\ROS2\ros2-windows\Lib\site-packages\demo_nodes_py\topics\listener.py&quot;, line 35, in main rclpy.init(args=args) File &quot;C:\ROS2\ros2-windows\Lib\site-packages\rclpy\__init__.py&quot;, line 89, in init return context.init(args, domain_id=domain_id) File &quot;C:\ROS2\ros2-windows\Lib\site-packages\rclpy\context.py&quot;, line 72, in init self.__context = _rclpy.Context( rclpy._rclpy_pybind11.RCLError: Failed to initialize init options: failed to load any RMW implementations, at C:\ci\ws\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:125, at C:\ci\ws\src\ros2\rcl\rcl\src\rcl\init_options.c:75 [ros2run]: Process exited with failure 1 </code></pre> <p>Any idea what could be wrong?</p> <p>Note: I originally posted this to stackoverflow, but I feel like it's more appropriate here. When answered, I'll update or close the stackoverflow post.</p>
ROS2 fails to start: 'failed to load any RMW implementations'