{"query":"Can\u2019t see debug messages using RCLCPP_DEBUG\n\nI can\u2019t see messages using RCLCPP_DEBUG by terminal and rqt, but I can using other levels of verbosity( INFO, ERROR, FATAL\u2026).Selecting debug in rqt to see those messages doesn\u2019t work either.\n\nI\u2019m using rolling, working in C++ in a plugin of a controller and launching tb3_simulation_launch.py from nav2_bringup.\n\nI also saw a post here where they recommended to set the environment variable:\n\nRCLCPP_LOG_MIN_SEVERITY=RCLCPP_LOG_MIN_SEVERITY_DEBUG\n\nbut that didn\u2019t work either. It must be something silly that I\u2019m missing. Has this ever happened to you?\n\nThank you","reasoning":"showing debug messages is usually related to log-level. We can check whether there is some argument that can adjust this.","id":"0","excluded_ids":["N\/A"],"gold_ids_long":["ros2cpp\/navigationlaunchpy.txt"],"gold_ids":["ros2cpp\/navigationlaunchpy_20.txt","ros2cpp\/navigationlaunchpy_19.txt"],"gold_answer":"$\\begingroup$\n\nYou can try adding ` arguments=[\"--ros-args\", \"--log-level\", \"debug\"], ` to\nthe Node which you are interested in at the launch file.\n\nOr in the case where you seem to be using the nav2_bringup straight, you can\nchange it at [ https:\/\/github.com\/ros-\nplanning\/navigation2\/blob\/ab9b1010d7a126c0c407cd09228d97068646ee4c\/nav2_bringup\/launch\/navigation_launch.py#L134\n](https:\/\/github.com\/ros-\nplanning\/navigation2\/blob\/ab9b1010d7a126c0c407cd09228d97068646ee4c\/nav2_bringup\/launch\/navigation_launch.py#L134)\n\nYou should also be able to give argument ` log_level:=debug ` when launching\nthe launch file since that is being handled in [ the launch file\n](https:\/\/github.com\/ros-\nplanning\/navigation2\/blob\/ab9b1010d7a126c0c407cd09228d97068646ee4c\/nav2_bringup\/launch\/navigation_launch.py#L119)\n. Downside is that then all nodes will have debug level and there will be lots\nof extras\n\nExample of launch file addition\n\n \n \n controller_server = Node(\n package=\"nav2_controller\",\n executable=\"controller_server\",\n output={\"both\": {\"screen\", \"log\", \"own_log\"}},\n emulate_tty=True,\n parameters=[],\n arguments=[\"--ros-args\", \"--log-level\", \"debug\"],\n )"} {"query":"sensor fusion of lidar and camera detection\n\nI am trying to achieve sensor fusion between two sensors(camera and lidar). I have two separate node(one is publishing detection results using camera, and other is using lidar and they both are operating on a seperate deep learning based object detection methods) which are publishing detection results in the form of vision_msgs detection array.\n\nNow I want to fuse these detection results. How can I go further? I am using ros2 humble with gazebo fortress and I am trying this experiments in the simulated environment only. (no real sensors)","reasoning":"This is related to Kalman Filter, which uses a series of measurements observed over time to produce estimates of unknown variables.","id":"1","excluded_ids":["N\/A"],"gold_ids_long":["camera_lidar\/classcvKalmanFilterh.txt"],"gold_ids":["camera_lidar\/classcvKalmanFilterh_4.txt","camera_lidar\/classcvKalmanFilterh_3.txt","camera_lidar\/classcvKalmanFilterh_1.txt","camera_lidar\/classcvKalmanFilterh_2.txt"],"gold_answer":"$\\begingroup$\n\nIf you're looking to fuse the sensor readings together into one better\nmeasurement, the right tool for the job is generally a Kalman Filter. It's not\nROS specific, but OpenCV has a [ Kalman Filter Implementation\n](https:\/\/vovkos.github.io\/doxyrest-\nshowcase\/opencv\/sphinx_rtd_theme\/class_cv_KalmanFilter.html) . The OpenCV\nkalman filter is available in python and C++. It's well documented and there\nare plenty of [ online tutorials ](https:\/\/pieriantraining.com\/kalman-filter-\nopencv-python-example\/) available for it that may apply directly to your use."} {"query":"Does gazebo_ros2_control need to be sourced\/built\/linked after installation via apt?\n\nAnywhere I search I can see that gazebo_ros2_control can be installed in the Humble distribution with Ubuntu 22 with just an apt command. My problem is that ros2 seems to not be finding the plugin.\n\n[gazebo-3] [Err] [Model.cc:1160] Exception occured in the Load function of plugin with name[gazebo_ros2_control] and filename[libgazebo_ros2_control.so]. This plugin will not run.\nFor example in here it is mentioned:\n\nA Gazebo plugin is added with this lines in the URDF:\n\n \n plugin args...\n <\/plugin>\nHowever you will need to export the plugins path to advertise Gazebo where to find custom plugins. Take a look at this tutorial, you whould be able to follow it until the end, where you will find how to export and launch the plugin.\n\nI am wondering, maybe I need to source \/usr\/share\/gazebo\/ or gazebo-11 for that matter. I tried with some repositories that are instantly triable. Same error. I actually thought of using the universal robots repo, which installs in the workspace the different ros2-control, gazebo-ros2-control.\n\nls ..\/workspaces\/ur_gazebo\/src\/\ngazebo_ros2_control moveit_msgs\nlearm_ros2 ros2_control\nlearm_ros2_description ros2_controllers\nlearm_ros2_moveit_config Universal_Robots_ROS2_Gazebo_Simulation\nmoveit2 ur_description\nBut I am getting the same. I got at some point a message to \"override\" paths.\n\nMy main question is: After installing gazebo_ros2_control, does ANYTHING ELSE need to be done? Adding to a CMakesList.txt, or to package.xml, setup.py? I read in here that it might be related to GAZEBO_MODEL_PATH. Something related to rosdep maybe?\n\nCode:\n\nimport os\nfrom launch_ros.actions import Node\nfrom launch import LaunchDescription\nfrom launch.substitutions import Command\nfrom launch.actions import ExecuteProcess\nfrom ament_index_python.packages import get_package_share_directory\n\n\ndef generate_launch_description():\n\n \n #robot_model = 'm1013'\n\n xacro_file = get_package_share_directory('learm_ros2') + '\/urdf\/learm-gazebo.urdf.xacro'\n\n \n # Robot State Publisher \n robot_state_publisher = Node(package ='robot_state_publisher',\n executable ='robot_state_publisher',\n name ='robot_state_publisher',\n output ='both',\n parameters =[{'robot_description': Command(['xacro', ' ', xacro_file]) \n }])\n\n\n # Spawn the robot in Gazebo\n spawn_entity_robot = Node(package ='gazebo_ros', \n executable ='spawn_entity.py', \n arguments = ['-entity', 'learm_ros2', '-topic', 'robot_description'],\n output ='screen')\n\n # Gazebo \n world_file_name = 'table_world.world'\n world = os.path.join(get_package_share_directory('learm_ros2'), 'worlds', world_file_name)\n gazebo_node = ExecuteProcess(cmd=['gazebo', '--verbose', world,'-s', 'libgazebo_ros_factory.so'], output='screen')\n\n\n # These are not working....\n \n # load_joint_state_broadcaster = ExecuteProcess(\n # cmd=['ros2', 'control', 'load_controller', '--set-state', 'start','joint_state_broadcaster'],\n # output='screen')\n\n \n # load_joint_trajectory_controller = ExecuteProcess( \n # cmd=['ros2', 'control', 'load_controller', '--set-state', 'start', 'joint_trajectory_controller'], \n # output='screen')\n\n\n return LaunchDescription([robot_state_publisher, spawn_entity_robot, gazebo_node, ])\nComplete log:\n\nros2 launch learm_ros2 my_gazebo_controller.launch.py \n[INFO] [launch]: All log files can be found below \/home\/mk\/.ros\/log\/2024-04-11-09-15-23-807156-mk-5577\n[INFO] [launch]: Default logging verbosity is set to INFO\n[INFO] [robot_state_publisher-1]: process started with pid [5579]\n[INFO] [spawn_entity.py-2]: process started with pid [5581]\n[INFO] [gazebo-3]: process started with pid [5583]\n[robot_state_publisher-1] [INFO] [1712819724.075684381] [robot_state_publisher]: got segment base_link\n[robot_state_publisher-1] [INFO] [1712819724.075815637] [robot_state_publisher]: got segment finger_left_link\n[robot_state_publisher-1] [INFO] [1712819724.075825642] [robot_state_publisher]: got segment finger_right_link\n[robot_state_publisher-1] [INFO] [1712819724.075831179] [robot_state_publisher]: got segment forearm_link\n[robot_state_publisher-1] [INFO] [1712819724.075835984] [robot_state_publisher]: got segment grip_left_link\n[robot_state_publisher-1] [INFO] [1712819724.075840953] [robot_state_publisher]: got segment grip_right_link\n[robot_state_publisher-1] [INFO] [1712819724.075845599] [robot_state_publisher]: got segment hand_link\n[robot_state_publisher-1] [INFO] [1712819724.075850323] [robot_state_publisher]: got segment humerus_link\n[robot_state_publisher-1] [INFO] [1712819724.075855091] [robot_state_publisher]: got segment shoulder_link\n[robot_state_publisher-1] [INFO] [1712819724.075859804] [robot_state_publisher]: got segment tendon_left_link\n[robot_state_publisher-1] [INFO] [1712819724.075864539] [robot_state_publisher]: got segment tendon_right_link\n[robot_state_publisher-1] [INFO] [1712819724.075869254] [robot_state_publisher]: got segment world\n[robot_state_publisher-1] [INFO] [1712819724.075873869] [robot_state_publisher]: got segment wrist_link\n[gazebo-3] Gazebo multi-robot simulator, version 11.10.2\n[gazebo-3] Copyright (C) 2012 Open Source Robotics Foundation.\n[gazebo-3] Released under the Apache 2 License.\n[gazebo-3] http:\/\/gazebosim.org\n[gazebo-3] \n[spawn_entity.py-2] [INFO] [1712819724.364785269] [spawn_entity]: Spawn Entity started\n[spawn_entity.py-2] [INFO] [1712819724.365130349] [spawn_entity]: Loading entity published on topic robot_description\n[spawn_entity.py-2] \/opt\/ros\/humble\/local\/lib\/python3.10\/dist-packages\/rclpy\/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead.\n[spawn_entity.py-2] warnings.warn(\n[spawn_entity.py-2] [INFO] [1712819724.366856777] [spawn_entity]: Waiting for entity xml on robot_description\n[gazebo-3] Gazebo multi-robot simulator, version 11.10.2\n[gazebo-3] Copyright (C) 2012 Open Source Robotics Foundation.\n[gazebo-3] Released under the Apache 2 License.\n[gazebo-3] http:\/\/gazebosim.org\n[gazebo-3] \n[spawn_entity.py-2] [INFO] [1712819724.472695945] [spawn_entity]: Waiting for service \/spawn_entity, timeout = 30\n[spawn_entity.py-2] [INFO] [1712819724.473441392] [spawn_entity]: Waiting for service \/spawn_entity\n[gazebo-3] [INFO] [1712819724.887534290] [gazebo_ros_node]: ROS was initialized without arguments.\n[spawn_entity.py-2] [INFO] [1712819725.229984757] [spawn_entity]: Calling service \/spawn_entity\n[spawn_entity.py-2] [INFO] [1712819725.546704340] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [learm_ros2]\n[INFO] [spawn_entity.py-2]: process has finished cleanly [pid 5581]\n[gazebo-3] [Msg] Waiting for master.\n[gazebo-3] [Msg] Connected to gazebo master @ http:\/\/127.0.0.1:11345\n[gazebo-3] [Msg] Publicized address: 192.168.1.49\n[gazebo-3] [Msg] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.\n[gazebo-3] [Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call\n[gazebo-3] [INFO] [1712819726.206974140] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin\n[gazebo-3] [INFO] [1712819726.208899511] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: \/\n[gazebo-3] [INFO] [1712819726.209095469] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control\n[gazebo-3] [INFO] [1712819726.210755756] [gazebo_ros2_control]: connected to service!! robot_state_publisher\n[gazebo-3] [INFO] [1712819726.211154584] [gazebo_ros2_control]: Received urdf from param server, parsing...\n[gazebo-3] [INFO] [1712819726.211194783] [gazebo_ros2_control]: Loading parameter files \/home\/mk\/ros2_ws\/install\/learm_ros2_description\/share\/learm_ros2_description\/config\/combined_controllers.yaml\n[gazebo-3] [INFO] [1712819726.219434473] [gazebo_ros2_control]: Loading joint: shoulder_pan...(#hiding other joints for log)\n[gazebo-3] [INFO] [1712819726.221340144] [resource_manager]: Initialize hardware 'GazeboSystem' \n[gazebo-3] [INFO] [1712819726.221351965] [resource_manager]: Successful initialization of hardware 'GazeboSystem'\n[gazebo-3] [INFO] [1712819726.221431741] [gazebo_ros2_control]: Loading controller_manager\n[gazebo-3] [Msg] Waiting for master.\n[gazebo-3] [Msg] Connected to gazebo master @ http:\/\/127.0.0.1:11345\n[gazebo-3] [Msg] Publicized address: 192.168.1.49\n[gazebo-3] [Msg] Loading world file [\/home\/mk\/ros2_ws\/install\/learm_ros2\/share\/learm_ros2\/worlds\/table_world.world]\n[gazebo-3] [Err] [Model.cc:1160] Exception occured in the Load function of plugin with name[gazebo_ros2_control] and filename[libgazebo_ros2_control.so]. This plugin will not run.\n[gazebo-3] [Err] [Connection.cc:547] Connection[16] Closed during Read\n[gazebo-3] [Err] [TransportIface.cc:385] Unable to read from master\n[ERROR] [gazebo-3]: process has died [pid 5583, exit code 255, cmd 'gazebo --verbose \/home\/mk\/ros2_ws\/install\/learm_ros2\/share\/learm_ros2\/worlds\/table_world.world -s libgazebo_ros_factory.so'].\n[gazebo-3] \n[gazebo-3] \n^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)\n[robot_state_publisher-1] [INFO] [1712819751.927358582] [rclcpp]: signal_handler(signum=2)\n[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 5579]\ncontroller.yaml:\n\ncontroller_manager:\n ros__parameters:\n update_rate: 30.0\n use_sim_time: true\n\n joint_state_controller:\n type: joint_state_controller\/JointStateController\n publish_rate: 50.0\n joint_state_broadcaster:\n type: joint_state_broadcaster\/JointStateBroadcaster\n arm_controller:\n type: joint_trajectory_controller\/JointTrajectoryController\n\narm_controller:\n ros__parameters:\n publish_rate: 50.0\n base_frame_id: base_link\n command_interfaces:\n - position\n state_interfaces:\n - position\n - velocity\n joints:\n - shoulder_pan\n - shoulder_lift\n - elbow\n - wrist_flex\n - wrist_roll\n - grip_left\nAnd finally my urdf.xacro file that has included and my ros2_control.xacro: has\n\n\n\n\n\n\n \n gazebo_ros2_control\/GazeboSystem<\/plugin>\n <\/hardware>\n\n\n -1.57<\/param>\n 1.57<\/param>\n<\/command_interface>\n\n -0.5<\/param>\n 0.5<\/param>\n<\/command_interface>\n\n -1000<\/param>\n 1000<\/param>\n<\/command_interface>\n\n\n\nand all the info relevant to the joints, and at the end:\n\n\n $(find learm_ros2_description)\/config\/combined_controllers.yaml<\/parameters>\n\n<\/plugin>\nEDIT:\n\nI used the same launch.py file as in [cart_example_position.launch.py]4.\n\nRunning ros2 launch gazebo_ros2_control_demos cart_example_position.launch.py and ros2 run gazebo_ros2_control_demos example_position works perfectly fine. copying all the contents, creating a new.run.launch.py file and editing\n\ngazebo_ros2_control_demos_path = os.path.join(\n get_package_share_directory('learm_ros2'))\n\n xacro_file = os.path.join(gazebo_ros2_control_demos_path,\n 'urdf',\n 'learm-gazebo-xacroTurdf.urdf')\nStill gives me errors.\n\n[gazebo_ros2_control]: Loading controller_manager\n [ERROR] [gzserver-1]: process has died [pid 23581, exit code -11, cmd 'gzserver -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so'].\n [ros2-5] Could not contact service \/controller_manager\/load_controller\n [ERROR] [ros2-5]: process has died [pid 23669, exit code 1, cmd 'ros2 control load_controller --set-state active joint_state_broadcaster'].\n [INFO] [ros2-6]: process started with pid [23794]\n [ros2-6] Could not contact service \/controller_manager\/load_controller\n [ERROR] [ros2-6]: process has died [pid 23794, exit code 1, cmd 'ros2 control load_controller --set-state active joint_trajectory_controller'].\n ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)\n [robot_state_publisher-3] [INFO] [1712843686.506268158] [rclcpp]: signal_handler(signum=2)\n [INFO] [robot_state_publisher-3]: process has finished cleanly [pid 23585]\n [INFO] [gzclient-2]: process has finished cleanly [pid 23583]\nSo I am currently lost. Editing my controllers.yaml to the yaml file they use, gives me different errors, but as if it managed to connect! So my errors are probably in the controller.yaml or urdf.","reasoning":"With apt, we need to check steps that install ROS 2 package. It may also provide a Gazebo plugin which instantiates a ros2_control controller manager and connects it to a Gazebo model.","id":"2","excluded_ids":["N\/A"],"gold_ids_long":["gazebo\/indexhtml.txt"],"gold_ids":["gazebo\/indexhtml_3.txt","gazebo\/indexhtml_4.txt","gazebo\/indexhtml_1.txt","gazebo\/indexhtml_2.txt"],"gold_answer":"$\\begingroup$\n\nIf you install gazebo_ros2_control via apt, this should be fine and all\ndependencies should be installed. Can you follow the steps described\nhttps:\/\/control.ros.org\/humble\/doc\/ros2_control_demos\/example_9\/doc\/userdoc.html\nor [ here\n](https:\/\/control.ros.org\/humble\/doc\/gazebo_ros2_control\/doc\/index.html) ?\n\nNote that you have to source ` source \/usr\/share\/gazebo\/setup.sh ` , but from\nyour console output it seems that gazebo itself is loading fine."} {"query":"Running ros1 packages with ros2 data\n\nI'm trying to run different lidar based SLAM methods in order to produce a map of an environment. I've recorded my data in both .db3 and .mcap formats, but a lot of SLAM methods (an example being Interactive SLAM by SMRT-AIST) are only implemented on ROS1 with the .bag format. Is there any way to either change the modern formats to .bag or is there another way to use these older packages with ROS2 datatypes?","reasoning":"One option is to find code that can convert between rosbag1 and rosbag2.","id":"3","excluded_ids":["N\/A"],"gold_ids_long":["ros_file_convert\/rosbags.txt"],"gold_ids":["ros_file_convert\/rosbags_1.txt","ros_file_convert\/rosbags_0.txt"],"gold_answer":"$\\begingroup$\n\nAs discussed in this link: [\nhttps:\/\/answers.ros.org\/question\/352466\/converting-ros2-bag-to-ros1-bag\/\n](https:\/\/answers.ros.org\/question\/352466\/converting-ros2-bag-to-ros1-bag\/) it\nseems that you can use ternaris\/rosbags to convert ROS2 bag to ROS1. You can\nalso take a look in this discussion. [\nhttps:\/\/answers.ros.org\/question\/388484\/how-to-read-ros2-bag-file-in-ros1\/\n](https:\/\/answers.ros.org\/question\/388484\/how-to-read-ros2-bag-file-in-ros1\/)\n\nIn case of slam method for ROS2 with 3D lidar, [ LIO-slam\n](https:\/\/github.com\/TixiaoShan\/LIO-SAM) have support for ROS2. There is\nanother option like using ROSbridge which I'm not sure about the changes in\ndata rate but you can look into."} {"query":"ldlidar ros 2, colcon build error, pthread mutex init\/lock\/unlock not declared\n\nSo i am trying to use the LD19 Lidar from ldrobot with ros2_iron. I am following this tutorial: https:\/\/github.com\/ldrobotSensorTeam\/ldlidar_stl_ros2. When i enter colcon build in the console it runs to 87% and then fails. I am using Rasbian OS on Raspberry Pi 5. The console shows this:\n\nStarting >>> ldlidar_stl_ros2\n--- stderr: ldlidar_stl_ros2 \n\/home\/pi\/ldlidar_ros2_ws\/src\/ldlidar_stl_ros2\/ldlidar_driver\/src\/logger\/log_module.cpp: In member function 'void LogModule::InitLock()':\n\/home\/pi\/ldlidar_ros2_ws\/src\/ldlidar_stl_ros2\/ldlidar_driver\/src\/logger\/log_module.cpp:172:3: error: 'pthread_mutex_init' was not declared in this scope; did you mean 'pthread_mutex_t'?\n 172 | pthread_mutex_init(&mutex_lock_,NULL);\n | ^~~~~~~~~~~~~~~~~~\n | pthread_mutex_t\n\/home\/pi\/ldlidar_ros2_ws\/src\/ldlidar_stl_ros2\/ldlidar_driver\/src\/logger\/log_module.cpp: In member function 'void LogModule::RealseLock()':\n\/home\/pi\/ldlidar_ros2_ws\/src\/ldlidar_stl_ros2\/ldlidar_driver\/src\/logger\/log_module.cpp:180:9: error: 'pthread_mutex_unlock' was not declared in this scope; did you mean 'pthread_mutex_t'?\n 180 | pthread_mutex_unlock(&mutex_lock_);\n | ^~~~~~~~~~~~~~~~~~~~\n | pthread_mutex_t\n\/home\/pi\/ldlidar_ros2_ws\/src\/ldlidar_stl_ros2\/ldlidar_driver\/src\/logger\/log_module.cpp: In member function 'void LogModule::Lock()':\n\/home\/pi\/ldlidar_ros2_ws\/src\/ldlidar_stl_ros2\/ldlidar_driver\/src\/logger\/log_module.cpp:188:9: error: 'pthread_mutex_lock' was not declared in this scope; did you mean 'pthread_mutex_t'?\n 188 | pthread_mutex_lock(&mutex_lock_);\n | ^~~~~~~~~~~~~~~~~~\n | pthread_mutex_t\n\/home\/pi\/ldlidar_ros2_ws\/src\/ldlidar_stl_ros2\/ldlidar_driver\/src\/logger\/log_module.cpp: In member function 'void LogModule::UnLock()':\n\/home\/pi\/ldlidar_ros2_ws\/src\/ldlidar_stl_ros2\/ldlidar_driver\/src\/logger\/log_module.cpp:196:9: error: 'pthread_mutex_unlock' was not declared in this scope; did you mean 'pthread_mutex_t'?\n 196 | pthread_mutex_unlock(&mutex_lock_);\n | ^~~~~~~~~~~~~~~~~~~~\n | pthread_mutex_t\ngmake[2]: *** [CMakeFiles\/ldlidar_stl_ros2_node.dir\/build.make:132: CMakeFiles\/ldlidar_stl_ros2_node.dir\/ldlidar_driver\/src\/logger\/log_module.cpp.o] Fehler 1\ngmake[2]: *** Es wird auf noch nicht beendete Prozesse gewartet....\ngmake[1]: *** [CMakeFiles\/Makefile2:137: CMakeFiles\/ldlidar_stl_ros2_node.dir\/all] Fehler 2\ngmake: *** [Makefile:146: all] Fehler 2\n---\nFailed <<< ldlidar_stl_ros2 [12.7s, exited with code 2]\n\nSummary: 0 packages finished [13.0s]\n 1 package failed: ldlidar_stl_ros2\n 1 package had stderr output: ldlidar_stl_ros2\n```\n","reasoning":"The problem is related to a missing include of the required header file for the functions mentioned in the compiler output. We can check pthread_mutex_init for the required #include.","id":"4","excluded_ids":["N\/A"],"gold_ids_long":["pthread_not_declared\/pthreadmutexinithtml.txt"],"gold_ids":["pthread_not_declared\/pthreadmutexinithtml_5.txt"],"gold_answer":"$\\begingroup$\n\nThe problem is a missing include of the required header file for the functions\nmentioned in the compiler output. See e.g. [ ` pthread_mutex_init `\n](https:\/\/pubs.opengroup.org\/onlinepubs\/7908799\/xsh\/pthread_mutex_init.html)\nfor the required ` #include ` .\n\nThis can be traced back to [ log_module.h\n](https:\/\/github.com\/ldrobotSensorTeam\/ldlidar_stl_ros2\/blob\/master\/ldlidar_driver\/include\/logger\/log_module.h#L37C1-L44C33)\nfrom the ` #include \"log_module.h\" ` in [ log_module.cpp\n](https:\/\/github.com\/ldrobotSensorTeam\/ldlidar_stl_ros2\/blob\/master\/ldlidar_driver\/src\/logger\/log_module.cpp#L18)\nof the ` ldlidar_stl_ros2 ` project:\n\n \n \n #ifndef LINUX\n #include \n #else\n \/\/#include <-- uncomment this line\n #include \n #define printf_s(fileptr,str) (fprintf(fileptr,\"%s\",str))\n #define __in\n #endif \/\/ ??????????????????????"} {"query":"Nav2 Custom Costmap plugin subscription [closed]\n\nClosed 5 days ago.\n\nI am trying to write a costmap plugin for nav2 and i need to get a specific data from a topic but i couldnt create and spin the subscription inside the plugin. (I need coordinate points to create an obstacle at those points)","reasoning":"To add a subscription, we can use node->create_subscription in static layer.","id":"5","excluded_ids":["N\/A"],"gold_ids_long":["costmap_subscript\/nav2costmap2d2Fplugi.txt"],"gold_ids":["costmap_subscript\/nav2costmap2d2Fplugi_14.txt","costmap_subscript\/nav2costmap2d2Fplugi_15.txt"],"gold_answer":"$\\begingroup$\n\nCould you elaborate the issue further with any relevant logs? As far as I know\nif you're running this with the layers of the global costmap, you should be\nable to add a subscription using ` node->create_subscription ` . This is how\nit's done in the ` static_layer ` plugin for ROS 2 Humble. You can find it\nhere: [ https:\/\/github.com\/ros-\nplanning\/navigation2\/blob\/humble\/nav2_costmap_2d%2Fplugins%2Fstatic_layer.cpp\n](https:\/\/github.com\/ros-\nplanning\/navigation2\/blob\/humble\/nav2_costmap_2d%2Fplugins%2Fstatic_layer.cpp)"} {"query":"Trouble launching moveit2 configurations\n\nHi I am using ROS2 humble with moveit2. I created a configuration with setup_assistant of moveit2. However, when I try to launch the demo launch file created by it. It gaves me the error:\n\n[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'\n\nI could not find anything related to capabilities. What does it mean? May someone please help me?","reasoning":"It is related to capabilities in default launch argument of moveit2.","id":"6","excluded_ids":["N\/A"],"gold_ids_long":["launch_moveit\/b634e96c2f080ab38780.txt"],"gold_ids":["launch_moveit\/b634e96c2f080ab38780_5.txt","launch_moveit\/b634e96c2f080ab38780_4.txt"],"gold_answer":"$\\begingroup$\n\nFrom what it looks like, this is a known issue for Humble. You will find more\ndiscussion on [ this\n](https:\/\/robotics.stackexchange.com\/questions\/109885\/ros2-error-launch-\ncapabilities) thread.\n\n**UPDATE**\n\nI don't know if this is going to solve your issue, but I'm taking a shot in\nthe dark regardless. I checked the recent pull requests for MoveIt2, and\nsomeone has sent in a PR which might correspond to what you want. [ Here\n](https:\/\/github.com\/ros-\nplanning\/moveit2\/pull\/2697\/commits\/b634e96c2f080ab38780668e85e974351978106d)\nis the PR in question.\n\nFrom what I suspect, there is some misdefinition of the default value of the\n\"capabilities\" launch argument, which the PR aims to fix by declaring proper\ndefault argument. You may try this out to see if that fixes your issue."} {"query":"Is it possible to modify or extend pre-existing Gazebo Sim plugins?\n\nQuestion\nIs it possible to modify or extend a pre-existing Gazebo Sim (Garden) plugin, such as the gz-sim-multicopter-control-system plugin to publish the quadcopter rotor velocities as Gazebo topics? How can this be done?\n\nSummary\nI am using Gazebo Garden (gz-sim7) to simulate a quadcopter. I have implemented two of Gazebo's pre-existing plugins for the quadcopter model flight. The plugins are gz-sim-multicopter-motor-model-system and gz-sim-multicopter-control-system, and their use in the model.sdf file is shown below. You can also find a more detailed version of the plugin implementation at multicopter_velocity_control.sdf.\n\n\n\n \n \n \n\n \n \n \n quadcopter<\/robotNamespace>\n rotor_0_joint<\/jointName>\n rotor_0<\/linkName>\n\n \n\n gazebo\/command\/motor_speed<\/commandSubTopic>\n 0<\/actuator_number>\n motor_speed\/0<\/motorSpeedPubTopic>\n velocity<\/motorType>\n <\/plugin>\n\n \n\n \n \n quadcopter<\/robotNamespace>\n base_link<\/comLinkName>\n gazebo\/command\/twist<\/commandSubTopic>\n enable<\/enableSubTopic>\n\n \n\n \n \n rotor_0_joint<\/jointName>\n\n \n\n <\/rotor>\n\n \n\n <\/rotorConfiguration>\n <\/plugin>\n <\/model>\n<\/sdf>\nIs it possible to publish the rotor velocities using Gazebo topics? If not, is it possible to modify or extend the functionalities of the pre-existing plugins to publish the rotor velocities to topics after calculating them?\n\nFurther Info\nI am using Gazebo Garden and ROS 2 Humble for this project. I have used the Gazebo's ros_gz_project_template as a starting framework for my project. There are four main packages in the workspace (my_package_application, my_package_bringup, my_package_description and my_package_gazebo), and the src directory looks something like this.\n\nsrc\n\u251c\u2500\u2500 ros_gz\n\u251c\u2500\u2500 sdformat_urdf\n\u251c\u2500\u2500 my_package_application\n\u251c\u2500\u2500 my_package_bringup\n\u251c\u2500\u2500 my_package_description\n\u2502 \u251c\u2500\u2500 CMakeLists.txt\n\u2502 \u251c\u2500\u2500 hooks\n\u2502 \u251c\u2500\u2500 include\n\u2502 \u2502 \u2514\u2500\u2500 my_package_description\n\u2502 \u2502 \u2514\u2500\u2500 MotorVelocityPublisher.hh\n\u2502 \u251c\u2500\u2500 models\n\u2502 \u2502 \u2514\u2500\u2500quadcopter\n\u2502 \u2502 \u251c\u2500\u2500 model.config\n\u2502 \u2502 \u2514\u2500\u2500 model.sdf\n\u2502 \u251c\u2500\u2500 package.xml\n\u2502 \u2514\u2500\u2500 src\n\u2502 \u2514\u2500\u2500 MotorVelocityPublisher.cc\n\u2514\u2500\u2500 my_package_gazebo\n \u251c\u2500\u2500 CMakeLists.txt\n \u251c\u2500\u2500 hooks\n \u251c\u2500\u2500 include\n \u251c\u2500\u2500 package.xml\n \u251c\u2500\u2500 src\n \u2514\u2500\u2500 worlds\n \u2514\u2500\u2500 quadcopter.sdf\nMy initial idea was to create a custom plugin called MotorVelocityPublisher which would access the rotor velocity data from the gz-sim-multicopter-control-system but the plugin doesn't make the rotor velocity data easily accessible.\n\nI have also thought about modifying or extending the existing gz-sim-multicopter-control-system plugin to publish the rotor velocity data. More specifically, creating a new RotorVelocitiesComponent.hh component to store the rotor velocity values.\n\n\/\/ RotorVelocitiesComponent.hh\n\n#ifndef ROTOR_VELOCITIES_COMPONENT_HH_\n#define ROTOR_VELOCITIES_COMPONENT_HH_\n\n#include \n\nnamespace multicopter_control\n{\n \/\/ Define a new Gazebo component to store rotor velocities\n GZ_SIM_DEFINE_COMPONENT(RotorVelocities, std::vector)\n}\n\n#endif \/\/ ROTOR_VELOCITIES_COMPONENT_HH_\nExtending the PreUpdate method in the MulticopterVelocityControl.cc library to save the rotor velocity values into the component.\n\n\/\/ Add the component header in MulticopterVelocityControl.cc\n#include \"RotorVelocitiesComponent.hh\"\n\n\/\/ Existing Multicopter Velocity Control methods\n\nvoid MulticopterVelocityControl::PreUpdate(\n const UpdateInfo &_info,\n EntityComponentManager &_ecm)\n{\n GZ_PROFILE(\"MulticopterVelocityControl::PreUpdate\");\n\n \/\/ Existing code for the Multicopter Velocity Control Pre-Update\n\n this->velocityController->CalculateRotorVelocities(*frameData, cmdVel,\n this->rotorVelocities);\n\n \/\/ New code to store the rotor velocities in the component\n auto rotorVelocitiesComp = _ecm.Component(this->model.Entity());\n if (!rotorVelocitiesComp)\n {\n _ecm.CreateComponent(this->model.Entity(), multicopter_control::RotorVelocities(this->rotorVelocities));\n }\n else\n {\n rotorVelocitiesComp->Data() = this->rotorVelocities;\n } \/\/ New code ends here\n\n this->PublishRotorVelocities(_ecm, this->rotorVelocities);\n}\nThe problem with this solution is that I don't know how to correctly save the extended gz-sim-multicopter-control-system plugin, build it, link it, etc. I'm not sure if this method will work or not.\n\n","reasoning":"We need to modify the MulticopterVelocityControl.hh and MulticopterVelocityControl.cc files to advertise the rotor velocity data through a Gazebo topic.","id":"7","excluded_ids":["N\/A"],"gold_ids_long":["gazebo_plugin\/MulticopterVelocityC1.txt","gazebo_plugin\/MulticopterVelocityC.txt"],"gold_ids":["gazebo_plugin\/MulticopterVelocityC1_6.txt","gazebo_plugin\/MulticopterVelocityC1_10.txt","gazebo_plugin\/MulticopterVelocityC_4.txt","gazebo_plugin\/MulticopterVelocityC_5.txt","gazebo_plugin\/MulticopterVelocityC_0.txt","gazebo_plugin\/MulticopterVelocityC1_0.txt","gazebo_plugin\/MulticopterVelocityC1_1.txt","gazebo_plugin\/MulticopterVelocityC1_7.txt","gazebo_plugin\/MulticopterVelocityC_3.txt","gazebo_plugin\/MulticopterVelocityC1_4.txt","gazebo_plugin\/MulticopterVelocityC_2.txt","gazebo_plugin\/MulticopterVelocityC1_3.txt","gazebo_plugin\/MulticopterVelocityC1_2.txt","gazebo_plugin\/MulticopterVelocityC1_8.txt","gazebo_plugin\/MulticopterVelocityC_1.txt","gazebo_plugin\/MulticopterVelocityC1_9.txt","gazebo_plugin\/MulticopterVelocityC1_5.txt"],"gold_answer":"$\\begingroup$\n\nMy solution to this question is slightly different to the solutions I proposed\nin my question. Instead of creating a new ` RotorVelocitiesComponent.hh `\ncomponent to store the rotor velocity values, I modified the [ `\nMulticopterVelocityControl.hh ` ](https:\/\/github.com\/gazebosim\/gz-sim\/blob\/gz-\nsim7\/src\/systems\/multicopter_control\/MulticopterVelocityControl.hh) and [ `\nMulticopterVelocityControl.cc ` ](https:\/\/github.com\/gazebosim\/gz-sim\/blob\/gz-\nsim7\/src\/systems\/multicopter_control\/MulticopterVelocityControl.cc) files to\nadvertise the rotor velocity data through a Gazebo topic.\n\n## Method\n\nI copied the plugin source files into my package, similar to how it is done in\nGazebo's [ ` ros_gz_project_template `\n](https:\/\/github.com\/gazebosim\/ros_gz_project_template) . My ` src ` directory\nnow looks something like this.\n\n \n \n src\n \u251c\u2500\u2500 ros_gz\n \u251c\u2500\u2500 sdformat_urdf\n \u251c\u2500\u2500 my_package_application\n \u251c\u2500\u2500 my_package_bringup\n \u251c\u2500\u2500 my_package_description\n \u2502 \u251c\u2500\u2500 CMakeLists.txt\n \u2502 \u251c\u2500\u2500 hooks\n \u2502 \u251c\u2500\u2500 include\n \u2502 \u2502 \u2514\u2500\u2500 my_package_description\n \u2502 \u2502 \u251c\u2500\u2500 Common.hh\n \u2502 \u2502 \u251c\u2500\u2500 LeeVelocityController.hh\n \u2502 \u2502 \u251c\u2500\u2500 MulticopterVelocityControl.hh\n \u2502 \u2502 \u2514\u2500\u2500 Parameters.hh\n \u2502 \u251c\u2500\u2500 models\n \u2502 \u2502 \u2514\u2500\u2500quadcopter\n \u2502 \u2502 \u251c\u2500\u2500 model.config\n \u2502 \u2502 \u2514\u2500\u2500 model.sdf\n \u2502 \u251c\u2500\u2500 package.xml\n \u2502 \u2514\u2500\u2500 src\n \u2502 \u251c\u2500\u2500 Common.cc\n \u2502 \u251c\u2500\u2500 LeeVelocityController.cc\n \u2502 \u2514\u2500\u2500 MulticopterVelocityControl.cc\n \u2514\u2500\u2500 my_package_gazebo\n \n\nThe next step is to change the package ` CMakeLists.txt ` file to build the\nplugin correctly.\n\n \n \n cmake_minimum_required(VERSION 3.8)\n project(my_package_description)\n \n # other ROS 2 CMakeLists.txt template code\n \n # find dependencies\n find_package(ament_cmake REQUIRED)\n find_package(Eigen3 REQUIRED)\n \n # find the needed plugin dependencies\n find_package(gz-cmake3 REQUIRED)\n find_package(gz-plugin2 REQUIRED COMPONENTS register)\n set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})\n find_package(gz-common5 REQUIRED COMPONENTS profiler)\n set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})\n find_package(gz-transport12 REQUIRED)\n set(GZ_TRANSPORT_VER ${gz-transport12_VERSION_MAJOR})\n find_package(gz-msgs9 REQUIRED)\n set(GZ_MSGS_VER ${gz-msgs9_VERSION_MAJOR})\n \n # set the right variables for gazebo garden\n find_package(gz-sim7 REQUIRED)\n set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})\n message(STATUS \"Compiling against Gazebo Garden\")\n \n # define a library target named 'MyModifiedPlugin'.\n add_library(MyModifiedPlugin\n SHARED\n src\/MulticopterVelocityControl.cc\n src\/Common.cc\n src\/LeeVelocityController.cc\n )\n \n # specify 'include' as the include directory for compiling\n # the 'MyModifiedPlugin' target.\n target_include_directories(\n MyModifiedPlugin PRIVATE include\n )\n \n # specify the gazebo libraries needed when linking the 'MyModifiedPlugin' target.\n target_link_libraries(MyModifiedPlugin PRIVATE\n gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}\n gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}\n gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER}\n gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}\n gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}\n Eigen3::Eigen\n )\n \n # copy the compiled libraries of 'MyModifiedPlugin' targets to the\n # subfolder 'lib\/my_package_description' of the install directory.\n install(TARGETS MyModifiedPlugin\n DESTINATION lib\/${PROJECT_NAME}\n )\n \n # other ROS 2 CMakeLists.txt template code\n # any other custom CMakeLists.txt code\n \n # I also use hooks to guide gazebo concerning where to look\n # for resources and plugins\n \n ament_package()\n \n\nNow it's just a matter of correctly modifying the pre-existing plugin source\nfiles and correctly using the plugin in the ` model.sdf ` file.\n\nMake sure to change any file inclusion directives to specify the correct\nlocations of the header files. An example for this case would be changing the\nfollowing inclusion directives\n\n \n \n #include \"Common.hh\"\n #include \"LeeVelocityController.hh\"\n #include \"MulticopterVelocityControl.hh\"\n #include \"Parameters.hh\"\n \n\nto the following inclusion directives.\n\n \n \n #include \"my_package_description\/Common.hh\"\n #include \"my_package_description\/LeeVelocityController.hh\"\n #include \"my_package_description\/MulticopterVelocityControl.hh\"\n #include \"my_package_description\/Parameters.hh\"\n \n\nThe majority of plugin modifications were done in the [ `\nMulticopterVelocityControl.hh ` ](https:\/\/github.com\/gazebosim\/gz-sim\/blob\/gz-\nsim7\/src\/systems\/multicopter_control\/MulticopterVelocityControl.hh) and [ `\nMulticopterVelocityControl.cc ` ](https:\/\/github.com\/gazebosim\/gz-sim\/blob\/gz-\nsim7\/src\/systems\/multicopter_control\/MulticopterVelocityControl.cc) files.\nUseful inclusion directives were added to the [ `\nMulticopterVelocityControl.hh ` ](https:\/\/github.com\/gazebosim\/gz-sim\/blob\/gz-\nsim7\/src\/systems\/multicopter_control\/MulticopterVelocityControl.hh) .\n\n \n \n \/\/ Pre-existing `MulticopterVelocityControl.hh` inclusion directives\n \n #include \n \n \/\/ New msg header for rotor velocity variables\n #include \n \n #include \n \n \/\/ Remaining pre-existing `MulticopterVelocityControl.hh` inclusion directives\n \n\nAdditional variables were added for the plugin modification.\n\n \n \n namespace gz\n {\n namespace sim\n {\n inline namespace GZ_SIM_VERSION_NAMESPACE\n {\n namespace systems\n {\n class MulticopterVelocityControl\n : public System,\n public ISystemConfigure,\n public ISystemPreUpdate\n {\n \n \/\/ Pre-existing `MulticopterVelocityControl.hh` declarations\n \n \/\/\/ \\brief Gazebo communication node.\n private: transport::Node node;\n \n \/\/\/ \\brief New topic for rotor velocities.\n private: std::string rotorVelocityPubTopic{\"rotor_velocities\"};\n \n \/\/\/ \\brief New rotor velocities publisher.\n private: transport::Node::Publisher rotorVelocityPub;\n \n \/\/\/ \\brief New variable that holds rotor velocities\n \/\/\/ computed by the controller to later be published.\n private: gz::msgs::Float_V rotorVelocityPubMsg;\n \n \/\/ Remaining pre-existing `MulticopterVelocityControl.hh` declarations\n \n };\n }\n }\n }\n }\n \n #endif\n \n\nThe rest of the changes were made in [ ` MulticopterVelocityControl.cc `\n](https:\/\/github.com\/gazebosim\/gz-sim\/blob\/gz-\nsim7\/src\/systems\/multicopter_control\/MulticopterVelocityControl.cc) . First,\nadd new logic to the ` MulticopterVelocityControl::Configure ` method to\ninitialise the topic advertiser.\n\n \n \n void MulticopterVelocityControl::Configure(const Entity &_entity,\n const std::shared_ptr &_sdf,\n EntityComponentManager &_ecm,\n EventManager & \/*_eventMgr*\/)\n {\n \n \/\/ Pre-existing Configure method logic\n \n sdfClone->Get(\"enableSubTopic\",\n this->enableSubTopic, this->enableSubTopic);\n this->enableSubTopic = transport::TopicUtils::AsValidTopic(\n this->enableSubTopic);\n if (this->enableSubTopic.empty())\n {\n gzerr << \"Invalid enable sub-topic.\" << std::endl;\n return;\n }\n \n \/\/ New code for rotor velocity publisher topic name\n sdfClone->Get(\"rotorVelocityPubTopic\",\n this->rotorVelocityPubTopic, this->rotorVelocityPubTopic);\n this->rotorVelocityPubTopic = transport::TopicUtils::AsValidTopic(\n this->rotorVelocityPubTopic);\n if (this->rotorVelocityPubTopic.empty())\n {\n gzerr << \"Invalid rotor velocity pub-topic.\" << std::endl;\n return;\n } \/\/ New code ends here\n \n \/\/ Pre-existing code to subscribe to actuator command messages\n \n \/\/ New initialise the publisher for rotor velocities\n std::string rotorVelocityTopic{this->robotNamespace + \"\/\" + this->rotorVelocityPubTopic};\n this->rotorVelocityPub = this->node.Advertise(rotorVelocityTopic);\n gzmsg << \"MulticopterVelocityControl publishing Double messages on [\"\n << rotorVelocityTopic << \"]\" << std::endl; \/\/ New code ends here\n \n \/\/ Remaining pre-existing Configure method logic\n \n this->initialized = true;\n }\n \n\nFinally, add additional logic to [ ` MulticopterVelocityControl.cc `\n](https:\/\/github.com\/gazebosim\/gz-sim\/blob\/gz-\nsim7\/src\/systems\/multicopter_control\/MulticopterVelocityControl.cc) to publish\nthe rotor velocities. I chose to do this in the `\nMulticopterVelocityControl::PublishRotorVelocities ` function to prevent the\nsimulation from breaking as much as possible.\n\n \n \n void MulticopterVelocityControl::PublishRotorVelocities(\n EntityComponentManager &_ecm,\n const Eigen::VectorXd &_vels)\n {\n \n \/\/ Pre-existing PublishRotorVelocities method logic\n \n \/\/ New code to clear previous data in the message\n \/\/ to prepare for new rotor velocities\n this->rotorVelocityPubMsg.clear_data();\n \n for (int i = 0; i < this->rotorVelocities.size(); ++i)\n {\n \n \/\/ Pre-existing logic to set rotorVelocitiesMsg velocities\n \n \/\/ New code to add each velocity value to the rotorVelocityPubMsg\n this->rotorVelocityPubMsg.add_data(_vels(i));\n }\n \n \/\/ New code to publish rotor velocities using rotorVelocityPub publisher\n this->rotorVelocityPub.Publish(this->rotorVelocityPubMsg);\n \n \/\/ Remaining pre-existing PublishRotorVelocities method logic\n \n }\n \n\nThe new plugin implementation can be done by directly specifying the plugin `\n.so ` file location, similarly as described in one of the [ answers\n](https:\/\/robotics.stackexchange.com\/a\/110132\/40013) to this question.\n\n \n \n \n \n <\/plugin>\n \n\nGazebo can also easily find the plugin in the ` lib\/my_package_description `\nfolder if you use hook files to widen Gazebo's search. The hook files will\nneed to be specified in ` CMakeLists.txt ` . You can also expand Gazebo's\nsearch by setting the GZ_SIM_SYSTEM_PLUGIN_PATH environment variable using the\ncommand.\n\n \n \n export GZ_SIM_SYSTEM_PLUGIN_PATH=${GZ_SIM_SYSTEM_PLUGIN_PATH}:\n \n\nSo far the simulation has been running well, without breaking."} {"query":"How to executing a callback function with multiple threads in ROS2\n\nI have a camera_node publishing image to processer_node, images are published faster than they are processed.\n\nWhen a new image appears in my image queue but the previous image is still processing, split a thread to bind a callback function to process the new image.\n\nIs there any way to this?","reasoning":"We can process multiple msgs coming on the same topic in multiple threads, which can be done using callback group and executor functionalities of ros2","id":"8","excluded_ids":["N\/A"],"gold_ids_long":["image_callback\/AboutExecutorshtml.txt"],"gold_ids":["image_callback\/AboutExecutorshtml_10.txt","image_callback\/AboutExecutorshtml_12.txt","image_callback\/AboutExecutorshtml_11.txt","image_callback\/AboutExecutorshtml_13.txt"],"gold_answer":"$\\begingroup$\n\nYes you can process multiple msgs coming on the same topic in multiple threads\nand you do not need to handle thread spinning, it can be done using ` callback\ngroup ` and ` executor ` functionalities of ros2. To achieve this you can\nfollow these steps\n\n * Define a [ multithreaded executor ](https:\/\/docs.ros.org\/en\/foxy\/Concepts\/About-Executors.html#callback-groups:%7E:text=The-,Multi%2DThreaded%20Executor,-creates%20a%20configurable) in your main function \n\n> ` rclcpp::executors::MultiThreadedExecutor executor; `\n\n * Add your node to this executor \n\n> ` executor->add_node(node); `\n\n * Now inside your node define a reentrant callback group (this allows parallel execution) and give this callback group in your topic subscription \n * ` my_callback_group = create_callback_group(rclcpp::CallbackGroupType::Reentrant); `\n * ` rclcpp::SubscriptionOptions options; `\n * ` options.callback_group = my_callback_group; `\n * ` my_subscription = create_subscription(\"\/topic\",rclcpp::SensorDataQoS(),callback, options); `\n\nThis should work for your use case. For further understanding check out the [\nexecutor ](https:\/\/docs.ros.org\/en\/foxy\/Concepts\/About-\nExecutors.html#callback-groups) concept on ros 2 wiki."} {"query":"What is the alternative to a \n\nI am using Arduino Mega.\n\nI wanted to configure it to create a ros2 topic using the ros2arduino header.\n\nHowever, I found out that the header cannot be used because it can only be supported from 32bit or higher\n\nIn this case, what idea can you recommend?\n\nCurrently, the board is connected to I2C communication, and it seems that the main board will also be connected to Arduino through I2C communication. (Currently, I am connecting from Ubuntu installed on my PC for testing purposes.)\n\nThank you so much for reading.","reasoning":"One option is to try Serial. We can check examples of interfaces about how to communicate serially with Ros2.","id":"9","excluded_ids":["N\/A"],"gold_ids_long":["arduino\/ros2serialinterface.txt"],"gold_ids":["arduino\/ros2serialinterface_7.txt","arduino\/ros2serialinterface_6.txt"],"gold_answer":"$\\begingroup$\n\nIf you don't have to use I2C, why don't you try Serial? Here seems to be an\nexample of an interface that can communicate serially with Ros2.\n\n[ https:\/\/github.com\/AnrdyShmrdy\/ros2_serial_interface\n](https:\/\/github.com\/AnrdyShmrdy\/ros2_serial_interface)"} {"query":"How do I post-process rviz images? [closed]\n\nI've made a gazebo envirnment and successfully visualized the cam image with rviz. However I wanted to do some post process to make it simulate the result of image segmentation and send it back to rviz. Is there any similiar methods or tutorials for this? Maybe a way to import the node to python?","reasoning":"We may find packages to process images in ros.","id":"10","excluded_ids":["N\/A"],"gold_ids_long":["image_process\/imageproc.txt"],"gold_ids":["image_process\/imageproc_49.txt","image_process\/imageproc_52.txt","image_process\/imageproc_65.txt","image_process\/imageproc_43.txt","image_process\/imageproc_36.txt","image_process\/imageproc_42.txt","image_process\/imageproc_64.txt","image_process\/imageproc_55.txt","image_process\/imageproc_61.txt","image_process\/imageproc_40.txt","image_process\/imageproc_51.txt","image_process\/imageproc_50.txt","image_process\/imageproc_48.txt","image_process\/imageproc_44.txt","image_process\/imageproc_39.txt","image_process\/imageproc_46.txt","image_process\/imageproc_35.txt","image_process\/imageproc_63.txt","image_process\/imageproc_60.txt","image_process\/imageproc_57.txt","image_process\/imageproc_37.txt","image_process\/imageproc_56.txt","image_process\/imageproc_45.txt","image_process\/imageproc_54.txt","image_process\/imageproc_53.txt","image_process\/imageproc_58.txt"],"gold_answer":"$\\begingroup$\n\nThere are so many nice tutorials that you could follow. I am listing down some\nof them below:\n\n[ http:\/\/wiki.ros.org\/image_proc ](http:\/\/wiki.ros.org\/image_proc)\n\n[ https:\/\/roboticsbackend.com\/ros-import-python-module-from-another-package\/\n](https:\/\/roboticsbackend.com\/ros-import-python-module-from-another-package\/)\n\nAnd for the last part of your question, see this.\n\n[ https:\/\/gist.github.com\/zkytony\/fb7616b745d77025f6abe919c41f8ea4\n](https:\/\/gist.github.com\/zkytony\/fb7616b745d77025f6abe919c41f8ea4)"} {"query":"How to add an additional argument in a ROS2 cpp callback\n\nI want to add an additional argument in a callback function for rclcpp, e.g. callback(msg, additional_argument).\n\nI can do it in python. There the solution would be:\n\nimport rclpy\nfrom std_msgs.msg import String\n\ndef callback(data, source):\n rospy.loginfo(f\"I heard '{data.data}' from {source}\")\n\ndef listener():\n rclpy.init()\n node = rclpy.create_node('listener')\n\n node.create_subscription(String, 'chatter_1', lambda msg: callback(msg, 1), 10)\n node.create_subscription(String, 'chatter_2', lambda msg: callback(msg, 2), 10)\n\n rclpy.spin(node)\n node.destroy_node()\n rclpy.shutdown()\n\nif __name__ == '__main__':\n listener()\nI also did it in ROS1 with boost::bind. I tried to do it in ROS2 with std::bind, but it did not work.\n\nDoes someone know the exact syntax?","reasoning":"We can check examples of callback implemented in ros2.","id":"11","excluded_ids":["N\/A"],"gold_ids_long":["additional_argument\/lambdacpp.txt"],"gold_ids":["additional_argument\/lambdacpp_0.txt"],"gold_answer":"$\\begingroup$\n\nYou can find a specific example in the ros2 examples repo: [\nhttps:\/\/github.com\/ros2\/examples\/blob\/rolling\/rclcpp\/topics\/minimal_subscriber\/lambda.cpp\n](https:\/\/github.com\/ros2\/examples\/blob\/rolling\/rclcpp\/topics\/minimal_subscriber\/lambda.cpp)\n\nIt can be done even shorter:\n\n \n \n #include \n \n #include \"rclcpp\/rclcpp.hpp\"\n #include \"std_msgs\/msg\/string.hpp\"\n \n class MinimalSubscriber : public rclcpp::Node {\n public:\n MinimalSubscriber()\n : Node(\"minimal_subscriber\"),\n subscription_1_(this->create_subscription(\n \"chatter_1\", 10,\n [this](const std_msgs::msg::String &msg) -> void {\n callback(msg, 1);\n })),\n subscription_2_(this->create_subscription(\n \"chatter_2\", 10, [this](const std_msgs::msg::String &msg) -> void {\n callback(msg, 2);\n })) {}\n \n private:\n void callback(const std_msgs::msg::String &msg, int source) {\n RCLCPP_INFO(this->get_logger(), \"I heard: '%s' from %d\", msg.data.c_str(),\n source);\n }\n \n rclcpp::Subscription::SharedPtr subscription_1_;\n rclcpp::Subscription::SharedPtr subscription_2_;\n };\n \n int main(int argc, char *argv[]) {\n rclcpp::init(argc, argv);\n rclcpp::spin(std::make_shared());\n rclcpp::shutdown();\n return 0;\n }\n ```"} {"query":"ros2_control - Hardware Interface - Write() & Moveit2 Joint Trajectory\n\nBy using ROS Humble, Moveit2, and ros2_control, I am trying to accomplish manipulation tasks with the CRX-10iA\/L Fanuc robot. Currently, I am implementing ros2_control hardware_interface part. Inside the default write function I am sending motion commands to robot.\n\nI have two motion command options from the provided robot interface. One of them should be sent except the last write command and the other one must be sent lastly. Otherwise, communication can't go further.\n\nI was wondering whether I can access to the total number of write commands that will be sent by hardware_interface? Then I can set a simple if-else logic.\n\nI thought about accessing total number of joint trajectory commands but I realized that when moveit generated a joint trajectory point with 22 positions, write() function was called 5 times in hardware_interface. Less than ideal as expected due to real hardware constraints.\n\nAny suggestion is appreciated. Thank you for your time.","reasoning":"The number of times write() method is called is related to the update rate of controller manager. We can check implrmentation of Hardware Components with different update rates.","id":"12","excluded_ids":["N\/A"],"gold_ids_long":["number_commands\/differentupdaterates.txt"],"gold_ids":["number_commands\/differentupdaterates_11.txt","number_commands\/differentupdaterates_13.txt","number_commands\/differentupdaterates_10.txt","number_commands\/differentupdaterates_9.txt","number_commands\/differentupdaterates_7.txt","number_commands\/differentupdaterates_6.txt","number_commands\/differentupdaterates_12.txt"],"gold_answer":"$\\begingroup$\n\nthe write() method will be called with the update rate of your controller\nmanager, if you need a different rate we added some [ docs here\n](https:\/\/control.ros.org\/master\/doc\/ros2_control\/hardware_interface\/doc\/different_update_rates_userdoc.html)\n. Which sampling time has your joint_trajectory, and which one the\ncontroller_manager? It sounds strange that it would be called 5 times only.\n\nYou cannot access the trajectory from your hardware_component, because the\njoint_trajectory_controller is sampling the trajectory at the current time\ninstance and sends only the current command to the hardware component.\n\nI'm not sure if I understand your problem right, but you simply can add a\nbuffer to save the old commands for the next call to write()?"} {"query":"ROS2 - modify py launchfile without rebuilding package\n\nIn ROS1 we could modify XML launchfile and roslaunch them directly without catkin_make rebuilding, in ROS2 it seems if I modify python launchfile, I need to rebuild the package otherwise\n\nros2 launch \nruns the old launchfile. Do I need to rebuild the package after each modification or am I missing something?","reasoning":"We may use some symbol link, which create symlinks pointing to actual source files. In this case, the change in source files will automatically be reflected.","id":"13","excluded_ids":["N\/A"],"gold_ids_long":["ros_launch\/whatistheuseofsymlin.txt"],"gold_ids":["ros_launch\/whatistheuseofsymlin_35.txt"],"gold_answer":"$\\begingroup$\n\nYou can use the ` --symlink-install ` flag while building your code. This will\ncreate symlinks in the install directory which points to actual source files\nrather then creating copies. So whenever you make change in your source files\nit will automatically be reflected in install and you won't be required to\nbuild again. You can also check this link, [ what is the use of --symlink-\ninstall in ROS2 colcon build? ](https:\/\/answers.ros.org\/question\/371822\/what-\nis-the-use-of-symlink-install-in-ros2-colcon-build\/) , for further help."} {"query":"Comparison of trajectories from odometries\n\nIs there a way in ROS2 to compare trajectories from odometry data? I'm using robot_localization to calculate various odometry outputs by incorporating GPS and IMU data. I have a bag file where I recorded odometry topics, and I would like to compare the paths taken in the following configurations:\n\n\/odom_local (odometry + IMU)\n\/odom_global (odometry + IMU + GPS)\n\/odom_ackermann (only my odometry data)\nI can visualize the trajectories in rviz2, but I also want to compare them in terms of distance error, etc.\n\nIf someone has already done this, I hope they can assist me.\n\nThanks in advance.","reasoning":"We may use Plotjuggler, a tool for plotting and investigating data. We can plot X-Y plots in case of plotting odometry data.","id":"14","excluded_ids":["N\/A"],"gold_ids_long":["odometry_trajectory\/PlotJuggler.txt"],"gold_ids":["odometry_trajectory\/PlotJuggler_86.txt","odometry_trajectory\/PlotJuggler_78.txt","odometry_trajectory\/PlotJuggler_85.txt","odometry_trajectory\/PlotJuggler_82.txt","odometry_trajectory\/PlotJuggler_81.txt","odometry_trajectory\/PlotJuggler_87.txt","odometry_trajectory\/PlotJuggler_79.txt","odometry_trajectory\/PlotJuggler_80.txt","odometry_trajectory\/PlotJuggler_84.txt"],"gold_answer":"$\\begingroup$\n\nYou should try [ Plotjuggler ](https:\/\/github.com\/facontidavide\/PlotJuggler) .\nIts a nice tool for plotting and investigating data. You can directly import\nrosbags into it. Another good thing about plotjuggler is that you can plot X-Y\nplots which really helps in case of plotting odometry data. I have been using\nit for years now, It might take some time to setup and get started but it will\nbe worth it.\n\nTip: you can plot goal (X-Y position) and over it your odometry(X-Y position)\nfor each case and you'll see how deviated each one of them is from reference\npath (goal path).\n\nCheck out [ this ](https:\/\/vimeo.com\/351160225) video by the author of\nplotjuggler and you'll understand more.\n\nHope this helps"} {"query":"Gazebo ignition spawn_entity equivalent\n\nWhen designing simulations in Gazebo Classic it was possible to spawn robots in the simulation with the launch file spawn_entity from the gazebo_ros pkg. Is there any equivalent in to that in Gazebo Ignition?","reasoning":"We may try to change the file of spawn_entity, and migrate the project from Gazebo Classic to Gazebo Ignition.","id":"15","excluded_ids":["N\/A"],"gold_ids_long":["spawn_entity\/migratinggazeboclass.txt"],"gold_ids":["spawn_entity\/migratinggazeboclass_35.txt"],"gold_answer":"$\\begingroup$\n\nIn Gazebo Ignition, they have moved from ` gazebo_ros ` to ` ros_gz ` . Inside\nthis ` ros_gz ` metapackage, you'd find the ` ros_gz_sim ` package, which\nprovides the functionality that you want.\n\nI'll point you to the source of the [ package\n](https:\/\/github.com\/gazebosim\/ros_gz\/tree\/ros2\/ros_gz_sim) , you can use this\nto check what types of inputs the launch file expects, and also to read more\nabout the package. In case you are looking to use it in the ROS 2 CLI, it's\n\n \n \n ros2 launch ros_gz_sim gz_sim.launch.py gz_args:=\"shapes.sdf\"\n \n\nI'd also point you to [ this\n](https:\/\/gazebosim.org\/docs\/harmonic\/migrating_gazebo_classic_ros2_packages)\nMigration Guide, where you have a a very nicely written document on how to\nmigrate your project from Gazebo Classic to Gazebo Ignition. The section of\ninterest for you would be the [ spawn model\n](https:\/\/gazebosim.org\/docs\/harmonic\/migrating_gazebo_classic_ros2_packages#spawn-\nmodel) section."} {"query":"Comparing navigation algorithms\n\nI am new to Nav2 stack and currently there are a bunch of navigation plugins to choose from (https:\/\/navigation.ros.org\/plugins\/index.html). I am interested in how to choose available algorithms from those in \"Planners\" and \"Controllers\" sections. For example, how to know pros & cons of NavFn planner compared with SmacPlanner. How to know pros & cons of DWB controller against TEB controller. Is there any site clarify something like this?\n\nThank you,\n\nPeera","reasoning":"We can check overview\/comparison between planners.","id":"16","excluded_ids":["N\/A"],"gold_ids_long":["nv_planner\/230715236pdf.txt"],"gold_ids":["nv_planner\/230715236pdf_4.txt","nv_planner\/230715236pdf_2.txt","nv_planner\/230715236pdf_6.txt","nv_planner\/230715236pdf_20.txt","nv_planner\/230715236pdf_8.txt","nv_planner\/230715236pdf_0.txt","nv_planner\/230715236pdf_1.txt","nv_planner\/230715236pdf_16.txt","nv_planner\/230715236pdf_5.txt","nv_planner\/230715236pdf_9.txt","nv_planner\/230715236pdf_10.txt","nv_planner\/230715236pdf_3.txt","nv_planner\/230715236pdf_14.txt","nv_planner\/230715236pdf_15.txt","nv_planner\/230715236pdf_13.txt","nv_planner\/230715236pdf_12.txt","nv_planner\/230715236pdf_17.txt","nv_planner\/230715236pdf_19.txt","nv_planner\/230715236pdf_18.txt","nv_planner\/230715236pdf_7.txt","nv_planner\/230715236pdf_11.txt"],"gold_answer":"$\\begingroup$\n\nThere's a paper for that: [ https:\/\/arxiv.org\/pdf\/2307.15236.pdf\n](https:\/\/arxiv.org\/pdf\/2307.15236.pdf)\n\n> S. Macenski, T. Moore, DV Lu, A. Merzlyakov, M. Ferguson, From the desks of\n> ROS maintainers: A survey of modern & capable mobile robotics algorithms in\n> the robot operating system 2, Robotics and Autonomous Systems, 2023"} {"query":"Trouble Installing ROS 2 Humble on Ubuntu 20.04 with arm64\/x86_64 Architecture\n\nI've been encountering an issue while attempting to install ROS 2 Humble on my Ubuntu 20.04 system. My machine supports both arm64 and x86_64 architectures. Despite following the official installation instructions closely, I run into the \"unable to locate package ros-humble-desktop\" error every time I try to execute the installation command.\n\nHere are the steps I've followed based on the instructions from the ROS.org page for Humble:\n\n1. Added the ROS 2 repository and keyring as follows:\n\nsudo apt update && sudo apt install curl -y\n\nsudo curl -sSL https:\/\/raw.githubusercontent.com\/ros\/rosdistro\/master\/ros.key -o \/usr\/share\/keyrings\/ros-archive-keyring.gpg\n\necho \"deb [arch=$(dpkg --print-architecture) signed-by=\/usr\/share\/keyrings\/ros-archive-keyring.gpg] http:\/\/packages.ros.org\/ros2\/ubuntu $(. \/etc\/os-release && echo $UBUNTU_CODENAME) main\" | sudo tee \/etc\/apt\/sources.list.d\/ros2.list > \/dev\/null\n2. Updated and upgraded my package lists:\n\n sudo apt update\n sudo apt upgrade\n3. Attempted to install ROS 2 Humble packages:\n\n sudo apt install ros-humble-desktop\nHowever, this results in the \"unable to locate package ros-humble-desktop\" error.\n\nInterestingly, I came across a similar issue on ROS Answers where a user encountered package location errors due to their system running on an ARMhf platform. However, after checking my system using dpkg --print-architecture and lscpu, I confirmed that my system is on arm64 and x86_64, which should be compatible with ROS 2 Humble according to REP 2000.\n\nI'm reaching out to see if anyone has faced a similar issue or could offer guidance on resolving this error. Could this problem be related to my prior attempts to uninstall ROS 2 Foxy and clean my system? Or is there something else I'm missing in the setup process for ROS 2 Humble on Ubuntu 20.04?\n\nAny advice or suggestions would be greatly appreciated. Thank you in advance for your help!","reasoning":"One option is to try source install.","id":"17","excluded_ids":["N\/A"],"gold_ids_long":["ros2humble\/UbuntuDevelopmentSet.txt"],"gold_ids":["ros2humble\/UbuntuDevelopmentSet_11.txt","ros2humble\/UbuntuDevelopmentSet_9.txt","ros2humble\/UbuntuDevelopmentSet_8.txt","ros2humble\/UbuntuDevelopmentSet_7.txt","ros2humble\/UbuntuDevelopmentSet_10.txt"],"gold_answer":"$\\begingroup$\n\nIn normal case, ROS2 Humble binary installation is available in Ubuntu 22.04\nversion, unless you have built a separate container environment.\n\n[ ![enter image description here](https:\/\/i.sstatic.net\/YMaN6.png)\n](https:\/\/i.sstatic.net\/YMaN6.png)\n\n \n \n **Installation**\n Options for installing ROS 2 Humble Hawksbill:\n \n Binary packages\n Binaries are only created for the Tier 1 operating systems listed in REP-2000. Given the nature of Rolling, this list may be updated at any time. If you are not running any of the following operating systems you may need to build from source or use a container solution to run ROS 2 on your platform.\n \n We provide ROS 2 binary packages for the following platforms:\n \n Ubuntu Linux - Jammy Jellyfish (22.04)\n \n Debian packages (recommended)\n \n \u201cfat\u201d archive\n \n RHEL 8\n \n RPM packages (recommended)\n \n \u201cfat\u201d archive\n \n Windows (VS 2019)\n \n\nOr you could try Source Install [\nhttps:\/\/docs.ros.org\/en\/humble\/Installation\/Alternatives\/Ubuntu-Development-\nSetup.html ](https:\/\/docs.ros.org\/en\/humble\/Installation\/Alternatives\/Ubuntu-\nDevelopment-Setup.html) [ ![enter image description\nhere](https:\/\/i.sstatic.net\/11U0I.png) ](https:\/\/i.sstatic.net\/11U0I.png)\n\n \n \n Ubuntu (source)\n Table of Contents\n \n System requirements\n \n System setup\n \n Set locale\n \n Add the ROS 2 apt repository\n \n Install development tools and ROS tools\n \n Get ROS 2 code\n \n Install dependencies using rosdep\n \n Install additional DDS implementations (optional)\n \n Build the code in the workspace\n \n Environment setup\n \n Source the setup script\n \n Try some examples\n \n Next steps after installing\n \n Using the ROS 1 bridge\n \n Additional RMW implementations (optional)\n \n Alternate compilers\n \n Clang\n \n Stay up to date\n \n Troubleshooting\n \n Uninstall\n \n System requirements\uf0c1\n The current Debian-based target platforms for Humble Hawksbill are:\n \n Tier 1: Ubuntu Linux - Jammy (22.04) 64-bit\n \n Tier 3: Ubuntu Linux - Focal (20.04) 64-bit\n \n Tier 3: Debian Linux - Bullseye (11) 64-bit"} {"query":"How to use ros2_control with actual hardware communicating via etherCAT?\n\nI am learning ros2_control with the real hardware. I need some help writing hardware interface for the current setup. I do not have experience writing on the communication side of the real hardware.\n\nsetup: I have Jetson nano, drives, motors, and sensors communicating via EtherCAT and using ros2 foxy and SOEM_ROS2 package. these were installed and running without ros2 control, simply via publisher and subscriber. The whole system controls the x,y,z axis with prismatic joint. It is not a robot. so no end effector. Now, I want to integrate ros2 control with the whole system. I don't know how to get the values from the hardware for the read and write methods of the hardware interface. I appreciate any help you can provide.","reasoning":"We need a driver with generic ways to parametrise and assemble Hardware Interfaces based on EtherCAT modules.","id":"18","excluded_ids":["N\/A"],"gold_ids_long":["hardware_communicate\/ethercatdriverros2.txt"],"gold_ids":["hardware_communicate\/ethercatdriverros2_42.txt","hardware_communicate\/ethercatdriverros2_41.txt"],"gold_answer":"$\\begingroup$\n\nHave you seen this [ EtherCAT driver ](https:\/\/github.com\/ICube-\nRobotics\/ethercat_driver_ros2) ?"} {"query":"Reading a ros2_control xacro file in a regular node\n\nI have a xacro file that I used for a specific piece of hardware. I figured out how to store custom data structures within the gpio framework within ros2_control\n\nexample:\n\n \n 0<\/param>\n 0x01<\/param>\n <\/gpio>\nThis would get automatically loading into the associated plugin and the data was available in the hardwareinfo structure\/map.\n\nI want to use the same xacro file but in a regular lifecycle node. It seems that I can read and parse the file in the launch file with\n\n device_config = xacro.process_file(io_config_file_path)\n device_config_parsed = device_config.toprettyxml(indent=' ')\nBut there isn't really a way to load that into the parameters.\n\nI have tried a bunch of different options and it blows up or nothing happens. Another option would be just to parse the file in the node with tinyxml2.\n\nAny ideas?\n\nThanks","reasoning":"We need a component parser to be incorporated into the code.","id":"19","excluded_ids":["N\/A"],"gold_ids_long":["ros_regular\/componentparserhpp.txt"],"gold_ids":["ros_regular\/componentparserhpp_0.txt"],"gold_answer":"$\\begingroup$\n\nHave a look at the [ component parser ](https:\/\/github.com\/ros-\ncontrols\/ros2_control\/blob\/master\/hardware_interface\/include\/hardware_interface\/component_parser.hpp)\nused within the controller_manager of ros2_control. It should be possible to\nuse that in your node."} {"query":"Custom hardware interface type\n\nI would like to write a controller that needs all joint states to update a single joint.\n\nMy idea was to create a class MyStateInterface which inherits from hardware_interface::StateInterface and stores all information for each joint. Then, I would like to export this class inside the hardware interface to pass the joint information to the controller.\n\nTo make it clear, I modify this example:\n\nstd::vector hw_states_;\n\nCallbackReturn MyRobotHardware::on_init(const hardware_interface::HardwareInfo & info) {\n \/\/ set some default values when starting the first time\n hw_states_.resize(info_.joints.size(), 0.0);\n return CallbackReturn::SUCCESS;\n}\n\nstd::vector\nMyRobotHardware::export_state_interfaces()\n{\n std::vector state_interfaces;\n\n for (uint i = 0; i < info_.joints.size(); i++)\n {\n state_interfaces.emplace_back(hardware_interface::StateInterface(\n info_.joints[i].name, \/\/ joint name from controller.yaml\n hardware_interface::HW_IF_POSITION, \/\/ \"position\"\n &hw_states_[i] \/\/ the joint value\n ));\n }\n\n return state_interfaces;\n}\nTo something like this:\n\nstd::vector hw_states_;\n\nCallbackReturn MyRobotHardware::on_init(const hardware_interface::HardwareInfo & info) {\n \/\/ set some default object when starting the first time\n hw_states_.resize(info_.joints.size(), MyStateHandle());\n return CallbackReturn::SUCCESS;\n}\n\nstd::vector\nMyRobotHardware::export_state_interfaces()\n{\n std::vector state_interfaces;\n\n for (uint i = 0; i < info_.joints.size(); i++)\n {\n state_interfaces.emplace_back(hardware_interface::StateInterface(\n info_.joints[i].name, \/\/ joint name from controller.yaml\n \"my_state_handle\", \/\/ a made up name\n &hw_states_[i] \/\/ information for controlling the joint\n ));\n }\n\n return states_interfaces;\n}\nThis didn't work because there is no matching function for the call hardware_interface::StateInterface(const std::string &name, const std::string &interface_name, MyStateHandle *value_ptr=nullptr) because there is only the function hardware_interface::StateInterface(const std::string &name, const std::string &interface_name, double *value_ptr=nullptr)\n\nI want to know if there is a way to pass a class full of control data from the hardware interface to the controller, or am I on a completely wrong track?","reasoning":"We can check post\/issues related to HW interface creation change.","id":"20","excluded_ids":["N\/A"],"gold_ids_long":["hardware_control\/1240.txt"],"gold_ids":["hardware_control\/1240_26.txt","hardware_control\/1240_9.txt","hardware_control\/1240_25.txt","hardware_control\/1240_5.txt","hardware_control\/1240_12.txt","hardware_control\/1240_15.txt","hardware_control\/1240_34.txt","hardware_control\/1240_30.txt","hardware_control\/1240_4.txt","hardware_control\/1240_29.txt","hardware_control\/1240_16.txt","hardware_control\/1240_32.txt","hardware_control\/1240_3.txt","hardware_control\/1240_38.txt","hardware_control\/1240_37.txt","hardware_control\/1240_31.txt","hardware_control\/1240_22.txt","hardware_control\/1240_35.txt","hardware_control\/1240_23.txt","hardware_control\/1240_21.txt","hardware_control\/1240_24.txt","hardware_control\/1240_10.txt","hardware_control\/1240_27.txt","hardware_control\/1240_33.txt","hardware_control\/1240_8.txt","hardware_control\/1240_28.txt","hardware_control\/1240_19.txt","hardware_control\/1240_20.txt","hardware_control\/1240_14.txt","hardware_control\/1240_18.txt","hardware_control\/1240_13.txt","hardware_control\/1240_17.txt","hardware_control\/1240_6.txt"],"gold_answer":"$\\begingroup$\n\nNo this is not possible yet. But we are working on that feature, see [ this PR\nhere ](https:\/\/github.com\/ros-controls\/ros2_control\/pull\/1240) . This feature\nmight come with Jazzy."} {"query":"Octomap and Projected Octomap not lining up\n\nI am trying to use a projected Octomap as an occupancy grid to pass onto the ROS navigation stack, but when I create one using the octomap_server package, it creates an occupancy grid which is rotated 90 degrees from the top down view (i.e., It projects from the side when it should be projecting downwards). The Octomap and the projected Octomap are shown below.\n\nIs there any way to change the direction from which Octomap creates the projection?","reasoning":"We can use dynamic configure to modify the parameters dynamically and check if it fixes the orientation","id":"21","excluded_ids":["N\/A"],"gold_ids_long":["automap_project\/OctomapServercfg.txt"],"gold_ids":["automap_project\/OctomapServercfg_0.txt"],"gold_answer":"$\\begingroup$\n\nIt seems you can use dynamic configure to modify the parameters dynamically\nand check if fix your orientation [ Octomap Params\n](https:\/\/github.com\/OctoMap\/octomap_mapping\/blob\/kinetic-\ndevel\/octomap_server\/cfg\/OctomapServer.cfg)\n\n \n \n rosrun rqt_reconfigure rqt_reconfigure\n \n\nOr add in your launch file a static transform Publisher between your robot\nbase_link and map frames with desired orientation\n\n \n \n "} {"query":"Controlling power input for different currents and voltages connected to the same power source\n\nI am new to robotics and am struggling with the electronics a bit. I am using two 9 V batteries in series to provide 18 V. I need to power 2 x 12 W DC motors and an Arduino Uno. I need to divide the input power of 18 volts into 3 streams: 2 x (12 V, 1 A) streams for the motors + 1 x (6 V, 0.2 A) for the Arduino.\n\nI thought of using a 1 \u03a9 resistor and a 2 \u03a9 resistor in parallel to get two streams: 12 volts and 6 volts respectively, but I am not sure if that will ensure the right current values will be drawn. I tried looking online but couldn't find a method. How can I go about carrying this out? Any help will be greatly appreciated!","reasoning":"An alternative is to use a converter and set the output voltage.","id":"22","excluded_ids":["N\/A"],"gold_ids_long":["motor_resistor\/9370.txt"],"gold_ids":["motor_resistor\/9370_0.txt"],"gold_answer":"$\\begingroup$\n\nIn addition to the above comment, you will never be able to source that much\npower from a pair of 9 Volt batteries. If you do use a battery eliminator\ncircuit keep in mind that they operate in the linear regime and are therefor\nnot very efficient. You would be better off using switch mode DC to DC\nconverters and a LiPo battery. There are lots of options, look at spark fun\nand find the ratings you need. Here is a [ link\n](https:\/\/www.sparkfun.com\/products\/9370) to a converter and [ here\n](https:\/\/www.sparkfun.com\/categories\/tags\/power) are some batteries. If you\nneed to increase the voltage use a [ boost\n](https:\/\/www.sparkfun.com\/search\/results?term=boost+converter) converter, you\ndont need to stack these in series."} {"query":"Subscriber in Hardware Interface (ros2_control)\n\nIs there any example for adding subscriber to hardware interface ? Publisher works fine. My code is below, I dont know where its going wrong but unable to get values after publishing using CLI.\n\n.hpp file '''\n\nnamespace diffdrive_ctre { class HardwareCommandPub : public rclcpp::Node { public:\n\nHardwareCommandPub();\nvoid publishData();\nvoid pincmdcheck();\nprivate: rclcpp::Publisher::SharedPtr pub_; rclcpp::Publisher::SharedPtr estop_pub_; rclcpp::Subscription::SharedPtr pin_sub_; rclcpp::TimerBase::SharedPtr timer_; amr_v4_msgs_srvs::msg::Pin latest_pin_cmd; };\n\nclass DiffDriveCTREHardware : public hardware_interface::SystemInterface {\n\n''' .cpp file\n\nHardwareCommandPub::HardwareCommandPub() : Node(\"Motor_Status\") {\n\npub_ = this->create_publisher(\"talonFX_right\/status\", 10); estop_pub_ = this->create_publisher(\"\/e_stop\", 10); pin_sub_ = this->create_subscription(\"\/amr\/pin_cmd\", 10, [this](const amr_v4_msgs_srvs::msg::Pin::SharedPtr pin_cmd) { latest_pin_cmd = *pin_cmd; });\n\n}\n\nvoid HardwareCommandPub::publishData() { \/\/ \/\/motor1 auto message = amr_v4_msgs_srvs::msg::Motor(); message.temperature_right = motor_right.GetDeviceTemp().ToString(); message.bus_voltage_right = motor_right.GetSupplyVoltage().ToString();\nmessage.output_current_right = motor_right.GetStatorCurrent().ToString(); message.error_right = motor_right.GetStickyFault_Hardware().ToString();\n\n\/\/ \/\/motor2 message.temperature_left = motor_left.GetDeviceTemp().ToString(); message.bus_voltage_left = motor_left.GetSupplyVoltage().ToString();\nmessage.output_current_left = motor_left.GetStatorCurrent().ToString(); message.error_left = motor_left.GetStickyFault_Hardware().ToString();\n\n\/\/ \/\/motor pin message.temperature_pin = pin_motor.GetDeviceTemp().ToString(); message.bus_voltage_pin =\npin_motor.GetSupplyVoltage().ToString(); message.output_current_pin = pin_motor.GetStatorCurrent().ToString(); message.error_pin = pin_motor.GetStickyFault_Hardware().ToString();\n\n\/\/estop auto message_estop = std_msgs::msg::Bool();\nmessage_estop.data = estop_temp; if (rclcpp::ok()) { estop_pub_->publish(message_estop); pub_->publish(message); pincmdcheck(); } }\n\nvoid HardwareCommandPub::pincmdcheck() { pin_temp = latest_pin_cmd.pin_command; RCLCPP_INFO( rclcpp::get_logger(\"Pin test\"), \"Got pin cmd '%i'and '%i' and '%s'!\",pin_temp,latest_pin_cmd.pin_command); }","reasoning":"We can check how subscription is created in the node of topic-based subscriber.","id":"23","excluded_ids":["N\/A"],"gold_ids_long":["subscriber_interface\/topicbasedsystemcppL.txt"],"gold_ids":["subscriber_interface\/topicbasedsystemcppL_3.txt"],"gold_answer":"$\\begingroup$\n\nHave a look at [ this implementation of topic_based_ros2_control\n](https:\/\/github.com\/PickNikRobotics\/topic_based_ros2_control\/blob\/37a98e652818ac4b884786558a2f3c0373415c16\/src\/topic_based_system.cpp#L149)\nhere.\n\nNote that in general, it is not recommended to use a node inside the hardware\ninterface if you have realtime requirements. Write your custom controller with\nrealtime-safe implementations instead."} {"query":"Make the robot stop if it finds an obstacle in front\n\nI am using the navigation stack (nav2) without problems, but I would like to understand how I can make the robot stop from its path if it finds a dynamic obstacle in front of it (at a minimum distance of n metres)?\n\nIs there a demo or tutorial to take inspiration from?\n\nmany thanks in advance","reasoning":"We can use the CollisionMonitor package inside the Nav2 Stack.","id":"24","excluded_ids":["N\/A"],"gold_ids_long":["robot_stop\/usingcollisionmonito.txt"],"gold_ids":["robot_stop\/usingcollisionmonito_535.txt","robot_stop\/usingcollisionmonito_536.txt","robot_stop\/usingcollisionmonito_531.txt","robot_stop\/usingcollisionmonito_526.txt","robot_stop\/usingcollisionmonito_533.txt","robot_stop\/usingcollisionmonito_528.txt","robot_stop\/usingcollisionmonito_524.txt","robot_stop\/usingcollisionmonito_541.txt","robot_stop\/usingcollisionmonito_532.txt","robot_stop\/usingcollisionmonito_537.txt","robot_stop\/usingcollisionmonito_534.txt","robot_stop\/usingcollisionmonito_529.txt","robot_stop\/usingcollisionmonito_527.txt","robot_stop\/usingcollisionmonito_523.txt","robot_stop\/usingcollisionmonito_530.txt","robot_stop\/usingcollisionmonito_540.txt","robot_stop\/usingcollisionmonito_542.txt","robot_stop\/usingcollisionmonito_539.txt"],"gold_answer":"$\\begingroup$\n\nYou can use the CollisionMonitor package inside the Nav2 Stack.\n\nHere is a tutorial: [ Using Collision Monitor\n](https:\/\/navigation.ros.org\/tutorials\/docs\/using_collision_monitor.html#using-\ncollision-monitor) and here are the sources [ Github ](https:\/\/github.com\/ros-\nplanning\/navigation2\/tree\/main\/nav2_collision_monitor)"} {"query":"What determines a robots euler rotation order?\n\nI know Fanuc robots use the XYZ rotation order, ABB uses ZYX and some robots use the ZYZ rotation order. What actually determines this order? is it the way the frames are setup on the DH table? Or is it just the order they chose to solve the IK, and any order could be used? Can anyone help me understand this? TY.","reasoning":"Any euler angles triplet can be used to represent the orientation of a rigid body (and so of the link a robot).","id":"25","excluded_ids":["N\/A"],"gold_ids_long":["robot_euler_angle\/Eulerangles.txt"],"gold_ids":["robot_euler_angle\/Eulerangles_5.txt"],"gold_answer":"$\\begingroup$\n\nAny [ euler angles triplet ](https:\/\/en.wikipedia.org\/wiki\/Euler_angles) can\nbe used to represent the orientation of a rigid body (and so of the link a\nrobot). I cannot answer for the particular robots you mentioned, but usually\none choose a representation for ease of visualization or to simplify some\ncomputation (e.g. if a link rotate around a revolute joint, it simplify the\nequation of motion to have one the rotation axis aligned with the joint axis)."} {"query":"How to make 4 wheeled robot work with DiffDrive plugin and ROS2 Control?\n\nI have a 4 wheeled robot with mecanum wheels (in real life), I have been able to simulate it and get it to work with the ROS2 DiffDrive plugin (replicating the skid steer plugin from ROS1) but now that I want to implement ROS2 Control with it I cannot get it to work. I have been following the Articubot tutorials but his robot only has 2 wheels. I can't find anything online regarding a 4 wheeled robot that would make use of the DiffDrive plugin on ROS2 while using ROS2 Control. At the moment My aim is to only simulate the robot in gazebo so that I can better understand how ROS2 control works but I am stuck.\n\nGitHub Repo\n\nI hope the question is clear.\n\nSome guidance on how to make ROS2 Control work with this robot with be very much appreciated. Thanks","reasoning":"We may use DiffBot, a simple mobile base with differential drive. We may also check parameters of diff_drive_controller.","id":"26","excluded_ids":["N\/A"],"gold_ids_long":["diffdrive\/userdochtml.txt","diffdrive\/diffdrivecontrollerp.txt"],"gold_ids":["diffdrive\/userdochtml_3.txt","diffdrive\/diffdrivecontrollerp_4.txt","diffdrive\/diffdrivecontrollerp_2.txt","diffdrive\/userdochtml_2.txt","diffdrive\/userdochtml_1.txt","diffdrive\/userdochtml_4.txt"],"gold_answer":"$\\begingroup$\n\nThere is currently no ros2_controller supporting omniwheels. If it has\nstandard wheels, use the diff_drive controller as in [ this demo\n](https:\/\/control.ros.org\/humble\/doc\/ros2_control_demos\/example_2\/doc\/userdoc.html)\n. Consider the wheels_per_side [ parameter ](https:\/\/github.com\/ros-\ncontrols\/ros2_controllers\/blob\/humble\/diff_drive_controller\/src\/diff_drive_controller_parameter.yaml)\n."} {"query":"Underwater Property Simulation with ROS2 e.g Particle Plume\n\nI want to develop and test adaptive path planning algorithms for AUVs or also USVs.\n\nSo far I did this in ROS1 with the UUV Simulator and especially the uuv_plume_simulator.\n\nNow I am looking for ways to do this in ROS2.\n\nI managed to get a simulation of an AUV working with ROS2 Humble and Gazebo Ignition but I couldn't find a solution comparable to the UUV Plume Simulator.\n\nAre there Gazebo (Ignition\/Garden\/Harmonic) Plugins or Projects that already deal with the simulation of the distribution of water properties like salinity\/turbidity\/temperature or the simulation of freshwater\/hotwater\/oil\/particle spill or plumes? Ideally these properties would be also influenced by currents.\n\nSo far i only came across the EnvironmentPreload Plugin for Gazebo Harmonic but it seems to only offer the a static distribution of values.\n\nAny recommendations are highly appreciated.","reasoning":"We can use the ROS2 Port of the uuv_plume_simulator package.","id":"27","excluded_ids":["N\/A"],"gold_ids_long":["underwater_simulation\/uuvplumesimulatorros.txt"],"gold_ids":["underwater_simulation\/uuvplumesimulatorros_6.txt","underwater_simulation\/uuvplumesimulatorros_7.txt"],"gold_answer":"$\\begingroup$\n\nWe did a port of the UUV Plume Simulator Package to Ros2 and it is available\nhere:\n\n[ https:\/\/github.com\/tiko5000\/uuv_plume_simulator_ros2\n](https:\/\/github.com\/tiko5000\/uuv_plume_simulator_ros2)"} {"query":"ros_gz_bridge does not publish on ros2 topic\n\nI am running ros_gz_bridge to read some data from Gazebo, in particular I have run:\n\nros2 run ros_gz_bridge parameter_bridge \/model\/x500_vision_0\/odometry@nav_msgs\/msg\/Odometry[gz.msgs.Odometry\n\n[INFO] [1706113773.667589591] [ros_gz_bridge]: Creating GZ->ROS Bridge: [\/model\/x500_vision_0\/odometry (gz.msgs.Odometry) -> \/model\/x500_vision_0\/odometry (nav_msgs\/msg\/Odometry)] (Lazy 0)\nThe problem is that when I run\n\nros2 topic echo \/model\/x500_vision_0\/odometry\nI do not see any message published on the topic.\n\nI have already checked that the name of the topic is correct, and when I run\n\ngz topic -et \/model\/x500_vision_0\/odometry\nI can see the messages exchanged within Gazebo.\n\nSo why is the bridge not publishing the messages on the ROS2 network?","reasoning":"We can try to install from the source. This can be related to different versions Gazebo Garden and Gazebo Fortress.","id":"28","excluded_ids":["N\/A"],"gold_ids_long":["rosgzbridge\/humble.txt"],"gold_ids":["rosgzbridge\/humble_10.txt","rosgzbridge\/humble_9.txt"],"gold_answer":"$\\begingroup$\n\nI solved the issue. I thought I was working with Gazebo Fortress, but a\nsoftware I was working with installed Gazebo Garden instead.\n\nWhen I installed the ` ros-gz-bridge ` from the apt repository, it installed\nonly the supported package that is officially supported by ROS Humble, which\nis the Gazebo Fortress one.\n\nI installed the ros-gz-bridge from [ sources\n](https:\/\/github.com\/gazebosim\/ros_gz\/tree\/humble) and now the bridge is\nworking as expected."} {"query":"Compilation error when subscription callback's input is of certain type\n\nI did an experiment where I tried all combinations of const, &, and SharedPtr as the input to the subscription callback. The message type is nav_msgs::msg::Odometry and the results are at the bottom of the code snippet.\n\n#include \"rclcpp\/rclcpp.hpp\"\n#include \"nav_msgs\/msg\/odometry.hpp\"\n\nclass SubToSharedPtr : public rclcpp::Node\n{\npublic:\n SubToSharedPtr()\n : Node(\"sub_to_shared_ptr_node\")\n {\n odom_sub_ = this->create_subscription(\n \"odom\", rclcpp::SystemDefaultsQoS(),\n std::bind(&SubToSharedPtr::odomCb, this, std::placeholders::_1)\n );\n }\n\nprivate:\n rclcpp::Subscription::SharedPtr odom_sub_;\n\n void odomCb(const nav_msgs::msg::Odometry& msg)\n {\n\n }\n};\n\nint main(int argc, char** argv)\n{\n rclcpp::init(argc, argv);\n auto node = std::make_shared();\n rclcpp::spin(node);\n rclcpp::shutdown();\n return 0;\n}\n\n\/\/ const SharedPtr& - doesn't work\n\/\/ const SharedPtr - works\n\/\/ SharedPtr - works\n\/\/ SharedPtr& - doesn't work\n\/\/ const & - works\n\/\/ const - works\n\/\/ & - doesn't work\n\/\/ nothing - works\nIt seems like there is an important implication to this pattern (maybe something to do with ownership?). For example, all the ones with & doesn't work except for const & maybe because even though you are getting the actual variable (not a copy) you are promising not to change it, which is why it's acceptable.\n\nDoes anyone have an explanation for why this pattern exists?","reasoning":"This is related to the pass of the smart pointer as a function parameter. We need to check the correct way to implement it.","id":"29","excluded_ids":["N\/A"],"gold_ids_long":["Odometry\/gotw91solutionsmartp.txt"],"gold_ids":["Odometry\/gotw91solutionsmartp_15.txt"],"gold_answer":"$\\begingroup$\n\nYou are correct that the implication to the pattern does have to do with\nownership. I'll summarize here, but there is a much more thorough explanation\nof the guidelines in [ Herb Sutter's GoTW #91: Smart Pointer Parameters\n](https:\/\/herbsutter.com\/2013\/06\/05\/gotw-91-solution-smart-pointer-\nparameters\/)\n\nThe relevant section that the ROS 2 callbacks are enforcing are:\n\n> Guideline: Don\u2019t pass a smart pointer as a function parameter unless you\n> want to use or manipulate the smart pointer itself, such as to share or\n> transfer ownership.\n\n> Guideline: Prefer passing objects by value, *, or &, not by smart pointer.\n\nThe new set of signatures are trying to be much more explicit about ownership.\nWhile the ownership may not be important in a single-producer, single-consumer\nsituation, there are more complex applications. This is especially important\nin the case of _intraprocess communications_ where the messages are held in an\ninternal buffer and only distributed based on the signatures of the\nsubscriptions. For more information on the implications on _intraprocess\ncomms_ , consult the [ Intraprocess Communications Design Doc\n](https:\/\/design.ros2.org\/articles\/intraprocess_communications.html) . The\nmost relevant section is _Number of message copies_ , which has a table\ncomparing various signatures.\n\nGenerally the signatures should be thought of as follows:\n\n * ` const Msg & ` \\- immutable, no ownership \n * ` unique_ptr ` \\- mutable and takes ownership \n * ` shared_ptr ` \\- immutable, but allows subscription to share ownership (by copying into member) \n * ` const shared_ptr & ` \\- immutable, but allows subscription to share ownership (by copying into member) \n * ` shared_ptr ` \\- deprecated. It's potentially unsafe if multiple subscriptions take the same message. \n\nFinally, for a full enumeration of all of the available subscription types,\nit's best to consult the ` AnySubscriptionCallbackPossibleTypes ` structure in\n` rclcpp ` : [\nhttps:\/\/github.com\/ros2\/rclcpp\/blob\/rolling\/rclcpp\/include\/rclcpp\/any_subscription_callback.hpp#L57\n](https:\/\/github.com\/ros2\/rclcpp\/blob\/rolling\/rclcpp\/include\/rclcpp\/any_subscription_callback.hpp#L57)"} {"query":"Where can i find the code about move_group_interface.plan method?\n\n\nI'm studying moveit. A trajectory was created through a method called plan, but I couldn't find the process, so I asked a question. thank you","reasoning":"We can find move_group_interface file in moveit repo, and search functions related to motion plan construction.","id":"30","excluded_ids":["N\/A"],"gold_ids_long":["move_group_interface\/movegroupinterfacecp.txt"],"gold_ids":["move_group_interface\/movegroupinterfacecp_23.txt","move_group_interface\/movegroupinterfacecp_22.txt"],"gold_answer":"$\\begingroup$\n\nThis should be in the MoveIt GitHub repository. More specifically, you can\nfind it [ here ](https:\/\/github.com\/ros-\nplanning\/moveit2\/blob\/4c024bc49ef20369f01d363c5884556932bf86da\/moveit_ros\/planning_interface\/move_group_interface\/src\/move_group_interface.cpp#L636)\nin the ` move_group_interface.cpp ` file. In simple terms, this method\nprepares the action goal, sends the goal, and handles the result.\n\nThe function takes only a reference to the ` Plan ` object, and the process\ndoes not really tell you what is happening under the hood. For a deeper\nunderstanding of how the motion planning request is constructed, look into the\n` constructMotionPlanRequest ` function too. You can find it [ here\n](https:\/\/github.com\/ros-\nplanning\/moveit2\/blob\/4c024bc49ef20369f01d363c5884556932bf86da\/moveit_ros\/planning_interface\/move_group_interface\/src\/move_group_interface.cpp#L1012)\n."} {"query":"Are hardware components in ros2_control designed to include a ROS 2 node as a member?\n\nI need to transmit high-level status updates strings about my hardware to another node using a publisher. Recognizing that blocking calls are not welcome within the read\/write methods, I intend to employ a Node in conjunction with RealtimePublisher from the realtime_tools package. However, I'm uncertain whether it is possible to instantiate a node within the implementation of the SystemInterface.","reasoning":"We can find a system that integrates ros2_control and can command the robot and publish its state.","id":"31","excluded_ids":["N\/A"],"gold_ids_long":["realtime_control\/topicbasedros2contro.txt"],"gold_ids":["realtime_control\/topicbasedros2contro_44.txt","realtime_control\/topicbasedros2contro_42.txt"],"gold_answer":"$\\begingroup$\n\nIt is possible but not recommended if you need to satisfy real-time\nrequirements. See e.g. [ this package\n](https:\/\/github.com\/PickNikRobotics\/topic_based_ros2_control) (be aware, that\nwas written for simulation)."} {"query":"Oriented Bounding Box in RVIZ\n\nI want to visualize an OrientedBoundingBox from Open3D on RVIZ, I have seen the :\n\nRvizVisualTools::publishWireframeRectangle\nRVIZ Line Segments\npublishWireframeRectangle has two dimensions width, and height, while I still have length, and for RVIZ Line Segment I have to develop the function myself, I wonder if there is a ready to use function to publish RVIZ Marker for OrientedBoundingBox which is ready to use, can you please tell me if there is any? thanks in advance.","reasoning":"It is related to the extension of rviz visualization tools that focused on MoveIt-related debugging and visualization.","id":"32","excluded_ids":["N\/A"],"gold_ids_long":["bounding_box_rviz\/moveitvisualtools.txt"],"gold_ids":["bounding_box_rviz\/moveitvisualtools_7.txt","bounding_box_rviz\/moveitvisualtools_9.txt","bounding_box_rviz\/moveitvisualtools_10.txt","bounding_box_rviz\/moveitvisualtools_8.txt"],"gold_answer":"$\\begingroup$\n\nThe tool that builds on [ Rviz Visual Tools\n](https:\/\/github.com\/PickNikRobotics\/rviz_visual_tools) is [ Moveit Visual\nTools ](https:\/\/github.com\/ros-planning\/moveit_visual_tools) . MoveIt Visual\nTools is more high-level and focused on MoveIt-related debugging and\nvisualization. That being said, MVT extends RVT with inheritance, which makes\nall the functionality you need available in both.\n\n**Here are the available shapes from (Rviz Visual Tools):**\n\n[ ![enter image description here](https:\/\/i.sstatic.net\/REpVZ.png)\n](https:\/\/i.sstatic.net\/REpVZ.png)\n\nTo start, you can use the method ` RvizVisualTools::publishWireframeRectangle\n` and see if this satisfies what you need. If you want to customize the\nbounding box edge shapes, you can use the ` publishLine ` or ` publishCylinder\n` methods to draw edges. This is doable in the same way that `\npublishWireframeRectangle ` works, given the center and dimensions of the\nbounding box.\n\nTry to familiarize yourself first with publishing shapes and markers before\nbuilding your own. You need a Markers display in Rviz that visualizes shapes\npublished on a specific topic. You set the topic name when defining the `\nrviz_visual_tools::RvizVisualTools ` object.\n\nRegarding the orientation, you would do some basic trigonometry to determine\nthe starting and ending of edges. Start with implementing something simple,\nthen figure out the formula that robustly works for the orientation."} {"query":"turtlebot4 nav2: how to call action navigateToPose from node in cpp\n\nI am migrating a node that send goals to nav2 (originally move_base) thru an action since I need to know if it has been reached or cancelled by the planner.\n\nIt will work with the Turtlebot4. I've been reading the nav2 documentation and launching the nav2 launch of Turtlebot4 and I guess that I need to call the action \/navigate_to_pose of the node bt_navigator. However showing the interface, I see that the result is a std_msgs\/Empty.\n\nHow can I easily send goals to Turtlebot4 from a cpp node and know the status of the navigation (i.e. goal reached\/cancelled\/travelling)?","reasoning":"We can check whether there is avaialable attribute that can show the result succeeded or cancelled.","id":"33","excluded_ids":["N\/A"],"gold_ids_long":["turtle_bot4\/memberfunctionscpp.txt"],"gold_ids":["turtle_bot4\/memberfunctionscpp_0.txt","turtle_bot4\/memberfunctionscpp_2.txt"],"gold_answer":"$\\begingroup$\n\nI found this [ example\n](https:\/\/github.com\/ros2\/examples\/blob\/humble\/rclcpp\/actions\/minimal_action_client\/member_functions.cpp)\nand I realized that the class `\nrclcpp_action::ClientGoalHandle::WrappedResult ` already has the attribute\n` code ` (that can be either ` rclcpp_action::ResultCode::SUCCEEDED ` , `\nrclcpp_action::ResultCode::ABORTED ` or ` rclcpp_action::ResultCode::CANCELLED\n` ) so there is no need of putting this information in the action interface."} {"query":"iRobot Roomba compatible with ROS2 other than the Create?\n\nI plan to buy an iRobot to test ROS2, but the Create 3 not available in my country, import tax and shipping cost may very high, also sometime custom will reject the import. But many other model from iRobot available like 627, I7, J7 ..., So what model compatible with ROS? Or I should by the Create 3.","reasoning":"We can consider build our own robots. We need to find related content\/tutorials.","id":"34","excluded_ids":["N\/A"],"gold_ids_long":["makearobot\/mobilerobotfulllist.txt"],"gold_ids":["makearobot\/mobilerobotfulllist_0.txt"],"gold_answer":"$\\begingroup$\n\nThe iRobot models 627, i7, and j7 are consumer-grade robotic vacuum cleaners\nand are not natively compatible with ROS. Do not expect the same level of\nprogrammability or integration capabilities as the Create 3.\n\nThe Create series is designed for robotic development and is compatible with\nROS 2. Create 3 is actually the base for Turtlebot 4. My answer is that it\nshould be Create 3 or a custom robot you make.\n\nIf getting it is hard, and there are no alternatives in your region, why don't\nyou try making your own mobile robot? This will help you much more than just\ntrying ROS 2. This [ series ](https:\/\/articulatedrobotics.xyz\/mobile-robot-\nfull-list\/) is a good resource for that."} {"query":"Ros2 Dictionary srv\/msg type\n\nI would like to be able to return a dictionary as a Response in my interface, Is it possible to return a python dictionary or should I write code similar to this:\n\nuint8 action\n\n---\n\nitem1Class dict\n-- other msg types below ---\n\nwhere item1Class is a struct\n\nThis is probably not possible, essentially I want:\n\n observation = {\n \"lidar\": lidar_data,\n \"pose\": {\n \"positionX\": X,\n \"positionY\": Y,\n \"orientation\": yaw,\n },\n }\nas a srv message where lidar is float32[] and all pose variable are floats.\n\nWhats the best practice using Ros2 to achieve this. Or is this not what srv\/msg was intended for?","reasoning":"We may define a .srv file to contain these along these lines. We can find example files as reference.","id":"35","excluded_ids":["N\/A"],"gold_ids_long":["srvmsg\/LaserScanmsg.txt","srvmsg\/Posemsg.txt"],"gold_ids":["srvmsg\/Posemsg_0.txt","srvmsg\/LaserScanmsg_0.txt"],"gold_answer":"$\\begingroup$\n\nDictionaries are not a natively supported type. And we actually encourage\nthings to be strongly typed, where a dictionary is not because it can contain\napproximately arbitrary data. When you receive a ROS datatype it will be a\nfully defined datatype with it's own structure.\n\nThe best practice is to define a ` .srv ` file to contain these along these\nlines to cover your description above.\n\n \n \n uint8 action\n \n ---\n \n sensor_msgs\/LaserScan lidar_data\n geometry_msgs\/Pose pose\n \n \n\nMessages to consider:\n\n * [ LaserScan ](https:\/\/github.com\/ros2\/common_interfaces\/blob\/rolling\/sensor_msgs\/msg\/LaserScan.msg)\n * [ Pose ](https:\/\/github.com\/ros2\/common_interfaces\/blob\/rolling\/geometry_msgs\/msg\/Pose.msg)"} {"query":"How to send and receive CAN messages on Ubuntu 18.04 using ROS Melodic\n\nI am trying to use a PCAN-USB device (from Peak-System) to be able to send and receive CAN messages which I would like to use to control a robot using ROS at some point for work.From the research I have done, I have found out that there are different drivers and python libraries and different APIs to achieve what I am looking for. The problem is there is no guides or clear instructions on how to get started.\n\nI go to a page and then it tells me to look at something else and this keeps happening. I would like to use the PEAK-System API and drivers, installed both already but I don't know how to make it work with python but and I am not sure if what I have downloaded is even the right thing.\n\nEssentially what I am looking for is some guidance on how to check if the drivers and API is installed correctly and how to get a simple python script going, and then I'll have something to build on.\n\nI have tried to give as much detail as possible and not make the question too broad sorry if it's still not specific enough.\n\nThanks.","reasoning":"We need to find packages\/examples that can connect to a CAN bus, creat and send messages.","id":"36","excluded_ids":["N\/A"],"gold_ids_long":["can_message\/indexhtml.txt"],"gold_ids":["can_message\/indexhtml_4.txt","can_message\/indexhtml_5.txt"],"gold_answer":"$\\begingroup$\n\nYou can use [ python-can ](https:\/\/python-\ncan.readthedocs.io\/en\/stable\/index.html) . I find the documentation on [\nhttps:\/\/python-can.readthedocs.io\/en\/stable\/index.html ](https:\/\/python-\ncan.readthedocs.io\/en\/stable\/index.html) very well written, it should be easy\nto follow. \nI have used this library with ROS 2 without any problem. You can also use it\nin your ROS 1 package. Note that, drivers are already included in the linux\nkernel for PCAN.\n\nDon't forget to enable your existing can interface. See [ https:\/\/python-\ncan.readthedocs.io\/en\/stable\/interfaces\/socketcan.html ](https:\/\/python-\ncan.readthedocs.io\/en\/stable\/interfaces\/socketcan.html)\n\n \n \n sudo ip link set can0 up type can bitrate 250000\n \n\nHere is a sample python script to send a message;\n\n \n \n import can\n \n bus = can.interface.Bus(interface='socketcan', channel='can0')\n msg = can.Message(\n arbitration_id=0xC0FFEE,\n data=[0, 25, 0, 1, 3, 1, 4, 1],\n is_extended_id=True\n )\n bus.send(msg)\n \n \n\nFor receiving can messages, I recommend using the [ Notifier ](https:\/\/python-\ncan.readthedocs.io\/en\/stable\/listeners.html#notifier) object. It creates a\nthread to read messages from the bus and distributes them to listeners, i.e.,\nyour callback function to process incoming can messages."} {"query":"Nav2 - How to create a custom behavior tree (BT) plugin\/node in a separate ros2 package?\n\nI'm trying to create a my own custom bt plugin. In the official tutorial https:\/\/navigation.ros.org\/plugin_tutorials\/docs\/writing_new_bt_plugin.html, I can't see an instruction or an example on how to create a behavior tree plugin in a separate ros2 package just like in this nav2 repo tutorial https:\/\/github.com\/ros-planning\/navigation2_tutorials\/tree\/master where the custom plugins (custom costmap, behavior, controller and planner) are created in a separate package.\n\nSo I'm wondering, is it possible to create the bt plugin\/node in a separate package? or I need to install nav2 from source and try to create the bt plugin on the \/navigation2\/nav2_behavior_tree\/plugins folder?","reasoning":"We can check implementation examples about behavior tree nodes.","id":"37","excluded_ids":["N\/A"],"gold_ids_long":["custom_bt\/opennavcoveragebt.txt"],"gold_ids":["custom_bt\/opennavcoveragebt_1.txt"],"gold_answer":"$\\begingroup$\n\nYes, it is possible. There's nothing special about the ` nav2_behavior_tree `\npackage. Here's one such recent example: [ https:\/\/github.com\/open-\nnavigation\/opennav_coverage\/tree\/main\/opennav_coverage_bt\n](https:\/\/github.com\/open-\nnavigation\/opennav_coverage\/tree\/main\/opennav_coverage_bt)"} {"query":"How to use Gazebo Ignition NavSat plugin\n\nI'm trying to use the Navsat plugin but I can't get it working. I'm using ros-humble\n\nI've been following the link below, but I am unable to see any navsat topic in gazebo https:\/\/answers.gazebosim.org\/\/question\/28643\/gps-sensor-plugin-in-ignition\/\n\nIn my robot urdf, I have the following code\n\n \n ....\n \n \n \n 1<\/always_on>\n 1<\/update_rate>\n navsat<\/topic>\n <\/sensor>\n <\/gazebo>\n <\/link>\nOn my world sdf, I also included\n\n \n ...\n \n EARTH_WGS84<\/surface_model>\n ENU<\/world_frame_orientation>\n -22.986687<\/latitude_deg>\n -43.202501<\/longitude_deg>\n 0<\/elevation>\n 0<\/heading_deg>\n <\/spherical_coordinates>\n <\/world>","reasoning":"We need to check examples about how the tag gazebo and plugin are used.","id":"38","excluded_ids":["N\/A"],"gold_ids_long":["navsetplugin\/sphericalcoordinates.txt","navsetplugin\/tutorialstutsdformat.txt"],"gold_ids":["navsetplugin\/sphericalcoordinates_5.txt","navsetplugin\/sphericalcoordinates_2.txt","navsetplugin\/tutorialstutsdformat_3.txt","navsetplugin\/sphericalcoordinates_4.txt","navsetplugin\/sphericalcoordinates_1.txt","navsetplugin\/sphericalcoordinates_3.txt","navsetplugin\/tutorialstutsdformat_2.txt"],"gold_answer":"$\\begingroup$\n\n 1. The ` ` should be in the world SDF file (see [ example ](https:\/\/github.com\/gazebosim\/gz-sim\/blob\/ign-gazebo6\/examples\/worlds\/spherical_coordinates.sdf) ). \n 2. The ` ` tag should be directly under ` ` in a URDF file and should reference the link it's modifying. In your case, it should be ` ` . You can refer to [ this ](http:\/\/sdformat.org\/tutorials?tut=sdformat_urdf_extensions&cat=specification&) documentation for more details on the ` ` tag."} {"query":"Sensors in ROS2 without driver\n\nI got a new LiDAR from a seller who unfortunately does not provide any ROS2 support. Rather there is only a Point Cloud Visualiser .exe in Windows. I would like to use the LiDAR in my project of developing Autonomous Farming Vehicle but dont know how I can use this in ROS2 without any Package or Driver. Is it possible to use it somehow or develop a ROS2 supported package of the LiDAR??","reasoning":"We need to find the driver with ROS wrapper to make the sensor data available over ROS topics\/services.","id":"39","excluded_ids":["N\/A"],"gold_ids_long":["ros2_driver\/ros2ousterdrivers.txt"],"gold_ids":["ros2_driver\/ros2ousterdrivers_32.txt","ros2_driver\/ros2ousterdrivers_30.txt","ros2_driver\/ros2ousterdrivers_42.txt","ros2_driver\/ros2ousterdrivers_28.txt","ros2_driver\/ros2ousterdrivers_34.txt","ros2_driver\/ros2ousterdrivers_29.txt","ros2_driver\/ros2ousterdrivers_31.txt","ros2_driver\/ros2ousterdrivers_37.txt","ros2_driver\/ros2ousterdrivers_49.txt","ros2_driver\/ros2ousterdrivers_46.txt","ros2_driver\/ros2ousterdrivers_27.txt","ros2_driver\/ros2ousterdrivers_44.txt","ros2_driver\/ros2ousterdrivers_51.txt","ros2_driver\/ros2ousterdrivers_33.txt","ros2_driver\/ros2ousterdrivers_39.txt","ros2_driver\/ros2ousterdrivers_23.txt","ros2_driver\/ros2ousterdrivers_43.txt","ros2_driver\/ros2ousterdrivers_48.txt","ros2_driver\/ros2ousterdrivers_24.txt","ros2_driver\/ros2ousterdrivers_35.txt","ros2_driver\/ros2ousterdrivers_38.txt","ros2_driver\/ros2ousterdrivers_40.txt","ros2_driver\/ros2ousterdrivers_50.txt","ros2_driver\/ros2ousterdrivers_22.txt","ros2_driver\/ros2ousterdrivers_36.txt","ros2_driver\/ros2ousterdrivers_52.txt","ros2_driver\/ros2ousterdrivers_26.txt","ros2_driver\/ros2ousterdrivers_47.txt","ros2_driver\/ros2ousterdrivers_45.txt","ros2_driver\/ros2ousterdrivers_41.txt"],"gold_answer":"$\\begingroup$\n\nIf there is an API or a device protocol specification available, then it would\nbe possible to develop your own driver for the hardware. This is how all\nexisting drivers for ROS 2 have started.\n\nTypically, people write a library that is independent of ROS, and then provide\na ROS wrapper to make the sensor data available over ROS topics\/services.\n\nExample drivers that you may want to reference:\n\n * [ https:\/\/github.com\/ros-drivers\/velodyne\/tree\/humble-devel\/velodyne_driver ](https:\/\/github.com\/ros-drivers\/velodyne\/tree\/humble-devel\/velodyne_driver) \\- Velodyne LIDAR driver, the lidar connects over ethernet and the driver uses PCAP to receive packets and expand them into ` sensor_msgs\/LaserScan `\n * [ https:\/\/github.com\/ros-drivers\/ros2_ouster_drivers ](https:\/\/github.com\/ros-drivers\/ros2_ouster_drivers) \\- Ouster lidar drivers \n * [ https:\/\/github.com\/ros-drivers\/urg_node ](https:\/\/github.com\/ros-drivers\/urg_node) \\- Hokuyo lidar driver, wraps the official ` urg_c ` library \n\nIn the case that a manufacturer does not provide an API, then you will have to\nwrite the lower-level hardware driver yourself. An example of this in the\nabove list is the Velodyne driver, where the manufacturer provides a datasheet\ndescribing the packet format and the driver interprets the packets\naccordingly."} {"query":"Transform between odom and base_link not made. ros2_controller Ackermann Steering Controller\n\nI cannot set odom as a fixed frame inside RViz. It doesn't show up at all. My robot is fully functional and visible in both Gazebo. I don't get any warnings, errors or exceptions in the log. I'm using ROS2 Humble and Gazebo Fortress. I follow the code of the tricycle_drive_example from ign_ros2_control_demos (which publishes odom correctly if I run it on my laptop).\n\nAs intended by the controller, the topic \/ackermann_steering_cotroller\/odometry is published. Whenerver I try to visualize that topic with RViz, I get the following message:\n\n[INFO] [1704543459.237610775] [rviz]: Message Filter dropping message: frame 'odom' at time 214,560 for reason 'discarding message because the queue is full'\nRunning ros2 run tf2_ros tf2_echo odom base_link, gives this:\n\n[INFO] [1704543792.043830485] [tf2_echo]: Waiting for transform odom -> base_link: Invalid frame ID \"odom\" passed to canTransform argument target_frame - frame does not exist\nAlso, my tf_tree looks like this: enter image description here\n\nThe ros2_control tag inside my urdf:\n\n\n \n ign_ros2_control\/IgnitionSystem<\/plugin>\n <\/hardware>\n \n \n \n <\/joint>\n \n \n \n <\/joint>\n \n \n \n \n <\/joint>\n \n \n \n \n <\/joint>\n<\/ros2_control>\nThe configuration file for the controllers:\n\ncontroller_manager:\n ros__parameters:\n update_rate: 50\n\n joint_state_broadcaster:\n type: joint_state_broadcaster\/JointStateBroadcaster\n\n ackermann_steering_controller:\n type: ackermann_steering_controller\/AckermannSteeringController\n\njoint_state_broadcaster:\n ros__parameters:\n extra_joints: [\"RIGHT_FRONT_WHEEL_JOINT\", \"LEFT_FRONT_WHEEL_JOINT\"]\n\nackermann_steering_controller:\n ros__parameters:\n\n reference_timeout: 2.0\n front_steering: true\n open_loop: false\n velocity_rolling_window_size: 10\n use_stamped_vel: false\n rear_wheels_names: [RIGHT_REAR_WHEEL_JOINT, LEFT_REAR_WHEEL_JOINT]\n front_wheels_names: [RIGHT_HINGE_JOINT, LEFT_HINGE_JOINT]\n odom_frame_id: odom\n base_frame_id: base_link\n enable_odom_tf: true\n odom_only_twist: false\n\n wheelbase: 0.324\n front_wheel_track: 0.387\n rear_wheel_track: 0.387\n front_wheels_radius: 0.055\n rear_wheels_radius: 0.055\nIn addition, here is what's on the log:\n\n[ruby $(which ign) gazebo-2] [INFO] [1704582360.211746217] [controller_manager]: Loading controller 'ackermann_steering_controller'\n[ruby $(which ign) gazebo-2] [INFO] [1704582360.222413325] [controller_manager]: Setting use_sim_time=True for ackermann_steering_controller to match controller manager (see ros2_control#325 for details)\n[spawner-7] [INFO] [1704582360.288968173] [spawner_ackermann_steering_controller]: Loaded ackermann_steering_controller\n[ruby $(which ign) gazebo-2] [INFO] [1704582360.290052009] [controller_manager]: Configuring controller 'ackermann_steering_controller'\n[ruby $(which ign) gazebo-2] [INFO] [1704582360.290166991] [ackermann_steering_controller]: ackermann odom configure successful\n[ruby $(which ign) gazebo-2] [INFO] [1704582360.295780665] [ackermann_steering_controller]: configure successful\n[spawner-7] [INFO] [1704582360.569778822] [spawner_ackermann_steering_controller]: Configured and activated ackermann_steering_controller\n[INFO] [spawner-7]: process has finished cleanly [pid 51038]","reasoning":"We need to check the implementation of tricycle_controller and ackermann_steering_controller to see whether their configurations are compatible.","id":"40","excluded_ids":["N\/A"],"gold_ids_long":["ackermann\/userdochtml.txt","ackermann\/userdochtml1.txt"],"gold_ids":["ackermann\/userdochtml1_4.txt","ackermann\/userdochtml1_2.txt","ackermann\/userdochtml1_1.txt","ackermann\/userdochtml_1.txt","ackermann\/userdochtml1_3.txt"],"gold_answer":"$\\begingroup$\n\nBe aware that tricycle_controller has a totally different codebase then the\nackermann_steering_controller (which uses the same base as\nbicycle_steering_controller and tricycle_steering_controller, see [\nsteering_controller_library\n](https:\/\/control.ros.org\/master\/doc\/ros2_controllers\/steering_controllers_library\/doc\/userdoc.html)\n): You cannot use the configuration directly.\n\nDoes [ this note ](https:\/\/github.com\/ros-\ncontrols\/ros2_controllers\/issues\/937#issuecomment-1875040977) here maybe fix\nyour problem?"} {"query":"behaviortree-cpp not installing using apt\n\nI tried to install behaviortree using sudo apt install ros-noetic-behaviortree-cpp* and got the following error while the system installing it:\n\nPreparing to unpack ...\/ros-noetic-behaviortree-cpp-v3_3.8.5-1focal.20230814.151\n459_amd64.deb ...\nUnpacking ros-noetic-behaviortree-cpp-v3 (3.8.5-1focal.20230814.151459) ...\ndpkg: error processing archive \/var\/cache\/apt\/archives\/ros-noetic-behaviortree-c\npp-v3_3.8.5-1focal.20230814.151459_amd64.deb (--unpack):\n trying to overwrite '\/opt\/ros\/noetic\/bin\/bt3_log_cat', which is also in package\n ros-noetic-behaviortree-cpp 4.4.2-1focal.20231128.201059\ndpkg-deb: error: paste subprocess was killed by signal (Broken pipe)\nErrors were encountered while processing:\n \/var\/cache\/apt\/archives\/ros-noetic-behaviortree-cpp-v3_3.8.5-1focal.20230814.15\n1459_amd64.deb\nE: Sub-process \/usr\/bin\/dpkg returned an error code (1)\nI tried multiple ways to install it but was unsuccessful.","reasoning":"Internally, the dpkg command is called on the archived file path \/var\/cache\/apt\/archives\/ros-noetic-behaviortree-c pp-v3_3.8.5-1focal.20230814.151459_amd64.deb. It has an error because it's unable to overwrite \/opt\/ros\/noetic\/bin\/bt3_log_cat as you install the ros-noetic packages.\n\nIt seems that you have a conflicting existing package, i.e. ros-noetic-behaviortree-cpp, and that needs to be purged prior to installing the new packages. Based on your command to install all other packages, my best guess is that it's an older package, hence the conflict. We can purge\/remove the older package and reinstall it.","id":"41","excluded_ids":["N\/A"],"gold_ids_long":["noetic\/dpkg1html.txt"],"gold_ids":["noetic\/dpkg1html_9.txt","noetic\/dpkg1html_8.txt"],"gold_answer":"$\\begingroup$\n\nAcc'd to your output:\n\n \n \n dpkg: error processing archive \/var\/cache\/apt\/archives\/ros-noetic-behaviortree-c\n pp-v3_3.8.5-1focal.20230814.151459_amd64.deb (--unpack):\n trying to overwrite '\/opt\/ros\/noetic\/bin\/bt3_log_cat', which is also in package\n ros-noetic-behaviortree-cpp 4.4.2-1focal.20231128.201059\n \n\nInternally, the ` dpkg ` command is called on the archived file path `\n\/var\/cache\/apt\/archives\/ros-noetic-behaviortree-c\npp-v3_3.8.5-1focal.20230814.151459_amd64.deb ` . It has an error because it's\nunable to overwrite ` \/opt\/ros\/noetic\/bin\/bt3_log_cat ` as you install the\nros-noetic packages.\n\nIt seems that you have a conflicting existing package, i.e. ros-noetic-\nbehaviortree-cpp, and that needs to be purged prior to installing the new\npackages. Based on your command to install all other packages, my best guess\nis that it's an older package, hence the conflict.\n\nSee [ man dpkg\n](https:\/\/manpages.ubuntu.com\/manpages\/noble\/en\/man1\/dpkg.1.html)\n\nTry the following:\n\n \n \n # Remove the existing package, -P or --purge\n sudo dpkg -P ros-noetic-behaviortree-cpp\n \n\nAnother way to fix this (not recommend), is to simply force the overwrite when\ninstalling with ` dpkg ` .\n\n \n \n # Force overwrite\n sudo dpkg -i --force-overwrite \/var\/cache\/apt\/archives\/ros-noetic-behaviortree-c\n pp-v3_3.8.5-1focal.20230814.151459_amd64.deb\n \n\nIn either case, follow up with ` sudo apt -f install ` to fix broken pipes (as\nyour output mentions in the following line for ` dpkg-deb ` ). Then try\nrunning your command again.\n\n \n \n # Fix broken pipes\n sudo apt -f install\n \n # Your command\n sudo apt install ros-noetic-behaviortree-cpp*\n \n\nHope this helps."} {"query":"How to get started using the C++ API for Gazebo Harmonic?\n\nI'm completely new to gazebo and did some of the well explained tutorials to learn how the basic functionality of gazebo is working. So this is my setup:\n\nI'm using Windows 10 and installed gazebo with WSL2 on a Ubuntu distribution. From here I did some of the tutorials and was able to interact with the simulation with the gui and also via messages from the powershell (using wsl). So from the powershell I'm able to start the simulation and also can send and receive commands to move the robot or read out some sensor data.\n\nMy plan is, to use this functionality inside of a C++ or C# application without using the powershell. So I like to use the C++ API given by gazebo.\n\nMy idea is, to write some code in Visual Studio on my Windows machine and execute this code via cross compilation on my wsl2 instance, where my actual gazebo instance is running.\n\nMy key question is, how to integrate the gazebo library into Visual Studio and to be able to interact with my gazebo instance? For the beginning i would just start a scene \"my_world.sdf\" and read out some sensor data.\n\nCurrently I am struggeling with the integration into Visual Studio 2022.\n\nI would be really grateful for any advice given to this topic.","reasoning":"We need to find tutorials\/guidance to add ROS2 to vscode.","id":"42","excluded_ids":["N\/A"],"gold_ids_long":["vscode_gazebo\/vscodedockerros2.txt"],"gold_ids":["vscode_gazebo\/vscodedockerros2_25.txt","vscode_gazebo\/vscodedockerros2_18.txt","vscode_gazebo\/vscodedockerros2_26.txt","vscode_gazebo\/vscodedockerros2_10.txt","vscode_gazebo\/vscodedockerros2_19.txt","vscode_gazebo\/vscodedockerros2_6.txt","vscode_gazebo\/vscodedockerros2_8.txt","vscode_gazebo\/vscodedockerros2_4.txt","vscode_gazebo\/vscodedockerros2_17.txt","vscode_gazebo\/vscodedockerros2_5.txt","vscode_gazebo\/vscodedockerros2_23.txt","vscode_gazebo\/vscodedockerros2_22.txt","vscode_gazebo\/vscodedockerros2_20.txt","vscode_gazebo\/vscodedockerros2_27.txt","vscode_gazebo\/vscodedockerros2_21.txt","vscode_gazebo\/vscodedockerros2_24.txt"],"gold_answer":"$\\begingroup$\n\nGazebo Sim uses the ` gz-transport ` library as its communication layer, so if\nyou want to interact with a running simulation from a separate application,\nyou will need to use that library. See the tutorials [ here\n](https:\/\/github.com\/gazebosim\/gz-transport\/tree\/gz-transport13\/tutorials) and\n[ here ](https:\/\/gazebosim.org\/api\/transport\/13\/tutorials.html) .\n\nSimulation functionality in Gazebo Sim is provided by plugins (system plugins,\nsensor plugins, gui plugins, physics plugin, etc). Depending on your needs,\nyou can use the existing plugins, or you will have to write your own plugins.\nFor more info on plugins, see this [ previous RSE answer\n](https:\/\/robotics.stackexchange.com\/a\/103884\/35117) .\n\nI am not sure about Visual Studio; I use VSCode with ROS 2 per [ these\ninstructions ](https:\/\/www.allisonthackston.com\/articles\/vscode-docker-ros2)\nand apart from that I just had to add the include path to the Gazebo headers."} {"query":"Using standalone gazebo 11, and no gui will spawn\n\nI am trying to use gazebo through c++ (without calling from command line). I have a main.cpp file something like following\n\n#include \n#include \n#include \n\nint main(int _argc, char **_argv)\n{\n \/\/ Initialize gazebo.\n gazebo::setupServer(_argc, _argv);\n\n \/\/ Load a world\n gazebo::physics::WorldPtr world = gazebo::loadWorld(\"simple_world.world\");\n\n gazebo::physics::ModelPtr robot = world->ModelByName(\"robot\");\n\n while (true)\n {\n gazebo::runWorld(world, 1);\n }\n\n \/\/ Close everything.\n gazebo::shutdown();\n}\nHowever no gui will spawn by running this but the robot will move around if I set velocity to the robot. I can spawn gazebo gui if I use command line tools gazebo simple_world.world.\n\nDoes anyone know if I missed anything here? I would really appreciate any help here. Thank you","reasoning":"We can check the developer's main file and see what they did.","id":"43","excluded_ids":["N\/A"],"gold_ids_long":["spawn_gui\/gazebomaincc.txt"],"gold_ids":["spawn_gui\/gazebomaincc_6.txt","spawn_gui\/gazebomaincc_4.txt","spawn_gui\/gazebomaincc_3.txt","spawn_gui\/gazebomaincc_0.txt","spawn_gui\/gazebomaincc_5.txt","spawn_gui\/gazebomaincc_2.txt","spawn_gui\/gazebomaincc_1.txt"],"gold_answer":"$\\begingroup$\n\nThe gazebo-classic simulator is implemented using two applications which work\ntogether: gzserver and gzclient. The gui part is handled by gzclient.\n\nThe job of \/usr\/bin\/gazebo is to launch gzserver and gzclient. All of this\ncode is open source, so you can easily see what the developers did to perform\nthis task. IIRC, the src file is ` gazebo\/gazebo_main.cc ` .\n\n[ https:\/\/github.com\/gazebosim\/gazebo-classic\n](https:\/\/github.com\/gazebosim\/gazebo-classic)"} {"query":"Gazebo Garden: How to publish the transform of elements in a simulation\n\nI need the depth ground truth of a camera view in gazebo and decided to go with an rgbd camera which produces a pointcloud. In order to visualize this I need to somehow publish the transform of the rgbd camera. How can I publish such a transform in gazebo? I can transfer gazebo topics to ros topics with my setup but I don't know how to publish the transforms from the simulation in the first place. Any ideas?\n\nI am working with a gazebo garden setup where I use a gz-ros2 and ros2-ros1 bridge in order to work with ros as well (I know this is not a good setup and the endeavor is to only use ros2 at some point.)","reasoning":"We can check the PosePublisher for details.","id":"44","excluded_ids":["N\/A"],"gold_ids_long":["posepublish\/PosePublisherhh.txt"],"gold_ids":["posepublish\/PosePublisherhh_1.txt","posepublish\/PosePublisherhh_0.txt"],"gold_answer":"$\\begingroup$\n\nYou should be able to get the rgbd camera pose through the [ pose publisher\nplugin ](https:\/\/github.com\/gazebosim\/gz-\nsim\/blob\/8b40b546e050ad1e8a3e08897e8146a4869d6d3e\/src\/systems\/pose_publisher\/PosePublisher.hh#L35)\n.\n\nSee also the [ pose_publisher.sdf ](https:\/\/github.com\/gazebosim\/gz-\nsim\/blob\/gz-sim8\/examples\/worlds\/pose_publisher.sdf) demo world."} {"query":"How to use Planner Selector in the Nav2 BT's xml file\n\nI want to use the PlannerSelector action in Nav2 in order to use multiple planners and choose which one to use in the runtime. I modified the default behavior tree xml a little bit in order to do this, and I added a PlannerSelector BT node in my xml file as you can see in the xml file below.\n\nThe main issue is that the robot always uses the default planner. I tried to change the planner by publishing the string message \"GridBased1\" in the topic \/planner_selector (ros2 topic pub \/planner_selector std_msgs\/msg\/String \"data: GridBased1\") but the robot was still using the default planner. If I change the default planner before starting the robot and execute the process again then the planner normally changes.\n\nTo sum up, it seems that the different planners work normally when assigning them as default_planner in the PlannerSelector but the system always uses the default planner and it cannot be changed by publishing in the \/planner_selector topic.\n\nBelow you can see the parameters related to planner_server:\n\nplanner_server:\n ros__parameters:\n expected_planner_frequency: 20.0\n use_sim_time: True\n planner_plugins: [\"GridBased\", \"GridBased1\"]\n GridBased: \n plugin: \"nav2_navfn_planner\/NavfnPlanner\"\n tolerance: 0.5\n use_astar: false\n allow_unknown: true \n GridBased1:\n plugin: \"nav2_straightline_planner\/StraightLine\"\n interpolation_resolution: 0.1\nBelow you can see the BT's xml file that I use:\n\n\n \n \n \n \n \n \n \n \n \n \n \n <\/ReactiveFallback>\n <\/RecoveryNode>\n <\/PipelineSequence>\n <\/RateController>\n \n \n \n \n \n <\/ReactiveFallback>\n <\/RecoveryNode>\n <\/PipelineSequence>\n \n \n \n \n \n \n <\/Sequence>\n \n \n \n <\/RoundRobin>\n <\/ReactiveFallback>\n <\/RecoveryNode>\nI am using:\n\nturtlebot3 package for the simulation with the default launchers for the gazebo and navigation packages\nROS2 galactic\nUbuntu 20.04\nIf you have any workable BT xml file with a PlannerSelector feel free to share. It's not necessary to correct my specific implementation. I generally try to figure out how the PlannerSelector node is used inside the behavior tree.\n\nThanks\n\n","reasoning":"The issue may lie in the incorrect use of QoS so that the message isn't being received due to incompatibility in the middleware. We may check an example and make some tests.","id":"45","excluded_ids":["N\/A"],"gold_ids_long":["planner_selector\/plannerselectornodec.txt"],"gold_ids":["planner_selector\/plannerselectornodec_1.txt","planner_selector\/plannerselectornodec_0.txt"],"gold_answer":"$\\begingroup$\n\nI believe your issue is not using the right QoS [1] so that the message isn't\nbeing received due to incompatibility in the middleware. You can mess with the\nQoS on the commandline, but you may be better served testing with a Python3\nscript to make your life easier.\n\n[1] [ https:\/\/github.com\/ros-\nplanning\/navigation2\/blob\/7872bfae096ac548a4af72c12a72c025648050fa\/nav2_behavior_tree\/plugins\/action\/planner_selector_node.cpp#L44\n](https:\/\/github.com\/ros-\nplanning\/navigation2\/blob\/7872bfae096ac548a4af72c12a72c025648050fa\/nav2_behavior_tree\/plugins\/action\/planner_selector_node.cpp#L44)"} {"query":"How to access URDF info inside a transmission interface?\n\nI'm trying to write a custom transmission interface for ros2 control for the robotiq 3f, and I need access to the joint limits defined by the urdf, but the Joint handle does seem to contain that info, and I can't see any way to access the URDF. Any suggestions or good workarounds?","reasoning":"We can check whether urdf information is exposed or stored in some component.","id":"46","excluded_ids":["N\/A"],"gold_ids_long":["access_urdf\/709.txt"],"gold_ids":["access_urdf\/709_3.txt"],"gold_answer":"$\\begingroup$\n\n_I already had the same problem as you are describing: But this is not yet\npossible directly from ros2_control side. I'll bring that up on the roadmap\nfor the next LTS version Jazzy. (We recently added this for controllers in the\nrolling version.) In the meantime, the only workaround is to add a node to\nyour hardware_component and parse the URDF from a parameter or add a\nsubscriber to the \/robot_description topic._\n\nEdit: I was wrong, this should be possible already since [ this PR\n](https:\/\/github.com\/ros-controls\/ros2_control\/pull\/709\/files) : The full URDF\nis inside ` hardware_info.original_xml ` ."} {"query":"Implementing a prismatic joint within a joint trajectory controller\n\nI'm wondering if someone has some ideas about how to make a prismatic axis work with ros2 controllers.\n\nI am using a UR10e which is mountd on an igus drylin ZLW 7th Axis controlled by Dryve D1. I have an API for it to communicate with the Axis to initialize, run and control it. It has an encoder so after homing I can extrapolate the exact position, velocity and other info.\n\nI send the move command using the function xAxis.profilePositionAbs_Async(pos, setvel, acc, dec);\n\nI have written a hardware interface with the following functions:\n\nstd::vector\nRRBotSystemPositionOnlyHardware::export_state_interfaces()\n{\n std::vector state_interfaces;\n\n state_interfaces.emplace_back(hardware_interface::StateInterface(\n axisName, hardware_interface::HW_IF_POSITION, &pos));\n\n\n return state_interfaces;\n}\n\nstd::vector\nRRBotSystemPositionOnlyHardware::export_command_interfaces()\n{\n std::vector command_interfaces;\n command_interfaces.emplace_back(hardware_interface::CommandInterface(\n axisName, hardware_interface::HW_IF_POSITION, &pos));\n\n return command_interfaces;\n}\n\nhardware_interface::CallbackReturn RRBotSystemPositionOnlyHardware::on_deactivate(\n const rclcpp_lifecycle::State & \/*previous_state*\/)\n{\n xAxis.waitForReady();\n xAxis.setShutdown();\n\n \/\/ Gracefully close everything down\n \n close(xAxis.sock);\n return hardware_interface::CallbackReturn::SUCCESS;\n}\n\nhardware_interface::return_type RRBotSystemPositionOnlyHardware::read(\n const rclcpp::Time & \/*time*\/, const rclcpp::Duration & \/*period*\/)\n{\n\n pos=xAxis.getCurrentPosInMM()\/1000;\n std::cout << \"position in meters\" << pos << std::endl;\n\n return hardware_interface::return_type::OK;\n}\n\nhardware_interface::return_type RRBotSystemPositionOnlyHardware::write(\n const rclcpp::Time & \/*time*\/, const rclcpp::Duration & \/*period*\/)\n{\n\n xAxis.profilePositionAbs_Async(pos*1000, setvel, acc, dec);\n\n return hardware_interface::return_type::OK;\n}\nNow the problem is, as the profilePositionAbs_Async function is within the write function it gets called every loop, meaning the movement gets rerun continuously leading to a continuous accel- and deceleration.\n\nAlso I seem to get issues due to the position parameter being used in both the state and command interface.\n\nSo i was wondering, what is the best way to incorporate such an axis in a joint trajectory controller and handle the state\/command interference\n\nEDIT: in order to elaborate on @ChristophFroehlich's reply i have added the description of the possible functions to interact with the driver:\n\n void profilePositionAbs(float position, float velo, float accel, float decel=0); \/\/ Function \"Profile Position Mode\"; Move to an absolute position with given velocity, acceleration and deceleration\n void profilePositionRel(float position, float velo, float accel, float decel=0); \/\/ Function \"Profile Position Mode\"; Move to an relative position with given velocity, acceleration and deceleration\n void profileVelocity(float velo, float accel, float decel=0); \/\/ Function \"Profile Position Mode\"; Move with a set target velocity, acceleration and deceleration; Movement starts directly when the target velocity is not 0```","reasoning":"We can use the velocity interface of your drive, and use the joint_trajectory_controller with position control and velocity command interface.","id":"47","excluded_ids":["N\/A"],"gold_ids_long":["prismatic_join\/userdochtml.txt"],"gold_ids":["prismatic_join\/userdochtml_1.txt","prismatic_join\/userdochtml_4.txt","prismatic_join\/userdochtml_3.txt","prismatic_join\/userdochtml_2.txt"],"gold_answer":"$\\begingroup$\n\nWithout knowing details of the underlying implementation of your drive, I can\nonly guess:\n\n * If the drive takes new position commands without stopping the old target, you can use position command and regularily send a new setpoint, sampled by JTC. Then the drive might have safe software-end stops implemented etc. \n * use the velocity interface of your drive, and use the joint_trajectory_controller with position control and velocity command interface. Unclear if end-stops work then? \n\nIf you use the latter one: (More information [ in the docs\n](https:\/\/control.ros.org\/humble\/doc\/ros2_controllers\/joint_trajectory_controller\/doc\/userdoc.html)\n)\n\n \n \n command_interfaces:\n - velocity\n \n state_interfaces:\n - position\n - velocity\n \n\nIn the write method of the hardware component, you send the velocity to the\nhardware coming from the command interfaces. In the read method you get the\ndata from your encoders, calculate the velocity from the signal, and update\nthe state interfaces."} {"query":"Issues with Sending ROS2 Action from roslib.js to rosbridge_suite: Unable to Import Message Classes\n\nI'm encountering difficulties sending a ROS2 action from roslib.js to rosbridge_suite. The action is supposed to be handled by rosbridge_suite, but I'm encountering issues related to the import of message classes, such as \"Unable to import msg class FollowJointTrajectoryGoal from package control_msgs.\"\n\nMy setup:\n\nUbuntu 22.04.2 LTS (Jammy) running on Windows 11 wsl\nROS2 @ rolling distribution\nroslib.js @ ros2 branch ( commit 6a63a03 )\nrosbridge_suite @ ros2-actions branch ( commit 692f41a )\nROS_PYTHON_VERSION=3\nThis is the example action I'm trying to send from roslib.js to rosbridge:\n\nros2 action send_goal \/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory control_msgs\/action\/FollowJointTrajectory \"{\n trajectory: {\n joint_names: [shoulder_pan_joint, shoulder_lift_joint, elbow_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint],\n points: [\n { positions: [3.02, -1.63, -1.88, 1.01, 1.51, 1.13], time_from_start: { sec: 5, nanosec: 500 } },\n { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, -1.63], time_from_start: { sec: 6, nanosec: 500 } },\n { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, 6.2], time_from_start: { sec: 50, nanosec: 500 } }\n ]\n },\n goal_tolerance: [\n { name: shoulder_pan_joint, position: 0.01 },\n { name: shoulder_lift_joint, position: 0.01 },\n { name: elbow_joint, position: 0.01 },\n { name: wrist_1_joint, position: 0.01 },\n { name: wrist_2_joint, position: 0.01 },\n { name: wrist_3_joint, position: 0.01 }\n ]\n}\"\nI use the latest roslib.js build from ros2-actions branch and I built and ran rosbridge_websocket (ros2 branch) with the following terminal commands. I could only find ROS1 rosbridge building steps. I modified the steps after some research.\n\nsource \/opt\/ros\/rolling\/setup.bash\nmkdir ~\/ws\nmkdir ~\/ws\/src\ncd ~\/ws\/src\ngit clone https:\/\/github.com\/RobotWebTools\/rosbridge_suite.git -b ros2\ncd ~\/ws\nsudo apt install python3-colcon-common-extensions\ncolcon build --symlink-install\ncolcon test\nsource install\/setup.bash\nros2 run rosbridge_server rosbridge_websocket\nHere's my javascript code for sending the action using roslib.js:\n\n\/* eslint-disable no-undef *\/\n\nimport \".\/roslib.js\"; \/\/ https:\/\/github.com\/RobotWebTools\/roslibjs\/blob\/ros2-actions\/build\/roslib.js\n\nclass RosController {\n constructor() {\n this.ros = new ROSLIB.Ros({\n url: \"ws:\/\/localhost:9090\",\n });\n\n this.ros.on('error', (error) => {\n console.error('Error connecting to ROS:', error);\n });\n\n \/\/ Create an action client\n this.actionClient = new ROSLIB.ActionClient({\n ros: this.ros,\n serverName: '\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory',\n actionName: 'control_msgs\/action\/FollowJointTrajectory'\n });\n\n \/\/ Create a goal\n this.goal = new ROSLIB.Goal({\n actionClient: this.actionClient,\n goalMessage: {\n trajectory: {\n joint_names: ['shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'],\n points: [\n { positions: [3.02, -1.63, -1.88, 1.01, 1.51, 1.13], time_from_start: { sec: 5, nanosec: 500 } },\n { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, -1.63], time_from_start: { sec: 6, nanosec: 500 } },\n { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, 6.2], time_from_start: { sec: 50, nanosec: 500 } }\n ]\n },\n goal_tolerance: [\n { name: 'shoulder_pan_joint', position: 0.01 },\n { name: 'shoulder_lift_joint', position: 0.01 },\n { name: 'elbow_joint', position: 0.01 },\n { name: 'wrist_1_joint', position: 0.01 },\n { name: 'wrist_2_joint', position: 0.01 },\n { name: 'wrist_3_joint', position: 0.01 }\n ]\n }\n });\n\n \/\/ Check the status of the goal\n this.goal.on('status', (status) => {\n console.log('Goal status: ' + status.status);\n if (status.status === 5) { \/\/ 5 is the status code for REJECTED\n console.error('Goal was rejected');\n }\n });\n\n this.ros.on('error', (error) => {\n console.error('Error connecting to ROS:', error);\n });\n\n this.ros.on('connection', () => {\n console.log('Connected to websocket server.');\n \/\/ ROS is connected, now you can send the goal\n this.moveUR5eRobot();\n });\n\n this.ros.on('close', function () {\n console.log('Connection to websocket server closed.');\n });\n\n \/\/ Optional: Listen for result or feedback\n this.goal.on('result', (result) => {\n console.log('Action completed successfully:', result);\n });\n\n this.goal.on('feedback', (feedback) => {\n console.log('Received feedback:', feedback);\n });\n\n \/\/ Optional: Handle errors\n this.goal.on('timeout', () => {\n console.error('Action did not complete before timeout');\n });\n }\n\n getRos() {\n return this.ros;\n }\n\n \/*\n https:\/\/docs.ros.org\/en\/iron\/Tutorials\/Advanced\/Simulators\/Webots\/Installation-Windows.html#launch-the-webots-ros2-universal-robot-example\n https:\/\/index.ros.org\/p\/webots_ros2_universal_robot\/#humble-overview\n https:\/\/github.com\/cyberbotics\/webots_ros2\/wiki\/Example-Universal-Robots\n *\/\n moveUR5eRobot() {\n console.log(\"moveUR5eRobot\");\n \/\/ Send the goal\n this.goal.send();\n }\n \n}\n\nexport { RosController };\nThe rosbridge_suite prints errors indicating problems with importing message classes. I've tried both the rolling and iron distributions, and the issue persists. Am I missing something in my setup, or could the problem be in rosbridge or roslib.js?\n\ntapani@Desktop:~\/ws$ ros2 run rosbridge_server rosbridge_websocket\nregistered capabilities (classes):\n - \n - \n - \n - \n - \n - \n - \n - \n - \n - \n - \n - \n - \n[INFO] [1702467864.667909416] [rosbridge_websocket]: Rosbridge WebSocket server started on port 9090\n[INFO] [1702467884.421195988] [rosbridge_websocket]: Calling services in existing thread\n[INFO] [1702467884.421448867] [rosbridge_websocket]: Sending action goals in existing thread\n[INFO] [1702467884.421979997] [rosbridge_websocket]: Client connected. 1 clients total.\n[ERROR] [1702467885.354114994] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] [id: advertise:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/goal:1] advertise: Unable to import msg class FollowJointTrajectoryGoal from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryGoal'\n[INFO] [1702467885.359658954] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] Subscribed to \/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/status\n[ERROR] [1702467885.359900905] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] [id: subscribe:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/feedback:4] subscribe: Unable to import msg class FollowJointTrajectoryFeedback from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryFeedback'\n[ERROR] [1702467885.360110707] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] [id: subscribe:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/result:5] subscribe: Unable to import msg class FollowJointTrajectoryResult from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryResult'\n[ERROR] [1702467885.360289265] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] [id: publish:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/goal:7] publish: Cannot infer topic type for topic \/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/goal as it is not yet advertised\n[ERROR] [1702467885.360480628] [rosbridge_websocket]: [Client 27351158-07e8-47e7-9dba-7d897476db2e] [id: subscribe:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/result:6] subscribe: Unable to import msg class FollowJointTrajectoryResult from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryResult'\n[INFO] [1702467885.491837270] [rosbridge_websocket]: Calling services in existing thread\n[INFO] [1702467885.492038974] [rosbridge_websocket]: Sending action goals in existing thread\n[INFO] [1702467885.492506295] [rosbridge_websocket]: Client connected. 2 clients total.\n[ERROR] [1702467886.352260753] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: advertise:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/goal:1] advertise: Unable to import msg class FollowJointTrajectoryGoal from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryGoal'\n[INFO] [1702467886.397142045] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] Subscribed to \/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/status\n[ERROR] [1702467886.397518737] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: subscribe:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/feedback:4] subscribe: Unable to import msg class FollowJointTrajectoryFeedback from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryFeedback'\n[ERROR] [1702467886.398005589] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: subscribe:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/result:5] subscribe: Unable to import msg class FollowJointTrajectoryResult from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryResult'\n[ERROR] [1702467886.398194954] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: publish:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/goal:7] publish: Cannot infer topic type for topic \/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/goal as it is not yet advertised\n[ERROR] [1702467886.398401323] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: subscribe:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/result:6] subscribe: Unable to import msg class FollowJointTrajectoryResult from package control_msgs. Caused by module 'control_msgs.msg' has no attribute 'FollowJointTrajectoryResult'\n[ERROR] [1702467887.947030067] [rosbridge_websocket]: [Client 01c40dd7-4ffc-4c64-abb8-bd477e5c49a0] [id: publish:\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/goal:8] publish: Cannot infer topic type for topic \/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory\/goal as it is not yet advertised\nRelated roslib.js github issue: https:\/\/github.com\/RobotWebTools\/roslibjs\/issues\/646","reasoning":"The solution was to use ROS2 roslib.js classes for action client and action goal","id":"48","excluded_ids":["N\/A"],"gold_ids_long":["roslib_message\/ros2actionclienthtml.txt"],"gold_ids":["roslib_message\/ros2actionclienthtml_0.txt","roslib_message\/ros2actionclienthtml_1.txt"],"gold_answer":"$\\begingroup$\n\nThe solution was to use ROS2 roslib.js classes for action client and action\ngoal: [\nhttps:\/\/github.com\/RobotWebTools\/roslibjs\/issues\/646#issuecomment-1855739957\n](https:\/\/github.com\/RobotWebTools\/roslibjs\/issues\/646#issuecomment-1855739957)\n\nFixed to use ROS2 classes:\n\n \n \n \/\/ Create an action client.\n this.actionClient = new ROSLIB.Action({\n ros: this.ros,\n name: '\/ur5e\/ur_joint_trajectory_controller\/follow_joint_trajectory',\n actionType: 'control_msgs\/FollowJointTrajectory'\n });\n \n \/\/ Create a goal\n this.goal = new ROSLIB.ActionGoal({\n trajectory: {\n joint_names: ['shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'],\n points: [\n { positions: [3.02, -1.63, -1.88, 1.01, 1.51, 1.13], time_from_start: { sec: 5, nanosec: 500 } },\n { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, -1.63], time_from_start: { sec: 6, nanosec: 500 } },\n { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, 6.2], time_from_start: { sec: 50, nanosec: 500 } }\n ]\n },\n goal_tolerance: [\n { name: 'shoulder_pan_joint', position: 0.01 },\n { name: 'shoulder_lift_joint', position: 0.01 },\n { name: 'elbow_joint', position: 0.01 },\n { name: 'wrist_1_joint', position: 0.01 },\n { name: 'wrist_2_joint', position: 0.01 },\n { name: 'wrist_3_joint', position: 0.01 }\n ]\n });\n \n \/\/ Send the goal , following the example from https:\/\/github.com\/RobotWebTools\/roslibjs\/blob\/ros2-actions\/examples\/ros2_action_client.html\n var goal_id = this.actionClient.sendGoal(this.goal,\n (result) => {\n console.log('Result for action goal on ' + this.actionClient.name + ': ' + result.result.sequence);\n },\n (feedback) => {\n console.log('Feedback for action on ' + this.actionClient.name + ': ' + feedback.partial_sequence);\n },\n );"} {"query":"ROS2: Adding parameters to YAML launch file\n\nHow do I use a YAML launch file to pass parameters to a node? The tutorial covers passing parameters using a python launch file but not YAML.","reasoning":"We can check the sample yaml file about how to launch file using yaml parameters.","id":"49","excluded_ids":["N\/A"],"gold_ids_long":["ros_yaml\/yamlparampassinglaun.txt"],"gold_ids":["ros_yaml\/yamlparampassinglaun_0.txt"],"gold_answer":"$\\begingroup$\n\nI made a working example [ here\n](https:\/\/github.com\/danzimmerman\/dz_launch_examples\/blob\/rolling\/launch\/yaml_param_passing.launch.yaml)\n.\n\nIn ` dz_launch_examples\/launch\/yaml_param_passing.launch.yaml ` I have launch\nfile contents:\n\n \n \n launch:\n - node:\n pkg: \"turtlesim\"\n exec: \"turtlesim_node\"\n name: \"sim\"\n namespace: \"turtlesim_dz\"\n param:\n -\n from: $(find-pkg-share dz_launch_examples)\/config\/turtlesim_custom_params.yaml\n \n\nand I have a parameter file `\ndz_launch_examples\/config\/turtlesim_custom_params.yaml ` with the contents:\n\n \n \n \/turtlesim_dz\/sim:\n ros__parameters:\n background_b: 0\n background_g: 204\n background_r: 255\n use_sim_time: false\n \n\nThis runs a turtlesim node with an orange background color.\n\nI've found that the [ migration guide from ROS 1 to ROS 2\n](https:\/\/docs.ros.org\/en\/rolling\/How-To-Guides\/Migrating-from-ROS1\/Migrating-\nLaunch-Files.html) can be helpful in discovering how to do things in ROS 2\nlaunch.\n\nIn working out some of the launch examples [ here\n](https:\/\/github.com\/danzimmerman\/dz_launch_examples\/) , I've observed that\nYAML syntax closely mirrors XML examples, even if that results in (in my\nopinion) a non-obvious syntax for the YAML.\n\nIn XML, passing parameters from file in ROS 2 is described [ here\n](https:\/\/docs.ros.org\/en\/rolling\/How-To-Guides\/Migrating-from-ROS1\/Migrating-\nLaunch-Files.html#rosparam) . It uses the ` from ` attribute in a ` `\ntag:\n\n \n \n \n \n <\/node>\n \n\nIn YAML this becomes:\n\n \n \n - node:\n pkg: \"my_package\"\n exec: \"my_executable\"\n name: \"my_node\"\n namespace: \"\/an_absolute_ns\"\n param:\n -\n from: \"\/path\/to\/file\""} {"query":"URDF surface tags are not propagated to gazebo\n\nI am struggling to set friction to my model in gazebo. Issue is it is frictionless. It is walking in place and cannot move. I set my tags according to this document SDFormat but they are not visible in link inspection in Gazebo. Looks like surface tag is not propagated at all. I got gazebo 11.10.2 .","reasoning":"We need to check the tag\/element for gazebo, link and robot.","id":"50","excluded_ids":["N\/A"],"gold_ids_long":["gazebo_tag\/tutorialstutrosurdfc.txt"],"gold_ids":["gazebo_tag\/tutorialstutrosurdfc_2.txt","gazebo_tag\/tutorialstutrosurdfc_3.txt","gazebo_tag\/tutorialstutrosurdfc_10.txt","gazebo_tag\/tutorialstutrosurdfc_11.txt","gazebo_tag\/tutorialstutrosurdfc_5.txt","gazebo_tag\/tutorialstutrosurdfc_0.txt","gazebo_tag\/tutorialstutrosurdfc_1.txt","gazebo_tag\/tutorialstutrosurdfc_7.txt","gazebo_tag\/tutorialstutrosurdfc_6.txt","gazebo_tag\/tutorialstutrosurdfc_4.txt","gazebo_tag\/tutorialstutrosurdfc_9.txt","gazebo_tag\/tutorialstutrosurdfc_8.txt"],"gold_answer":"$\\begingroup$\n\nI figured it out. You need to insert all tags inside < gazebo\nreference=\"link_name\"> tag under < robot> tag and not under < link> tag. Here\nis document [ GazeboURDF\n](http:\/\/classic.gazebosim.org\/tutorials?tut=ros_urdf&cat=connect_ros#%3Ccollision%3Eand%3Cvisual%3Eelements)\n. Like this works for me:\n\n \n \n \n \n 0.01<\/minDepth>\n Gazebo\/Orange<\/material>\n 0.23<\/mu2>\n <\/gazebo>\n \n (other tags ...)\n <\/link>\n <\/robot>"} {"query":"Create message which is array of submessages?\n\nLet's say I created a custom message in ROS2. How would I create a second meta message consisting of an array of those messages?\n\nThe documentation tutorial is very poor on creating anything but trivial messages.","reasoning":"To figure out how to implement, we can check the available message types.","id":"51","excluded_ids":["N\/A"],"gold_ids_long":["message_type\/indexmsghtml.txt"],"gold_ids":["message_type\/indexmsghtml_0.txt"],"gold_answer":"$\\begingroup$\n\nTypically messages contain a timestamp and a reference frame. If one needs an\narray of data, that array is typically created inside the custom message. If\none is looking to use a custom message type for multiple sensors or actuators,\nthe ROS convention is to publish each sensor or actuator separately rather\nthan aggregating them into a single publisher.\n\nThere examples of building messages consisting of other message types in the `\ngeometry_msgs ` library: [\nhttps:\/\/docs.ros.org\/en\/noetic\/api\/geometry_msgs\/html\/index-msg.html\n](https:\/\/docs.ros.org\/en\/noetic\/api\/geometry_msgs\/html\/index-msg.html) . In\nparticular \"Polygon\", \"PolygonStamped\", and \"PoseWithCovariance\" might be good\nexamples."} {"query":"How can i show on my browser what i see on Rviz?\n\nIm on ROS2-Humble and i want to see my robot's location and movement on the map, the way i see it on Rviz, on my browser. For example, I want from Rviz to get the Grid, RobotModel, TF, and Map, send it on my browser and show it there, kinda like streaming it or rendering it via a .js file and .html. Im new with ROS2 and i cant seem to find any sources to help me. Most of the things i find are for ROS1 and Chat GPT doesnt help at all. Basically something like this: https:\/\/answers.ros.org\/question\/319626\/real-time-map-generate-on-web-like-a-rviz\/\n\nAny tips\/help would be greatly appreciated, thanks in advance!","reasoning":"An alternative is to use rosbridge, which provides a JSON API to ROS functionality for non-ROS programs.","id":"52","excluded_ids":["N\/A"],"gold_ids_long":["rviz_browser\/rosbridgesuite.txt"],"gold_ids":["rviz_browser\/rosbridgesuite_9.txt"],"gold_answer":"$\\begingroup$\n\nI assume it is not your intention to use third party tools but these worth\ngiving a try:\n\n * [ Foxglove ](https:\/\/foxglove.dev\/ros)\n * [ webviz ](https:\/\/webviz.io\/)\n\nIf you don't want to deal with these, then by using **rosbridge_suite** you\ncan do so: [ rosbridge_suite wiki ](https:\/\/wiki.ros.org\/rosbridge_suite)"} {"query":"Simple takeoff then do yaw rotation\n\nArming and takeoff work fine but i don't know how to do yaw rotation:\n\nclass controller:\n def __init__(self):\n \n rospy.Subscriber('mavros\/state', State, self.state_cb)\n \n self.state = State()\n\n\n def state_cb(self, msg):\n self.state = msg\n \n def move(self,x,y,z):\n pub_posisi = rospy.Publisher(\"\/mavros\/setpoint_velocity\/cmd_vel\",TwistStamped,queue_size=1)\n pub_data = TwistStamped()\n\n pub_data.twist.linear.x = x\n pub_data.twist.linear.y = y\n pub_data.twist.linear.z = z\n\n pub_posisi.publish(pub_data)\n\n time.sleep(5)\n \n def position(self,x,y,z):\n pub_posisi = rospy.Publisher(\"\/mavros\/setpoint_position\/local\",PoseStamped,queue_size=10)\n posisi = PoseStamped()\n \n posisi.pose.position.x = x\n posisi.pose.position.y = y\n posisi.pose.position.z = z\n\n q = quaternion_from_euler(0.0,0.0,3.0)\n \n posisi.pose.orientation.x = q[0]\n posisi.pose.orientation.y = q[1]\n posisi.pose.orientation.z = q[2]\n posisi.pose.orientation.w = q[3] \n\n pub_posisi.publish(posisi)\n\n rospy.loginfo(f\"go to point {x,y,z}\")\n\n time.sleep(15)","reasoning":"To do this with the existing functions we can modify the position function to take a yaw value. For example, quaternion_from_euler(ai, aj, ak, axes='sxyz') takes a yaw value in radians for the ak parameter.","id":"53","excluded_ids":["N\/A"],"gold_ids_long":["takeoff_rotation\/transformationshtml.txt"],"gold_ids":["takeoff_rotation\/transformationshtml_7.txt","takeoff_rotation\/transformationshtml_11.txt"],"gold_answer":"$\\begingroup$\n\nTo do this with your existing functions you can modify the position function\nto take a yaw value. quaternion_from_euler(ai, aj, ak, axes='sxyz') takes a\nyaw value in radians for the ak parameter. You can find this in the [\ntf.transformations docs\n](http:\/\/docs.ros.org\/en\/jade\/api\/tf\/html\/python\/transformations.html) .\n\n \n \n def position(self,x,y,z,yaw):\n pub_posisi = rospy.Publisher(\"\/mavros\/setpoint_position\/local\",PoseStamped,queue_size=10)\n posisi = PoseStamped()\n \n posisi.pose.position.x = x\n posisi.pose.position.y = y\n posisi.pose.position.z = z\n \n q = quaternion_from_euler(0.0,0.0,yaw)\n \n posisi.pose.orientation.x = q[0]\n posisi.pose.orientation.y = q[1]\n posisi.pose.orientation.z = q[2]\n posisi.pose.orientation.w = q[3] \n \n pub_posisi.publish(posisi)\n \n rospy.loginfo(f\"go to point {x,y,z} with yaw {yaw}\")\n \n time.sleep(15)\n \n\nHope this helps! :)"} {"query":"irobot create3 topics not found after setup in macos multipass vm\n\nI have a Mac OS 14.1 and I'm seting up irobot Create3 for the first time. I've confirmed the robot works using the python web playground.\n\nI've installed Multipass 1.12.2+mac and created an Ubuntu 22.04 instance and installed ROS2 per the robot humble setup guide. I created the multipass instance with this command:\n\nmultipass launch --name=create3 --cpus=2 --disk=20GiB\nWhen listing the topics, I don't see any of the expected irobot topics\n\nros2 topic list\nActual:\n\n\/parameter_events \n\/rosout\nExpected:\n\n\/battery_state\n\/cliff_intensity\n\/cmd_audio ...\nThe VM info multipass info create3:\n\nName: create3\nState: Running\nIPv4: 10.211.67.3\n 172.17.0.1\nRelease: Ubuntu 22.04.3 LTS\nImage hash: 054db2d88c45 (Ubuntu 22.04 LTS)\nCPU(s): 2\nLoad: 0.00 0.14 0.12\nDisk usage: 8.8GiB out of 19.3GiB\nMemory usage: 248.8MiB out of 3.8GiB\nMounts: --","reasoning":"We need to check possible ways to communicate over a network between a virtual machine (VM) and the Create\u00ae 3 robot using ROS 2.","id":"54","excluded_ids":["N\/A"],"gold_ids_long":["irobot_create3\/networkconfig.txt"],"gold_ids":["irobot_create3\/networkconfig_15.txt","irobot_create3\/networkconfig_14.txt","irobot_create3\/networkconfig_13.txt","irobot_create3\/networkconfig_16.txt","irobot_create3\/networkconfig_12.txt"],"gold_answer":"$\\begingroup$\n\nPer the [ Network Reccommendations\n](https:\/\/iroboteducation.github.io\/create3_docs\/setup\/network-config\/) ,\nBridged Network is required:\n\n> While many virtualization applications default to a \"shared\" or \"NAT\"\n> network connection, this type of connection will not allow ROS 2 to\n> communicate with the Create\u00ae 3 robot. Instead, a bridged network connection\n> should be used for the virtual machine.\n\nCreating a multipass instance with ` --bridged ` fixes:\n\n \n \n multipass launch --name=create3-bridged --bridged --cpus=2 --disk=20GiB\n \n\nVM Infor ` multipass info create3-bridged ` :\n\n \n \n Name: create3-bridged\n State: Running\n IPv4: 10.211.67.5\n 192.168.0.153\n Release: Ubuntu 22.04.3 LTS\n Image hash: 054db2d88c45 (Ubuntu 22.04 LTS)\n CPU(s): 2\n Load: 1.38 0.90 0.47\n Disk usage: 2.5GiB out of 19.3GiB\n Memory usage: 204.5MiB out of 951.1MiB\n \n\nNotice previously, the IP was ` 172.17.0.1 ` but now is ` 192.168.0.153 `\nwhich matches my home network.\n\n` ros2 topic list ` now produces:\n\n \n \n \/battery_state\n \/cliff_intensity\n \/cmd_audio\n \/cmd_lightring\n \/cmd_vel\n \/dock\n \/hazard_detection\n \/imu\n \/interface_buttons\n \/ir_intensity\n \/ir_opcode\n \/kidnap_status\n \/mobility_monitor\/transition_event\n \/mouse\n \/odom\n \/parameter_events\n \/robot_state\/transition_event\n \/rosout\n \/slip_status\n \/static_transform\/transition_event\n \/stop_status\n \/tf\n \/tf_static\n \/wheel_status\n \/wheel_ticks\n \/wheel_vels"} {"query":"executable '[]' not found on the PATH\n\nI am trying to launch the first example from the ros2 control demo package: https:\/\/github.com\/ros-controls\/ros2_control_demos\/tree\/humble. I am using ROS2 humble on ubuntu 22.04. First I built every package successfully, then sourced the install\/setup.bash and started the launchfile with:\n\nros2 launch ros2_control_demo_example_1 view_robot.launch.py\nBut I received the following Error.\n\n[ERROR] [launch]: Caught exception in launch (see debug for traceback): executable '[]' not found on the PATH\nI did not change any code from the example. It would be nice if somebody could help me or tell me what the problem is?\n\nHere is my Traceback:\n\n[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'\n[INFO] [launch]: All log files can be found below \/home\/user\/.ros\/log\/date\n[INFO] [launch]: Default logging verbosity is set to DEBUG\n[DEBUG] [launch]: processing event: ''\n[DEBUG] [launch]: processing event: '' \u2713 ''\nExecuting exception=SubstitutionFailure(\"executable '[]' not found on the PATH\") created at \/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/launch_service.py:318> took 0.133 seconds\n[DEBUG] [launch]: An exception was raised in an async action\/event\n[DEBUG] [launch]: Traceback (most recent call last):\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/launch_service.py\", line 336, in run_async\n raise completed_tasks_exceptions[0]\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/launch_service.py\", line 230, in _process_one_event\n await self.__process_event(next_event)\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/launch_service.py\", line 250, in __process_event\n visit_all_entities_and_collect_futures(entity, self.__context))\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/utilities\/visit_all_entities_and_collect_futures_impl.py\", line 45, in visit_all_entities_and_collect_futures\n futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/utilities\/visit_all_entities_and_collect_futures_impl.py\", line 45, in visit_all_entities_and_collect_futures\n futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/utilities\/visit_all_entities_and_collect_futures_impl.py\", line 45, in visit_all_entities_and_collect_futures\n futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)\n [Previous line repeated 1 more time]\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/utilities\/visit_all_entities_and_collect_futures_impl.py\", line 38, in visit_all_entities_and_collect_futures\n sub_entities = entity.visit(context)\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/action.py\", line 108, in visit\n return self.execute(context)\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch_ros\/actions\/node.py\", line 490, in execute\n self._perform_substitutions(context)\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch_ros\/actions\/node.py\", line 445, in _perform_substitutions\n evaluated_parameters = evaluate_parameters(context, self.__parameters)\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch_ros\/utilities\/evaluate_parameters.py\", line 164, in evaluate_parameters\n output_params.append(evaluate_parameter_dict(context, param))\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch_ros\/utilities\/evaluate_parameters.py\", line 72, in evaluate_parameter_dict\n evaluated_value = perform_substitutions(context, list(value))\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/utilities\/perform_substitutions_impl.py\", line 26, in perform_substitutions\n return ''.join([context.perform_substitution(sub) for sub in subs])\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/utilities\/perform_substitutions_impl.py\", line 26, in \n return ''.join([context.perform_substitution(sub) for sub in subs])\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/launch_context.py\", line 240, in perform_substitution\n return substitution.perform(self)\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/substitutions\/command.py\", line 94, in perform\n command_str = perform_substitutions(context, self.command)\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/utilities\/perform_substitutions_impl.py\", line 26, in perform_substitutions\n return ''.join([context.perform_substitution(sub) for sub in subs])\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/utilities\/perform_substitutions_impl.py\", line 26, in \n return ''.join([context.perform_substitution(sub) for sub in subs])\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/launch_context.py\", line 240, in perform_substitution\n return substitution.perform(self)\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/substitutions\/path_join_substitution.py\", line 45, in perform\n performed_substitutions = [sub.perform(context) for sub in self.__substitutions]\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/substitutions\/path_join_substitution.py\", line 45, in \n performed_substitutions = [sub.perform(context) for sub in self.__substitutions]\n File \"\/opt\/ros\/humble\/lib\/python3.10\/site-packages\/launch\/substitutions\/find_executable.py\", line 66, in perform\n raise SubstitutionFailure(\"executable '{}' not found on the PATH\".format(self.name))\nlaunch.substitutions.substitution_failure.SubstitutionFailure: executable '[]' not found on the PATH\n\n[ERROR] [launch]: Caught exception in launch (see debug for traceback): executable '[]' not found on the PATH\n[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'\n[DEBUG] [launch]: processing event: ''\n[DEBUG] [launch]: processing event: '' \u2713 ''\n[DEBUG] [launch]: processing event: '' \u2713 ''","reasoning":"This is related to the missing dependency. We need to check steps to build packages.","id":"55","excluded_ids":["N\/A"],"gold_ids_long":["ros2_dependency\/indexhtml.txt"],"gold_ids":["ros2_dependency\/indexhtml_11.txt","ros2_dependency\/indexhtml_14.txt","ros2_dependency\/indexhtml_12.txt","ros2_dependency\/indexhtml_16.txt","ros2_dependency\/indexhtml_13.txt","ros2_dependency\/indexhtml_15.txt"],"gold_answer":"$\\begingroup$\n\nThe solution was that I had to install all the dependencies with rosdep. I\nforgot this step. Thank you @ChristophFroehlich\n\nFollow the [ tutorial\n](https:\/\/control.ros.org\/master\/doc\/ros2_control_demos\/doc\/index.html#build-\nfrom-debian-packages) on how to build the ros2 control demos:"} {"query":"octomap_msgs\/conversions.h: No such file or directory\n\nUsing 64-bit Ubuntu 22.04.3 LTS On \"colcon build\" I'm recieving the following error:\n\n\/home\/ajifoster3\/dev_ws\/src\/octomap_publisher\/src\/octomap_publisher_node.cpp:2:10: fatal error: octomap_msgs\/conversions.h: No such file or directory\n 2 | #include \n | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~\ncompilation terminated.\ngmake[2]: *** [CMakeFiles\/octomap_publisher_node.dir\/build.make:76: CMakeFiles\/octomap_publisher_node.dir\/src\/octomap_publisher_node.cpp.o] Error 1\ngmake[1]: *** [CMakeFiles\/Makefile2:137: CMakeFiles\/octomap_publisher_node.dir\/all] Error 2\ngmake: *** [Makefile:146: all] Error 2\n---\nFailed <<< octomap_publisher [0.17s, exited with code 2]\nopt\/ros\/humble\/include\/octomap_msgs has a file called conversions.h\n\nMy ros node:\n\n#include \n#include \n#include \n\nclass OctomapPublisher : public rclcpp::Node {\npublic:\n OctomapPublisher() : Node(\"octomap_publisher\") {\n this->declare_parameter(\"octomap_file\", \"\/home\/ajifoster3\/occupancy_map_full.txt\");\n std::string octomap_file;\n this->get_parameter(\"octomap_file\", octomap_file);\n\n auto tree = std::make_shared(octomap_file);\n octomap_msgs::msg::Octomap octomap_msg;\n octomap_msgs::binaryMapToMsg(*tree, octomap_msg);\n\n publisher_ = this->create_publisher(\"octomap\", 1);\n timer_ = this->create_wall_timer(\n std::chrono::milliseconds(1000),\n [this, octomap_msg]() {\n publisher_->publish(octomap_msg);\n });\n }\n\nprivate:\n rclcpp::Publisher::SharedPtr publisher_;\n rclcpp::TimerBase::SharedPtr timer_;\n};\n\nint main(int argc, char** argv) {\n rclcpp::init(argc, argv);\n rclcpp::spin(std::make_shared());\n rclcpp::shutdown();\n return 0;\n}\nmy CMakeLists.txt is the following\n\ncmake_minimum_required(VERSION 3.8)\nproject(octomap_publisher)\n\nif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES \"Clang\")\n add_compile_options(-Wall -Wextra -Wpedantic)\nendif()\n\nfind_package(ament_cmake REQUIRED)\nfind_package(rclcpp REQUIRED)\nfind_package(octomap_msgs REQUIRED)\n\nadd_executable(octomap_publisher_node src\/octomap_publisher_node.cpp)\n\nament_target_dependencies(octomap_publisher_node rclcpp octomap_msgs)\n\ninstall(TARGETS\n octomap_publisher_node\n DESTINATION lib\/${PROJECT_NAME}\n)\n\nif(BUILD_TESTING)\n find_package(ament_lint_auto REQUIRED)\n ament_lint_auto_find_test_dependencies()\nendif()\n\nament_package()\npackage.xml:\n\n\n\n\n octomap_publisher<\/name>\n 0.0.0<\/version>\n TODO: Package description<\/description>\n ajifoster3<\/maintainer>\n TODO: License declaration<\/license>\n\n ament_cmake<\/buildtool_depend>\n\n rclcpp<\/depend>\n octomap_msgs<\/depend>\n\n ament_lint_auto<\/test_depend>\n ament_lint_common<\/test_depend>\n\n \n ament_cmake<\/build_type>\n <\/export>\n<\/package>","reasoning":"The CMakeLists.txt file needs to specify the version of c++ standard. We can check example CMakeLists.txt file.","id":"56","excluded_ids":["N\/A"],"gold_ids_long":["octomap_publish\/WritingASimpleCppPub.txt"],"gold_ids":["octomap_publish\/WritingASimpleCppPub_19.txt"],"gold_answer":"$\\begingroup$\n\nI'm not exactly sure of the solution to my problem, but I resolved it. The\nfollowing is my current source code, CMakeList.txt and package.xml.\n\noctomap_publisher_node.cpp\n\n \n \n #include \n #include \n #include \n #include \n #include \n \n class OctomapPublisher : public rclcpp::Node\n {\n public:\n OctomapPublisher(const std::string& octree_file)\n : Node(\"octomap_publisher\"), octree_file_(octree_file)\n {\n publisher_ = this->create_publisher(\"octomap\", 10);\n timer_ = this->create_wall_timer(\n std::chrono::milliseconds(500),\n std::bind(&OctomapPublisher::publishOctomap, this));\n }\n \n private:\n void publishOctomap()\n {\n octomap::OcTree* tree = nullptr;\n \n \/\/ Load the octree from the OT file\n tree = dynamic_cast(octomap::AbstractOcTree::read(octree_file_));\n if (!tree) {\n RCLCPP_ERROR(this->get_logger(), \"Failed to read octree from file\");\n return;\n }\n \n \/\/ Convert the octree to a message\n octomap_msgs::msg::Octomap msg;\n octomap_msgs::binaryMapToMsg(*tree, msg);\n msg.header.frame_id = \"map\";\n msg.header.stamp = this->now();\n \n \/\/ Publish the message\n publisher_->publish(msg);\n \n delete tree; \/\/ Clean up\n }\n \n std::string octree_file_;\n rclcpp::Publisher::SharedPtr publisher_;\n rclcpp::TimerBase::SharedPtr timer_;\n };\n \n int main(int argc, char **argv)\n {\n rclcpp::init(argc, argv);\n \n if (argc < 2) {\n std::cerr << \"Usage: octomap_publisher \" << std::endl;\n return 1;\n }\n \n auto octomap_publisher = std::make_shared(argv[1]);\n rclcpp::spin(octomap_publisher);\n \n rclcpp::shutdown();\n return 0;\n }\n \n\nCMakeList.txt\n\n \n \n cmake_minimum_required(VERSION 3.5)\n project(octomap_publisher)\n \n # Default to C99\n if(NOT CMAKE_C_STANDARD)\n set(CMAKE_C_STANDARD 99)\n endif()\n \n # Default to C++14\n if(NOT CMAKE_CXX_STANDARD)\n set(CMAKE_CXX_STANDARD 14)\n endif()\n \n \n if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES \"Clang\")\n add_compile_options(-Wall -Wextra -Wpedantic)\n endif()\n \n # Find dependencies\n find_package(ament_cmake REQUIRED)\n find_package(rclcpp REQUIRED)\n find_package(octomap REQUIRED)\n find_package(octomap_msgs REQUIRED)\n find_package(octomap_server REQUIRED)\n \n # Include C++ libraries\n include_directories(\n include\n )\n \n # Declare a C++ executable\n add_executable(octomap_publisher_node src\/octomap_publisher_node.cpp)\n \n \n ament_target_dependencies(octomap_publisher_node\n rclcpp\n octomap\n octomap_msgs\n octomap_server\n )\n \n # Specify libraries to link a library or executable target against\n target_link_libraries(octomap_publisher_node\n ${OCTOMAP_LIBRARIES}\n )\n \n # Specify libraries to link a\n \n # Install targets\n install(TARGETS\n octomap_publisher_node\n DESTINATION lib\/${PROJECT_NAME}\n )\n ament_package()\n \n\npackage.xml\n\n \n \n \n \n \n octomap_publisher<\/name>\n 0.0.0<\/version>\n TODO: Package description<\/description>\n ajifoster3<\/maintainer>\n TODO: License declaration<\/license>\n \n ament_cmake_auto<\/buildtool_depend>\n \n octomap_msgs<\/depend>\n octomap<\/depend>\n rclcpp<\/depend>\n octomap_server<\/depend>\n \n ament_lint_auto<\/test_depend>\n ament_lint_common<\/test_depend>\n \n \n ament_cmake<\/build_type>\n <\/export>\n <\/package>"} {"query":"Error fetching dependencies from Git repo\n\nI have cloned this repo:https:\/\/github.com\/ClemensElflein\/open_mower_ros\n\nhowever when fetching the dependencies with:\n\nrosdep install --from-paths src --ignore-src --default-yes\nI get the following error:\n\nERROR: the following packages\/stacks could not have their rosdep keys resolved to system dependencies: \nmower_utils: Cannot locate rosdep definition for [xbot_msgs] \nmower_msgs: Cannot locate rosdep definition for [xesc_msgs] \nmower_simulation: Cannot locate rosdep definition for [xbot_positioning]\nmower_comms: Cannot locate rosdep definition for [xesc_msgs] \nmower_map: Cannot locate rosdep definition for [xbot_msgs] \nopen_mower: Cannot locate rosdep definition for [ftc_local_planner] \nmower_logic: Cannot locate rosdep definition for [xbot_positioning]\nI have tried many things, but nothing works. I am working on ros-noetic. Any tip?","reasoning":"We need to check the missing submodules.","id":"57","excluded_ids":["N\/A"],"gold_ids_long":["missing_module\/gitmodules.txt"],"gold_ids":["missing_module\/gitmodules_0.txt"],"gold_answer":"$\\begingroup$\n\nIt looks like you didn't get the [ openmower submodules\n](https:\/\/github.com\/ClemensElflein\/open_mower_ros\/blob\/main\/.gitmodules) (the\n[ readme\n](https:\/\/github.com\/ClemensElflein\/open_mower_ros\/blob\/main\/README.md) should\nbe changed to mention those prominently)\n\n \n \n cd open_mower_ros\n git submodule update --init --recursive\n \n\nThere may be some other packages to git clone manually that aren't in the\nsubmodules and can't be installed through rosdep (like the above comment\nsuggests)."} {"query":"depth aligned capture doesn't yield same number of rgb and depth frames -- cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is\n\nSteps for reproducing the problem with an Intel RealSense D435 camera using ROS Noetic inside a docker.\n\nIn the first terminal:\n\n(base) mona@ada:~$ sudo docker run -it --privileged -v \/dev:\/dev -v \/home\/mona:\/workspace -v \/tmp\/.X11-unix:\/tmp\/.X11-unix -e DISPLAY=$DISPLAY --device \/dev\/bus\/usb ros_noetic\n\nroot@7a805700666e:\/workspace# cd catkin_ws\n\n(base) mona@ada:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7a805700666e ros_noetic \"\/ros_entrypoint.sh \u2026\" 4 seconds ago Up 3 seconds clever_feynman\n\nroslaunch realsense2_camera rs_camera.launch align_depth:=true\n\nAfter capture is done,\n\n5.\n\nroot@7a805700666e:\/workspace\/catkin_ws# catkin_make\nBase path: \/workspace\/catkin_ws\nSource space: \/workspace\/catkin_ws\/src\nBuild space: \/workspace\/catkin_ws\/build\nDevel space: \/workspace\/catkin_ws\/devel\nInstall space: \/workspace\/catkin_ws\/install\n####\n#### Running command: \"make cmake_check_build_system\" in \"\/workspace\/catkin_ws\/build\"\n####\n####\n#### Running command: \"make -j32 -l32\" in \"\/workspace\/catkin_ws\/build\"\n####\n root@ce71bcbb2d89:\/workspace\/catkin_ws# source devel\/setup.bash \n root@ce71bcbb2d89:\/workspace\/catkin_ws# rosrun bag_converter convert.py\nother terminal\n\n$ xhost +local:docker\n\ndocker exec -it -e DISPLAY=$DISPLAY clever_feynman bash run step 3 in this terminal after starting step 4 in the first terminal.\n\nroot@7a805700666e:\/workspace# rosbag record -a -O mona_noetic\n\nHere's the conversion script:\n\n(base) mona@ada:~$ cat catkin_ws\/src\/bag_converter\/scripts\/convert.py \n#!\/usr\/bin\/python3\n\nimport os\nimport sys\nimport yaml\nfrom rosbag.bag import Bag\nimport cv2\n\nimport roslib; #roslib.load_manifest(PKG)\nimport rosbag\nimport rospy\nimport cv2\nimport numpy as np\nimport argparse\nimport os\n\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge\nfrom cv_bridge import CvBridgeError\n\nclass ImageCreator():\n def __init__(self, bagfile, rgbpath, depthpath, rgbstamp, depthstamp):\n self.bridge = CvBridge()\n with rosbag.Bag(bagfile, 'r') as bag:\n for topic,msg,t in bag.read_messages():\n print(topic)\n if topic == \"\/camera\/color\/image_raw\":\n cv_image = self.bridge.imgmsg_to_cv2(msg,\"bgr8\")\n timestr = \"%.6f\" % msg.header.stamp.to_sec()\n image_name = timestr+ \".png\" \n cv2.waitKey(1);\n cv2.imwrite(rgbpath + image_name, cv_image) \n\n elif topic == \"\/camera\/aligned_depth_to_color\/image_raw\": \n cv_image = self.bridge.imgmsg_to_cv2(msg,\"16UC1\")\n timestr = \"%.6f\" % msg.header.stamp.to_sec()\n image_name = timestr+ \".png\"\n \n cv2.imwrite(depthpath + image_name, (cv_image).astype(np.uint16))\n\n\nif __name__ == '__main__':\n ImageCreator('\/workspace\/mona_noetic.bag', '\/workspace\/mona_noetic\/rgb\/', '\/workspace\/mona_noetic\/depth\/', 1, 1)\n\nHowever, from the capture, we see this unaligned number of depth aligned frames for rgb and depth:\n\nroot@7a805700666e:\/workspace# rosbag info mona_noetic.bag \npath: mona_noetic.bag\nversion: 2.0\nduration: 18.2s\nstart: Nov 15 2023 16:04:52.73 (1700064292.73)\nend: Nov 15 2023 16:05:10.93 (1700064310.93)\nsize: 30.5 MB\nmessages: 462\ncompression: none [41\/41 chunks]\ntypes: bond\/Status [eacc84bf5d65b6777d4c50f463dfb9c8]\n diagnostic_msgs\/DiagnosticArray [60810da900de1dd6ddd437c3503511da]\n dynamic_reconfigure\/Config [958f16a05573709014982821e6822580]\n dynamic_reconfigure\/ConfigDescription [757ce9d44ba8ddd801bb30bc456f946f]\n realsense2_camera\/Extrinsics [3627b43073f4cd5dd6dc179a49eda2ad]\n realsense2_camera\/Metadata [4966ca002be16ee67fe4dbfb2f354787]\n rosgraph_msgs\/Log [acffd30cd6b6de30f120938c17c593fb]\n sensor_msgs\/CameraInfo [c9a58c1b0b154e0e6da7578cb991d214]\n sensor_msgs\/CompressedImage [8f7a12909da2c9d3332d540a0977563f]\n sensor_msgs\/Image [060021388200f6f0f447d0fcd9c64743]\n tf2_msgs\/TFMessage [94810edda583a504dfda3829e70d7eec]\n theora_image_transport\/Packet [33ac4e14a7cff32e7e0d65f18bb410f3]\ntopics: \/camera\/align_to_color\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/align_to_color\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/aligned_depth_to_color\/image_raw 2 msgs : sensor_msgs\/Image \n \/camera\/aligned_depth_to_color\/image_raw\/compressed\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/aligned_depth_to_color\/image_raw\/compressed\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/aligned_depth_to_color\/image_raw\/compressedDepth\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/aligned_depth_to_color\/image_raw\/compressedDepth\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/aligned_depth_to_color\/image_raw\/theora\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/aligned_depth_to_color\/image_raw\/theora\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/color\/camera_info 2 msgs : sensor_msgs\/CameraInfo \n \/camera\/color\/image_raw\/compressed 2 msgs : sensor_msgs\/CompressedImage \n \/camera\/color\/image_raw\/compressed\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/color\/image_raw\/compressed\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/color\/image_raw\/compressedDepth\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/color\/image_raw\/compressedDepth\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/color\/image_raw\/theora\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/color\/image_raw\/theora\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/depth\/camera_info 39 msgs : sensor_msgs\/CameraInfo \n \/camera\/depth\/image_rect_raw 38 msgs : sensor_msgs\/Image \n \/camera\/depth\/image_rect_raw\/compressed 38 msgs : sensor_msgs\/CompressedImage \n \/camera\/depth\/image_rect_raw\/compressed\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/depth\/image_rect_raw\/compressed\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/depth\/image_rect_raw\/compressedDepth 40 msgs : sensor_msgs\/CompressedImage \n \/camera\/depth\/image_rect_raw\/compressedDepth\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/depth\/image_rect_raw\/compressedDepth\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/depth\/image_rect_raw\/theora 3 msgs : theora_image_transport\/Packet \n \/camera\/depth\/image_rect_raw\/theora\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/depth\/image_rect_raw\/theora\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/depth\/metadata 37 msgs : realsense2_camera\/Metadata \n \/camera\/extrinsics\/depth_to_color 1 msg : realsense2_camera\/Extrinsics \n \/camera\/realsense2_camera_manager\/bond 37 msgs : bond\/Status (2 connections)\n \/camera\/rgb_camera\/auto_exposure_roi\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/rgb_camera\/auto_exposure_roi\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/rgb_camera\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/rgb_camera\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/stereo_module\/auto_exposure_roi\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/stereo_module\/auto_exposure_roi\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/camera\/stereo_module\/parameter_descriptions 1 msg : dynamic_reconfigure\/ConfigDescription\n \/camera\/stereo_module\/parameter_updates 1 msg : dynamic_reconfigure\/Config \n \/diagnostics 68 msgs : diagnostic_msgs\/DiagnosticArray \n \/rosout 88 msgs : rosgraph_msgs\/Log (2 connections)\n \/rosout_agg 38 msgs : rosgraph_msgs\/Log \n \/tf_static 1 msg : tf2_msgs\/TFMessage\nFurther, I see this error when starting the depth align capture:\n\n[ INFO] [1700064224.344956163]: SELECTED BASE:Depth, 0\n[ INFO] [1700064224.355172954]: RealSense Node Is Up!\n 15\/11 16:03:44,482 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 300, error: Resource temporarily unavailable, number: b\n[ WARN] [1700064224.531686247]: \n 15\/11 16:03:44,873 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:44,924 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:45,179 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:45,230 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:45,381 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:45,432 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:45,584 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:45,635 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:45,786 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:45,837 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:45,988 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:46,039 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:46,191 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n 15\/11 16:03:46,243 WARNING [140201123149568] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11\n[ERROR] [1700064294.457665710]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n 15\/11 16:04:54,800 ERROR [140200416114432] (uvc-streamer.cpp:106) uvc streamer watchdog triggered on endpoint: 132\n[ERROR] [1700064294.983499621]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064295.496846075]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064296.010771429]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064296.478652416]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064296.895753832]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064297.321010419]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064297.747054477]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064298.173193296]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064298.601070803]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064299.022315621]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064299.448716345]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064299.868316530]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064300.287427109]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064300.702281242]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064301.118212082]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064301.540673572]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064301.961749822]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064302.381357661]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064302.799640022]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064303.226624059]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064303.655973210]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064304.081943511]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064304.509441908]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064304.939367902]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064305.369842480]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064305.800837626]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064306.233901531]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064306.662224030]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064307.088729246]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064307.503594745]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064307.920114882]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064308.346923624]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064308.779323394]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064309.224245296]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064309.664677204]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064310.094353804]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064310.524822175]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n[ERROR] [1700064310.940728063]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'\n^C[camera\/realsense2_camera-3] killing on exit\n[camera\/realsense2_camera_manager-2] killing on exit\n[rosout-1] killing on exit\n[master] killing on exit\nshutting down processing monitor...\n... shutting down processing monitor complete\ndone","reasoning":"The regex format of rosbag record may not be correct. We need to check for the one that fixes the problem.","id":"58","excluded_ids":["N\/A"],"gold_ids_long":["depth_frame\/315issuecomment69903.txt"],"gold_ids":["depth_frame\/315issuecomment69903_19.txt","depth_frame\/315issuecomment69903_18.txt","depth_frame\/315issuecomment69903_17.txt"],"gold_answer":"$\\begingroup$\n\nUsing\n\n` rosbag record -O mona_noetic.bag -a -x \"(.*)theora(.*)|(.*)compressed(.*)\" `\n\ninstead of\n\n` rosbag record -a -O mona_noetic `\n\nfixed the problem.\n\nAlso, if you exactly know what you want to capture, you can use a command like\nthe following:\n\n \n \n root@77c9b6999e4b:\/workspace# rosbag record -O mona_noetic.bag \/camera\/aligned_depth_to_color\/image_raw \/camera\/color\/image_raw \/camera\/depth\/camera_info \/camera\/color\/camera_info \/camera\/extrinsics\/depth_to_color \n [ INFO] [1700147750.161300211]: Subscribing to \/camera\/aligned_depth_to_color\/image_raw\n [ INFO] [1700147750.164502682]: Subscribing to \/camera\/color\/camera_info\n [ INFO] [1700147750.166064340]: Subscribing to \/camera\/color\/image_raw\n [ INFO] [1700147750.166996966]: Subscribing to \/camera\/depth\/camera_info\n [ INFO] [1700147750.167893184]: Subscribing to \/camera\/extrinsics\/depth_to_color\n [ INFO] [1700147750.170980936]: Recording to 'mona_noetic.bag'.\n \n \n\nPlease note, despite having depth aligned captures, it happens that we have 1-3 more depth images than color. And you can find and omit them by using ` ls *.png | sort > ..\/depth.txt ` and ` ls *.png | sort > ..\/rgb.txt ` and then ` vimdiff depth.txt rgb.txt ` . \n \n \n (base) mona@ada:~\/mona_noetic$ ls rgb\/*.png | wc -l\n 538\n (base) mona@ada:~\/mona_noetic$ ls depth\/*.png | wc -l\n 539\n \n \n\nReference [ https:\/\/github.com\/IntelRealSense\/realsense-\nros\/issues\/315#issuecomment-699030884\n](https:\/\/github.com\/IntelRealSense\/realsense-\nros\/issues\/315#issuecomment-699030884)"} {"query":"What is the difference between RCL_STEADY_TIME, RCL_SYSTEM_TIME and RCL_ROS_TIME?\n\nI wrote the following code to check the difference myself, but I could not find any considerable difference.\n\n#include \n\nauto main(int argc, char **argv) -> int \n{\n rclcpp::init(argc, argv);\n\n auto node = std::make_shared(\"time_converter\");\n\n rclcpp::Time steady_time(node->now(),RCL_STEADY_TIME);\n RCLCPP_INFO(node->get_logger(), \"RCL_STEADY_TIME = %f\",steady_time.seconds()); \n\n rclcpp::Time sys_time(node->now(),RCL_SYSTEM_TIME);\n RCLCPP_INFO(node->get_logger(), \"RCL_SYSTEM_TIME = %f\",sys_time.seconds()); \n\n rclcpp::Time ros_time(node->now(),RCL_ROS_TIME);\n RCLCPP_INFO(node->get_logger(), \"RCL_ROS_TIME = %f\",ros_time.seconds()); \n\n return EXIT_SUCCESS;\n}\nOutput:\n\n[INFO] [1699543136.456027415] [time_converter]: steady node time = 1699543136.456026\n[INFO] [1699543136.456121797] [time_converter]: sys node time = 1699543136.456121\n[INFO] [1699543136.456138399] [time_converter]: sys node time = 1699543136.456138\nActual question is, How do I get steady time from node->now()? Because that is the answer I am looking for.","reasoning":"We need to check the documentation on the different time sources.","id":"59","excluded_ids":["N\/A"],"gold_ids_long":["nodenow\/clockandtimehtml.txt"],"gold_ids":["nodenow\/clockandtimehtml_2.txt","nodenow\/clockandtimehtml_11.txt","nodenow\/clockandtimehtml_9.txt","nodenow\/clockandtimehtml_4.txt","nodenow\/clockandtimehtml_18.txt","nodenow\/clockandtimehtml_8.txt","nodenow\/clockandtimehtml_3.txt","nodenow\/clockandtimehtml_13.txt","nodenow\/clockandtimehtml_10.txt","nodenow\/clockandtimehtml_14.txt","nodenow\/clockandtimehtml_16.txt","nodenow\/clockandtimehtml_7.txt","nodenow\/clockandtimehtml_17.txt","nodenow\/clockandtimehtml_15.txt","nodenow\/clockandtimehtml_5.txt"],"gold_answer":"$\\begingroup$\n\nThe documentation on the different time sources is [ here\n](https:\/\/design.ros2.org\/articles\/clock_and_time.html) :\n\n> There will be at least three versions of these abstractions with the\n> following types, ` SystemTime ` , ` SteadyTime ` and ` ROSTime ` . These\n> choices are designed to parallel the ` std::chrono ` ` system_clock ` and `\n> steady_clock ` .\n>\n> [...]\n>\n> The ` ROSTime ` will report the same as ` SystemTime ` when a ROS Time\n> Source is not active. When the ROS time source is active ` ROSTime ` will\n> return the latest value reported by the Time Source. ` ROSTime ` is\n> considered active when the parameter ` use_sim_time ` is set on the node.\n\nFor the difference between ` std::chrono::system_clock ` and `\nstd::chrono::steady_clock ` , see [ this stackverflow answer\n](https:\/\/stackoverflow.com\/a\/31553641\/20622761) :\n\n> If you're holding a ` system_clock ` in your hand, you would call it a\n> watch, and it would tell you what time it is.\n>\n> If you're holding a ` steady_clock ` in your hand, you would call it a\n> stopwatch, and it would tell you how fast someone ran a lap, but it would\n> not tell you what time it is.\n>\n> If you had to, you could time someone running a lap with your watch. But if\n> your watch (like mine) periodically talked to another machine (such as the\n> atomic clock in Boulder CO) to correct itself to the current time, it might\n> make minor mistakes in timing that lap. The stopwatch won't make that\n> mistake, but it also can't tell you what the correct current time is.\n\nRe. your second question:\n\n> Actual question is, How do I get steady time from node->now()? Because that\n> is the answer I am looking for.\n\n~~I think ROS node clocks always use ` RCL_ROS_TIME ` which either is `\nSystemTime ` or the time that is published to topic ` \/clock ` in case of `\nuse_sim_time ` true.~~\n\n**EDIT:** Seems above is wrong, see [ the source code\n](https:\/\/github.com\/ros2\/rclcpp\/blob\/9c098e544ecf191b7c61f63f7f4fac6f6449cedd\/rclcpp\/src\/rclcpp\/node.cpp#L197)\n: the Node constructor takes the clock type from the NodeOptions. So it seems\nit is possible to choose the clock type by instantiatin a NodeOptions, set its\nclock type and pass it to your node constructor. See [ here\n](https:\/\/github.com\/ros2\/rclcpp\/blob\/9c098e544ecf191b7c61f63f7f4fac6f6449cedd\/rclcpp\/include\/rclcpp\/node_options.hpp#L38-L61)\nfor the options in the NodeOptions. **\/EDIT**\n\nWhat is your exact use case to want to set the node clock to steady time?\n\nIf you actually want a steady timer:\n\nYou can create use ` Node::create_wall_timer() ` instead of `\nNode::create_timer() ` , e.g.:\n\n \n \n timer_ = this->create_wall_timer(\n 500ms, std::bind(&MinimalPublisher::timer_callback, this));\n \n\nA wall timer uses RCL_STEADY_TIME:\n\n[\nhttps:\/\/github.com\/ros2\/rclcpp\/blob\/0f331f90a99da40f7b7a69b4f55b30b7245d294f\/rclcpp\/include\/rclcpp\/timer.hpp#L347\n](https:\/\/github.com\/ros2\/rclcpp\/blob\/0f331f90a99da40f7b7a69b4f55b30b7245d294f\/rclcpp\/include\/rclcpp\/timer.hpp#L347)\n\nDo realize that if you use a wall_timer in a node that is also used with `\nuse_sim_time == true ` , its timer will run and the timer callback will be\ntriggered irrespective of the simulation time (e.g. also when the simulation\nis paused)."} {"query":"Parameter substitution within rosparam list inside launch file\n\nI am trying to change the parameter map_frame within the rosparam list as shown below, but the substitution does not work.\n\nI am actually passing the \"tf_pre\" argument from another launch file.\n\nThis line $(arg tf_pre)\/map <\/rosparam> # prefix the tf name for the map is used to pass the value of tf_pre to the value of map_frame inside the list.\n\nThis does not seem to have any effect because when I run rosparam get \/h1\/slam_gmapping\/map_frame I get the wrong value.\n\nAnyone has an idea what could be wrong?\n\nThis runs in ROS Noetic and I am trying to slam a multi robot Gazebo simulation.\n\n \n \n \n \n \n \n $(arg tf_pre)\/map <\/rosparam> # prefix the tf name for the map\n \n \n odom_frame: odom\n base_frame: base_link\n map_frame: map\n ...\n \n <\/rosparam>\n \n <\/node>\n <\/launch>","reasoning":"It looks like you're setting that parameter twice and the one that you're trying to parameterize is lower in precedence.\n\nWe need to check the parameter evaluation order.","id":"60","excluded_ids":["N\/A"],"gold_ids_long":["rosparam\/XMLEvaluationorder.txt"],"gold_ids":["rosparam\/XMLEvaluationorder_13.txt"],"gold_answer":"$\\begingroup$\n\nYou haven't provided a fully reproducible example to show what is actually\ngoing wrong. But based on your description it looks like you're setting that\nparameter twice and the one that you're trying to parameterize is lower in\nprecedence.\n\nThe last instance of the parameter is the one used. [\nhttp:\/\/wiki.ros.org\/roslaunch\/XML#Evaluation_order\n](http:\/\/wiki.ros.org\/roslaunch\/XML#Evaluation_order)"} {"query":"Crazyflie: Connecting, logging and parameters-->Add logging config\n\nI would like to define stateEstimate.vx, stateEstimate.vy, and stateEstimate.vz variables to access those data. I used the following code parts.\n\ndef _connected(self, link_uri):\n\n self.get_logger().info('Connected!')\n self._lg_stab = LogConfig(name='Stabilizer', period_in_ms=100)\n self._lg_stab.add_variable('stateEstimate.x', 'float')\n self._lg_stab.add_variable('stateEstimate.y', 'float')\n self._lg_stab.add_variable('stateEstimate.z', 'float')\n self._lg_stab.add_variable('stateEstimate.vx', 'float')\n self._lg_stab.add_variable('stateEstimate.vy', 'float')\n self._lg_stab.add_variable('stateEstimate.vz', 'float') \n self._lg_stab.add_variable('stateEstimate.roll', 'float')\n self._lg_stab.add_variable('stateEstimate.pitch', 'float')\n self._lg_stab.add_variable('stateEstimate.yaw', 'float')\n \n self._lg_range = LogConfig(name='Range', period_in_ms=100)\n self._lg_range.add_variable('range.zrange', 'uint16_t')\n self._lg_range.add_variable('range.front', 'uint16_t')\n self._lg_range.add_variable('range.right', 'uint16_t')\n self._lg_range.add_variable('range.left', 'uint16_t')\n self._lg_range.add_variable('range.back', 'uint16_t')\n try:\n self._cf.log.add_config(self._lg_stab)\n self._lg_stab.data_received_cb.add_callback(self._stab_log_data)\n self._lg_stab.error_cb.add_callback(self._stab_log_error)\n self._lg_stab.start()\n self._cf.log.add_config(self._lg_range)\n self._lg_range.data_received_cb.add_callback(self._range_log_data)\n self._lg_range.error_cb.add_callback(self._range_log_error)\n self._lg_range.start()\n\n except KeyError as e:\n print('Could not start log configuration,'\n '{} not found in TOC'.format(str(e)))\n except AttributeError:\n print('Could not add Stabilizer log config, bad configuration.')\nWhen I run my python file via ROS2, I saw the following part on the terminal (Could not add Stabilizer log config, bad configuration). I could not get why it happens. However, whenver I use the above code part without stateEstimate.vx, stateEstimate.vy, and stateEstimate.vz, it works pretty well. Could you help us to fix it, thanks.\n\nntukenmez3@ae-icps-407120:~\/Documents\/2023-crazy-flie-1\/crazyflie_ros2_experimental_2\/crazyflie_ros2$ ros2 run crazyflie_ros2 crazyflie_publisher \n[INFO] [1698871075.735318053] [crazyflie_publisher]: Connected!\nCould not add Stabilizer log config, bad configuration.","reasoning":"This is related to the messages in the logblocks. We may check its maximum data size.","id":"61","excluded_ids":["N\/A"],"gold_ids_long":["crazy_file_add_variable\/pythonapi.txt"],"gold_ids":["crazy_file_add_variable\/pythonapi_100.txt"],"gold_answer":"$\\begingroup$\n\nThe error itself comes from your own (or the copied) script\n\n \n \n except AttributeError:\n print('Could not add Stabilizer log config, bad configuration.')`\n \n\nThis is an error but it is not clear why it fails. Here is the API\ndocumentation of the crazyflie python library logging functionality:\n\n[ https:\/\/www.bitcraze.io\/documentation\/repository\/crazyflie-lib-\npython\/master\/user-guides\/python_api\/#logging\n](https:\/\/www.bitcraze.io\/documentation\/repository\/crazyflie-lib-\npython\/master\/user-guides\/python_api\/#logging)\n\nHere it says that you can only create logblocks for messages that are no\nlarger than 30 bytes. the logblock 'Stabilizer' contains 36 bytes (9 x float\nwhich is 4 bytes each). So therefore it fails.\n\nIf you look in the documentation, you can see that there is a possibility of\ndeclaring a 16 - bit (2 byte) float. In the logblock declaration, you can\nreplace ` 'float' ` with ` 'FP16' ` , and reduce the total message size. This\nshould fix it."} {"query":"Transform failed during publishing of map_odom transform\n\ni am trying publish tf and odom. my problem is that i always get this error:\n\n[ERROR] [1698638471.209513778]: Transform failed during publishing of map_odom transform: Lookup would require extrapolation 0.567969187s into the future. Requested time 1698638469.812094927 but the latest data is at time 1698638469.244125605, when looking up transform from frame [base_link] to frame [odom]\nAnd when i look at my tf tree, odom is not publish to base_link as i expected enter image description here\n\nHere's the odom publisher node:\n\n#include \"ros\/ros.h\"\n#include \"std_msgs\/Int16.h\"\n#include \n#include \n#include \n#include \n#include \n \n\/\/ Create odometry data publishers\nros::Publisher odom_data_pub;\nros::Publisher odom_data_pub_quat;\nnav_msgs::Odometry odomNew;\nnav_msgs::Odometry odomOld;\n \n\/\/ Initial pose\nconst double initialX = 0.0;\nconst double initialY = 0.0;\nconst double initialTheta = 0.00000000001;\nconst double PI = 3.141592;\n \n\/\/ Robot physical constants\nconst double TICKS_PER_REVOLUTION = 535; \/\/ For reference purposes.\nconst double WHEEL_RADIUS = 0.033; \/\/ Wheel radius in meters\nconst double WHEEL_BASE = 0.17; \/\/ Center of left tire to center of right tire\nconst double TICKS_PER_METER = 3100; \/\/ Original was 2800\n \n\/\/ Distance both wheels have traveled\ndouble distanceLeft = 0;\ndouble distanceRight = 0;\n \n\/\/ Flag to see if initial pose has been received\nbool initialPoseRecieved = false;\n \nusing namespace std;\n \n\/\/ Get initial_2d message from either Rviz clicks or a manual pose publisher\nvoid set_initial_2d(const geometry_msgs::PoseStamped &rvizClick) {\n \n odomOld.pose.pose.position.x = rvizClick.pose.position.x;\n odomOld.pose.pose.position.y = rvizClick.pose.position.y;\n odomOld.pose.pose.orientation.z = rvizClick.pose.orientation.z;\n initialPoseRecieved = true;\n}\n \n\/\/ Calculate the distance the left wheel has traveled since the last cycle\nvoid Calc_Left(const std_msgs::Int16& leftCount) {\n \n static int lastCountL = 0;\n if(leftCount.data != 0 && lastCountL != 0) {\n \n int leftTicks = (leftCount.data - lastCountL);\n \n if (leftTicks > 10000) {\n leftTicks = 0 - (65535 - leftTicks);\n }\n else if (leftTicks < -10000) {\n leftTicks = 65535-leftTicks;\n }\n else{}\n distanceLeft = leftTicks\/TICKS_PER_METER;\n }\n lastCountL = leftCount.data;\n}\n \n\/\/ Calculate the distance the right wheel has traveled since the last cycle\nvoid Calc_Right(const std_msgs::Int16& rightCount) {\n \n static int lastCountR = 0;\n if(rightCount.data != 0 && lastCountR != 0) {\n \n int rightTicks = rightCount.data - lastCountR;\n \n if (rightTicks > 10000) {\n distanceRight = (0 - (65535 - distanceRight))\/TICKS_PER_METER;\n }\n else if (rightTicks < -10000) {\n rightTicks = 65535 - rightTicks;\n }\n else{}\n distanceRight = rightTicks\/TICKS_PER_METER;\n }\n lastCountR = rightCount.data;\n}\n \n\/\/ Publish a nav_msgs::Odometry message in quaternion format\nvoid publish_quat() {\n \n tf2::Quaternion q;\n \n q.setRPY(0, 0, odomNew.pose.pose.orientation.z);\n \n nav_msgs::Odometry quatOdom;\n quatOdom.header.stamp = odomNew.header.stamp;\n quatOdom.header.frame_id = \"odom\";\n quatOdom.child_frame_id = \"base_link\";\n quatOdom.pose.pose.position.x = odomNew.pose.pose.position.x;\n quatOdom.pose.pose.position.y = odomNew.pose.pose.position.y;\n quatOdom.pose.pose.position.z = odomNew.pose.pose.position.z;\n quatOdom.pose.pose.orientation.x = q.x();\n quatOdom.pose.pose.orientation.y = q.y();\n quatOdom.pose.pose.orientation.z = q.z();\n quatOdom.pose.pose.orientation.w = q.w();\n quatOdom.twist.twist.linear.x = odomNew.twist.twist.linear.x;\n quatOdom.twist.twist.linear.y = odomNew.twist.twist.linear.y;\n quatOdom.twist.twist.linear.z = odomNew.twist.twist.linear.z;\n quatOdom.twist.twist.angular.x = odomNew.twist.twist.angular.x;\n quatOdom.twist.twist.angular.y = odomNew.twist.twist.angular.y;\n quatOdom.twist.twist.angular.z = odomNew.twist.twist.angular.z;\n \n for(int i = 0; i<36; i++) {\n if(i == 0 || i == 7 || i == 14) {\n quatOdom.pose.covariance[i] = .01;\n }\n else if (i == 21 || i == 28 || i== 35) {\n quatOdom.pose.covariance[i] += 0.1;\n }\n else {\n quatOdom.pose.covariance[i] = 0;\n }\n }\n \n odom_data_pub_quat.publish(quatOdom);\n}\n \n\/\/ Update odometry information\nvoid update_odom() {\n \n \/\/ Calculate the average distance\n double cycleDistance = (distanceRight + distanceLeft) \/ 2;\n \n \/\/ Calculate the number of radians the robot has turned since the last cycle\n double cycleAngle = asin((distanceRight-distanceLeft)\/WHEEL_BASE);\n \n \/\/ Average angle during the last cycle\n double avgAngle = cycleAngle\/2 + odomOld.pose.pose.orientation.z;\n \n if (avgAngle > PI) {\n avgAngle -= 2*PI;\n }\n else if (avgAngle < -PI) {\n avgAngle += 2*PI;\n }\n else{}\n \n \/\/ Calculate the new pose (x, y, and theta)\n odomNew.pose.pose.position.x = odomOld.pose.pose.position.x + cos(avgAngle)*cycleDistance;\n odomNew.pose.pose.position.y = odomOld.pose.pose.position.y + sin(avgAngle)*cycleDistance;\n odomNew.pose.pose.orientation.z = cycleAngle + odomOld.pose.pose.orientation.z;\n \n \/\/ Prevent lockup from a single bad cycle\n if (isnan(odomNew.pose.pose.position.x) || isnan(odomNew.pose.pose.position.y)\n || isnan(odomNew.pose.pose.position.z)) {\n odomNew.pose.pose.position.x = odomOld.pose.pose.position.x;\n odomNew.pose.pose.position.y = odomOld.pose.pose.position.y;\n odomNew.pose.pose.orientation.z = odomOld.pose.pose.orientation.z;\n }\n \n \/\/ Make sure theta stays in the correct range\n if (odomNew.pose.pose.orientation.z > PI) {\n odomNew.pose.pose.orientation.z -= 2 * PI;\n }\n else if (odomNew.pose.pose.orientation.z < -PI) {\n odomNew.pose.pose.orientation.z += 2 * PI;\n }\n else{}\n \n \/\/ Compute the velocity\n odomNew.header.stamp = ros::Time::now();\n odomNew.twist.twist.linear.x = cycleDistance\/(odomNew.header.stamp.toSec() - odomOld.header.stamp.toSec());\n odomNew.twist.twist.angular.z = cycleAngle\/(odomNew.header.stamp.toSec() - odomOld.header.stamp.toSec());\n \n \/\/ Save the pose data for the next cycle\n odomOld.pose.pose.position.x = odomNew.pose.pose.position.x;\n odomOld.pose.pose.position.y = odomNew.pose.pose.position.y;\n odomOld.pose.pose.orientation.z = odomNew.pose.pose.orientation.z;\n odomOld.header.stamp = odomNew.header.stamp;\n \n \/\/ Publish the odometry message\n odom_data_pub.publish(odomNew);\n}\n \nint main(int argc, char **argv) {\n \n \/\/ Set the data fields of the odometry message\n odomNew.header.frame_id = \"odom\";\n odomNew.pose.pose.position.z = 0;\n odomNew.pose.pose.orientation.x = 0;\n odomNew.pose.pose.orientation.y = 0;\n odomNew.twist.twist.linear.x = 0;\n odomNew.twist.twist.linear.y = 0;\n odomNew.twist.twist.linear.z = 0;\n odomNew.twist.twist.angular.x = 0;\n odomNew.twist.twist.angular.y = 0;\n odomNew.twist.twist.angular.z = 0;\n odomOld.pose.pose.position.x = initialX;\n odomOld.pose.pose.position.y = initialY;\n odomOld.pose.pose.orientation.z = initialTheta;\n \n \/\/ Launch ROS and create a node\n ros::init(argc, argv, \"ekf_odom_pub\");\n ros::NodeHandle node;\n \n \/\/ Subscribe to ROS topics\n ros::Subscriber subForRightCounts = node.subscribe(\"right_ticks\", 100, Calc_Right, ros::TransportHints().tcpNoDelay());\n ros::Subscriber subForLeftCounts = node.subscribe(\"left_ticks\", 100, Calc_Left, ros::TransportHints().tcpNoDelay());\n ros::Subscriber subInitialPose = node.subscribe(\"slam_out_pose\", 1, set_initial_2d);\n \n \/\/ Publisher of simple odom message where orientation.z is an euler angle\n odom_data_pub = node.advertise(\"odom_data_euler\", 100);\n \n \/\/ Publisher of full odom message where orientation is quaternion\n odom_data_pub_quat = node.advertise(\"odom_data_quat\", 100);\n \n ros::Rate loop_rate(30); \n \n while(ros::ok()) {\n \n if(initialPoseRecieved) {\n update_odom();\n publish_quat();\n }\n ros::spinOnce();\n loop_rate.sleep();\n }\n \n return 0;\n}\nCan anyone please tell me where did i do wrong. Thank you!","reasoning":"It seems you are only publishing the odometry message to topics \"odom_data_euler\" and odom_data_quat \", but not actually broadcasting it.\n\nYou will typically use TransformStamped to achieve this.","id":"62","excluded_ids":["N\/A"],"gold_ids_long":["odom_transform\/WritingATf2Broadcast.txt"],"gold_ids":["odom_transform\/WritingATf2Broadcast_17.txt","odom_transform\/WritingATf2Broadcast_16.txt","odom_transform\/WritingATf2Broadcast_18.txt","odom_transform\/WritingATf2Broadcast_20.txt","odom_transform\/WritingATf2Broadcast_13.txt","odom_transform\/WritingATf2Broadcast_9.txt","odom_transform\/WritingATf2Broadcast_23.txt","odom_transform\/WritingATf2Broadcast_19.txt","odom_transform\/WritingATf2Broadcast_8.txt","odom_transform\/WritingATf2Broadcast_24.txt","odom_transform\/WritingATf2Broadcast_15.txt","odom_transform\/WritingATf2Broadcast_25.txt","odom_transform\/WritingATf2Broadcast_21.txt","odom_transform\/WritingATf2Broadcast_11.txt","odom_transform\/WritingATf2Broadcast_14.txt","odom_transform\/WritingATf2Broadcast_22.txt","odom_transform\/WritingATf2Broadcast_12.txt"],"gold_answer":"$\\begingroup$\n\nIt seems you are only publishing the odometry message to topics\n\"odom_data_euler\" and odom_data_quat \", but not actually broadcasting it.\n\nYou will typically use TransformStamped to achieve this. It is almost the same\ncode-wise, but check this link out:\n\n[ https:\/\/docs.ros.org\/en\/humble\/Tutorials\/Intermediate\/Tf2\/Writing-A-\nTf2-Broadcaster-Cpp.html\n](https:\/\/docs.ros.org\/en\/humble\/Tutorials\/Intermediate\/Tf2\/Writing-A-\nTf2-Broadcaster-Cpp.html)"} {"query":"Convert ROS2 SQLite bag to MCAP format\nAsked 5 months ago\nModified 5 months ago\nViewed 803 times\n2\n\nI've got some ROS2 bags in SQLite format that I'd like to convert to MCAP format, but I cannot find any examples or tools that do it. I'd have hoped there would be an obvious option for ros2 bag convert, like the --output-options YAML's storage_id:, but it's not obvious to me what to use.\n","reasoning":"SQLite files usually end with .db3. The steps about convert your existing ROS 2 .db3 files into MCAP files using ros2 bag convert would be related.","id":"63","excluded_ids":["N\/A"],"gold_ids_long":["ros_convert\/ros2.txt"],"gold_ids":["ros_convert\/ros2_5.txt"],"gold_answer":"$\\begingroup$\n\nI did this recently with the mcap cli tool built from source [\nhttps:\/\/github.com\/foxglove\/mcap ](https:\/\/github.com\/foxglove\/mcap) :\n\n \n \n sudo apt install golang-go\n git clone [[email\u00a0protected]](\/cdn-cgi\/l\/email-protection):foxglove\/mcap.git\n cd mcap\/go\n make -C cli\/mcap build\n .\/cli\/mcap\/bin\/mcap version # show the binary works\n \n\nAfter that you need to have all the message definitions of all the messages in\nthe .db3 file available, source the workspace they were built in (e.g. `\nsource \/opt\/ros\/humble\/setup.bash ` works if using ` humble ` and all of the\nrequired messages were apt installed, or ` source\n~\/my_ros2_ws\/install\/setup.bash ` if you had to build some packages with\ncustom messages):\n\n \n \n source your_ros2_ws\/install\/setup.bash \n cd directory_with_db3\n # I made a symlink to .\/mcap\/go\/cli\/mcap\/bin\/mcap so it is on my PATH\n mcap convert foo.db3 foo.mcap\n # see that all the messages are there\n mcap info foo.mcap\n library: mcap go v1.0.4 \n profile: ros2\n messages: 834056 \n duration: 9m38.219675178s \n start: 2022-01-07T12:39:35.007852857-08:00 (1641587975.007852857) \n end: 2022-01-07T12:49:13.227528035-08:00 (1641588553.227528035) \n compression:\n zstd: [1834\/1834 chunks] [15.58 GiB\/10.90 GiB (30.03%)] [19.31 MiB\/sec] \n channels:\n ...\n \n\nThere's an example mcap I made (and also used ` mcap filter ` to reduce the\nsize) attached to the issue here (and a workaround to related issue with\nviewing the mcap in plotjuggler): [\nhttps:\/\/github.com\/facontidavide\/PlotJuggler\/issues\/878\n](https:\/\/github.com\/facontidavide\/PlotJuggler\/issues\/878)\n\n## mcap convert while missing messages\n\n \n \n ...failed to convert file: failed to find schema for novatel_oem7_msgs\/msg\/BESTVEL: schema not found\n \n\nIt exits immediately on encountering an unknown message and leaves behind an\nmcap file of size 0.\n\n# ros2 bag convert\n\nros2 bag convert also works (going from [ https:\/\/mcap.dev\/guides\/getting-\nstarted\/ros-2#using-ros2-bag-convert ](https:\/\/mcap.dev\/guides\/getting-\nstarted\/ros-2#using-ros2-bag-convert) ), at least with the ros2 bag I built\nfrom iron sources:\n\nconvert.yaml:\n\n \n \n output_bags:\n - uri: ros2_output\n storage_id: mcap\n all: true\n \n\nThe uri is the output directory the mcap conversion will be stored in, it\ndoesn't look possible to specify it on the command line as with the ` mcap `\ntool. More possible parameters for the yaml are listed in [\nhttps:\/\/github.com\/ros2\/rosbag2#converting-bags\n](https:\/\/github.com\/ros2\/rosbag2#converting-bags) but not documented.\n\n \n \n ros2 bag convert -i E-SOLO-FAST-140-170.db3 -o ..\/..\/..\/convert.yaml\n \n closing.\n \n closing.\n [INFO] [1698332502.004769814] [rosbag2_storage]: Opened database 'E-SOLO-FAST-140-170.db3' for READ_ONLY.\n \n\nIt creates a subdirectory ` ros2_output\/ ` with ` metadata.yaml ` and `\nros2_output_0.mcap ` (now format ` libmcap 0.8.0 ` ), looks to have all the\nmessages in it.\n\n## ros2 bag convert while missing messages\n\n \n \n ros2 bag convert -i . -o ..\/..\/..\/convert.yaml \n ^C[INFO] [1698419071.371486821] [rosbag2_storage]: Opened database '.\/T-MULTI-FAST-EURO.db3' for READ_ONLY.\n [WARN] [1698419071.444842070] [ROSBAG2_TRANSPORT]: Topic '\/vehicle_3\/radar_front\/esr_status1' has unknown type 'delphi_esr_msgs\/msg\/EsrStatus1' . Only topics with known type are supported. Reason: 'package 'delphi_esr_msgs' not found, searching: [\/home\/lucasw\/ros\/ros2_iron\/install\/rqt_bag_plugins, \/home\/lucasw\/ros\/ros2_iron\/install\/rosbag2,\n \n\nIn contrast with ` mcap ` the ` ros2 bag convert ` converts every message it\ndoes understand and skips the rest.\n\n## ros2 bag zstd compression\n\nThese compression options can be added to convert.yaml, but the output `\n.mcap.zstd ` file is not readable by the mcap cli tool (while ros2 bag info\nworks with it):\n\n \n \n compression_mode: file\n compression_format: zstd\n \n\nThis yields mcap files readable by the mcap tool but the files are a little\nlarger, appears to be the same as the default settings of the mcap cli tool:\n\n \n \n compression_mode: message\n compression_format: zstd"} {"query":"About Lifecycle, And how to call `on_deactivate()` in `hardware_interface` of ros2_control by controller_manager CLI or other method?\n\nI have implemented a hardware interface in ros2_control and added code to free my hardware resources in the on_deactivate() method.\n\nWhen I try to stop the controller with the command ros2 control set_controller_state diffbot_base_controller inactive and try to free the hardware, on_deactivate() doesn't seem to be called.\n\nI can't find console output from deactivate, and the read\/write method is still being called. Unlike before, only the value from hw_command_ is 0.\n\nIt's very confusing.Maybe I'm confused about the life cycle concept in controller_manager of ros2_control. I was hoping to get some tips or links to relevant materials.","reasoning":"The hardware components and controllers may be different in ros2_control. Deactivating the controller may not guarantee the deactivation of the hardware component.\n\nWe can check some discussion about the Lifecycle of hardware components.","id":"64","excluded_ids":["N\/A"],"gold_ids_long":["lifecycle_deactivate\/1103.txt"],"gold_ids":["lifecycle_deactivate\/1103_6.txt","lifecycle_deactivate\/1103_5.txt","lifecycle_deactivate\/1103_4.txt","lifecycle_deactivate\/1103_3.txt"],"gold_answer":"$\\begingroup$\n\nBe aware that hardware components and controllers are different parts of\nros2_control. You try to deactivate the controller -> this does not deactivate\nthe hardware component.\n\nLifecycle of hardware components is not 100% implemented as by now, and there\n[ are some issues ](https:\/\/github.com\/ros-controls\/ros2_control\/issues\/1103)\nwith the current implementation. Moreover, controller won't be deactivated\ncurrently if you deactivate the hardware_component, where the controller\nclaimed the interfaces.\n\nHave a look at [ this draft example ](https:\/\/github.com\/StoglRobotics-\nforks\/ros2_control_demos\/pull\/7) , which should make things more clear."} {"query":"How do I send a new position to my 5 dof robot arm?\n\nI am a newbie with ros2 control. I am using ros2 iron on Ubunto 22.04 (Linux Mint). I made a copy of the ros2_control demo example #7.\n\nThis is the one that is launched with the command ros2 launch ros2_control_demo_example_7 r6bot_controller.launch.py, I changed the name as well as urdf file. I also interfaced it with my Arduino robot arm based on positions. My arm has 5 instead of 6 joints and only uses positions. There are no encoders on my arm. All the velocity commands and states related to velocity were taken out of example 7. In my hardware interface (copy), I have code that when a position is changed, the code should send off a state change to an Arduino robot arm...\n\nWhen I run ros2 control list_controllers, I see\n\njem_5dof_robot_arm_controller[jem_robot_arm\/RobotController] active \njoint_state_broadcaster[joint_state_broadcaster\/JointStateBroadcaster] active\nWhen I run ros2 control list_hardware_interfaces, I see\n\ncommand interfaces\n Joint1\/position [available] [claimed]\n Joint2\/position [available] [claimed]\n Joint3\/position [available] [claimed]\n Joint4\/position [available] [claimed]\n Joint5\/position [available] [claimed]\nstate interfaces\n Joint1\/position\n Joint2\/position\n Joint3\/position\n Joint4\/position\n Joint5\/position\nI also see am image of my robot arm in rviz... I would say \"things look like they are working\"\n\nMy question is this...........\n\nHow do I send a new position to my robot arm from the command line or a GUI. Either send one new position for a Joint or send the set of positions for all 5 joints. All I want to happen is, quickly send something and interact with the Arduino hardware. I believe the code I implemented in the hardware interface to my Arduino based arm will work, the question is how to I force something to call my hardware interface with an update (so as to test). I'd like to set a few different positions and see if the hardware is working ok. Ideally, it would be nice to make changes in rviz and send those changes to my arm\/Arduino. I suspect that rviz is only a one way visualization of the arm and has no way to move something. I suspect that once a new position is sent to my robot arm's controller [jem_5dof_robot_arm_controller], rviz will update accordingly.\n\nWhat are is a simple way to send off a few new positions from the command line to test?","reasoning":"The custom controller may not be required. We may find information about position controller.","id":"65","excluded_ids":["N\/A"],"gold_ids_long":["set_position_ros2\/userdochtml.txt"],"gold_ids":["set_position_ros2\/userdochtml_1.txt"],"gold_answer":"$\\begingroup$\n\nThe first question: do you really need a custom controller, or might work a [\nposition_controller\n](https:\/\/control.ros.org\/master\/doc\/ros2_controllers\/position_controllers\/doc\/userdoc.html)\n(simple interface, topic with one position-vector per received topic) or the [\njoint trajectory controller\n](https:\/\/control.ros.org\/master\/doc\/ros2_controllers\/joint_trajectory_controller\/doc\/userdoc.html)\n(has also a topic interface, but additionally an action server; and it\ninterpolates optionally from a full trajectory, not only from a single point).\n\nHave a look at the [ other examples\n](https:\/\/control.ros.org\/master\/doc\/ros2_control_demos\/example_1\/doc\/userdoc.html)\nfrom the demos on how to use them."} {"query":"rclcpp wait for a list of service\/action servers to start before proceeding further\n\nI have a list of services and a list of actions that I need to wait for to start before I can proceed further. Is there some sort of inbuilt function in rclcpp or rclcpp::Node that I can use?\n\nCreating a custom service and action client type is not really a viable option for me, since I would have more than 100 services + actions combined.\n\nWhat I want is something like the following:\n\nclass SomeNode : public rclcpp::Node\n{\npublic:\n SomeNode() : Node(\"service_and_action_check\")\n {\n \/* We do our initial setup *\/\n\n std::vector serviceList = {\"service1\", \"service2\", \"service3\"};\n std::vector actionList = {\"action1\", \"action2\", \"action3\"};\n\n for (auto &elem : serviceList)\n {\n checkIfServiceServerIsRunning(elem);\n }\n\n for (auto &elem : actionList)\n {\n checkIfActionServerIsRunning(elem);\n }\n\n RCLCPP_INFO(this->get_logger(), \"All services and actions have been loaded.\");\n }\n .\n .\n .\n};\n \nIf this is not readily available, if anyone knows of a simple way to create the functions checkIfServiceServerIsRunning and checkIfActionServerIsRunning, that would be of help too.\n\nThanks!","reasoning":"We can use the wait_for method in services and actions. We may check its implementation, action node and client node.","id":"66","excluded_ids":["N\/A"],"gold_ids_long":["rclcpp_service_action\/Cpphtml.txt"],"gold_ids":["rclcpp_service_action\/Cpphtml_33.txt","rclcpp_service_action\/Cpphtml_30.txt","rclcpp_service_action\/Cpphtml_31.txt","rclcpp_service_action\/Cpphtml_35.txt","rclcpp_service_action\/Cpphtml_28.txt","rclcpp_service_action\/Cpphtml_37.txt","rclcpp_service_action\/Cpphtml_32.txt","rclcpp_service_action\/Cpphtml_34.txt","rclcpp_service_action\/Cpphtml_29.txt","rclcpp_service_action\/Cpphtml_27.txt"],"gold_answer":"$\\begingroup$\n\nBoth services and actions have ` wait_for_...() ` methods, see the [ service\ntutorial ](https:\/\/docs.ros.org\/en\/rolling\/Tutorials\/Beginner-Client-\nLibraries\/Writing-A-Simple-Cpp-Service-And-Client.html#write-the-client-node)\nand rclcpp [ source code\n](https:\/\/github.com\/ros2\/rclcpp\/blob\/5ffc963e1aef97928a6cc895db18d40673c655f1\/rclcpp\/include\/rclcpp\/client.hpp#L191-L198)\n:\n\n \n \n while (!client->wait_for_service(1s)) {\n if (!rclcpp::ok()) {\n RCLCPP_ERROR(rclcpp::get_logger(\"rclcpp\"), \"Interrupted while waiting for the service. Exiting.\");\n return 0;\n }\n RCLCPP_INFO(rclcpp::get_logger(\"rclcpp\"), \"service not available, waiting again...\");\n }\n \n\nand the [ action client tutorial\n](https:\/\/docs.ros.org\/en\/rolling\/Tutorials\/Intermediate\/Writing-an-Action-\nServer-Client\/Cpp.html#writing-an-action-client) :\n\n \n \n if (!this->client_ptr_->wait_for_action_server()) {\n RCLCPP_ERROR(this->get_logger(), \"Action server not available after waiting\");\n rclcpp::shutdown();\n }\n \n\n` wait_for_action_server() ` can also take a duration, see the rclcpp_action [\nsource code\n](https:\/\/github.com\/ros2\/rclcpp\/blob\/5ffc963e1aef97928a6cc895db18d40673c655f1\/rclcpp_action\/include\/rclcpp_action\/client.hpp#L83-L86)\n.\n\nFor your application you'd have to loop over each of your services\/actions and\nwait untill all are available."} {"query":"Why TEB controller is not available in ros2 humble?\n\nOn navigation plugin setup document , the TEB controller is mentioned, but I don't find any documentation to set up this controller in nav2 humble. And there is no humble branch in the teb_local_planner repository. So I copied the TEB parameters from foxy and launch the navigation node, but it told me the TEB controller plugin can't be found.\n\n[controller_server-4] [FATAL] [1697706023.360686729] [controller_server]: Failed to create controller. Exception: According to the loaded plugin descriptions the class teb_local_planner::TebLocalPlannerROS with base class type nav2_core::Controller does not exist. Declared types are dwb_core::DWBLocalPlanner nav2_mppi_controller::MPPIController nav2_regulated_pure_pursuit_controller::RegulatedPurePursuitController nav2_rotation_shim_controller::RotationShimController\nSo why TEB controller is not available in ros2 humble? or did I miss something? Thanks.","reasoning":"The central question is to understand whether TEB controller is supported in nav2 humble. We can check post\/announcement for details.","id":"67","excluded_ids":["N\/A"],"gold_ids_long":["teb_controller\/30054.txt"],"gold_ids":["teb_controller\/30054_15.txt"],"gold_answer":"$\\begingroup$\n\nThere was a [ recent post on the ROS Discourse\n](https:\/\/discourse.ros.org\/t\/nav2-model-predictive-path-integral-mppi-\ncontroller-now-available\/30054) , about a new MPPI controller. That post\nmentions:\n\n> I would be inundated with messages regarding TEB if I did not address it\n> here. While TEB is quite a fantastic piece of software, the maintainer has\n> since moved on from his academic career into a position where it is not\n> possible to maintain it into the future. As such, its largely unmaintained\n> and represents techniques which are bordering on a decade old. This work is\n> very modern and state of the art in the same vertical of techniques as TEB\n> (MPC) so it meets the same need that TEB serves. With MPPI\u2019s modern\n> methodology, performance, active maintenance, and documentation, I hope you\n> all will agree with me over time that this is an improvement. There are\n> certain characteristics of the Elastic Band approaches that I did not like\n> in a production setting that are not present in this work.\n\nSo I conclude that TEB is indeed not supported anymore.\n\nEDIT: that thread also mentions the upcoming ROSCon 2023 presentation [ On Use\nof Nav2 MPPI Controller\n](https:\/\/roscon.ros.org\/2023\/#:%7E:text=On%20Use%20of%20Nav2%20MPPI%20Controller)\nwhich is scheduled **today** , so you might want to watch the live feed (or\nlater on the recording, when it gets published).\n\nEDIT 2: In the description of the ROSCon talk, MPPI is refered to as \"the\nfunctional successor of the TEB and DWB controllers\", so it seems that MPPI is\neffectively considered as the replacement for TEB:\n\n> We introduce the Nav2 project's MPPI Local Trajectory Planner. It is the\n> functional successor of the TEB and DWB controllers, providing predictive\n> time-varying trajectories reminiscent of TEB while providing tunable critic\n> functions similar to DWB."} {"query":"How to use stereo_image_proc without camera_info topics?\n\nI'm working with 2 csi cameras in a jetson nano with ROS2 humble and I want to do a disparity image. What I'm trying to use is stereo_image_proc disparity node, but it requires to have the camera_info topics for both of the cameras. The camera is a imx219-83 and I haven't found a driver that allows me to have a camera_info topic. Is it possible to obtain this topic ? If not, is there something that could be helpful for this situations?\n\nThanks!","reasoning":"We may refer to Image Pipeline Tutorial in ROS2 that also involves creating a disparity map with stereo_image_proc.","id":"68","excluded_ids":["N\/A"],"gold_ids_long":["ros2_camera\/ros2imagepipelinetut.txt"],"gold_ids":["ros2_camera\/ros2imagepipelinetut_8.txt","ros2_camera\/ros2imagepipelinetut_10.txt","ros2_camera\/ros2imagepipelinetut_12.txt","ros2_camera\/ros2imagepipelinetut_4.txt","ros2_camera\/ros2imagepipelinetut_6.txt","ros2_camera\/ros2imagepipelinetut_13.txt","ros2_camera\/ros2imagepipelinetut_7.txt","ros2_camera\/ros2imagepipelinetut_16.txt","ros2_camera\/ros2imagepipelinetut_11.txt","ros2_camera\/ros2imagepipelinetut_15.txt","ros2_camera\/ros2imagepipelinetut_9.txt","ros2_camera\/ros2imagepipelinetut_5.txt","ros2_camera\/ros2imagepipelinetut_2.txt","ros2_camera\/ros2imagepipelinetut_3.txt"],"gold_answer":"$\\begingroup$\n\n[ This tutorial ](https:\/\/jeffzzq.medium.com\/ros2-image-pipeline-\ntutorial-3b18903e7329) does exactly what you want, I think. They are also\ncreating a disparity map with stereo_image_proc.\n\nThere you will calibrate your cameras and use the opencv_cam driver to read\nyour devices. When reading you cameras with opencv_cam you can provide a\ncalibration file (.yaml) that you created with the calibration, and open_cv\ncam will publish your image_raw and camera_info topic."} {"query":"Joint Trajectory Controller with velocity command interface has non-zero velocity after finshed trajectory\n\nI want to control a manipulator with the Joint Trajectory Controller by using the velocity command interface. I am planning a trajectory with with MoveIt MotionPlanningof rviz. I am using ros2 humble.\n\nI've tested several setups but with all of them I have the same problem: When the Joint Trajectory Controller reports \"Goal reached, success!\", the velocities aren't set to zero. I tried to play with with the parameters (increasing and decreasing stopped_velocity_tolerance or goal_time, changing the gains, adding and removing ff_velocity_scale) which sometimes leads to a smaller final velocity but never to completely stopped motion.\n\nA simple setup to reproduce this issue is by launching ros2 launch moveit2_tutorials demo.launch.py from (moveit2_tutorials)[https:\/\/github.com\/ros-planning\/moveit2_tutorials] but with changing from position to velocity interface in the panda_moveit_config. I changed\n\nSettings for panda_arm_controller in ros2_controllers.yaml to:\npanda_arm_controller:\n ros__parameters:\n command_interfaces:\n - velocity\n state_interfaces:\n - position\n - velocity\n joints:\n - panda_joint1\n - panda_joint2\n - panda_joint3\n - panda_joint4\n - panda_joint5\n - panda_joint6\n - panda_joint7\n gains:\n panda_joint1:\n p: 10.0\n i: 1.0\n d: 1.0\n i_clamp: 1.0\n ff_velocity_scale: 1.0\n panda_joint2:\n p: 10.0\n i: 1.0\n d: 1.0\n i_clamp: 1.0\n ff_velocity_scale: 1.0\n panda_joint3:\n p: 10.0\n i: 1.0\n d: 1.0\n i_clamp: 1.0\n ff_velocity_scale: 1.0\n panda_joint4:\n p: 10.0\n i: 1.0\n d: 1.0\n i_clamp: 1.0\n ff_velocity_scale: 1.0\n panda_joint5:\n p: 10.0\n i: 1.0\n d: 1.0\n i_clamp: 1.0\n ff_velocity_scale: 1.0\n panda_joint6:\n p: 10.0\n i: 1.0\n d: 1.0\n i_clamp: 1.0\n ff_velocity_scale: 1.0\n panda_joint7:\n p: 10.0\n i: 1.0\n d: 1.0\n i_clamp: 1.0\n ff_velocity_scale: 1.0\nSetting command_interface from position to velocity in panda.ros2_control.xacro:\n\n\n\n \n \n\n \n \n \n mock_components\/GenericSystem<\/plugin>\n true<\/param>\n <\/xacro:if>\n \n topic_based_ros2_control\/TopicBasedSystem<\/plugin>\n \/isaac_joint_commands<\/param>\n \/isaac_joint_states<\/param>\n <\/xacro:if>\n <\/hardware>\n \n \n \n ${initial_positions['panda_joint1']}<\/param>\n <\/state_interface>\n \n <\/joint>\n \n \n \n ${initial_positions['panda_joint2']}<\/param>\n <\/state_interface>\n \n <\/joint>\n \n \n \n ${initial_positions['panda_joint3']}<\/param>\n <\/state_interface>\n \n <\/joint>\n \n \n \n ${initial_positions['panda_joint4']}<\/param>\n <\/state_interface>\n \n <\/joint>\n \n \n \n ${initial_positions['panda_joint5']}<\/param>\n <\/state_interface>\n \n <\/joint>\n \n \n \n ${initial_positions['panda_joint6']}<\/param>\n <\/state_interface>\n \n <\/joint>\n \n \n \n ${initial_positions['panda_joint7']}<\/param>\n <\/state_interface>\n \n <\/joint>\n <\/ros2_control>\n <\/xacro:macro>\n<\/robot>\nNow you can run ros2 launch moveit2_tutorials demo.launch.py, open a second terminal and run ros2 topic echo \/joint_states. Plan an arbitrary trajectory by using rviz and hit Plan & Execute in the MotionPlanning panel of rviz. Then you should see a motion being executed and the terminal should report:\n\n[ros2_control_node-5] [INFO] [1697458106.110702550] [panda_arm_controller]: Goal reached, success!\n[move_group-4] [INFO] [1697458106.122919526] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: Controller 'panda_arm_controller' successfully finished\n[move_group-4] [INFO] [1697458106.151076866] [moveit_ros.trajectory_execution_manager]: Completed trajectory execution with status SUCCEEDED ...\n[move_group-4] [INFO] [1697458106.151414260] [moveit_move_group_default_capabilities.move_action_capability]: Solution was found and executed.\n[rviz2-1] [INFO] [1697458106.151859534] [move_group_interface]: Plan and Execute request complete!\nIn parallel you can check the logs of ros2 topic echo \/joint_states which should report non-zero velocities even after the trajectory is successfully executed. Therefore the arm keeps moving (slowly but steady) and you should see the positions constantly changing.\n\nIs this the intended behavior of the Joint Trajectory Controller? Or do I just have a bad parameter setup? Any help or hint on what the problem could be would be highly appreciated!","reasoning":"This is related to velocity or effort command interface. We can check related discussions.","id":"69","excluded_ids":["N\/A"],"gold_ids_long":["joint_controller_velocity\/558.txt"],"gold_ids":["joint_controller_velocity\/558_16.txt","joint_controller_velocity\/558_11.txt","joint_controller_velocity\/558_13.txt","joint_controller_velocity\/558_14.txt","joint_controller_velocity\/558_15.txt","joint_controller_velocity\/558_6.txt","joint_controller_velocity\/558_3.txt","joint_controller_velocity\/558_4.txt","joint_controller_velocity\/558_12.txt"],"gold_answer":"$\\begingroup$\n\nWhich ROS distro are you using? This is a well-known \"feature\"\/bug and was [\nfixed for rolling\/iron packages ](https:\/\/github.com\/ros-\ncontrols\/ros2_controllers\/pull\/558) . I plan to backport this fix to humble,\nbut this might still take some time to ensure not breaking existing setups."} {"query":"How to publish pose of the lidar\/camera\/(or any dynamic\/static model) in gazebo fortress?\n\nI am trying publish the pose of the camera and view it in rviz2. I am using ros2 Humble and gazebo fortress. I can see the image using the image topic but i am not able to visualize the topic in the gazebo as well. Here is my sdf file.\n\n\n\n \n \n <\/plugin>\n \n ogre2<\/render_engine>\n <\/plugin>\n \n <\/plugin>\n \n <\/plugin>\n \n true<\/cast_shadows>\n 0 0 10 0 0 0<\/pose>\n 0.8 0.8 0.8 1<\/diffuse>\n 0.2 0.2 0.2 1<\/specular>\n \n 1000<\/range>\n 0.9<\/constant>\n 0.01<\/linear>\n 0.001<\/quadratic>\n <\/attenuation>\n -0.5 0.1 -0.9<\/direction>\n <\/light>\n\n \n true<\/static>\n \n \n \n \n 0.0 0.0 1<\/normal>\n 100 100<\/size>\n <\/plane>\n <\/geometry>\n <\/collision>\n \n \n \n 0.0 0.0 1<\/normal>\n 100 100<\/size>\n <\/plane>\n <\/geometry>\n \n 0.8 0.8 0.8 1<\/ambient>\n 0.8 0.8 0.8 1<\/diffuse>\n 0.8 0.8 0.8 1<\/specular>\n <\/material>\n <\/visual>\n <\/link>\n <\/model>\n\n \n \n 5.0 0 0.7 0 0 0<\/pose>\n \n \n \n 1<\/ixx>\n 0<\/ixy>\n 0<\/ixz>\n 1<\/iyy>\n 0<\/iyz>\n 1<\/izz>\n <\/inertia>\n 1.0<\/mass>\n <\/inertial>\n \n \n \n 1 1 1<\/size>\n <\/box>\n <\/geometry>\n <\/collision>\n\n \n \n \n 1 1 1<\/size>\n <\/box>\n <\/geometry>\n \n 0.3 0.3 0.3 1<\/ambient>\n 0.3 0.3 0.3 1<\/diffuse>\n 0.3 0.5 0.3 1<\/specular>\n <\/material>\n <\/visual>\n <\/link>\n <\/model>\n\n \n true<\/static>\n 4 -6 2 0 0 1.57<\/pose>\n \n 0.05 0.05 0.05 0 0 0<\/pose>\n \n \n \n 0.1 0.1 0.1<\/size>\n <\/box>\n <\/geometry>\n <\/visual>\n \n \n 1.047<\/horizontal_fov>\n \n 640<\/width>\n 480<\/height>\n <\/image>\n \n 0.1<\/near>\n 100<\/far>\n <\/clip>\n <\/camera>\n 1<\/always_on>\n 30<\/update_rate>\n true<\/visualize>\n camera<\/topic>\n <\/sensor>\n <\/link>\n <\/model>\n\n \n \n 4.05 -6 2 0 0 1.57<\/pose>\n \n 0.05 0.05 0.05 0 0 0<\/pose>\n \n 0.1<\/mass>\n \n 0.000166667<\/ixx>\n 0.000166667<\/iyy>\n 0.000166667<\/izz>\n <\/inertia>\n <\/inertial>\n \n \n \n 0.1 0.1 0.1<\/size>\n <\/box>\n <\/geometry>\n <\/collision>\n \n \n \n 0.1 0.1 0.1<\/size>\n <\/box>\n <\/geometry>\n <\/visual>\n\n \n lidar<\/topic>\n 10<\/update_rate>\n \n \n \n 1024<\/samples>\n 1<\/resolution>\n -1.396263<\/min_angle>\n 1.396263<\/max_angle>\n <\/horizontal>\n \n 64<\/samples>\n 1<\/resolution>\n -0.261799<\/min_angle>\n 0.261799<\/max_angle>\n <\/vertical>\n <\/scan>\n \n 0.08<\/min>\n 30.0<\/max>\n 0.01<\/resolution>\n <\/range>\n <\/lidar>\n 1<\/alwaysOn>\n true<\/visualize>\n <\/sensor>\n\n \n true<\/publish_link_pose>\n true<\/publish_sensor_pose>\n true<\/use_pose_vector_msg>\n true<\/static_publisher>\n <\/plugin>\n <\/link>\n true<\/static>\n <\/model>\n <\/world>\n<\/sdf>\nI tried to publish the pose of the lidar using pose-publisher-system as well. Thank you.","reasoning":"We need to check the usage of pose plugin, e.g., with examples","id":"70","excluded_ids":["N\/A"],"gold_ids_long":["camera_plugin\/posepublishersdf.txt"],"gold_ids":["camera_plugin\/posepublishersdf_3.txt","camera_plugin\/posepublishersdf_4.txt","camera_plugin\/posepublishersdf_5.txt","camera_plugin\/posepublishersdf_2.txt","camera_plugin\/posepublishersdf_0.txt","camera_plugin\/posepublishersdf_6.txt","camera_plugin\/posepublishersdf_1.txt"],"gold_answer":"$\\begingroup$\n\nA Gazebo Sim system plugin can only be attached to a ` ` , a ` \n` or a ` ` , not to a ` ` . You should be getting an error\nmessage for this in the log output, I think even without verbose output\nenabled. In any case: for testing purposes it is advisable to enable verbose\noutput ( ` -v 4 ` ), e.g.:\n\n \n \n ign gazebo -v 4 world.sdf\n \n\nAll standard Gazebo Fortress system plugins can be found in the [ GitHub\nrepository ](https:\/\/github.com\/gazebosim\/gz-sim\/tree\/ign-gazebo6\/src\/systems)\n. See the other branches of that repository for the other Gazebo Sim versions.\n\nEach plugin has usage documentation in its header file. For the `\nPosePublisher ` system see [ this part of the header file\n](https:\/\/github.com\/gazebosim\/gz-\nsim\/blob\/14b0f3b42da811cdd8fb24e983c2b2598a855c91\/src\/systems\/pose_publisher\/PosePublisher.hh#L35-L66)\n.\n\nI haven't used that plugin yet, but given following documentation I conclude\nthat you just have to add the plugin to the ` ` in order to get all\npose information published:\n\n> Attach to an entity to publish the transform of its child entities in the\n> form of gz::msgs::Pose messages, or a single gz::msgs::Pose_V message if\n> \"use_pose_vector_msg\" is true.\n\nThe GitHub repository also holds [ example worlds\n](https:\/\/github.com\/gazebosim\/gz-sim\/tree\/ign-gazebo6\/examples\/worlds) that\nshow the use of each plugin. [ Here ](https:\/\/github.com\/gazebosim\/gz-\nsim\/blob\/ign-gazebo6\/examples\/worlds\/pose_publisher.sdf) is the one for the\npose publisher."} {"query":"How to get sensor data over a topic with webots_ros2 plugin?\n\nI've installed webots 2023b and after I saw that a world with and inverted pendulum has been already shipped in the default installation directory, I decided to use that world for my project.\n\nBasically I followed this tutorial and this tutorial to be able to publish sensor data directly from the urdf file itself. That means, that I create this file:\n\n\n\n \n \n \n \/hip<\/topicName>\n true<\/alwaysOn>\n <\/ros>\n <\/device>\n \n \n \/horizontal_position<\/topicName>\n true<\/alwaysOn>\n <\/ros>\n <\/device>\n \n <\/webots>\n<\/robot>\nbut, even if, everything starts correctly (no errors or warnings in webots), doing a:\n\n $ros2 topic list\ndoes not show any topic with the name \/hip or \/horizontal_position. It hangs forever waiting for data to be published.\n\nThe simulator is not paused, since I created a driver, which moves the cart forth and back.\n\nAny idea?\n\nThe code for the world is the same. I changed only the name. But I add it here anyway, just in case.\n\n#VRML_SIM R2023b utf8\n \nEXTERNPROTO \"https:\/\/raw.githubusercontent.com\/cyberbotics\/webots\/R2023b\/projects\/objects\/backgrounds\/protos\/TexturedBackground.proto\"\nEXTERNPROTO \"https:\/\/raw.githubusercontent.com\/cyberbotics\/webots\/R2023b\/projects\/objects\/floors\/protos\/Floor.proto\"\n\nWorldInfo {\n info [\n \"An example of hot to solve the Inverted Pendulum problem using a PID controller\"\n ]\n title \"Inverted Pendulum\"\n basicTimeStep 16\n contactProperties [\n ContactProperties {\n material1 \"robot_basis\"\n material2 \"floor\"\n coulombFriction [\n 0.2\n ]\n }\n ]\n}\nViewpoint {\n orientation -0.0996069518072968 -0.03685053329082472 0.9943442529364971 3.666446119327704\n position 13.193129047100818 10.690115274872808 4.2889817843979205\n follow \"robot:solid\"\n}\nTexturedBackground {\n}\nFloor {\n size 1000 2\n appearance PBRAppearance {\n baseColorMap ImageTexture {\n url [\n \"https:\/\/raw.githubusercontent.com\/cyberbotics\/webots\/R2023b\/projects\/default\/worlds\/textures\/checkered_marble.jpg\"\n ]\n }\n roughness 1\n metalness 0\n }\n}\nRobot {\n rotation 0 0 1 3.14159\n children [\n SliderJoint {\n jointParameters JointParameters {\n axis 1 0 0\n dampingConstant 1.5\n }\n device [\n LinearMotor {\n name \"horizontal_motor\"\n maxForce 40\n }\n PositionSensor {\n name \"horizontal position sensor\"\n }\n ]\n endPoint Solid {\n translation 0 0 0.06\n children [\n DEF ROBOT_SHAPE Shape {\n appearance PBRAppearance {\n baseColor 0.2443427176317998 0.704051270313573 0.1756923781185626\n roughness 1\n metalness 0\n }\n geometry Box {\n size 0.3 0.1 0.1\n }\n }\n DEF HIP HingeJoint {\n jointParameters HingeJointParameters {\n position 0.000161402\n axis 0 1 0\n anchor 0 0 0.03\n }\n device [\n PositionSensor {\n name \"hip\"\n }\n ]\n endPoint DEF THIGH_BB Solid {\n translation 0 -0.061 0.33000000000000007\n rotation 0 1 0 0\n children [\n Shape {\n appearance PBRAppearance {\n baseColor 0.8496833752956435 0.07072556649118791 0.09393453879606317\n roughness 1\n metalness 0\n }\n geometry DEF THIGH_BOX Box {\n size 0.05 0.02 0.6\n }\n }\n ]\n boundingObject USE THIGH_BOX\n physics Physics {\n density -1\n mass 0.05\n centerOfMass [\n 0 0.061 -0.27\n ]\n }\n }\n }\n PointLight {\n attenuation 0 0 1\n intensity 5\n location 0 0 2\n }\n ]\n contactMaterial \"robot_basis\"\n boundingObject USE ROBOT_SHAPE\n physics Physics {\n density -1\n mass 1\n }\n }\n }\n ]\n name \"Inverted_Pendulum\"\n boundingObject Box {\n size 200 0.1 0.01\n }\n physics Physics {\n density -1\n mass 30\n }\n controller \"\"\n}","reasoning":"This is related to ros2_control. We may check the ros2_control interface for webots_ros2.","id":"71","excluded_ids":["N\/A"],"gold_ids_long":["webots_plugin\/turtlebotwebotsurdfL.txt"],"gold_ids":["webots_plugin\/turtlebotwebotsurdfL_0.txt"],"gold_answer":"$\\begingroup$\n\nThere is no position sensor ROS plugin in ` webots_ros2 ` .\n\nThere are two ways to get joint position data published:\n\n * Use [ ` ros2_control ` ](https:\/\/control.ros.org\/master\/index.html) . There is a ` ros2_control ` interface for ` webots_ros2 ` called [ ` webots_ros2_control ` ](https:\/\/github.com\/cyberbotics\/webots_ros2\/tree\/master\/webots_ros2_control) (see usage example [ here ](https:\/\/github.com\/cyberbotics\/webots_ros2\/blob\/b0361c09c13e070be76d85aa89d9d0794b6d2a0b\/webots_ros2_turtlebot\/resource\/turtlebot_webots.urdf#L33%5D) ). In your case, you will need to spawn [ ` joint_state_broadcaster ` ](https:\/\/control.ros.org\/master\/doc\/ros2_controllers\/joint_state_broadcaster\/doc\/userdoc.html) which publishes joints state messages. This is generally a recommended way to interact with joints in ROS as you can achieve hard control loops, much better performance, and simpler sim2real transfer. \n * Create a custom ` webots_ros2 ` plugin (see the [ tutorial ](https:\/\/docs.ros.org\/en\/humble\/Tutorials\/Advanced\/Simulators\/Webots\/Setting-Up-Simulation-Webots-Basic.html) ). You can use it to create a joint state publisher and publish joints state messages."} {"query":"ros2 parameter setting\n\nI would like to follow a simple take off and land example without any launch files or yaml files on ros2 crazyswarm (Physical Experiments part). What could be the reason for the following output, thanks.\n\nntukenmez3@ae-icps-407120:~\/Documents\/ros2_ws$ ros2 param set crazyflie_server cf231.params.commander.enHighLevel 1\nSetting parameter failed","reasoning":"The cause may be the incorrect setup of crazyflie. We may check the example of crazyflie.yml.","id":"72","excluded_ids":["N\/A"],"gold_ids_long":["crazyswarm\/usagehtmlcrazyfliesy.txt"],"gold_ids":["crazyswarm\/usagehtmlcrazyfliesy_4.txt","crazyswarm\/usagehtmlcrazyfliesy_5.txt","crazyswarm\/usagehtmlcrazyfliesy_3.txt"],"gold_answer":"$\\begingroup$\n\nBe sure you set up correctly the ` crazyflies.yaml ` file: [ link\n](https:\/\/imrclab.github.io\/crazyswarm2\/usage.html#crazyflies-yaml)"} {"query":"How to put ArUco markers in Gazebo Classic\n\nThe title says it all. I would like to test my robot's ArUco recognition and processing abilities by putting some markers around environments in classic Gazebo.\n\nAll the tutorials I see online seem to be for older versions of Gazebo and (frankly) use some very elaborate tricks.\n\nWhat is the canonical way of adding a marker to Gazebo?\n\nEDIT: My version of Gazebo is 11.10.2, by \"older versions of Gazebo\" I mean older versions of Gazebo classic specifically. Sorry for any confusion.","reasoning":"We can check some implementation examples about how it works.","id":"73","excluded_ids":["N\/A"],"gold_ids_long":["visual_marker\/visualservoingingaze.txt"],"gold_ids":["visual_marker\/visualservoingingaze_2.txt","visual_marker\/visualservoingingaze_8.txt","visual_marker\/visualservoingingaze_11.txt","visual_marker\/visualservoingingaze_7.txt","visual_marker\/visualservoingingaze_10.txt","visual_marker\/visualservoingingaze_5.txt","visual_marker\/visualservoingingaze_4.txt","visual_marker\/visualservoingingaze_12.txt","visual_marker\/visualservoingingaze_6.txt","visual_marker\/visualservoingingaze_1.txt","visual_marker\/visualservoingingaze_9.txt","visual_marker\/visualservoingingaze_3.txt"],"gold_answer":"$\\begingroup$\n\n[ This forum post ](https:\/\/answers.gazebosim.org\/\/question\/27574\/is-it-\npossible-to-create-an-aruco-marker-and-add-it-to-gazebo11\/) and [ this blog\npost ](https:\/\/nlamprian.me\/blog\/software\/ros\/2020\/01\/27\/visual-servoing-in-\ngazebo\/) and corresponding [ example model\n](https:\/\/github.com\/nlamprian\/grobot\/tree\/master\/grobot_gazebo\/models\/aruco_marker)\nare pretty helpful.\n\nThis is just a simple [ model\n](https:\/\/github.com\/nlamprian\/grobot\/blob\/78fd627990f743997138015d14e9059079e3044f\/grobot_gazebo\/models\/aruco_marker\/model.sdf#L3)\ndefining a link which has a [ front visual\n](https:\/\/github.com\/nlamprian\/grobot\/blob\/78fd627990f743997138015d14e9059079e3044f\/grobot_gazebo\/models\/aruco_marker\/model.sdf#L17-L31)\nand a [ back visual\n](https:\/\/github.com\/nlamprian\/grobot\/blob\/78fd627990f743997138015d14e9059079e3044f\/grobot_gazebo\/models\/aruco_marker\/model.sdf#L33-L40)\n. The front visual loads the aruco marker throug a [ material script\n](https:\/\/github.com\/nlamprian\/grobot\/blob\/78fd627990f743997138015d14e9059079e3044f\/grobot_gazebo\/models\/aruco_marker\/model.sdf#L25-L29)\n.\n\nThere is nothing \"very elaborately tricky\" about this, this is just how\ntextures are done in Gazebo Classic. The material script and the marker image\nare [ here\n](https:\/\/github.com\/nlamprian\/grobot\/tree\/master\/grobot_gazebo\/models\/aruco_marker\/materials)\n; this should be self-explanatory.\n\nGiven you mention \"older versions of Gazebo\": be aware that there is 'Gazebo\nClassic' which typically has version _numers_ and is currently at version 11,\nand there is 'Gazebo Sim' (i.e. 'New Gazebo') which gets version _names_ ,\ne.g. Fortress, Garden, Harmonic. Gazebo Sim used to be called 'Ignition'. This\nwas changed to 'Gazebo Sim' due to some trademark issues wrt 'ignition'.\n\nThe material scripts work for Gazebo _Classic_ , not for Gazebo _Sim_ . If you\nneed a solution for Gazebo Sim, then [ this\n](https:\/\/www.youtube.com\/watch?v=A3fJwTL2O4g) looks promising (I did not test\nit, but it seems to generate a ` dae ` model and load it as a mesh, which is\nindeed a possible way to load textures in Gazebo Sim)."} {"query":"Cannot locate rosdep definition, error on micro-ROS\n\nI'm trying to set up micro-ROS on Ubuntu 20.04 using this website, and connect ESP32 to ROS 2. However, when executing the command ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32, I get the following error:\n\nERROR: the following packages\/stacks could not have their rosdep keys resolved\nto system dependencies:\nrclc_parameter: Cannot locate rosdep definition for [osrf_testing_tools_cpp]\nrmw: Cannot locate rosdep definition for [osrf_testing_tools_cpp]\nrmw_implementation: Cannot locate rosdep definition for [rcpputils]\nrosidl_typesupport_c: Cannot locate rosdep definition for [mimick_vendor]\nrosidl_default_runtime: Cannot locate rosdep definition for [rosidl_typesupport_introspection_cpp]\nrcl_logging_noop: Cannot locate rosdep definition for [launch_testing]\nrosidl_typesupport_microxrcedds_c_tests: Cannot locate rosdep definition for [rosidl_typesupport_introspection_c]\ntracetools_launch: Cannot locate rosdep definition for [launch_ros]\nrcutils: Cannot locate rosdep definition for [osrf_testing_tools_cpp]\nrcl_action: Cannot locate rosdep definition for [osrf_testing_tools_cpp]\nlibyaml_vendor: Cannot locate rosdep definition for [rcpputils]\nrcl_lifecycle: Cannot locate rosdep definition for [osrf_testing_tools_cpp]\ntracetools_test: Cannot locate rosdep definition for [launch_ros]\ntest_rmw_implementation: Cannot locate rosdep definition for [rmw_dds_common]\nrclc_lifecycle: Cannot locate rosdep definition for [osrf_testing_tools_cpp]\nrosidl_typesupport_cpp: Cannot locate rosdep definition for [rcpputils]\nrcl: Cannot locate rosdep definition for [rcpputils]\nros2trace: Cannot locate rosdep definition for [ros2cli]\nrclc: Cannot locate rosdep definition for [osrf_testing_tools_cpp]\nIs there any solution?\n\nIncidentally, I implemented the following solution suggested by ChatGPT, but it didn't improve the situation.\n\nUpdate ROS 2 dependencies. rosdep update\nInstall System Packages, which ROS2 packages or stacks depend on. rosdep install --from-paths \/path\/to\/your\/ros2\/workspace --ignore-src --rosdistro \nRebuild the ROS 2 workspace. colcon build\n","reasoning":"This looks like using galactic. We may check recent releases to see the supported distributions.","id":"74","excluded_ids":["N\/A"],"gold_ids_long":["galactic\/Releaseshtml.txt"],"gold_ids":["galactic\/Releaseshtml_7.txt"],"gold_answer":"$\\begingroup$\n\nSince you mention that you are using ` Ubuntu 20.04 ` , you can not use the\ntutorial. It is written for ` Ubuntu 22.04 ` ( [\nhttps:\/\/micro.ros.org\/docs\/tutorials\/core\/first_application_rtos\/freertos\/#:~:text=Hawksbill%20on%20your-,Ubuntu%2022.04,-LTS%20computer.%20To\n](https:\/\/micro.ros.org\/docs\/tutorials\/core\/first_application_rtos\/freertos\/#:%7E:text=Hawksbill%20on%20your-,Ubuntu%2022.04,-LTS%20computer.%20To)\n)\n\nI assume you are trying to use **galactic** , which is not supported any more\n( [ https:\/\/docs.ros.org\/en\/rolling\/Releases.html\n](https:\/\/docs.ros.org\/en\/rolling\/Releases.html) )"} {"query":"Intel RealSense with ROS 2\n\nI am just getting started with Intel Real Sense integration with ROS2. When trying to install Intel real sense packages in ROS 2 Humble, the official documentation says the supported kernel version of this package is only for 5.4 or less. On the contrary, by default, the kernel version of ROS2 humble in Ubuntu 22 is 6.\n\nPlease give some input on whether ROS2 Humble supports real-sense integration.","reasoning":"We may need to configure your Ubuntu repositories in order to install these packages. We can check the official documents for details.","id":"75","excluded_ids":["N\/A"],"gold_ids_long":["realtime_ros2\/realsenseros.txt"],"gold_ids":["realtime_ros2\/realsenseros_8.txt","realtime_ros2\/realsenseros_9.txt"],"gold_answer":"$\\begingroup$\n\nWelcome to Robotics Stack Exchange!\n\nIn short, the Intel RealSense camera works with ROS 2. You are looking at the\ndocumentation of the ` librealsense ` , which may not be updated accordingly.\nAnyways, I strongly suggest installing the prebuilt package using ` apt ` .\nBelow is an example:\n\n \n \n sudo apt install ros--librealsense2*\n sudo apt install ros--realsense2-*\n \n\nPlease note that you may need to configure your Ubuntu repositories in order\nto install these packages. So, please look at [ the official documentation\n](https:\/\/github.com\/IntelRealSense\/realsense-ros#--installation) ."} {"query":"Gazebo Garden Detachable Joint with moving object causing massive velocity errors\n\nI 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.\n\nA 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.\n\nthis plugin takes heavy inspiration from the detachable joint system inside the gz_sim repo\n\ngazebo Versions:\n\nsim: 7.5.0\nplugin: 2.0.1\ntransport 12.2.0\n#include \n\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace monke_plugins;\n\n\nJointCreator::JointCreator():\ndataPtr(new JointCreatorPrivate)\n{\n\n}\nJointCreator::~JointCreator(){\n\n}\nvoid JointCreator::Configure(const gz::sim::Entity &_entity,\n const std::shared_ptr & _sdf,\n gz::sim::EntityComponentManager &_ecm,\n gz::sim::EventManager &\/*_eventMgr*\/\n){\n\n \/\/ Initialise the Plugin via sdf elements\n\n gzmsg << \"loading JointCreator plugin\\n\";\n if(_sdf->HasElement(\"parent\")){\n\n this->dataPtr->end_effector_link_name = _sdf->Get(\"parent\");\n }\n else{\n gzerr << \"[parent] link name not specified in sdf \\n\";\n return;\n }\n\n gz::sim::Model model(_entity);\n this->dataPtr->end_effector_entity = model.LinkByName(_ecm, this->dataPtr->end_effector_link_name);\n if (this->dataPtr->end_effector_entity == gz::sim::kNullEntity)\n {\n gzerr << \"Could not find link named \"<< this->dataPtr->end_effector_link_name << std::endl;\n return;\n }\n\n if(_sdf->HasElement(\"contact_sensor_topic\")){\n this->dataPtr->contact_sensor_topic = _sdf->Get(\"contact_sensor_topic\");\n std::function callback = [this](gz::msgs::Contacts msg){this->ContactSensorCallback(msg);};\n if(!this->dataPtr->transport_node->Subscribe(this->dataPtr->contact_sensor_topic,callback)){\n gzerr << \"Failed to subscribe to topic [\" << this->dataPtr->contact_sensor_topic << \"] \\n\";\n return;\n }\n \/\/? idk if advertising a subscription works\n this->dataPtr->transport_node->Advertise(this->dataPtr->contact_sensor_topic);\n\n }\n else{\n gzerr << \"detachable_joint plugin has no SDF Element contact_sensor_topic\";\n return;\n }\n \n if(_sdf->HasElement(\"command_topic\")){\n this->dataPtr->command_topic = _sdf->Get(\"command_topic\");\n std::function callback = [this](gz::msgs::Boolean msg){this->CommandCallback(msg);};\n if(!this->dataPtr->transport_node->Subscribe(this->dataPtr->command_topic,callback)){\n gzerr << \"Failed to subscribe to topic [\" << this->dataPtr->command_topic << \"] \\n\";\n return;\n }\n \/\/? idk if advertising a subscription works \n this->dataPtr->transport_node->Advertise(this->dataPtr->command_topic); \n \n }\n else{\n gzerr << \"detachable_joint plugin has no SDF Element command_topic\";\n return;\n }\n\n if(_sdf->HasElement(\"triggered_topic\")){\n this->dataPtr->triggered_topic = _sdf->Get(\"triggered_topic\");\n \n this->dataPtr->publisher = std::make_unique(this->dataPtr->transport_node->Advertise(this->dataPtr->triggered_topic)); \n \n }\n else{\n gzerr << \"detachable_joint plugin has no SDF Element triggered_topic\";\n return;\n }\n\n\n\n\n\n\n\n}\n\nvoid JointCreator::PostUpdate(const gz::sim::UpdateInfo &_info,\nconst gz::sim::EntityComponentManager &_ecm){\n\n if(_info.paused){return;} \/\/if sim is paused.\n\n \/\/ gzmsg << \"JointCreator::PostUpdate - \" << _info.simTime.count() << std::endl;\n \n}\n\nvoid JointCreator::PreUpdate(const gz::sim::UpdateInfo &_info,\ngz::sim::EntityComponentManager &_ecm){\n if(_info.paused){return;} \/\/if sim is paused.\n\n\n auto Contact = [this](){return(this->dataPtr->contacted_entity != gz::sim::kNullEntity);};\n\n\n\n if(this->dataPtr->PluginActive && !this->dataPtr->JointCreated && Contact()){ \/\/! CREATE JOINT\n \/\/ if the joint is active, it has not been created, and contact is made, then create the joint\n this->dataPtr->joint = _ecm.CreateEntity();\n auto parentLink = _ecm.ParentEntity(this->dataPtr->contacted_entity); \/\/create a new link as the parent entity of the obejct we're trying to grab\n _ecm.CreateComponent(\n this->dataPtr->joint,\n gz::sim::components::DetachableJoint({this->dataPtr->end_effector_entity,parentLink,\"fixed\"})\n );\n gzdbg << \"created detachable joint between end effector & [\" << this->dataPtr->contacted_entity<< \"] @ \" << _info.simTime.count() <<\"\\n\";\n gz::msgs::Boolean msg;\n msg.set_data(true);\n this->dataPtr->publisher->Publish(msg);\n\n\n this->dataPtr->JointCreated = true;\n\n }\n if(!this->dataPtr->PluginActive && this->dataPtr->JointCreated){\/\/! DESTROY JOINT\n \/\/ if the joint is not active and the joint has been created, then destroy the joint.\n _ecm.RequestRemoveEntity(this->dataPtr->joint,true);\n this->dataPtr->joint = gz::sim::kNullEntity;\n\n \n gzdbg << \"deleted detachable joint between end effector & [\"<< this->dataPtr->child_entity << \"] @ \" << _info.simTime.count() <<\"\\n\";\n gz::msgs::Boolean msg;\n msg.set_data(false);\n this->dataPtr->publisher->Publish(msg);\n this->dataPtr->JointCreated = false;\n }\n \n \n}\n\n\nvoid JointCreator::CommandCallback(const gz::msgs::Boolean & _msg){\n gzmsg << \"JointCreator received command msg [\" << _msg.data() << \"]\\n\";\n this->dataPtr->PluginActive = _msg.data(); \n}\n\nvoid JointCreator::ContactSensorCallback(const gz::msgs::Contacts & _msg){\n if(_msg.contact_size()){\n gzmsg << \"JointCreator received contact msg with object: [\" << _msg.contact(0).collision2().id() << \"]\\n\";\n auto contact = _msg.contact(0);\n this->dataPtr->contacted_entity = contact.collision2().id();\n\n }\n else{\n this->dataPtr->contacted_entity = gz::sim::kNullEntity;\n }\n}\n\nGZ_ADD_PLUGIN(\n monke_plugins::JointCreator,\n gz::sim::System,\n monke_plugins::JointCreator::ISystemPreUpdate,\n \/\/ sample_system::JointCreator::ISystemUpdate,\n monke_plugins::JointCreator::ISystemPostUpdate,\n monke_plugins::JointCreator::ISystemConfigure\n)\n\/\/ GZ_ADD_PLUGIN_ALIAS(sample_system::JointCreator,\"gz::sim:systems::JointCreator\")\n```","reasoning":"The problem is related to the model collision. We may check details about collion between detached models.","id":"76","excluded_ids":["N\/A"],"gold_ids_long":["detachable_joint\/detachablejointsmd.txt"],"gold_ids":["detachable_joint\/detachablejointsmd_5.txt"],"gold_answer":"$\\begingroup$\n\nThere's a [ remark in the tutorial ](https:\/\/github.com\/gazebosim\/gz-\nsim\/blob\/gz-sim8\/tutorials\/detachable_joints.md) that models should not be\ncolliding when the detachable joint is made. See also [ this discussion\n](https:\/\/github.com\/gazebosim\/gz-sim\/pull\/1687#pullrequestreview-1440781144)\nin the pull request.\n\nSo I think the behavior you experience is due to this.\n\nAn alternative, instead of checking for _contact_ , you could check for\n_distance_ and create the joint when the object is close enough.\n\nOr, in a similar previous question I suggested [ to use a PerformerDetector\n](https:\/\/robotics.stackexchange.com\/questions\/25095\/gazebo-garden-how-to-get-\ncolliding-entities-with-gpu-lidar-sensor-ray\/25099#25099) . This reports when\nan object enters a specific volume. I have not tried this yet, but the idea is\nthat you could place a small detection volume at the center of your gripper\nand get notified if (and which) object overlaps with that region. And then you\ncan create the joint with that object.\n\nNote that there is a remark to that answer that the \"PerformerDetector uses\naxis aligned boxes\". Not sure what that means and why it would be an issue."} {"query":"Point cloud in gazebo environment\n\nI 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 how to generate a point cloud of an outdoor environment in Ignition Gazebo Fortress?","reasoning":"The user wants to take a ros2 PointCloud2 message and write it to a .pcd file. We may check instructions to do this.","id":"77","excluded_ids":["N\/A"],"gold_ids_long":["point_cloud\/pclros.txt"],"gold_ids":["point_cloud\/pclros_92.txt","point_cloud\/pclros_90.txt","point_cloud\/pclros_93.txt","point_cloud\/pclros_91.txt"],"gold_answer":"$\\begingroup$\n\nSo you want to take a ros2 PointCloud2 message and write it to a .pcd file.\n\nThere is a existing ros1\/ros2 package called ` pcl_ros ` . The src code for\nboth is in this [ github repo ](https:\/\/github.com\/ros-\nperception\/perception_pcl) , but I don't know the current status of the port\nto ros2. This package has a ros node named ` pointcloud_to_pcd ` that writes\nPointCloud2 messages into .pcd files."} {"query":"Use sim time with Moveit\n\nI 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 move_group.launcy.py file looks like this:\n\nfrom moveit_configs_utils import MoveItConfigsBuilder\nfrom moveit_configs_utils.launches import generate_move_group_launch\n\n\ndef generate_launch_description():\n moveit_config = MoveItConfigsBuilder(\"ur\", package_name=\"flower_catcher_moveit_config\").to_moveit_configs()\n return generate_move_group_launch(moveit_config)\nThe problem with this format is that there is no way for me to set the use_sim_time parameter to true, and that causes the path execution to fail with this error:\n\n[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.\nI kind of solved the problem by setting the parameter afterward with the command\n\nros2 param set \/move_group use_sim_time true\nHowever, I want to know if there is a way to set this parameter in the launch file.\n\nThanks!\n\n","reasoning":"The user wants to set use_sim_time to be true in the config. We may check issues\/discussions that also involve using this parameter.","id":"78","excluded_ids":["N\/A"],"gold_ids_long":["use_sim_time\/1810.txt"],"gold_ids":["use_sim_time\/1810_6.txt","use_sim_time\/1810_7.txt","use_sim_time\/1810_5.txt","use_sim_time\/1810_3.txt","use_sim_time\/1810_4.txt"],"gold_answer":"$\\begingroup$\n\nUnfortunately, there is no clean way to pass it through launch file, while\nusing ` moveit_configs_utils.launches ` . This was raised previously in an [\nissue ](https:\/\/github.com\/ros-\nplanning\/moveit2\/issues\/1810#issuecomment-1353538795) and ` use_sim_time `\ntechnically supposed to be added [ here ](https:\/\/github.com\/ros-\nplanning\/moveit2\/blob\/5dd0d5e63c9dae08976656cb1c8473ca7a34c058\/moveit_configs_utils\/moveit_configs_utils\/launches.py#L225)\nin the source code. That said, here is an engineered solution around this:\n\n \n \n from moveit_configs_utils import MoveItConfigsBuilder\n from moveit_configs_utils.launches import *\n def generate_move_group_launch(moveit_config):\n ld = LaunchDescription()\n ld.add_action(DeclareBooleanLaunchArg(\"debug\", default_value=False))\n ld.add_action(\n DeclareBooleanLaunchArg(\"allow_trajectory_execution\", default_value=True)\n )\n ld.add_action(\n DeclareBooleanLaunchArg(\"publish_monitored_planning_scene\", default_value=True)\n )\n # load non-default MoveGroup capabilities (space separated)\n ld.add_action(DeclareLaunchArgument(\"capabilities\", default_value=\"\"))\n # inhibit these default MoveGroup capabilities (space separated)\n ld.add_action(DeclareLaunchArgument(\"disable_capabilities\", default_value=\"\"))\n # do not copy dynamics information from \/joint_states to internal robot monitoring\n # default to false, because almost nothing in move_group relies on this information\n ld.add_action(DeclareBooleanLaunchArg(\"monitor_dynamics\", default_value=False))\n should_publish = LaunchConfiguration(\"publish_monitored_planning_scene\")\n move_group_configuration = {\n \"publish_robot_description_semantic\": True,\n \"allow_trajectory_execution\": LaunchConfiguration(\"allow_trajectory_execution\"),\n # Note: Wrapping the following values is necessary so that the parameter value can be the empty string\n \"capabilities\": ParameterValue(\n LaunchConfiguration(\"capabilities\"), value_type=str\n ),\n \"disable_capabilities\": ParameterValue(\n LaunchConfiguration(\"disable_capabilities\"), value_type=str\n ),\n # Publish the planning scene of the physical robot so that rviz plugin can know actual robot\n \"publish_planning_scene\": should_publish,\n \"publish_geometry_updates\": should_publish,\n \"publish_state_updates\": should_publish,\n \"publish_transforms_updates\": should_publish,\n \"monitor_dynamics\": False,\n \"use_sim_time\": True\n }\n move_group_params = [\n moveit_config.to_dict(),\n move_group_configuration,\n ]\n add_debuggable_node(\n ld,\n package=\"moveit_ros_move_group\",\n executable=\"move_group\",\n commands_file=str(moveit_config.package_path \/ \"launch\" \/ \"gdb_settings.gdb\"),\n output=\"screen\",\n parameters=move_group_params,\n extra_debug_args=[\"--debug\"],\n # Set the display variable, in case OpenGL code is used internally\n additional_env={\"DISPLAY\": \":0\"},\n )\n return ld\n def generate_launch_description():\n moveit_config = MoveItConfigsBuilder(\"ur\", package_name=\"ur_moveit\").to_moveit_configs()\n return generate_move_group_launch(moveit_config)\n \n\nYou can observe how ` use_sim_time: True ` has been passed with the `\nmove_group_configuration ` dictionary."} {"query":"Setting frame of IMU message in Gazebo Fortress\n\nI 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.\n\nHowever, the frame of the IMU messages is not correct. This is my IMU gazebo code in its corresponding xacro file:\n\n \n Gazebo\/Black<\/material>\n true<\/gravity>\n \n true<\/always_on>\n 25<\/update_rate>\n false<\/visualize>\n ${prefix}\/imu<\/topic>\n \n <\/plugin>\n 0 0 0 0 0 0<\/pose>\n <\/sensor>\n <\/gazebo>\nI have tried to add frameID to the plugin parameters, as I did in Gazebo Classic, but it didn't work. My questions are:\n\nHow to change the frame published in the messages?\nWhat parameters are available for the IMU plugin? Is there any documentation or where can I read the source code?\nThank you!","reasoning":"From the source code it appears you can use the tag gz_frame_id or the older ignition_frame_id (deprecated) as a child of the sensor tag.","id":"79","excluded_ids":["N\/A"],"gold_ids_long":["imu_gazebo\/Sensorcc.txt"],"gold_ids":["imu_gazebo\/Sensorcc_3.txt"],"gold_answer":"$\\begingroup$\n\nFrom the source code it appears you can use the tag ` gz_frame_id ` or the\nolder ` ignition_frame_id ` (deprecated) as a child of the ` sensor ` tag.\n\nThe relevant source code is [ here ](https:\/\/github.com\/gazebosim\/gz-\nsensors\/blob\/ec52913e608ce8f64053650bfcced84a70ca12e2\/src\/Sensor.cc#L158) ."} {"query":"ROS Environment variables not set after new Humble install on Ubuntu 22.04\n\nI carefully followed the install instructions for installing ROS2 Humble binary.\n\nhttps:\/\/docs.ros.org\/en\/humble\/Installation\/Ubuntu-Install-Debians.html\n\nThe install had no errors. And I did the talker-listener test to make sure.\n\nBut none of the ROS environment variables are set.\n\nWhen I type printenv I don't see ROS_VERSION=2,ROS_PYTHON_VERSION=3 or ROS_DISTRO=humble.\n\nThe tutorials page just says to go back to the installation page or get help from the community. So here I am :)\n\nThanks in advance!","reasoning":"We can find examples about how to set environment variables in ros.","id":"80","excluded_ids":["N\/A"],"gold_ids_long":["ros_environment_variable\/EnvironmentVariables.txt"],"gold_ids":["ros_environment_variable\/EnvironmentVariables_7.txt","ros_environment_variable\/EnvironmentVariables_6.txt","ros_environment_variable\/EnvironmentVariables_8.txt","ros_environment_variable\/EnvironmentVariables_10.txt","ros_environment_variable\/EnvironmentVariables_30.txt","ros_environment_variable\/EnvironmentVariables_24.txt","ros_environment_variable\/EnvironmentVariables_31.txt","ros_environment_variable\/EnvironmentVariables_29.txt","ros_environment_variable\/EnvironmentVariables_18.txt"],"gold_answer":"$\\begingroup$\n\nTo have those environment variables exported in every command line\nautomatically, the easiest thing to do is to add ` export VARIABLE_NAME=VALUE\n` for each one at the end of the ` ~\/.bashrc ` file.\n\nAfter saving, you need to open a new terminal window or call ` source\n~\/.bashrc ` for the changes to take effect.\n\n**Edit:**\n\nYou shouldn't have to export those variables by yourself as those are taken\ncare of by the ` setup.bash ` script inside your ros humble instalation.\n\nPlease make sure you have your ros installation sourced in ` ~\/.bashrc ` via `\nsource \/opt\/ros\/humble\/setup.bash `\n\n[ Docs here ](https:\/\/wiki.ros.org\/ROS\/EnvironmentVariables)"} {"query":"ROS2 Map not received when using nav2_bringup\n\nI'm currently using the TurtleBot2 on Ubuntu 22.04 Humble and successfully generated a map with ros2 launch nav2_bringup navigation_launch.py. I was able to use the command ros2 launch nav2_bringup bringup_launch.py map:=\/name\/of\/path.yaml 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\n\n[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 \"map\" passed to canTransform argument target_frame - frame does not exist\n\nOpening 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.\n\nI 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.\n\nCan someone help me out please?","reasoning":"This is related to map server in nav2 system. We can check more details.","id":"81","excluded_ids":["N\/A"],"gold_ids_long":["nav2bringup\/READMEmd.txt"],"gold_ids":["nav2bringup\/READMEmd_2.txt","nav2bringup\/READMEmd_0.txt","nav2bringup\/READMEmd_1.txt"],"gold_answer":"$\\begingroup$\n\nThe nav2 map server is the one that puts the map into the \/map topic, the map\nis published once during launch and not continuously published. If you would\nlike to see the map again you could use the map server services, more info is\navailable here: [ https:\/\/github.com\/ros-\nplanning\/navigation2\/blob\/main\/nav2_map_server\/README.md\n](https:\/\/github.com\/ros-\nplanning\/navigation2\/blob\/main\/nav2_map_server\/README.md)\n\nMore information can be provided if you share the logs."} {"query":"In ROS, is it possible to do dynamic reconfigure with \"nested\" parameters?\n\nNot positive I have the terminology right, but the idea is that I have a ROS 1 node that can have multiple \"layers\" of namespaces for some of the parameters. So the parameter list is something like:\n\n\/perception_node\/map_size\n\/perception_node\/sensor_1\/max_range\n\/perception_node\/sensor_2\/max_range\nIt doesn't have to be set up this way, the key here is that there are multiple \"sensor\" 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.\n\nI'm able to get it up and running so that it all initializes correctly, I can have a sensor struct like this:\n\nstruct Sensor\n{\n string sensor_name; \/\/ < This gets set in the constructor\n float max_range;\n\n void configure(ros::NodeHandle & nodeHandle)\n {\n max_range = nodeHandle.param(sensor_name + \"\/max_range\");\n }\n};\nAnd that works, but I'd really like to use dynamic reconfigure with this setup too. I've used dynamic reconfigure before on other projects, so I know the basics of creating a \".cfg\" file and everything.\n\nBut dynamic reconfigure doesn't seem to like parameter names with \"\/\" symbols in them, at least when I tried the following it failed to compile:\n\ngen = ParameterGenerator()\n\ngen.add(\"sensor_1\/max_range\", float_t ...etc....\nMy initial idea was that since the \".cfg\" 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.\n\nI 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:\n\nsensor_1_params = gen.addGroup(\"sensor_1\")\nsensor_1_params.add(\"max_range\", float_t ...etc...\n\nsensor_2_params = gen.addGroup(\"sensor_2\")\nsensor_2_params.add(\"max_range\", float_t ...etc... #Nope! This fails to compile too\nThe only thing I can think of right now is to get rid of the slashes, so that the parameters are called something like \"sensor_1_max_range\" and \"sensor_2_max_range\" 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:\n\nif (sensor_name == \"sensor_1\") {\n max_range = config.sensor_1_max_range;\n}\nelse if (sensor_name == \"sensor_2\") {\n max_range = config.sensor_2_max_range;\n}\n\/\/ And many more lines...\nI 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.\n\nSo, 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?","reasoning":"We can check example usage of dynamic variables, which are associated with dynamic reconfigure.","id":"82","excluded_ids":["N\/A"],"gold_ids_long":["dynamic_reconfig\/dwaplannerroscpp.txt"],"gold_ids":["dynamic_reconfig\/dwaplannerroscpp_2.txt"],"gold_answer":"$\\begingroup$\n\nYes, multiple sets of dynamic_reconfigure parameters are supported for a\nsingle ros node. You need to create a Server for each path that has this kind\nof parameter. You can reuse a .cfg class name for different paths if you want\nto.\n\nAn example is move_base, which provides dynamic parameters for multiple items\nwithin its \/move_base namespace. Each path is associated to a separate\ndynamic_reconfigure::Server object. The following lines of code are from file\n[ dwa_planner_ros.cpp in the navigation.git repo ](https:\/\/github.com\/ros-\nplanning\/navigation\/blob\/noetic-\ndevel\/dwa_local_planner\/src\/dwa_planner_ros.cpp) , where ` name ` is a\nrelative path like \"DWAPlannerROS\":\n\n \n \n ros::NodeHandle private_nh(\"~\/\" + name);\n dsrv_ = new dynamic_reconfigure::Server(private_nh);\n \n\nTake a look at the rest of that file to get the full picture."} {"query":"Configuration wrt. automatic chaining of `setup.bash` prefix paths from `colcon build`\n\nI recently found (to my great surprise) that upon issuing 'source install\/setup.bash' for my ROS 2 install (built from source), that both Gazebo Sim and ros_gz_bridge were also sourced automatically.\n\nSo I had a look at the ROS 2 install\/setup.bash script, and indeed it mentions:\n\n# This script extends the environment with the environment of other prefix\n# paths which were sourced when this file was generated as well as all packages\n# contained in this prefix path.\nSo probably I did the following:\n\nCompile and source ROS 2,\nCompile and source Gazebo Sim,\nCompile and source ros_gz_bridge,\nCompile ROS 2 again.\nI 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:\n\nIn above case, it is obviously undesirable that the ROS 2 setup.bash script would chain the Gazebo and ros_gz_bridge scripts,\n\nBut 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.\n\nIs there some documentation wrt. this behavior?","reasoning":"We can check the installation files of colcon, e.g., the functionality of setup and local_setup.","id":"83","excluded_ids":["N\/A"],"gold_ids_long":["setupbash\/environmenthtmlworks.txt"],"gold_ids":["setupbash\/environmenthtmlworks_4.txt"],"gold_answer":"$\\begingroup$\n\nThe answer is in the [ colcon documentation\n](https:\/\/colcon.readthedocs.io\/en\/released\/developer\/environment.html#workspace-\nlevel) :\n\n * ` local_setup.bash ` adds only that workspace to ` COLCON_PREFIX_PATH ` , \n * ` setup.bash ` adds all workspaces to ` COLCON_PREFIX_PATH ` that were in the ` COLCON_PREFIX_PATH ` at the time of build. \n\nSo my best practice is to:\n\n * Open a separate terminal to compile, \n * Source only those workspaces that are strictly needed, \n * Use that terminal only to compile. \n\nThis avoids that I recompiled in a terminal where I had sourced other\nworkspaces (e.g. PlotJuggler) and then all of these other workspaces\nunnecessarily end up in the ` setup.bash ` ."} {"query":"[ROS1 Noetic]Qt5 Rviz plugin\n\nI'm having trouble making Rviz teleop plugin using Qtcreator. I'm using Noetic and Ubuntu 20.04.\n\nThe codes is not complete yet, for now I just want to see teleop GUI on Rviz. I'm using catkin_make_isolated --install build system\n\nError message: [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. \n\nfiles: package name: rviz_teleop_plugin\n\nCMakeLists.txt\npackage.xml\nplugin_description.xml\nsrc\/qt_teleop_ui,cpp\ninclude\/rviz_teleop_plugin\/qt_teleop_ui.h\ncmake_minimum_required(VERSION 3.0.2)\nproject(rviz_teleop_plugin)\n\nfind_package(catkin REQUIRED COMPONENTS\n geometry_msgs\n nav_msgs\n roscpp\n rospy\n rviz\n sensor_msgs\n std_msgs\n)\n\nfind_package(Qt5 COMPONENTS Core Widgets REQUIRED)\nfind_package(Qt5Widgets REQUIRED)\nfind_package(Qt5Core REQUIRED)\nfind_package(Qt5OpenGL REQUIRED)\n\nset(CMAKE_INCLUDE_CURRENT_DIR ON)\n\nset(CMAKE_AUTOUIC ON)\nset(CMAKE_AUTOMOC ON)\nset(CMAKE_AUTORCC ON)\n\nset(CMAKE_CXX_STANDARD 11)\nset(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -fPIC\")\nset(CMAKE_CXX_STANDARD_REQUIRED ON)\n\nset(QT_LIBRARIES Qt5::Widgets)\n\nadd_definitions(-DQT_NO_KEYWORDS)\n\ncatkin_package(\n INCLUDE_DIRS include\n LIBRARIES rviz_teleop_plugin\n CATKIN_DEPENDS geometry_msgs nav_msgs roscpp rospy rviz sensor_msgs std_msgs\n # DEPENDS system_lib\n)\n\ninclude_directories(\n include\n ${catkin_INCLUDE_DIRS}\n ${Qt5Widgets_INCLUDE_DIRS}\n)\n\nlink_directories(${catkin_LIBRARY_DIRS})\n\nqt5_wrap_cpp(MOC_FILES\n include\/rviz_teleop_plugin\/qt_teleop_ui.h\n)\n\nset(SOURCE_FILES\n src\/qt_teleop_ui.cpp\n ${MOC_FILES}\n)\n\nadd_library(${PROJECT_NAME}\n ${SOURCE_FILES}\n)\n\nadd_dependencies(rviz_teleop_plugin ${PROJECT_NAME_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})\n\ntarget_link_libraries(${PROJECT_NAME}\n Qt5::Widgets\n ${QT_LIBRARIES}\n ${catkin_LIBRARIES}\n)\n\ninstall(TARGETS \n ${PROJECT_NAME}\n ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}\n LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}\n RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}\n)\n\ninstall(DIRECTORY include\/${PROJECT_NAME}\/ rviz\n DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}\n)\n\ninstall(FILES plugin_description.xml\n DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}\n)\n\nset_target_properties(rviz_teleop_plugin PROPERTIES OUTPUT_NAME \"rviz_teleop_plugin\")\n\n\n rviz_teleop_plugin<\/name>\n 0.0.0<\/version>\n The rviz_teleop_plugin package<\/description>\n\n minseojeong<\/maintainer>\n TODO<\/license>\n\n catkin<\/buildtool_depend>\n\n geometry_msgs<\/build_depend>\n nav_msgs<\/build_depend>\n roscpp<\/build_depend>\n rospy<\/build_depend>\n rviz<\/build_depend>\n sensor_msgs<\/build_depend>\n std_msgs<\/build_depend>\n\n qt_gui_cpp<\/build_depend>\n qtbase5-dev<\/build_depend>\n libqt5-core<\/build_depend>\n libqt5-gui<\/build_depend>\n libqt5-widgets<\/build_depend>\n\n geometry_msgs<\/build_export_depend>\n nav_msgs<\/build_export_depend>\n roscpp<\/build_export_depend>\n rospy<\/build_export_depend>\n rviz<\/build_export_depend>\n sensor_msgs<\/build_export_depend>\n std_msgs<\/build_export_depend>\n\n qt_gui_cpp<\/build_export_depend>\n qtbase5-dev<\/build_export_depend>\n libqt5-core<\/build_export_depend>\n libqt5-gui<\/build_export_depend>\n libqt5-widgets<\/build_export_depend>\n\n geometry_msgs<\/exec_depend>\n nav_msgs<\/exec_depend>\n roscpp<\/exec_depend>\n rospy<\/exec_depend>\n rviz<\/exec_depend>\n sensor_msgs<\/exec_depend>\n std_msgs<\/exec_depend>\n\n qt_gui_cpp<\/exec_depend>\n qtbase5-dev<\/exec_depend>\n libqt5-core<\/exec_depend>\n libqt5-gui<\/exec_depend>\n libqt5-widgets<\/exec_depend>\n\n \n \n <\/export>\n\n<\/package>\n\n\n \n \n A Teleop Panel to control the robot.\n <\/description>\n \n rviz_teleop_plugin\/QtTeleopPanel<\/name>\n rviz_teleop_plugin::QtTeleopPanel<\/class>\n