@2090127048 找不到distro
-
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
python3-distro 已经是最新版 (1.8.0-1)。
python3-yaml 已经是最新版 (6.0-3build1)。
下列软件包是自动安装的并且现在不需要了:
grub-pc-bin
使用'sudo apt autoremove'来卸载它(它们)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 226 个软件包未被升级。
/tmp/fishinstall/install.py:76: SyntaxWarning: invalid escape sequence '.'
book = """
/tmp/fishinstall/install.py:81: SyntaxWarning: invalid escape sequence '\ '
.'// .-~"""""""-._ | _,-"""""""~-. \`.
--2023-12-11 09:48:28-- http://fishros.com/install/install1s/tools/base.py
正在解析主机 fishros.com (fishros.com)... 139.9.131.171
正在连接 fishros.com (fishros.com)|139.9.131.171|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 44694 (44K) [application/octet-stream]
正在保存至: ‘/tmp/fishinstall/tools/base.py’/tmp/fishinstall/tools/base.py 100%[================================================================================================>] 43.65K --.-KB/s 用时 0.1s
2023-12-11 09:48:28 (338 KB/s) - 已保存 ‘/tmp/fishinstall/tools/base.py’ [44694/44694])
WARN:No Yaml Module!
Traceback (most recent call last):
File "/tmp/fishinstall/install.py", line 122, in <module>
main()
File "/tmp/fishinstall/install.py", line 57, in main
from tools.base import CmdTask,FileUtils,PrintUtils,ChooseTask,ChooseWithCategoriesTask
File "/tmp/fishinstall/tools/base.py", line 775, in <module>
osversion = GetOsVersion()
^^^^^^^^^^^^^^
File "/tmp/fishinstall/tools/base.py", line 105, in GetOsVersion
import distro
ModuleNotFoundError: No module named 'distro' -
-
请输入指令控制rm_vision: 重启(r) 进入(e) 启动(s) 关闭(c) 删除(d) 测试(t):
t
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/rm_vision/json": dial unix /var/run/docker.sock: connect: permission denied
密码:
无效的密码。
一键安装docker+ros-humble启动失败,输入密码说是无效的密码,无法启动 -
系统:Win11+WSL2-Ubuntu22.04
[main] 正在配置项目: zhjrROS2 [proc] 执行命令: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++ -S/mnt/c/Users/zhjr/zhjrProjects/zhjrROS2/src/village_wang_cpp -B/mnt/c/Users/zhjr/zhjrProjects/zhjrROS2/build -G Ninja [cmake] Not searching for unused variables given on the command line. [cmake] -- Found ament_cmake: 1.3.6 (/opt/ros/humble/share/ament_cmake/cmake) [cmake] -- Found rclcpp: 16.0.7 (/opt/ros/humble/share/rclcpp/cmake) [cmake] -- Found rosidl_generator_c: 3.1.5 (/opt/ros/humble/share/rosidl_generator_c/cmake) [cmake] -- Found rosidl_adapter: 3.1.5 (/opt/ros/humble/share/rosidl_adapter/cmake) [cmake] -- Found rosidl_generator_cpp: 3.1.5 (/opt/ros/humble/share/rosidl_generator_cpp/cmake) [cmake] -- Using all available rosidl_typesupport_c: rosidl_typesupport_fastrtps_c;rosidl_typesupport_introspection_c [cmake] -- Using all available rosidl_typesupport_cpp: rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_introspection_cpp [cmake] -- Found rmw_implementation_cmake: 6.1.1 (/opt/ros/humble/share/rmw_implementation_cmake/cmake) [cmake] -- Found rmw_fastrtps_cpp: 6.2.5 (/opt/ros/humble/share/rmw_fastrtps_cpp/cmake) [cmake] -- Using RMW implementation 'rmw_fastrtps_cpp' as default [cmake] CMake Error at CMakeLists.txt:14 (find_package): [cmake] By not providing "Findvillage_interfaces.cmake" in CMAKE_MODULE_PATH this [cmake] project has asked CMake to find a package configuration file provided by [cmake] "village_interfaces", but CMake did not find one. [cmake] [cmake] Could not find a package configuration file provided by [cmake] "village_interfaces" with any of the following names: [cmake] [cmake] village_interfacesConfig.cmake [cmake] village_interfaces-config.cmake [cmake] [cmake] Add the installation prefix of "village_interfaces" to CMAKE_PREFIX_PATH or [cmake] set "village_interfaces_DIR" to a directory containing one of the above [cmake] files. If "village_interfaces" provides a separate development package or [cmake] SDK, be sure it has been installed. [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] See also "/mnt/c/Users/zhjr/zhjrProjects/zhjrROS2/build/CMakeFiles/CMakeOutput.log". [proc] 命令“/usr/bin/cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++ -S/mnt/c/Users/zhjr/zhjrProjects/zhjrROS2/src/village_wang_cpp -B/mnt/c/Users/zhjr/zhjrProjects/zhjrROS2/build -G Ninja”已退出,代码为 1
VSCode编译报错信息:
4006c995-58e8-4869-905f-f565b6d08bd5-image.pngCMakeList.txt
cmake_minimum_required(VERSION 3.8) project(village_wang_cpp) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() # find dependencies find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(std_msgs REQUIRED) find_package(village_interfaces REQUIRED) if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) # the following line skips the linter which checks for copyrights # comment the line when a copyright and license is added to all source files set(ament_cmake_copyright_FOUND TRUE) # the following line skips cpplint (only works in a git repo) # comment the line when this package is in a git repo and when # a copyright and license is added to all source files set(ament_cmake_cpplint_FOUND TRUE) ament_lint_auto_find_test_dependencies() endif() ament_package() add_executable(wang2 src/wang2.cpp) ament_target_dependencies(wang2 rclcpp std_msgs village_interfaces) install(TARGETS wang2 DESTINATION lib/${PROJECT_NAME}) install(DIRECTORY launch DESTINATION share/${PROJECT_NAME})package.xml
<?xml version="1.0"?> <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> <package format="3"> <name>village_wang_cpp</name> <version>0.0.0</version> <description>TODO: Package description</description> <maintainer email="*********@qq.com">zhjr</maintainer> <license>Apache-2.0</license> <buildtool_depend>ament_cmake</buildtool_depend> <depend>rclcpp</depend> <depend>std_msgs</depend> <depend>village_interfaces</depend> <test_depend>ament_lint_auto</test_depend> <test_depend>ament_lint_common</test_depend> <export> <build_type>ament_cmake</build_type> </export> </package> -
-
在ros2-iron版本下使用gazebo进行仿真时,使用ros2_control中的Joint Trajectory Controller控制器对机器人关节进行控制。当加载控制器时,关节位置会发生突变,突然跳跃至某一固定位置。以上情况仅在command interface为position、或在使用Position Controller时出现。如果命令接口为velocity/effort或使用Velocity/Effort Controller,则不会出现这种情况,控制器会从加载时的实时位置进行速度或力矩控制。看了一下控制器的源码,似乎没有找到类似初始位置的命令。有人遇到过这个问题吗?或者有何解决思路?感谢大家!
-
系统UBUNTU22.04,ROS2 HUMBLE
#include <memory> #include <stdio.h> #include <stdlib.h> #include <string> #include <cstring> #include "rclcpp/rclcpp.hpp" #include <message_filters/subscriber.h> #include <message_filters/time_synchronizer.h> #include <message_filters/synchronizer.h> #include <message_filters/sync_policies/approximate_time.h> #include "dvl_msgs/msg/odom.hpp" #include "ahrs_msgs/msg/fn70_auxa.hpp" #include "plc_msgs/msg/sensor.hpp" using namespace message_filters; using std::placeholders::_1; using std::placeholders::_2; using std::placeholders::_3; class AUVSENSORS_MESSAGES : public rclcpp::Node { public: AUVSENSORS_MESSAGES() : Node("auvsensors_message") { odom_sub_.subscribe(this,"/dvl/odom"); imu_sub_.subscribe(this,"/ahrs/raw"); depth_sub_.subscribe(this,"/plc"); sync_ = std::make_shared<message_filters::TimeSynchronizer<dvl_msgs::msg::Odom, ahrs_msgs::msg::Fn70Auxa, plc_msgs::msg::Sensor>>(odom_sub_, imu_sub_, depth_sub_,10); sync_->registerCallback(std::bind(&AUVSENSORS_MESSAGES::disparityCb, this, _1, _2, _3)); } private: void disparityCb(const dvl_msgs::msg::Odom::ConstSharedPtr& dvl_msg, const ahrs_msgs::msg::Fn70Auxa::ConstSharedPtr& imu_msg,const plc_msgs::msg::Sensor::ConstSharedPtr& ph_msg) { const char *t_1 = std::to_string(dvl_msg->linear.x).c_str(); const char *t_2 = std::to_string(dvl_msg->linear.x).c_str(); const char *t_3 = std::to_string(dvl_msg->linear.x).c_str(); const char *t_4 = std::to_string(imu_msg->altitude).c_str(); const char *t_5 = std::to_string(ph_msg->depth).c_str(); RCLCPP_INFO(this->get_logger(), "消息:%s,%s,%s,%s,%s", t_1,t_2,t_3,t_4,t_5); } message_filters::Subscriber<dvl_msgs::msg::Odom> odom_sub_ ; message_filters::Subscriber<ahrs_msgs::msg::Fn70Auxa> imu_sub_; message_filters::Subscriber<plc_msgs::msg::Sensor> depth_sub_; std::shared_ptr<message_filters::TimeSynchronizer<dvl_msgs::msg::Odom, ahrs_msgs::msg::Fn70Auxa, plc_msgs::msg::Sensor>> sync_; }; int main(int argc, char * argv[]) { rclcpp::init(argc, argv); rclcpp::spin(std::make_shared<AUVSENSORS_MESSAGES>()); rclcpp::shutdown(); return 0; }
各位大佬,我使用Message filter想做时间软同步,代码如下:我想输出几个实例数据,因此我运行记录数据的bag包,其能够正常play,
os2 bag play rosbag2_2023_12_08-15_36_13 [INFO] [1702044100.446161521] [rosbag2_storage]: Opened database 'rosbag2_2023_12_08-15_36_13/rosbag2_2023_12_08-15_36_13_0.db3' for READ_ONLY. [INFO] [1702044100.446240068] [rosbag2_player]: Set rate to 1 [INFO] [1702044100.456354394] [rosbag2_player]: Adding keyboard callbacks. [INFO] [1702044100.456406646] [rosbag2_player]: Press SPACE for Pause/Resume [INFO] [1702044100.456417656] [rosbag2_player]: Press CURSOR_RIGHT for Play Next Message [INFO] [1702044100.456426625] [rosbag2_player]: Press CURSOR_UP for Increase Rate 10% [INFO] [1702044100.456434797] [rosbag2_player]: Press CURSOR_DOWN for Decrease Rate 10% [INFO] [1702044100.456868918] [rosbag2_storage]: Opened database 'rosbag2_2023_12_08-15_36_13/rosbag2_2023_12_08-15_36_13_0.db3' for READ_ONLY.但是我订阅其话题并实现时间同步输出实例参数的终端报以下错误,这是怎么回事,怎样解决呢?
terminate called after throwing an instance of 'std::runtime_error' what(): can't compare times with different time sources [ros2run]: Aborted -
下载代码后安装以来一直提示
克隆代码完成后,安装依赖一直提示:
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
fishbot_description: Cannot locate rosdep definition for [ament_python]
Continuing to install resolvable dependencies...
#All required rosdeps installed successfullycolcon build编译也报错,已经尝试重装过好几遍ros2环境,还未解决
2e180845-ec9f-4656-bff2-dfdd53054052-image.png -
-
操作系统:ubantu18.04
ROS版本:melodic
gazebo9
新手小白在做一个可动小车的仿真时,遇到了如下问题,恳请各位相助!
我在RVIZ里查看小车模型时可以得到下图所示的模型图
小车模型图.png
但是当我输入命令
roslaunch steer_mini_gazebo steer_mini_sim.launch
在gazebo中驱动小车时,却出现了如下报错
[ INFO] [1701960022.508446103, 61.242000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server. [FATAL] [1701960022.609885892, 61.242000000]: Failed to create robot simulation interface loader: Could not find library corresponding to plugin steer_bot_hardware_gazebo/SteerBotHardwareGazebo. Make sure the plugin description XML file has the correct name of the library and that the library actually exists. [ INFO] [1701960022.610109458, 61.242000000]: Loaded gazebo_ros_control.且在RIVIZ中车轮的link也无法识别,如下图所示
d6e091d7-d6ee-4eb1-84ce-42702b281303-image.png
在网上找了很久都没找到解决方案,恳请各位大佬帮忙!万分感谢!
相关代码附在下面:
小车的urdf文件 <?xml version="1.0" encoding="utf-8"?> <!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com) Commit Version: 1.5.1-0-g916b5db Build Version: 1.5.7152.31018 For more information, please see http://wiki.ros.org/sw_urdf_exporter --> <robot name="neor_mini"> <link name="base_link"> <!-- avoid root link inertia warnings, annotation --> <!-- <inertial> <origin xyz="0.030649671440691 -1.79069899872708E-05 0.0558717976709459" rpy="0 0 0" /> <mass value="1.72617713171385" /> <inertia ixx="0.0107311274569357" ixy="-3.24164649120244E-08" ixz="0.00169188715816868" iyy="0.0198871551919603" iyz="2.40252669081509E-07" izz="0.0269841937242323" /> </inertial> --> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/base_link.dae" /> </geometry> <material name=""> <color rgba="0.250980392156863 0.250980392156863 0.250980392156863 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/base_link.STL" /> </geometry> </collision> </link> <link name="rear_wheel_link"> <inertial> <origin xyz="-8.88178419700125E-16 -2.05391259555654E-14 -0.00112500000001892" rpy="0 0 0" /> <mass value="5.65486677646169E-05" /> <inertia ixx="1.32005796313028E-10" ixy="-1.938704560671E-27" ixz="2.13770572261755E-26" iyy="1.32005796313028E-10" iyz="-7.60216295195271E-25" izz="2.03575203952622E-10" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/rear_wheel_link.STL" /> </geometry> <material name=""> <color rgba="0.274509803921569 1 0.247058823529412 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/rear_wheel_link.STL" /> </geometry> </collision> </link> <joint name="rear_wheel_joint" type="continuous"> <origin xyz="-0.181499999999597 0 0.0399999999987674" rpy="0 0 0" /> <parent link="base_link" /> <child link="rear_wheel_link" /> <axis xyz="0 1 0" /> </joint> <link name="left_rear_link"> <inertial> <origin xyz="7.85229659072684E-11 -0.0196762547002777 4.85059770127805E-11" rpy="0 0 0" /> <mass value="0.29556182905038" /> <inertia ixx="0.000374087423652291" ixy="2.19336154342606E-13" ixz="-5.50404301757561E-12" iyy="0.000661017199375587" iyz="-5.10049385981967E-14" izz="0.000374087441459994" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/left_rear_link.STL" /> </geometry> <material name=""> <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/left_rear_link.STL" /> </geometry> </collision> </link> <joint name="left_rear_joint" type="continuous"> <origin xyz="-0.181499999999595 0.228542434993694 0.0399999999991634" rpy="0 0 0" /> <parent link="base_link" /> <child link="left_rear_link" /> <axis xyz="0 1 0" /> <limit lower="-3.14" upper="3.14" effort="0" velocity="0" /> </joint> <link name="right_rear_link"> <inertial> <origin xyz="7.8521189550429E-11 0.0196762545376323 3.35983463273237E-11" rpy="0 0 0" /> <mass value="0.295561829050389" /> <inertia ixx="0.000374087423652306" ixy="-2.1933774523493E-13" ixz="5.50404145624456E-12" iyy="0.000661017199375601" iyz="-5.10073974604221E-14" izz="0.000374087441459995" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/right_rear_link.STL" /> </geometry> <material name=""> <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/right_rear_link.STL" /> </geometry> </collision> </link> <joint name="right_rear_joint" type="continuous"> <origin xyz="-0.181499999999595 -0.228542434994426 0.0399999999991584" rpy="0 0 0" /> <parent link="base_link" /> <child link="right_rear_link" /> <axis xyz="0 1 0" /> <limit lower="-3.14" upper="3.14" effort="0" velocity="0" /> </joint> <link name="front_steer_link"> <inertial> <origin xyz="-2.1316282072803E-14 3.67778030252452E-11 -0.00112486602459905" rpy="0 0 0" /> <mass value="5.65486677646163E-05" /> <inertia ixx="1.32005796313026E-10" ixy="1.16322273640277E-26" ixz="1.20446157864484E-28" iyy="1.32005796313026E-10" iyz="-8.66481261175625E-27" izz="2.03575203952619E-10" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_steer_link.STL" /> </geometry> <material name=""> <color rgba="0.274509803921569 1 0.247058823529412 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_steer_link.STL" /> </geometry> </collision> </link> <joint name="front_steer_joint" type="revolute"> <origin xyz="0.172883370897628 0 -0.00376561854722868" rpy="0 0 0" /> <parent link="base_link" /> <child link="front_steer_link" /> <axis xyz="0 0 1" /> <limit lower="-0.72" upper="0.72" effort="0" velocity="0" /> </joint> <!-- In order to fit ackermann simulation plugins's request,amend the front steer link and it's joint --> <link name="front_steer_right_link"> <!-- remember add inertial label,if not,and it can't visual on gazebo--> <inertial> <origin xyz="9.44636555644252E-08 -0.000295273745285485 -8.13046296954667E-11" rpy="0 0 0" /> <mass value="0.296315811300368" /> <inertia ixx="0.000374692013709393" ixy="-9.17172260383823E-08" ixz="-2.43187512356516E-12" iyy="0.000661029987747155" iyz="1.9736939507106E-13" izz="0.000374691963930348" /> </inertial> <visual> <geometry> <cylinder length="0.001" radius="0.005"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0" /> <material name=""> <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <cylinder length="0.001" radius="0.005"/> </geometry> </collision> </link> <joint name="front_steer_right_joint" type="revolute"> <origin rpy="0 0 0" xyz="0.17 -0.21 0.102" /> <parent link="base_link" /> <child link="front_steer_right_link" /> <axis xyz="0 0 1" /> <!-- charge steer direction default is 0 0 1--> <limit lower="-0.69" upper="0.69" effort="0" velocity="0" /> </joint> <!-- ************************************************************************************* --> <link name="front_right_wheel_link"> <inertial> <origin xyz="9.44636555644252E-08 -0.000295273745285485 -8.13046296954667E-11" rpy="0 0 0" /> <mass value="0.296315811300368" /> <inertia ixx="0.000374692013709393" ixy="-9.17172260383823E-08" ixz="-2.43187512356516E-12" iyy="0.000661029987747155" iyz="1.9736939507106E-13" izz="0.000374691963930348" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_right_wheel_link.STL" /> </geometry> <material name=""> <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_right_wheel_link.STL" /> </geometry> </collision> </link> <joint name="front_right_wheel_joint" type="continuous"> <origin xyz="0 0 -0.06" rpy="0 0 0" /> <!-- amend the position between steer_right_link and front right wheel--> <parent link="front_steer_right_link" /> <child link="front_right_wheel_link" /> <axis xyz="0 1 0" /> </joint> <!-- In order to fit ackermann simulation plugins's request,amend the front steer link and it's joint --> <link name="front_steer_left_link"> <!-- remember add inertial label,if not,and it can't visual on gazebo--> <inertial> <origin xyz="9.44636555644252E-08 -0.000295273745285485 -8.13046296954667E-11" rpy="0 0 0" /> <mass value="0.296315811300368" /> <inertia ixx="0.000374692013709393" ixy="-9.17172260383823E-08" ixz="-2.43187512356516E-12" iyy="0.000661029987747155" iyz="1.9736939507106E-13" izz="0.000374691963930348" /> </inertial> <visual> <geometry> <cylinder length="0.001" radius="0.005"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0" /> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <cylinder length="0.001" radius="0.005"/> </geometry> </collision> </link> <joint name="front_steer_left_joint" type="revolute"> <origin rpy="0 0 0" xyz="0.17 0.21 0.102" /> <parent link="base_link" /> <child link="front_steer_left_link" /> <axis xyz="0 0 1" /> <!-- charge steer direction default is 0 0 1--> <limit lower="-0.69" upper="0.69" effort="0" velocity="0" /> </joint> <!-- ************************************************************************************* --> <link name="front_left_wheel_link"> <inertial> <origin xyz="-3.99413835339146E-11 0.000295273997845347 1.08602016268833E-10" rpy="0 0 0" /> <mass value="0.296315811293944" /> <inertia ixx="0.00037469197851121" ixy="-1.84493877596723E-13" ixz="-9.50756757097929E-12" iyy="0.00066103001709398" iyz="-1.17866882205563E-13" izz="0.000374691969713977" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_left_wheel_link.STL" /> </geometry> <material name=""> <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_left_wheel_link.STL" /> </geometry> </collision> </link> <joint name="front_left_wheel_joint" type="continuous"> <origin xyz="0 0 -0.06" rpy="0 0 0" /> <!-- amend the position between steer_left_link and front left wheel--> <parent link="front_steer_left_link" /> <child link="front_left_wheel_link" /> <axis xyz="0 1 0" /> </joint> </robot> 在gazebo中驱动小车的urdf文件 <?xml version="1.0" encoding="utf-8"?> <!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com) Commit Version: 1.5.1-0-g916b5db Build Version: 1.5.7152.31018 For more information, please see http://wiki.ros.org/sw_urdf_exporter --> <robot name="neor_mini"> <!-- Add Gazebo plugins --> <!-- Load ros_control plugin using the steer_bot_hardware_gazebo implementation of the hardware_interface::RobotHW --> <gazebo> <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> <robotSimType>steer_bot_hardware_gazebo/SteerBotHardwareGazebo</robotSimType> <legacyModeNS>false</legacyModeNS> </plugin> </gazebo> <link name="base_link"> <!-- avoid root link inertia warnings, annotation --> <inertial> <origin xyz="0.030649671440691 -1.79069899872708E-05 0.0558717976709459" rpy="0 0 0" /> <mass value="1.72617713171385" /> <inertia ixx="0.0107311274569357" ixy="-3.24164649120244E-08" ixz="0.00169188715816868" iyy="0.0198871551919603" iyz="2.40252669081509E-07" izz="0.0269841937242323" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/base_link.dae" /> </geometry> <material name=""> <color rgba="0.250980392156863 0.250980392156863 0.250980392156863 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/base_link.STL" /> </geometry> </collision> </link> <link name="rear_wheel_link"> <inertial> <origin xyz="-8.88178419700125E-16 -2.05391259555654E-14 -0.00112500000001892" rpy="0 0 0" /> <mass value="5.65486677646169E-05" /> <inertia ixx="1.32005796313028E-10" ixy="-1.938704560671E-27" ixz="2.13770572261755E-26" iyy="1.32005796313028E-10" iyz="-7.60216295195271E-25" izz="2.03575203952622E-10" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/rear_wheel_link.STL" /> </geometry> <material name=""> <color rgba="0.274509803921569 1 0.247058823529412 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/rear_wheel_link.STL" /> </geometry> </collision> </link> <joint name="rear_wheel_joint" type="continuous"> <origin xyz="-0.181499999999597 0 0.0399999999987674" rpy="0 0 0" /> <parent link="base_link" /> <child link="rear_wheel_link" /> <axis xyz="0 1 0" /> </joint> <link name="left_rear_link"> <inertial> <origin xyz="7.85229659072684E-11 -0.0196762547002777 4.85059770127805E-11" rpy="0 0 0" /> <mass value="0.29556182905038" /> <inertia ixx="0.000374087423652291" ixy="2.19336154342606E-13" ixz="-5.50404301757561E-12" iyy="0.000661017199375587" iyz="-5.10049385981967E-14" izz="0.000374087441459994" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/left_rear_link.STL" /> </geometry> <material name=""> <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/left_rear_link.STL" /> </geometry> </collision> </link> <joint name="left_rear_joint" type="continuous"> <origin xyz="-0.181499999999595 0.228542434993694 0.0399999999991634" rpy="0 0 0" /> <parent link="base_link" /> <child link="left_rear_link" /> <axis xyz="0 1 0" /> <limit lower="-3.14" upper="3.14" effort="0" velocity="0" /> </joint> <link name="right_rear_link"> <inertial> <origin xyz="7.8521189550429E-11 0.0196762545376323 3.35983463273237E-11" rpy="0 0 0" /> <mass value="0.295561829050389" /> <inertia ixx="0.000374087423652306" ixy="-2.1933774523493E-13" ixz="5.50404145624456E-12" iyy="0.000661017199375601" iyz="-5.10073974604221E-14" izz="0.000374087441459995" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/right_rear_link.STL" /> </geometry> <material name=""> <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/right_rear_link.STL" /> </geometry> </collision> </link> <joint name="right_rear_joint" type="continuous"> <origin xyz="-0.181499999999595 -0.228542434994426 0.0399999999991584" rpy="0 0 0" /> <parent link="base_link" /> <child link="right_rear_link" /> <axis xyz="0 1 0" /> <limit lower="-3.14" upper="3.14" effort="0" velocity="0" /> </joint> <link name="front_steer_link"> <inertial> <origin xyz="-2.1316282072803E-14 3.67778030252452E-11 -0.00112486602459905" rpy="0 0 0" /> <mass value="5.65486677646163E-05" /> <inertia ixx="1.32005796313026E-10" ixy="1.16322273640277E-26" ixz="1.20446157864484E-28" iyy="1.32005796313026E-10" iyz="-8.66481261175625E-27" izz="2.03575203952619E-10" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_steer_link.STL" /> </geometry> <material name=""> <color rgba="0.274509803921569 1 0.247058823529412 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_steer_link.STL" /> </geometry> </collision> </link> <joint name="front_steer_joint" type="revolute"> <origin xyz="0.172883370897628 0 -0.00376561854722868" rpy="0 0 0" /> <parent link="base_link" /> <child link="front_steer_link" /> <axis xyz="0 0 1" /> <limit lower="-0.72" upper="0.72" effort="0" velocity="0" /> </joint> <!-- In order to fit ackermann simulation plugins's request,amend the front steer link and it's joint --> <link name="front_steer_right_link"> <!-- remember add inertial label,if not,and it can't visual on gazebo--> <inertial> <origin xyz="9.44636555644252E-08 -0.000295273745285485 -8.13046296954667E-11" rpy="0 0 0" /> <mass value="0.296315811300368" /> <inertia ixx="0.000374692013709393" ixy="-9.17172260383823E-08" ixz="-2.43187512356516E-12" iyy="0.000661029987747155" iyz="1.9736939507106E-13" izz="0.000374691963930348" /> </inertial> <visual> <geometry> <cylinder length="0.001" radius="0.005"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0" /> <material name=""> <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <cylinder length="0.001" radius="0.005"/> </geometry> </collision> </link> <joint name="front_steer_right_joint" type="revolute"> <origin rpy="0 0 0" xyz="0.17 -0.21 0.102" /> <parent link="base_link" /> <child link="front_steer_right_link" /> <axis xyz="0 0 1" /> <!-- charge steer direction default is 0 0 1--> <limit lower="-0.69" upper="0.69" effort="0" velocity="0" /> </joint> <!-- ************************************************************************************* --> <link name="front_right_wheel_link"> <inertial> <origin xyz="9.44636555644252E-08 -0.000295273745285485 -8.13046296954667E-11" rpy="0 0 0" /> <mass value="0.296315811300368" /> <inertia ixx="0.000374692013709393" ixy="-9.17172260383823E-08" ixz="-2.43187512356516E-12" iyy="0.000661029987747155" iyz="1.9736939507106E-13" izz="0.000374691963930348" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_right_wheel_link.STL" /> </geometry> <material name=""> <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_right_wheel_link.STL" /> </geometry> </collision> </link> <joint name="front_right_wheel_joint" type="continuous"> <origin xyz="0 0 -0.06" rpy="0 0 0" /> <!-- amend the position between steer_right_link and front right wheel--> <parent link="front_steer_right_link" /> <child link="front_right_wheel_link" /> <axis xyz="0 1 0" /> </joint> <!-- In order to fit ackermann simulation plugins's request,amend the front steer link and it's joint --> <link name="front_steer_left_link"> <!-- remember add inertial label,if not,and it can't visual on gazebo--> <inertial> <origin xyz="9.44636555644252E-08 -0.000295273745285485 -8.13046296954667E-11" rpy="0 0 0" /> <mass value="0.296315811300368" /> <inertia ixx="0.000374692013709393" ixy="-9.17172260383823E-08" ixz="-2.43187512356516E-12" iyy="0.000661029987747155" iyz="1.9736939507106E-13" izz="0.000374691963930348" /> </inertial> <visual> <geometry> <cylinder length="0.001" radius="0.005"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0" /> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <cylinder length="0.001" radius="0.005"/> </geometry> </collision> </link> <joint name="front_steer_left_joint" type="revolute"> <origin rpy="0 0 0" xyz="0.17 0.21 0.102" /> <parent link="base_link" /> <child link="front_steer_left_link" /> <axis xyz="0 0 1" /> <!-- charge steer direction default is 0 0 1--> <limit lower="-0.69" upper="0.69" effort="0" velocity="0" /> </joint> <!-- ************************************************************************************* --> <link name="front_left_wheel_link"> <inertial> <origin xyz="-3.99413835339146E-11 0.000295273997845347 1.08602016268833E-10" rpy="0 0 0" /> <mass value="0.296315811293944" /> <inertia ixx="0.00037469197851121" ixy="-1.84493877596723E-13" ixz="-9.50756757097929E-12" iyy="0.00066103001709398" iyz="-1.17866882205563E-13" izz="0.000374691969713977" /> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_left_wheel_link.STL" /> </geometry> <material name=""> <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" /> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry> <mesh filename="package://neor_mini/meshes/front_left_wheel_link.STL" /> </geometry> </collision> </link> <joint name="front_left_wheel_joint" type="continuous"> <origin xyz="0 0 -0.06" rpy="0 0 0" /> <!-- amend the position between steer_left_link and front left wheel--> <parent link="front_steer_left_link" /> <child link="front_left_wheel_link" /> <axis xyz="0 1 0" /> </joint> </robot> launch文件 <launch> <param name="robot_description" textfile="$(find neor_mini)/urdf/neor_mini.urdf" /> <node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" /> <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" /> <node name="rviz" pkg="rviz" type="rviz" args="-d $(find neor_mini)/rviz/neor_mini_rviz.rviz" /> </launch> -
鱼哥和各位大佬好,我想请问nav2的参数配置文件中的参数意义,如下参数文件
amcl:
ros__parameters:
use_sim_time: True
alpha1: 0.2
alpha2: 0.2
alpha3: 0.2
alpha4: 0.2
alpha5: 0.2
base_frame_id: "base_link"
beam_skip_distance: 0.5
beam_skip_error_threshold: 0.9
beam_skip_threshold: 0.3
do_beamskip: false
global_frame_id: "map"
lambda_short: 0.1
laser_likelihood_max_dist: 2.0
laser_max_range: 100.0
laser_min_range: -1.0
laser_model_type: "likelihood_field"
max_beams: 60
max_particles: 5000
min_particles: 500
initial_pose_x: 0.0
initial_pose_y: 0.0
initial_pose_a: 0.0
initial_cov_xx: 32
initial_cov_yy: 32
initial_cov_zz: 32
odom_frame_id: "odom"
pf_err: 0.05
pf_z: 0.99
recovery_alpha_fast: 0.0
recovery_alpha_slow: 0.0
resample_interval: 1
robot_model_type: "nav2_amcl::DifferentialMotionModel"
save_pose_rate: 0.5
sigma_hit: 0.2
tf_broadcast: true
transform_tolerance: 10.0
update_min_a: 0.2
update_min_d: 0.25
z_hit: 0.5
z_max: 0.05
z_rand: 0.5
z_short: 0.05
scan_topic: scanamcl_map_client:
ros__parameters:
use_sim_time: Trueamcl_rclcpp_node:
ros__parameters:
use_sim_time: Truebt_navigator:
ros__parameters:
use_sim_time: True
global_frame: map
robot_base_frame: base_link
odom_topic: /odom
bt_loop_duration: 10
default_server_timeout: 20
# 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
# nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
# nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
# They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
plugin_lib_names:
- nav2_compute_path_to_pose_action_bt_node
- nav2_compute_path_through_poses_action_bt_node
- nav2_smooth_path_action_bt_node
- nav2_follow_path_action_bt_node
- nav2_spin_action_bt_node
- nav2_wait_action_bt_node
- nav2_back_up_action_bt_node
- nav2_drive_on_heading_bt_node
- nav2_clear_costmap_service_bt_node
- nav2_is_stuck_condition_bt_node
- nav2_goal_reached_condition_bt_node
- nav2_goal_updated_condition_bt_node
- nav2_globally_updated_goal_condition_bt_node
- nav2_is_path_valid_condition_bt_node
- nav2_initial_pose_received_condition_bt_node
- nav2_reinitialize_global_localization_service_bt_node
- nav2_rate_controller_bt_node
- nav2_distance_controller_bt_node
- nav2_speed_controller_bt_node
- nav2_truncate_path_action_bt_node
- nav2_truncate_path_local_action_bt_node
- nav2_goal_updater_node_bt_node
- nav2_recovery_node_bt_node
- nav2_pipeline_sequence_bt_node
- nav2_round_robin_node_bt_node
- nav2_transform_available_condition_bt_node
- nav2_time_expired_condition_bt_node
- nav2_path_expiring_timer_condition
- nav2_distance_traveled_condition_bt_node
- nav2_single_trigger_bt_node
- nav2_is_battery_low_condition_bt_node
- nav2_navigate_through_poses_action_bt_node
- nav2_navigate_to_pose_action_bt_node
- nav2_remove_passed_goals_action_bt_node
- nav2_planner_selector_bt_node
- nav2_controller_selector_bt_node
- nav2_goal_checker_selector_bt_node
- nav2_controller_cancel_bt_node
- nav2_path_longer_on_approach_bt_node
- nav2_wait_cancel_bt_node
- nav2_spin_cancel_bt_node
- nav2_back_up_cancel_bt_node
- nav2_drive_on_heading_cancel_bt_nodebt_navigator_rclcpp_node:
ros__parameters:
use_sim_time: Truecontroller_server:
# Progress checker parameters progress_checker: plugin: "nav2_controller::SimpleProgressChecker" required_movement_radius: 0.5 movement_time_allowance: 10.0 # Goal checker parameters #precise_goal_checker: # plugin: "nav2_controller::SimpleGoalChecker" # xy_goal_tolerance: 0.25 # yaw_goal_tolerance: 0.25 # stateful: True general_goal_checker: stateful: True plugin: "nav2_controller::SimpleGoalChecker" xy_goal_tolerance: 0.25 yaw_goal_tolerance: 0.25 # DWB parameters FollowPath: plugin: "dwb_core::DWBLocalPlanner" debug_trajectory_details: True min_vel_x: 0.0 min_vel_y: 0.0 max_vel_x: 0.26 max_vel_y: 0.0 max_vel_theta: 1.0 min_speed_xy: 0.0 max_speed_xy: 0.26 min_speed_theta: 0.0 # Add high threshold velocity for turtlebot 3 issue. # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75 acc_lim_x: 2.5 acc_lim_y: 0.0 acc_lim_theta: 3.2 decel_lim_x: -2.5 decel_lim_y: 0.0 decel_lim_theta: -3.2 vx_samples: 20 vy_samples: 5 vtheta_samples: 20 sim_time: 1.7 linear_granularity: 0.05 angular_granularity: 0.025 transform_tolerance: 0.2 xy_goal_tolerance: 0.25 trans_stopped_velocity: 0.25 short_circuit_trajectory_evaluation: True stateful: True critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"] BaseObstacle.scale: 0.02 PathAlign.scale: 32.0 PathAlign.forward_point_distance: 0.1 GoalAlign.scale: 24.0 GoalAlign.forward_point_distance: 0.1 PathDist.scale: 32.0 GoalDist.scale: 24.0 RotateToGoal.scale: 32.0 RotateToGoal.slowing_factor: 5.0 RotateToGoal.lookahead_time: -1.0
ros__parameters:
use_sim_time: True
controller_frequency: 20.0
min_x_velocity_threshold: 0.001
min_y_velocity_threshold: 0.5
min_theta_velocity_threshold: 0.001
failure_tolerance: 0.3
progress_checker_plugin: "progress_checker"
goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
controller_plugins: ["FollowPath"]controller_server_rclcpp_node:
ros__parameters:
use_sim_time: Truelocal_costmap:
local_costmap:
ros__parameters:
update_frequency: 5.0
publish_frequency: 2.0
global_frame: odom
robot_base_frame: base_link
use_sim_time: True
rolling_window: true
width: 3
height: 3
resolution: 0.05
robot_radius: 0.12
plugins: ["voxel_layer", "inflation_layer"]
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
inflation_radius: 0.35
voxel_layer:
plugin: "nav2_costmap_2d::VoxelLayer"
enabled: True
publish_voxel_map: True
origin_z: 0.0
z_resolution: 0.05
z_voxels: 16
max_obstacle_height: 2.0
mark_threshold: 0
observation_sources: scan
scan:
topic: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
raytrace_max_range: 3.0
raytrace_min_range: 0.0
obstacle_max_range: 2.5
obstacle_min_range: 0.0
static_layer:
map_subscribe_transient_local: True
always_send_full_costmap: True
local_costmap_client:
ros__parameters:
use_sim_time: True
local_costmap_rclcpp_node:
ros__parameters:
use_sim_time: Trueglobal_costmap:
global_costmap:
ros__parameters:
update_frequency: 1.0
publish_frequency: 1.0
global_frame: map
robot_base_frame: base_link
use_sim_time: True
robot_radius: 0.12
resolution: 0.05
track_unknown_space: true
plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
obstacle_layer:
plugin: "nav2_costmap_2d::ObstacleLayer"
enabled: True
observation_sources: scan
scan:
topic: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
raytrace_max_range: 3.0
raytrace_min_range: 0.0
obstacle_max_range: 2.5
obstacle_min_range: 0.0
static_layer:
plugin: "nav2_costmap_2d::StaticLayer"
map_subscribe_transient_local: True
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
inflation_radius: 0.35
always_send_full_costmap: True
global_costmap_client:
ros__parameters:
use_sim_time: True
global_costmap_rclcpp_node:
ros__parameters:
use_sim_time: Truemap_server:
ros__parameters:
use_sim_time: True
yaml_filename: "turtlebot3_world.yaml"map_saver:
ros__parameters:
use_sim_time: True
save_map_timeout: 5.0
free_thresh_default: 0.25
occupied_thresh_default: 0.65
map_subscribe_transient_local: Trueplanner_server:
ros__parameters:
expected_planner_frequency: 20.0
use_sim_time: True
planner_plugins: ["GridBased"]
GridBased:
plugin: "nav2_navfn_planner/NavfnPlanner"
tolerance: 0.5
use_astar: false
allow_unknown: trueplanner_server_rclcpp_node:
ros__parameters:
use_sim_time: Truesmoother_server:
ros__parameters:
use_sim_time: True
smoother_plugins: ["simple_smoother"]
simple_smoother:
plugin: "nav2_smoother::SimpleSmoother"
tolerance: 1.0e-10
max_its: 1000
do_refinement: Truebehavior_server:
ros__parameters:
costmap_topic: local_costmap/costmap_raw
footprint_topic: local_costmap/published_footprint
cycle_frequency: 10.0
behavior_plugins: ["spin", "backup", "drive_on_heading", "wait"]
spin:
plugin: "nav2_behaviors/Spin"
backup:
plugin: "nav2_behaviors/BackUp"
drive_on_heading:
plugin: "nav2_behaviors/DriveOnHeading"
wait:
plugin: "nav2_behaviors/Wait"
global_frame: odom
robot_base_frame: base_link
transform_tolerance: 0.1
use_sim_time: true
simulate_ahead_time: 2.0
max_rotational_vel: 1.0
min_rotational_vel: 0.4
rotational_acc_lim: 3.2robot_state_publisher:
ros__parameters:
use_sim_time: Truewaypoint_follower:
ros__parameters:
loop_rate: 20
stop_on_failure: false
waypoint_task_executor_plugin: "wait_at_waypoint"
wait_at_waypoint:
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
enabled: True
waypoint_pause_duration: 200请问,其中的
amcl_map_client:
ros__parameters:
use_sim_time: Trueamcl_rclcpp_node:
ros__parameters:
use_sim_time: Truebt_navigator_rclcpp_node:
ros__parameters:
use_sim_time: True等等这些在官网参数配置中看不到的节点配置是怎么来的?
感谢!!! -
Ubuntu 22.04
使用的是ros2 humble版本,在学习c00ba584-50be-439d-bbde-fd5a5269a7c9-image.png 时,编译遇到以下问题,df@df-virtual-machine:~/fishbot$ rosdep install --from-paths src -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
fishbot_description: Cannot locate rosdep definition for [ament_python] -
在看4-6-2的时候跟着鱼哥使用ros2 run village_li li4_node命令时,系统报错ImportError: cannot import name 'BorrowMoney' from 'village_interfaces.srv'
据体文件和错误为以下
import rclpy
from rclpy.node import Node
#1.导入消息类型
from std_msgs.msg import String,UInt32
#1.导入服务接口
from village_interfaces.srv import BorrowMoneyclass WriterNode(Node):
self.count = 0 self.timer_period=5 self.timer=self.create_timer(self.timer_period,self.timer_callback) self.account = 80 self.sub_money = self.create_subscription(UInt32,"sexy_girl_money",self.recv_money_callback,10) #3.声明并创建服务端 self.borrow_server = self.create_service(BorrowMoney,"brrow_money",self.borrow_money_callback) #2.创建服务端回调函数 def borrow_money_callback(self,request,response): pass self.get_logger().info("收到来自:%s 的借钱请求,账户目前有:%d" % (request.name,self.account)) if request.money <= self.account*0.1: response.success = True response.money = request.money self.account = self.account - request.money self.get_logger().info("借钱成功,借出%d,目前还剩%d" %(response.money,self.account)) else: response.success = False response.money = 0 self.get_logger.info("对不起,大兄弟,现在手头紧,不能借给你!") return response def timer_callback(self): msg=String() msg.data = "第%d回:淩艳湖 %d 次偶遇胡艳娘" % (self.count,self.count) self.pub_novel.publish(msg) #让发布者发布消息 self.get_logger().info("发布了一个章节的小说,内容是:%s" % msg.data) self.count += 1 def recv_money_callback(self,money): self.account += money.data self.get_logger().info("收到了%d的稿费,现在账户里有%d的钱" % (money.data,self.account))
def init(self,name):
super().init(name)
self.get_logger().info("大家好,我是作家li4%s." % name)
#2.声明并创建发布者
self.pub_novel = self.create_publisher(String,"sexy_girl",10)def main(args=None):
rclpy.init(args=args)
li4_node = WriterNode("li4")
rclpy.spin(li4_node)
rclpy.shutdown()www@www-virtual-machine:~/town_ws$ ros2 run village_li li4_node
Traceback (most recent call last):
File "/home/www/town_ws/install/village_li/lib/village_li/li4_node", line 33, in <module>
sys.exit(load_entry_point('village-li==0.0.0', 'console_scripts', 'li4_node')())
File "/home/www/town_ws/install/village_li/lib/village_li/li4_node", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.10/importlib/metadata/init.py", line 171, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/www/town_ws/install/village_li/lib/python3.10/site-packages/village_li/li4.py", line 6, in <module>
from village_interfaces.srv import BorrowMoney
ImportError: cannot import name 'BorrowMoney' from 'village_interfaces.srv' (/home/www/town_ws/install/village_interfaces/local/lib/python3.10/dist-packages/village_interfaces/srv/init.py)
[ros2run]: Process exited with failure 1 -
关联pr: https://github.com/fishros/install/pull/43
如题,此pr将为自动安装程序添加使用系统ROS的功能。
由于ROS官方不再为ROS1 发布新系统的更新,在新的操作系统上使用ROS变得十分困难。即使可以通过Docker等虚拟化的方式实现曲线救国式的安装,但使用起来仍旧复杂。
本pr提供了使用系统ROS的可能,通过安装系统的ROS软件包后,即使在Ubuntu 22.04 上依然能够正常使用roocore等命令,详细情况见下图:
替代文字
需要注意的是,这个方式安装的ROS仅含有基本组件。可以理解为ROS的最小系统版本。比如,这个版本里面没有维护如rqt等等软件包,
同时,此方法安装的ROS并不能与使用ROS官方软件源安装的ROS/ROS2共存!
介于以上情况,此方法安装的ROS仅供特殊人员在特殊情况下使用,在安装目录处做了警示说明。
-
虚拟机安装的ubuntu20.04,ros2版本foxy,在编写launch文件启动节点时遇到如下错误:
[INFO] [launch]: All log files can be found below /home/daisy/.ros/log/2023-12-07-14-31-39-216423-daisy-VirtualBox-9375
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=InvalidLaunchFileError('py')>
Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 53, in get_launch_description_from_any_launch_file
return loader(launch_file_path)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
return getattr(launch_file_module, 'generate_launch_description')()
File "/home/daisy/test2/src/install/print/share/print/launch/print.launch.py", line 9, in generate_launch_description
return LaunchDescription(generate_launch_description)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description.py", line 55, in init
self.__entities = list(initial_entities) if initial_entities is not None else []
TypeError: 'function' object is not iterableThe above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
await self.__process_event(next_event)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
return self.execute(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/include_launch_description.py", line 130, in execute
launch_description = self.__launch_description_source.get_launch_description(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
self._get_launch_description(self.__expanded_location)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_description_source.py", line 53, in _get_launch_description
return get_launch_description_from_any_launch_file(location)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 56, in get_launch_description_from_any_launch_file
raise InvalidLaunchFileError(extension, likely_errors=exceptions)
launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: 'function' object is not iterable
daisy@daisy-VirtualBox:~/test2/src$ colcon build --packages-select print
Starting >>> print
Finished <<< print [1.24s]Summary: 1 package finished [2.34s]
daisy@daisy-VirtualBox:~/test2/src$ source install/setup.bash
daisy@daisy-VirtualBox:~/test2/src$ ros2 launch print.launch.py
Package 'print.launch.py' not found: "package 'print.launch.py' not found, searching: ['/home/daisy/test2/src/install/print', '/home/daisy/test2/src/install/village_interface', '/opt/ros/foxy']"
daisy@daisy-VirtualBox:~/test2/src$ ros2 launch print print.launch.py
[INFO] [launch]: All log files can be found below /home/daisy/.ros/log/2023-12-07-14-34-04-971162-daisy-VirtualBox-9556
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=InvalidLaunchFileError('py')>
Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 53, in get_launch_description_from_any_launch_file
return loader(launch_file_path)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
return getattr(launch_file_module, 'generate_launch_description')()
File "/home/daisy/test2/src/install/print/share/print/launch/print.launch.py", line 9, in generate_launch_description
return LaunchDescription(generate_launch_description)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description.py", line 55, in init
self.__entities = list(initial_entities) if initial_entities is not None else []
TypeError: 'function' object is not iterableThe above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
await self.__process_event(next_event)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
return self.execute(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/include_launch_description.py", line 130, in execute
launch_description = self.__launch_description_source.get_launch_description(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
self._get_launch_description(self.__expanded_location)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_description_source.py", line 53, in _get_launch_description
return get_launch_description_from_any_launch_file(location)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 56, in get_launch_description_from_any_launch_file
raise InvalidLaunchFileError(extension, likely_errors=exceptions)
launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: 'function' object is not iterable节点程序:
import rclpy
from rclpy.node import Node
from std_msgs.msg import String,UInt32 # 导入消息类型,这里是字符串,整形
from village_interface.srv import BorrowMoneyclass Print(Node):
self.account = 80 #账户 # 收钱(类型,name,回调函数, 10不懂) # self.submoney = self.create_subscription(UInt32,"money", self.money_callback, 10) # 创建服务端 # self.borrow_serve = self.create_service(BorrowMoney, "borrow_money",self.borrowmoney_callback) def call_back_fun(self): # msg = String() self.masage.data = "lala%d,;alal%d" % (self.count, self.count) self.pub_novel.publish(self.masage) self.get_logger().info("%s" % self.masage.data) self.count += 1 # def money_callback(self, money): # self.account += money.data # self.get_logger().info("shoudao%d的稿费,现在有%d" % (money.data,self.account)) def borrowmoney_callback(self,requst,response): # self.get_logger().info("%s, %d"%(requst.name, self.account)) # if request.money <= self.account*0.1: # response.success = True # response.money = request.money # else: # response.success = False # response.money = 0 # return response
def init(self, name):
super().init(name)
# self.get_logger().info("hahhhahha")
# 发布小说 (话题的类型, 话题的name, 这个参数在研究研究)
self.pub_novel = self.create_publisher(String, "sexy_girl", 10)
# 定时发布(周期, 回调hafunction)
self.count = 0
self.masage = String()
self.t = 5
self.timer = self.create_timer(self.t, self.call_back_fun)def main(args = None):
rclpy.init(args = args) # my_print = Node("print") # my_print.get_logger().info("lalallalallalal") my_print = Print("print") rclpy.spin(my_print) rclpy.shutdown()launch 文件:
from launch import LaunchDescription
from launch_ros.actions import Nodedef generate_launch_description():
my_print = Node(
package = 'print',
executable = 'my_print'
)
return LaunchDescription(generate_launch_description)setup 文件:
from setuptools import setup
import os
from glob import globpackage_name = 'print'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
(os.path.join('share',package_name,'launch'),glob('launch/*.py'))
],
install_requires=['setuptools'],
zip_safe=True,
maintainer='daisy',
maintainer_email='daisy@todo.todo',
description='TODO: Package description',
license='TODO: License declaration',
tests_require=['pytest'],
entry_points={
'console_scripts': [
"my_print = print.my_print:main"
],
},
) -
系统UBUNTU22.04,系统ros2 humble
大佬们,我想请问一下各位在使用鱼总开发的将bag包转为csv文件的那个工具ros2bag_convert,我在转自定义信息的时候都可以,但是我在转sensor_msgs/msg/NavSatfIX这种ros2自带的消息类型的时候容易报错或者转换不成功,大家有遇到过这种问题吗?(github上有人提出这个问题过,但是好像没有解决(https://github.com/fishros/ros2bag_convert/issues/3))
496c31bc-0ae1-4f1f-90e1-8de9511d5ace-image.png
问题:
5da1f33e-ed1f-418e-818e-c389da2ba0d6-e09cb82b0b7a01e6bbaeb5f2a8e9a12.png
1530f3dd-5046-4c74-b9f1-8bf89335fd1d-e998e00a91e69b8e37a3fa7fc569f89.jpg -
@小鱼
更改了配置文件里的服务端IP,网络名称和密码
写入成功,也按过RST按键
但是手机上只显示1台连接设备是我的电脑
虚拟机是桥接模式
还测试过将之前的无线通信程序写入后可以连接到热点
屏幕截图 2023-12-06 182617.png
微信图片_20231206182820.jpg -
RUN Choose Task:[请输入括号内的数字]
请选择你要安装的ROS版本名称(请注意ROS1和ROS2区别):
[1]:humble(ROS2)
[2]:iron(ROS2)
[3]:rolling(ROS2)
[0]:quit
请输入[]内的数字以选择:1
RUN Choose Task:[请输入括号内的数字]
请选择安装的具体版本(如果不知道怎么选,请选1桌面版):
[1]:humble(ROS2)桌面版
[2]:humble(ROS2)基础版(小)
[0]:quit
请输入[]内的数字以选择:1
Run CMD Task:[sudo apt-cache search aptitude ]
[]apt-cacher - Caching proxy server for Debian/Ubuntu/Devuan software repositor[-]apticron-systemd - Simple tool to mail about pending package updates - system[]aptitude-common - architecture independent files for the aptitude package man[-]aptitude-doc-en - English manual for aptitude, a terminal-based package manag[/]aptitude-doc-es - Spanish manual for aptitude, a terminal-based package manag[]aptitude-doc-fi - Finnish manual for aptitude, a terminal-based package manag[|]aptitude-doc-fr - French manual for aptitude, a terminal-based package manage[-]aptitude-doc-it - Italian manual for aptitude, a terminal-based package manag[/]aptitude-doc-ja - Japanese manual for aptitude, a terminal-based package mana[|]aptitude-doc-ru - Russian manual for aptitude, a terminal-based package manag[|]gbrainy - brain teaser game and trainer to have fun and to keep your brain tr[/]libcwidget-dev - high-level terminal interface library for C++ (development f[-]Result:success end for Debian/UbuntuRun CMD Task:[sudo apt install aptitude -y]
[]升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 42 个软件包未被[-]Result:successRun CMD Task:[sudo apt-cache search aptitude ]
[]apt-cacher - Caching proxy server for Debian/Ubuntu/Devuan software repositor[-]apticron-systemd - Simple tool to mail about pending package updates - system[]aptitude-common - architecture independent files for the aptitude package man[-]aptitude-doc-en - English manual for aptitude, a terminal-based package manag[/]aptitude-doc-es - Spanish manual for aptitude, a terminal-based package manag[]aptitude-doc-fi - Finnish manual for aptitude, a terminal-based package manag[|]aptitude-doc-fr - French manual for aptitude, a terminal-based package manage[-]aptitude-doc-it - Italian manual for aptitude, a terminal-based package manag[/]aptitude-doc-ja - Japanese manual for aptitude, a terminal-based package mana[|]aptitude-doc-ru - Russian manual for aptitude, a terminal-based package manag[|]gbrainy - brain teaser game and trainer to have fun and to keep your brain tr[/]libcwidget-dev - high-level terminal interface library for C++ (development f[-]Result:success end for Debian/UbuntuRun CMD Task:[sudo apt install aptitude -y]
[]升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 42 个软件包未被[-]Result:successRun CMD Task:[sudo apt install ros-humble-desktop -y]
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
ros-humble-desktop 已经是最新版 (0.10.0-1jammy.20231117.222203)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 42 个软件包未被升级。
Run CMD Task:[sudo apt install ros-humble-desktop -y]
[]升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 42 个软件包未被[-]Result:successRun CMD Task:[sudo apt-cache search python3-colcon-common-extensions ]
[]python3-colcon-common-extensions - Meta package aggregating colcon-core and c[-]Result:successRun CMD Task:[sudo apt install python3-colcon-common-extensions -y]
[]升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 42 个软件包未被[-]Result:successRun CMD Task:[sudo apt-cache search python3-argcomplete ]
[-]Result:success for argparse (for Python 3)Run CMD Task:[sudo apt install python3-argcomplete -y]
[]升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 42 个软件包未被[-]Result:successRun CMD Task:[sudo apt-cache search python3-rosdep ]
[]python3-rosdep2 - rosdep package manager abstraction tool for Robot OS (Pytho[-]Result:success anager abstraction tool for ROSRun CMD Task:[sudo apt install python3-rosdep -y]
[]升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 42 个软件包未被[-]Result:successRun CMD Task:[ls /opt/ros/humble/setup.bash]
[-]Result:success欢迎使用一键配置ROS开发环境,本工具由作者小鱼提供
Run CMD Task:[ls /opt/ros/*/setup.bash]
[-]Result:successRun CMD Task:[ls /home/*/.bashrc]
[-]Result:success检测到系统有1个ROS环境,已为你生成启动选择,修改~/.bashrc可关闭
恭喜你,安装成功了,再附赠你机器人学习宝藏网站:鱼香社区:https://fishros.org.cn/forum
Run CMD Task:[ls /opt/ros/humble/setup.bash]
[-]Result:successFailed to read config, exiting
按照B站视频”Ubuntu22安装ROS2和Turtlebot3仿真环境“进行安装,请问最后的报错是什么原因呀?要如何解决呀?本人小白,麻烦了! -
问题描述:
在esp32上使用microros服务通信,esp32作为服务端使用set_microros_wifi_transports通信,pc端调用ros2 service call 发送的信息,在pc终端上打印正常,但是esp32服务端串口调试信息显示,接收到的信息不对,并且ros2 service call命令一直卡住,使用rqt工具同样的现象,卡住,然后串口显示的信息不对。
排除点:
同样使用set_microros_wifi_transports通信,话题通信方式,接受到的信息就是对的,wifi应该没有问题
举例:
比如esp32服务端接受请求int32数据,pc端service call 发送数据10,esp32服务端接受到的值很大请问上述问题如何调试呢,怎么确定是哪儿出来问题,使用的是addtwoints代码例子