653b8b6018d5bf55e008629440a4ba9.jpg
maps文件夹:
9a59f6b9b0e30ab7b3530cdb2fe99bd.jpg
要修改的launch文件:
cbd2161a51a12ece656a88c84bb458a.jpg
第一次按教程走的时候,能打开rviz2,但是显示的是系统自带的地图,而不是我们跑的地图。
后面把fishros整个文件及地图都删除了,再按教程走,试了好多次,都是图上的错误,试了两台机器人,都是这个问题。
报错信息:
tingbo@DESKTOP-NHH5E05:~/chapt6/chapt6_ws$ ros2 launch fishbot_description display_robot.launch.py model:=/home/tingbo/chapt6/chapt6_ws/src/fishbot_description/urdf/fishbot/fishbot.urdf.xacro [INFO] [launch]: All log files can be found below /home/tingbo/.ros/log/2024-04-19-11-07-25-252392-DESKTOP-NHH5E05-75355 [INFO] [launch]: Default logging verbosity is set to INFO [ERROR] [launch]: Caught exception in launch (see debug for traceback): executed command failed. Command: xacro /home/tingbo/chapt6/chapt6_ws/src/fishbot_description/urdf/fishbot/fishbot.urdf.xacro Captured stderr output: error: name 'l' is not defined when evaluating expression 'l' when instantiating macro: box_inertia (/home/tingbo/chapt6/chapt6_ws/install/fishbot_description/share/fishbot_description/urdf/fishbot/common_inertia.xacro) instantiated from: imu_xacro (/home/tingbo/chapt6/chapt6_ws/install/fishbot_description/share/fishbot_description/urdf/fishbot/sensor/imu.urdf.xacro) in file: /home/tingbo/chapt6/chapt6_ws/src/fishbot_description/urdf/fishbot/fishbot.urdf.xacrobase.urdf.xacro代码如下:
<?xml version="1.0"?> <robot xmlns:xacro="http://www.ros.org/wiki/xacro"> <xacro:include filename="$(find fishbot_description)/urdf/fishbot/common_inertia.xacro"/> <xacro:macro name="base_xacro" params ="length radius"> <link name="base_footprint" /> <link name="base_link"> <visual> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> <geometry> <cylinder radius="${length}" length="${length}"/> </geometry> <material name="white"> <color rgba="1.0 1.0 1.0 0.5"/> </material> </visual> <collision> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> <geometry> <cylinder radius="${length}" length="${length}"/> </geometry> <material name="white"> <color rgba="1.0 1.0 1.0 0.5"/> </material> </collision> <xacro:cylinder_inertia m="1.0" r="${radius}" h="${length}"/> </link> <joint name="base_joint" type="fixed"> <parent link="base_footprint"/> <child link="base_link"/> <origin xyz=" 0.0 0.0 ${length/2+0.032-0.001}" rpy="0.0 0.0 0.0"/> </joint> </xacro:macro> </robot>common_inertia.xacro代码如下:
<?xml version="1.0"?> <robot xmlns:xacro="http://www.ros.org/wiki/xacro" > <xacro:macro name="box_inertia" params="m l w h"> <inertial> <mass value="${m}"/> <inertia ixx="${(m/12) * (h*h + l*l)}" ixy="0.0" ixz="0.0" iyy="${(m/12) * (w*w + l*l)}" iyz="0.0" izz="${(m/12) * (w*w + h*h)}"/> </inertial> </xacro:macro> <xacro:macro name="cylinder_inertia" params="m r h"> <inertial> <mass value="${m}"/> <inertia ixx="${(m/12) * (3*r*r + h*h)}" ixy="0.0" ixz="0.0" iyy="${(m/12) * (3*r*r + h*h)}" iyz="0.0" izz="${(m/2) * (r*r)}"/> </inertial> </xacro:macro> <xacro:macro name="sphere_inertia" params="m r"> <inertial> <mass value="${m}"/> <inertia ixx="${(2/5) * m * (r*r)}" ixy="0.0" ixz="0.0" iyy="${(2/5) * m * (r*r)}" iyz="0.0" izz="${(2/5) * m * (r*r)}"/> </inertial> </xacro:macro> </robot>camera.urdf.xacro代码如下:
<?xml version="1.0"?> <robot xmlns:xacro="http://www.ros.org/wiki/xacro"> <xacro:include filename="$(find fishbot_description)/urdf/fishbot/common_inertia.xacro"/> <xacro:macro name="camera_xacro" params="xyz"> <!--=========相机模块=========--> <link name="camera_link"> <visual> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> <geometry> <box size="0.02 0.1 0.02"/> </geometry> <material name="green"> <color rgba="0.0 1.0 0.0 0.8"/> </material> </visual> <collision> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> <geometry> <box size="0.02 0.1 0.02"/> </geometry> <material name="green"> <color rgba="0.0 1.0 0.0 0.8"/> </material> </collision> <xacro:box_inertia m="0.05" l="${l}" w="${w}" h="${h}"/> </link> <joint name="camera_joint" type="fixed"> <parent link="base_link"/> <child link="camera_link"/> <origin xyz="${xyz}"/> </joint> </xacro:macro> </robot>imu.urdf.xacro代码如下:
<?xml version="1.0"?> <robot xmlns:xacro="http://www.ros.org/wiki/xacro"> <xacro:include filename="$(find fishbot_description)/urdf/fishbot/common_inertia.xacro"/> <xacro:macro name="imu_xacro" params="xyz"> <link name="imu_link"> <visual> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> <geometry> <box size="0.02 0.02 0.02"/> </geometry> <material name="black"> <color rgba="0.0 0.0 0.0 0.8"/> </material> </visual> <collision> <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/> <geometry> <box size="0.02 0.02 0.02"/> </geometry> <material name="black"> <color rgba="0.0 0.0 0.0 0.8"/> </material> </collision> <xacro:box_inertia m="0.05" l="${l}" w="${w}" h="${h}"/> </link> <joint name="imu_joint" type="fixed"> <parent link="base_link"/> <child link="imu_link"/> <origin xyz="${xyz}"/> </joint> </xacro:macro> </robot>fishbot.urdf.xacro代码如下:
<?xml version="1.0"?> <robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="fishbot"> <xacro:include filename="$(find fishbot_description)/urdf/fishbot/base.urdf.xacro" /> <!--传感器组件--> <xacro:include filename="$(find fishbot_description)/urdf/fishbot/sensor/imu.urdf.xacro" /> <xacro:include filename="$(find fishbot_description)/urdf/fishbot/sensor/laser.urdf.xacro" /> <xacro:include filename="$(find fishbot_description)/urdf/fishbot/sensor/camera.urdf.xacro" /> <xacro:base_xacro length="0.12" radius="0.1" /> <!--传感器--> <xacro:imu_xacro xyz="0.0 0.0 0.02" /> <xacro:laser_xacro xyz="0.0 0.0 0.1" /> <xacro:camera_xacro xyz="0.1 0.0 0.075" /> <!--执行器组件--> <xacro:include filename="$(find fishbot_description)/urdf/fishbot/actuator/wheel.urdf.xacro" /> <xacro:include filename="$(find fishbot_description)/urdf/fishbot/actuator/caster.urdf.xacro" /> <!--执行器主动轮+从动轮--> <xacro:wheel_xacro wheel_name="left" xyz="0.0 0.1 -0.06" /> <xacro:wheel_xacro wheel_name="right" xyz="0.0 -0.1 -0.06" /> <xacro:caster_xacro caster_name="front" xyz="0.08 0.0 -0.076" /> <xacro:caster_xacro caster_name="back" xyz="-0.08 0.0 -0.076" /> </robot>背景:已经完成了主板和雷达的连接,和以上两个的网络配置一样的步骤在配置camera,但是在下载并重构工作空间后运行驱动时出现问题,一直在提示超时,但是我的电脑热点已经出现了camera的连接,小白提问这是为啥,该怎么解决
ma@ma201530:~/fishbot_ws$ source ~/fishbot_ws/install/setup.bash[INFO] [1713506712.843290846] [fishbot_camera]: start read image thread http://192.168.50.79:81/stream
[ERROR] [1713506846.980526627] [fishbot_camera]: 发生错误:<urlopen error [Errno 110] Connection timed out>
[ERROR] [1713506982.148470247] [fishbot_camera]: 发生错误:<urlopen error [Errno 110] Connection timed out>
[ERROR] [1713507117.316282254] [fishbot_camera]: 发生错误:<urlopen error [Errno 110] Connection timed out>
[ERROR] [1713507252.484538759] [fishbot_camera]: 发生错误:<urlopen error [Errno 110] Connection timed out>
[ERROR] [1713507387.656694674] [fishbot_camera]: 发生错误:<urlopen error [Errno 110] Connection timed out>
背景:
购买fishbot后,想利用树莓派5作为上位机与fishbot开发板进行串口或wifi等通信,方便后续开发。
环境:树莓派5 ubuntu23.10 一键安装docker+Ros 2 humble,docker中安装microros agent。
问题描述:当前Ros2能成功启动小乌龟,但是无法利用Microros agent与fishbot开发板通信。
尝试的方法有
1.《动手学ROS2》4.2的命令 sudo docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:$ROS_DISTRO serial --dev /dev/ttyUSB0 -v6
失败,我理解是该容器与ROS2的容器非一个容器无法通讯
2.于是在ROS2的容器中安装microros agent源码,启动源码加串口通讯,但是一直报错Serial not found
5eaa430f-360d-40f6-943a-3e77a0ee28b7-image.png 代码使用的是控制LED的代码
3.2步骤中将串口改为wifi通讯依旧连接不上,其中代码在虚拟机ros2可以成功通信,所以理解还是树莓派的docker中无法与外网通信导致
f96a87dd-d78d-4b2b-8685-3ea22d0aaae6-image.png
代码为
万分感谢
[FATAL] [1713409995.346251746]: F0418 11:13:15.000000 4896 lua_parameter_dictionary.cc:84] Check failed: status == 0 (3 vs. 0) [string "-- Copyright 2016 The Cartographer Authors..."]:40: '}' expected (to close '{' at line 18) near 'odometry_sampling_ratio'
*** Check failure stack trace: ***
@ 0x7fa604fac0cd google::LogMessage::Fail()
@ 0x7fa604fadf33 google::LogMessage::SendToLog()
@ 0x7fa604fabc28 google::LogMessage::Flush()
@ 0x7fa604fae999 google::LogMessageFatal::~LogMessageFatal()
@ 0x56481f694727 (unknown)
@ 0x56481f695aa2 (unknown)
@ 0x56481f695dbd (unknown)
@ 0x56481f6732f5 (unknown)
@ 0x56481f63bf44 (unknown)
@ 0x56481f638d84 (unknown)
@ 0x7fa600f39c87 __libc_start_main
@ 0x56481f63bc0a (unknown)
[cartographer_node-1] process has died [pid 4896, exit code -6, cmd /home/zq/cartographer_ws/install_isolated/lib/cartographer_ros/cartographer_node -configuration_directory /home/zq/cartographer_ws/install_isolated/share/cartographer_ros/configuration_files -configuration_basename my_laser.lua scan:=scan __name:=cartographer_node __log:=/home/zq/.ros/log/8f76bafc-fd31-11ee-ae26-000c2935d1f6/cartographer_node-1.log].
log file: /home/zq/.ros/log/8f76bafc-fd31-11ee-ae26-000c2935d1f6/cartographer_node-1*.log
回复: 使用OS0-128激光雷达跑ALOAM,怎么修改
如何用128线雷达跑aloam算法呢?修改launch文件也不行
针对这个问题我想提问:
1,多播是否是1对多的信息传递形式?针对的是整个域id?如果是的话为什么域id中需要用多播?
2,单播又是什么意思?针对的是一个域id中的每一个进程?如果是的话为什么进程中需要用单播?
3,为什么多播和单播都有两个端口,每一个端口的作用是什么?
4,这里说的ros2进程和ros2中的节点有什么关系?是一个意思吗?可否举例说明
参考内容如下:
参与者约束
对于计算机上运行的每个ROS 2进程,将创建一个DDS "participant" 。由于每个DDS参与者占用计算机上的两个端口,因此在一台计算机上运行120个以上的ROS 2进程可能会溢出到其他域ID或临时端口。
为了解释原因,我们考虑域ID编号1和2。
域ID 1使用端口7650和7651进行多播。
域ID 2使用端口7900和7901进行多播。
在域ID 1中创建第一个进程 (第0个参与者) 时,端口7660和7661用于单播。
在域ID 1中创建第120个进程 (第119个参与者) 时,端口7898和7899用于单播。
在域ID 1中创建第121个进程 (第120个参与者) 时,端口7900和7901用于单播,并与域ID 2重叠。
如果已知计算机一次只能在一个域ID上,并且域ID足够低,那么创建比这更多的ROS 2进程是安全的。
在选择特定平台域 ID 范围顶部的域 ID 时,还有一个限制因素需要考虑。
例如,假设一台ID为101的Linux计算机:
计算机上的第0个ROS 2进程将连接到端口32650、32651、32660和32661。
计算机上的第1个ROS 2进程将连接到端口32650、32651、32662和32663。
计算机上的第53个ROS 2进程将连接到端口32650、32651、32766和32767。
计算机上的第54个ROS 2进程将连接到端口32650、32651、32768和32769,运行在临时端口范围内。
因此,在Linux上使用域ID为101时应创建的最大进程数为54。同样,在Linux上使用域ID为232时应创建的最大进程数为63,因为最大端口号为65535。
macOS和Windows的情况相似,尽管数字不同。在macOS和Windows上,当选择166 (范围顶部) 的域账号时,运行到临时端口范围之前,可以在计算机上创建的ROS 2进程的最大数量为120。
ubuntu22.04,humble,通过代理克隆了nav2的包后进行编译,然后报错,编译路径为工作空间下面,结果报错```
~/chapt8_ws$ colcon build --packages-up-to navigation2
[0.726s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
'nav2_amcl' is in: /opt/ros/humble
'navigation2' is in: /opt/ros/humble
'nav2_map_server' is in: /opt/ros/humble
'nav2_navfn_planner' is in: /opt/ros/humble
'nav2_common' is in: /opt/ros/humble
'nav2_behavior_tree' is in: /opt/ros/humble
'nav2_lifecycle_manager' is in: /opt/ros/humble
'nav2_msgs' is in: /opt/ros/humble
'nav2_planner' is in: /opt/ros/humble
'nav2_util' is in: /opt/ros/humble
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.
If you understand the risks and want to override a package anyways, add the following to the command line:
--allow-overriding nav2_amcl nav2_behavior_tree nav2_common nav2_lifecycle_manager nav2_map_server nav2_msgs nav2_navfn_planner nav2_planner nav2_util navigation2
Finished <<< nav2_simple_commander [0.79s]
--- stderr: nav2_util
CMake Error at test/CMakeLists.txt:7 (find_package):
By not providing "Findtest_msgs.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"test_msgs", but CMake did not find one.
Could not find a package configuration file provided by "test_msgs" with
any of the following names:
Add the installation prefix of "test_msgs" to CMAKE_PREFIX_PATH or set
"test_msgs_DIR" to a directory containing one of the above files. If
"test_msgs" provides a separate development package or SDK, be sure it has
been installed.
Failed <<< nav2_util [1.13s, exited with code 2]
Aborted <<< nav2_voxel_grid [4.83s]
Summary: 5 packages finished [6.21s]
1 package failed: nav2_util
1 package aborted: nav2_voxel_grid
2 packages had stderr output: nav2_simple_commander nav2_util
29 packages not processed
截图 2024-04-17 22-20-55.jpg
试过下载了这个test-msgs包,再次编译后电脑死机了
b669fec4-cd8f-429e-9a2b-5155d6e4bcf9-image.png
在鱼香ROS教程中,启动GAZEBO和生产FISHBOT的Launch文件,运行时 失败
,请求帮助
ros2 launch fishbot_description gazebo.launch.py
[INFO] [launch]: All log files can be found below /home/zhang/.ros/log/2024-04-17-17-03-55-460706-zhang-ros-9393
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: name 'gazebo_world_path' is not defined
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/colcon_core/executor/init.py", line 91, in call
rc = await self.task(*args, **kwargs)
File "/usr/lib/python3/dist-packages/colcon_core/task/init.py", line 93, in call
return await task_method(*args, **kwargs)
File "/usr/lib/python3/dist-packages/colcon_ros/task/ament_cmake/build.py", line 59, in build
rc = await extension.build(
File "/usr/lib/python3/dist-packages/colcon_cmake/task/cmake/build.py", line 87, in build
rc = await self._reconfigure(args, env)
File "/usr/lib/python3/dist-packages/colcon_cmake/task/cmake/build.py", line 133, in _reconfigure
buildfile = get_buildfile(cmake_cache)
File "/usr/lib/python3/dist-packages/colcon_cmake/task/cmake/init.py", line 110, in get_buildfile
generator = get_variable_from_cmake_cache(
File "/usr/lib/python3/dist-packages/colcon_cmake/task/cmake/init.py", line 174, in get_variable_from_cmake_cache
lines = _get_cmake_cache_lines(path)
File "/usr/lib/python3/dist-packages/colcon_cmake/task/cmake/init.py", line 193, in _get_cmake_cache_lines
content = h.read()
File "/usr/lib/python3.8/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xda in position 1: invalid continuation byte
运行报错:
tingbo@DESKTOP-NHH5E05:~/chapt6/chapt6_ws$ ros2 launch fishbot_description display_robot.launch.py model :=/home/tingbo/chapt6/chapt6_ws/src/fishbot_description/urdf/first_robot.urdf.xacro malformed launch argument 'model', expected format '<name>:=<value>' tingbo@DESKTOP-NHH5E05:~/chapt6/chapt6_ws$ ros2 launch fishbot_description display_robot.launch.py model := /home/tingbo/chapt6/chapt6_ws/src/fishbot_description/ urdf/first_robot.urdf.xacro malformed launch argument 'model', expected format '<name>:=<value>' tingbo@DESKTOP-NHH5E05:~/chapt6/chapt6_ws$ ros2 launch fishbot_description display_robot.launch.py <model> : = </home/tingbo/chapt6/chapt6_ws/src/fishbot_descripti on/urdf/first_robot.urdf.xacro> bash: 未预期的记号 "newline" 附近有语法错误cindy@cindy-desktop:~/carto$ wget http://fishros.com/install -O fishros && . fishros
--2024-04-16 22:11:49-- http://fishros.com/install
正在解析主机 fishros.com (fishros.com)... 47.119.165.169
正在连接 fishros.com (fishros.com)|47.119.165.169|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 301 Moved Permanently
位置:http://fishros.com/install/ [跟随至新的 URL]
--2024-04-16 22:11:49-- http://fishros.com/install/
再次使用存在的到 fishros.com:80 的连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 579 [application/octet-stream]
正在保存至: “fishros”
fishros 100%[===========================================================>] 579 --.-KB/s 用时 0s
2024-04-16 22:11:49 (28.1 MB/s) - 已保存 “fishros” [579/579])
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
python3-distro 已经是最新版 (1.4.0-1)。
python3-yaml 已经是最新版 (5.3.1-1ubuntu0.1)。
下列软件包是自动安装的并且现在不需要了:
apt-clone archdetect-deb dctrl-tools dpkg-repack gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 grub-common libdebian-installer4
libfile-readbackwards-perl libpython2-dev libpython2.7 libpython2.7-dev libtimezonemap-data libtimezonemap1 libwiringpi2 os-prober
python2-dev python2.7-dev python3-icu python3-pam rdate
使用'sudo apt autoremove'来卸载它(它们)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 945 个软件包未被升级。
--2024-04-16 22:11:52-- http://mirror.fishros.com/install/tools/base.py
正在解析主机 mirror.fishros.com (mirror.fishros.com)... 47.119.165.169
正在连接 mirror.fishros.com (mirror.fishros.com)|47.119.165.169|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 44656 (44K) [application/octet-stream]
正在保存至: “/tmp/fishinstall/tools/base.py”
/tmp/fishinstall/tools/base.py 100%[===========================================================>] 43.61K --.-KB/s 用时 0.1s
2024-04-16 22:11:53 (406 KB/s) - 已保存 “/tmp/fishinstall/tools/base.py” [44656/44656])
Run CMD Task:[dpkg --print-architecture]
[-]Result:success
Run CMD Task:[wget https://fishros.org.cn/forum/topic/1733 -O /tmp/t1733 -q && rm -rf /tmp/t1733]
[-]Result:success
RUN Choose Task:[请输入括号内的数字]
---众多工具,等君来用---
ROS相关:
[1]:一键安装(推荐):ROS(支持ROS/ROS2,树莓派Jetson)
[3]:一键安装:rosdep(小鱼的rosdepc,又快又好用)
[4]:一键配置:ROS环境(快速更新ROS环境设置,自动生成环境选择)
[9]:一键安装:Cartographer(18 20测试通过,16未测. updateTime 20240125)
[11]:一键安装:ROS Docker版(支持所有版本ROS/ROS2)
[16]:一键安装:系统自带ROS (!!警告!!仅供特殊情况下使用)
常用软件:
[2]:一键安装:github桌面版(小鱼常用的github客户端)
[6]:一键安装:NodeJS环境
[7]:一键安装:VsCode开发工具
[8]:一键安装:Docker
[10]:一键安装:微信(可以在Linux上使用的微信)
[12]:一键安装:PlateformIO MicroROS开发环境(支持Fishbot)
[14]:一键安装:科学上网代理工具
[15]:一键安装:QQ for Linux
配置工具:
[5]:一键配置:系统源(更换系统源,支持全版本Ubuntu系统)
[13]:一键配置:python国内源
请输入[]内的数字以选择:9
--2024-04-16 22:12:01-- http://mirror.fishros.com/install/tools/tool_install_cartographer.py
正在解析主机 mirror.fishros.com (mirror.fishros.com)... 47.119.165.169
正在连接 mirror.fishros.com (mirror.fishros.com)|47.119.165.169|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 2885 (2.8K) [application/octet-stream]
正在保存至: “/tmp/fishinstall/tools/tool_install_cartographer.py”
/tmp/fishinstall/tools/tool_insta 100%[===========================================================>] 2.82K --.-KB/s 用时 0.003s
2024-04-16 22:12:02 (887 KB/s) - 已保存 “/tmp/fishinstall/tools/tool_install_cartographer.py” [2885/2885])
--2024-04-16 22:12:02-- http://mirror.fishros.com/install/tools/tool_config_rosdep.py
正在解析主机 mirror.fishros.com (mirror.fishros.com)... 47.119.165.169
正在连接 mirror.fishros.com (mirror.fishros.com)|47.119.165.169|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 857 [application/octet-stream]
正在保存至: “/tmp/fishinstall/tools/tool_config_rosdep.py”
/tmp/fishinstall/tools/tool_confi 100%[===========================================================>] 857 --.-KB/s 用时 0s
2024-04-16 22:12:02 (40.9 MB/s) - 已保存 “/tmp/fishinstall/tools/tool_config_rosdep.py” [857/857])
欢迎使用一键安装Cartographer,本工具由作者catalpa提供
欢迎使用一键编译安装Cartographer,该工具将会以当前目录作为工作区,创建src文件夹并进行cartographer的编译安装
使用一键安装前,若未安装ROS或出现错误,可以使用一键安装ROS
检测到您的系统版ROS版本为:noetic
Run CMD Task:[sudo apt update]
[-]Result:success --upgradable’ 来查看它们。easee,685 B]
Run CMD Task:[sudo apt install ninja-build stow git -y]
[-]Result:success .卸载 0 个软件包,有 945 个软件包未被升级。
Run CMD Task:[mkdir -p cartographer_ws/src]
[-]Result:success
Run CMD Task:[git clone https://gitee.com/yuzi99url/cartographer_ros.git]
[-]Result:success
Run CMD Task:[git clone https://gitee.com/yuzi99url/cartographer.git]
[-]Result:success
Run CMD Task:[sudo apt-get install libamd2 libatlas3-base libbtf1 libcamd2 libccolamd2 libceres-dev libceres1 libcholmod3 libcxsparse3 libgflags-dev libgflags2.2 libgoogle-glog-dev libgoogle-glog0v5 libklu1 libldl2 liblua5.2-0 liblua5.2-dev libmetis5 libncurses5 libncursesw5 librbio2 libreadline-dev libspqr2 libsuitesparse-dev libtinfo-dev libtinfo5 libtool-bin libumfpack5 -y]
[-]Result:success .卸载 0 个软件包,有 945 个软件包未被升级。
Run CMD Task:[sudo apt-get remove ros-noetic-abseil-cpp -y]
[-]Result:code:100
Run CMD Task:[bash src/cartographer/scripts/install_abseil.sh]
[][22/184] Building CXX object absl/container/CMakeFiles/hashtablez_sampler.dir/internal/hashtablez_sampler_force_weak_definition.cc.[-]Result:success kgconfig/absl_utility.pcs.access.pccl.pclper.pc_util.pce.hh.occ.os.cc.oon.cc.ost_util.cc.o
Run CMD Task:[catkin_make_isolated --install --use-ninja]
[-]Result:code:127
Run CMD Task:[sudo chmod -R 777 cartographer_ws]
[-]Result:success
欢迎加入机器人学习交流QQ群:438144612(入群口令:一键安装)
鱼香小铺正式开业,最低499可入手一台能建图会导航的移动机器人,淘宝搜店:鱼香ROS 或打开链接查看:https://item.taobao.com/item.htm?id=696573635888
如在使用过程中遇到问题,请打开:https://fishros.org.cn/forum 进行反馈
cindy@cindy-desktop:~/carto$ ls
cartographer_ws
cindy@cindy-desktop:~/carto$ cd cartographer_ws/
cindy@cindy-desktop:~/carto/cartographer_ws$ ls
abseil-cpp src
cindy@cindy-desktop:~/carto/cartographer_ws$ catkin_make_isolated --install --use-ninja
Base path: /home/cindy/carto/cartographer_ws
Source space: /home/cindy/carto/cartographer_ws/src
Build space: /home/cindy/carto/cartographer_ws/build_isolated
Devel space: /home/cindy/carto/cartographer_ws/devel_isolated
Install space: /home/cindy/carto/cartographer_ws/install_isolated
The packages or cmake arguments have changed, forcing cmake invocation
==> Processing plain cmake package: 'cartographer'
==> Creating build directory: 'build_isolated/cartographer/install'
==> cmake /home/cindy/carto/cartographer_ws/src/cartographer -DCMAKE_INSTALL_PREFIX=/home/cindy/carto/cartographer_ws/install_isolated -G Ninja in '/home/cindy/carto/cartographer_ws/build_isolated/cartographer/install'
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build type: Release
文件 /home/cindy/carto/cartographer_ws/build_isolated/cartographer/install/AllFiles.cmake 和 - 不同
CMake Warning at /usr/src/googletest/googlemock/CMakeLists.txt:43 (project):
VERSION keyword not followed by a value or was followed by a value that
expanded to nothing.
CMake Warning at /usr/src/googletest/googletest/CMakeLists.txt:54 (project):
VERSION keyword not followed by a value or was followed by a value that
expanded to nothing.
-- Found PythonInterp: /usr/bin/python (found version "2.7.18")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found GMock: gmock_main;-lpthread
-- Found Boost: /usr/local/lib/cmake/Boost-1.78.0/BoostConfig.cmake (found version "1.78.0") found components: iostreams
CMake Error at /usr/local/lib/cmake/Ceres/CeresConfig.cmake:85 (message):
Failed to find Ceres - Found Eigen dependency, but the version of Eigen
found (3.4.0) does not exactly match the version of Eigen Ceres was
compiled with (3.3.7). This can cause subtle bugs by triggering violations
of the One Definition Rule. See the Wikipedia article
http://en.wikipedia.org/wiki/One_Definition_Rule for more details
Call Stack (most recent call first):
/usr/local/lib/cmake/Ceres/CeresConfig.cmake:200 (ceres_report_not_found)
CMakeLists.txt:39 (find_package)
CMake Error at CMakeLists.txt:39 (find_package):
Found package configuration file:
but it set Ceres_FOUND to FALSE so package "Ceres" is considered to be NOT
FOUND.
-- Configuring incomplete, errors occurred!
See also "/home/cindy/carto/cartographer_ws/build_isolated/cartographer/install/CMakeFiles/CMakeOutput.log".
See also "/home/cindy/carto/cartographer_ws/build_isolated/cartographer/install/CMakeFiles/CMakeError.log".
<== Failed to process package 'cartographer':
Command '['cmake', '/home/cindy/carto/cartographer_ws/src/cartographer', '-DCMAKE_INSTALL_PREFIX=/home/cindy/carto/cartographer_ws/install_isolated', '-G', 'Ninja']' returned non-zero exit status 1.
Reproduce this error by running:
==> cd /home/cindy/carto/cartographer_ws/build_isolated/cartographer && cmake /home/cindy/carto/cartographer_ws/src/cartographer -DCMAKE_INSTALL_PREFIX=/home/cindy/carto/cartographer_ws/install_isolated -G Ninja
Command failed, exiting.
出现问题:
按display_robot.launch.py的代码清单录入,构建工作空间后运行错误,提示如下
display_robot.launch.py代码清单如下:
import launch import launch_ros from ament_index_python.packages import get_package_share_directory def generate_launch_description(): urdf_tutorial_path = get_package_share_directory('fishbot_description') default_model_path = urdf_tutorial_path + '/urdf/first_robot.urdf' #print (str(default_model_path)) action_declare_arg_mode_path = launch.actions.DeclareLaunchArgument( name='model', default_value=str(default_model_path), description='URDF的绝对路径') robot_description=launch_ros.parameter_descriptions.ParameterValue( launch.substitutions.Command( ['cat ', launch.substitutions.LaunchConfiguration('model')]), value_type=str) robot_state_publisher_node = launch_ros.actions.Node ( package='robot_state_publisher', executable='robot_state_publisher', parameters=[{'robot_description':robot_description}]) joint_state_publisher_node = launch_ros.actions.Node( package='joint_state_publish', executable='joint_state_publisher', ) rviz_node = launch_ros.actions.Node( package='rviz2', executable='rviz2', ) return launch.launch_description([ action_declare_arg_mode_path, joint_state_publisher_node, robot_state_publisher_node, rviz_node ])cmakelists.txt代码清单如下:
cmake_minimum_required(VERSION 3.8) project(fishbot_description) 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) # uncomment the following section in order to fill in # further dependencies manually. # find_package(<dependency> 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() install(DIRECTORY launch urdf DESTINATION share/${PROJECT_NAME} ) ament_package()我跟随Moveit2官网创建了panda机械臂,并成功运行了 demo.launch.py:
MoveIt Setup Assistant — MoveIt Documentation: Rolling documentation
我想将教程熊猫机械臂命令接口从'position'更改为'velocity'。
我更改了两个文件:
ros2_controllers.yaml panda.ros2_control.xacro更改后,运行以下命令启动程序:
colcon build
ros2 launch panda_moveit_config demo.launch.py
这时RViz 展示了正确的计划轨迹
但是完成计划后并单击“ Execute”按钮时,rviz中机械臂没有相应的动作(只有之前点击“Plan”后出现的计划轨迹)
我的更改内容是否有问题?或者说正确的更改是什么?
以下是控制台输出,以及我更改的两个文件:
控制台输出:
[rviz2-4] [INFO] [1713256529.569964067] [move_group_interface]: MoveGroup action client/server ready [move_group-3] [INFO] [1713256529.570737967] [moveit_move_group_default_capabilities.move_action_capability]: Received request [move_group-3] [INFO] [1713256529.570926767] [moveit_move_group_default_capabilities.move_action_capability]: executing.. [rviz2-4] [INFO] [1713256529.571154567] [move_group_interface]: Planning request accepted [move_group-3] [INFO] [1713256529.579226867] [moveit_move_group_default_capabilities.move_action_capability]: Planning request received for MoveGroup action. Forwarding to planning pipeline. [move_group-3] [INFO] [1713256529.579303767] [moveit_move_group_capabilities_base.move_group_capability]: Using planning pipeline 'ompl' [move_group-3] [INFO] [1713256529.579782367] [moveit.ompl_planning.model_based_planning_context]: Planner configuration 'robot_arm' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed. [move_group-3] [INFO] [1713256529.634432567] [moveit_move_group_default_capabilities.move_action_capability]: Motion plan was computed successfully. [rviz2-4] [INFO] [1713256529.635581867] [move_group_interface]: Planning request complete! [rviz2-4] [INFO] [1713256529.635675367] [move_group_interface]: time taken to generate plan: 0.0163399 seconds [move_group-3] [INFO] [1713256535.657329254] [moveit_move_group_default_capabilities.execute_trajectory_action_capability]: Received goal request [move_group-3] [INFO] [1713256535.657736354] [moveit_move_group_default_capabilities.execute_trajectory_action_capability]: Execution request received [move_group-3] [INFO] [1713256535.657824254] [moveit.plugins.moveit_simple_controller_manager]: Returned 2 controllers in list [move_group-3] [INFO] [1713256535.657872854] [moveit.plugins.moveit_simple_controller_manager]: Returned 2 controllers in list [move_group-3] [INFO] [1713256535.658506454] [moveit_ros.trajectory_execution_manager]: Validating trajectory with allowed_start_tolerance 0.01 [rviz2-4] [INFO] [1713256535.658094154] [move_group_interface]: Execute request accepted [move_group-3] [INFO] [1713256535.660050654] [moveit_ros.trajectory_execution_manager]: Starting trajectory execution ... [move_group-3] [INFO] [1713256535.660163154] [moveit.plugins.moveit_simple_controller_manager]: Returned 2 controllers in list [move_group-3] [INFO] [1713256535.660240354] [moveit.plugins.moveit_simple_controller_manager]: Returned 2 controllers in list [move_group-3] [INFO] [1713256535.660452454] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: sending trajectory to robot_arm_controller [ros2_control_node-5] [INFO] [1713256535.660962554] [robot_arm_controller]: Received new action goal [ros2_control_node-5] [INFO] [1713256535.661051554] [robot_arm_controller]: Accepted new action goal [move_group-3] [INFO] [1713256535.661379754] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: robot_arm_controller started execution [move_group-3] [INFO] [1713256535.661414754] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: Goal request accepted! [ros2_control_node-5] [INFO] [1713256545.758803767] [robot_arm_controller]: Goal reached, success! [move_group-3] [INFO] [1713256545.761655467] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: Controller 'robot_arm_controller' successfully finished [move_group-3] [INFO] [1713256545.789580068] [moveit_ros.trajectory_execution_manager]: Completed trajectory execution with status SUCCEEDED ... [move_group-3] [INFO] [1713256545.789703768] [moveit_move_group_default_capabilities.execute_trajectory_action_capability]: Execution completed: SUCCEEDED [rviz2-4] [INFO] [1713256545.790211768] [move_group_interface]: Execute request success!更改的文件:
ros2_controllers.yaml: # This config file is used by ros2_control controller_manager: ros__parameters: update_rate: 100 # Hz robot_arm_controller: type: joint_trajectory_controller/JointTrajectoryController robot_hand_controller: type: position_controllers/GripperActionController joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster robot_arm_controller: ros__parameters: joints: - panda_joint1 - panda_joint2 - panda_joint3 - panda_joint4 - panda_joint5 - panda_joint6 - panda_joint7 command_interfaces: # - position # changed: - velocity state_interfaces: - position - velocity robot_hand_controller: ros__parameters: joint: panda_finger_joint1 panda.ros2_control.xacro <?xml version="1.0"?> <robot xmlns:xacro="http://www.ros.org/wiki/xacro"> <xacro:macro name="panda_ros2_control" params="name initial_positions_file"> <xacro:property name="initial_positions" value="${load_yaml(initial_positions_file)['initial_positions']}"/> <ros2_control name="${name}" type="system"> <hardware> <!-- By default, set up controllers for simulation. This won't work on real hardware --> <plugin>mock_components/GenericSystem</plugin> </hardware> <joint name="panda_joint1"> <!-- changed --> <command_interface name="velocity"/> <!-- position --> <state_interface name="position"> <param name="initial_value">${initial_positions['panda_joint1']}</param> </state_interface> <state_interface name="velocity"/> </joint> <joint name="panda_joint2"> <!-- changed --> <command_interface name="velocity"/> <!-- position --> <state_interface name="position"> <param name="initial_value">${initial_positions['panda_joint2']}</param> </state_interface> <state_interface name="velocity"/> </joint> <joint name="panda_joint3"> <!-- changed --> <command_interface name="velocity"/> <!-- position --> <state_interface name="position"> <param name="initial_value">${initial_positions['panda_joint3']}</param> </state_interface> <state_interface name="velocity"/> </joint> <joint name="panda_joint4"> <!-- changed --> <command_interface name="velocity"/> <!-- position --> <state_interface name="position"> <param name="initial_value">${initial_positions['panda_joint4']}</param> </state_interface> <state_interface name="velocity"/> </joint> <joint name="panda_joint5"> <!-- changed --> <command_interface name="velocity"/> <!-- position --> <state_interface name="position"> <param name="initial_value">${initial_positions['panda_joint5']}</param> </state_interface> <state_interface name="velocity"/> </joint> <joint name="panda_joint6"> <!-- changed --> <command_interface name="velocity"/> <!-- position --> <state_interface name="position"> <param name="initial_value">${initial_positions['panda_joint6']}</param> </state_interface> <state_interface name="velocity"/> </joint> <joint name="panda_joint7"> <!-- changed --> <command_interface name="velocity"/> <!-- position --> <state_interface name="position"> <param name="initial_value">${initial_positions['panda_joint7']}</param> </state_interface> <state_interface name="velocity"/> </joint> <joint name="panda_finger_joint1"> <command_interface name="position"/> <state_interface name="position"> <param name="initial_value">${initial_positions['panda_finger_joint1']}</param> </state_interface> <state_interface name="velocity"/> </joint> </ros2_control> </xacro:macro> </robot>