98afc932-22f5-4444-bce3-70274be7a7d4-image.png
用了vpn模式后没有删掉就关机,再开机发现一件安装打不开了,变成了我的代理ip和端口,这咋整
回复: [FishBot教程] 9.0.3. 主控板固件烧录与配置 我对esp32并不熟悉,但是我按照教程用串口助手给esp32刷入了固件,我也不太清楚这些固件是什么,那么此时我是否必须还要去修改esp32的代码,使其能使用microROS。我照着快速上手的视频操作过,功能都是正常的。那么接下来,我只需要在电脑上编写ROS2的代码就行了吗@小鱼
3744c805-3601-48d9-9217-8e01e5db6589-图片.png
如图,kuka的机械臂,可以在gazebo中正常打开,但移动下方的方块砸机械臂,它一点而都不动,也尝试过直接给机械臂施加力和力矩,机械臂也不动,下面粘贴urdf部分urdf文件,
还有部分xacro文件内容
```
<gazebo reference="link_1">
<material>Gazebo/Orange</material>
<self_collide>false</self_collide>
<gravity>true</gravity>
</gazebo>
<gazebo>
<is_static>false</is_static>
<self_collide>true</self_collide>
</gazebo>
<ros2_control name="GazeboSystem" type="system">
<hardware>
<plugin>gazebo_ros2_control/GazeboSystem</plugin>
</hardware>
<joint name="joint_1">
<command_interface name="position"/>
<command_interface name="effort"/>
<!-- <command_interface name="velocity"/> -->
<state_interface name="position">
<param name="initial_value">0</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
请问我在gazebo.launch文件中修改了一个机器人模型,但是命名空间是不起作用还是咋了
一直停留在[robot3.spawn_entity]:Waiting for entity xml on robot1/robot_description不显示机器人模型
具体launch修改代码如下:
import launch
import launch_ros
from ament_index_python.packages import get_package_share_directory
import os
import launch_ros.parameter_descriptions
import launch.launch_description_sources
def generate_launch_description():
# 获取功能包的share路径
urdf_package_path = get_package_share_directory('fishbot_description')
default_xacro_path = os.path.join(urdf_package_path, 'urdf', 'fishbot', 'fishbot.urdf.xacro')
default_gazebo_world_path = os.path.join(urdf_package_path, 'world', 'custom_room.world')
rk3588s的板子,系统是ubuntu22.04
使用一键安装ros2 humble 桌面版后,重启系统就会到这个登陆界面fad84da0fbb5efd99d8da6afed90d61f.jpg
但是输入密码后会黑屏然后又跳回这个界面。
这是什么情况呀
2.2节用cmake编译c++时,提示python解释器没找到,我已经卸载anaconda3了,请问这个怎么解决?716b4577-a625-4f5e-a666-6333ffe7268e.png
我C++创建节点是可以正常启动节点的
python启动节点后,正常应该是 等待状态,目前我的是直接没反映,查看节点信息也没有
可能是哪个python库没安装吗,求大佬指教
(教程示例)源代码:
import rclpy
from rclpy.node import Node
def main():
rclpy.init()
node = Node("python_node")
rclpy.spin(node)
rclpy.shutdowm()
终端启动命令:
wl@wl-VirtualBox:~/chapt1$ python3 ros2_python_node.py
wl@wl-VirtualBox:~/chapt1$ (这里直接跳出,未启动节点)
08ae98961b08e58e1f63051e5ac444b.jpg这个是怎么回事。。。
294fdc2a-5311-4364-81ab-db620fe88f2d-1745367853576.png
1、执行gazebo_sim.launch.py的时候上图问题
(1)libgazebo_ros2_control.so找不到
(2)load_controller无法连接到
dd7905a1-1581-4f89-9a2b-9e7d18efab56-image.png
2、安装完gazebo后按照教材执行查看命令的时候看不到教材示例
请问这种问题怎么解决
(补充:用gitee上的代码也是这个效果!)
ros@ros2:~/fishbot_ws$ ros2 run yolov5_ros2 yolo_detect_2d --ros-args -p device:=cpu -p image_topic:=/fishbot_camera_raw
[INFO] [1745386092.623652118] [yolov5_ros2]: Current ROS 2 distribution: humble
[INFO] [1745386092.859007222] [yolov5_ros2]: default_camera_info: [476.7030836014194, 0.0, 400.5, 0.0, 476.7030836014194, 400.5, 0.0, 0.0, 1.0]
[0.0, 0.0, 0.0, 0.0, 0.0]
ros2 topic echo /yolo_result
订阅结果为空
import launch
import launch_ros
from ament_index_python.packages import get_package_share_directory
import os
def generate_launch_description():
# 获取默认的urdf文件路径
urdf_package_path = get_package_share_directory('fishbot_description')
default_urdf_path = os.path.join(urdf_package_path, 'urdf', 'first_robot.urdf')
# 声明一个URDF目录的参数,方便修改
action_declare_arg_mode_path = launch.actions.DeclareLaunchArgument(
name = 'model',default_value=str(default_urdf_path),description='加载的模型文件路径'
以下是报错:[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'
[INFO] [launch]: All log files can be found below /home/jin/.ros/log/2025-04-22-16-49-27-291232-jin-Virtual-Machine-11473
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x74ce4db9f730>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x74ce4db9f730>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x74ce4c64fd60>'
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 54, in get_launch_description_from_any_launch_file
return loader(launch_file_path)
File "/opt/ros/humble/lib/python3.10/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 "display_robot.launch.py", line 16, in generate_launch_description
substitutions_command_result = launch.substitutions.command(['cat ',launch.substitutions.LaunchConfiguration('model')])
TypeError: 'module' object is not callable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 336, in run_async
raise completed_tasks_exceptions[0]
File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
await self.__process_event(next_event)
File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File "/opt/ros/humble/lib/python3.10/site-packages/launch/action.py", line 108, in visit
return self.execute(context)
File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/include_launch_description.py", line 148, in execute
launch_description = self.__launch_description_source.get_launch_description(context)
File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
self._get_launch_description(self.__expanded_location)
File "/opt/ros/humble/lib/python3.10/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/humble/lib/python3.10/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 57, in get_launch_description_from_any_launch_file
raise InvalidLaunchFileError(extension, likely_errors=exceptions)
launch.invalid_launch_file_error.InvalidLaunchFileError: Caught multiple exceptions when trying to load file of format [py]:
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught multiple exceptions when trying to load file of format [py]:
TypeError: 'module' object is not callable InvalidFrontendLaunchFileError: The launch file may have a syntax error, or its format is unknown[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x74ce4db9c340>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x74ce4db9c340>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x74ce4db94b50>'
开发环境用x86+ubuntu+linux,能构建出在arm64+android+linux运行的ros2程序包吗?
请教大佬:
我有一台小车,ubuntu22.04系统,电脑上是虚拟机,二者都是22.04,humble版本, 能够互相ping通,在同一网段下,电脑的防火墙也关掉后,对虚拟机进行了重启,电脑没有重启。 我想实现二者的通信。
我将二者的都设置为ROS_DOMAIN_ID=189,写在了.bashrc里。但是我小车端启动小海龟,虚拟机端启动键盘控制节点,无法实现小海龟的运动,在虚拟机端查看话题,只有发布,没有订阅。这是什么原因导致没有通讯成功呢?
b2ec0b47-e5e7-44bd-ae30-483385b89753-screenshot-20250422-114158.png /home/ubuntu/Pictures/screenshot-20250422-114158.png
在仿真环境中,cartographer使用odom建图的时候,机器人向前行驶,rviz中显示机器人不动,map往后行驶,tf显示map和base footprint在一起,odom在往后行驶,下面是使用的lua参数,
lei-wang@lei-wang-VMware-Virtual-Platform:~/robot1$ cmake .
-- Found rclcpp: 28.1.8 (/opt/ros/jazzy/share/rclcpp/cmake)
-- Found rosidl_generator_c: 4.6.5 (/opt/ros/jazzy/share/rosidl_generator_c/cmake)
-- Found rosidl_generator_cpp: 4.6.5 (/opt/ros/jazzy/share/rosidl_generator_cpp/cmake)
-- Using all available rosidl_typesupport_c: rosidl_typesupport_fastrtps_c;rosidl_typesupport_introspection_c
-- Using all available rosidl_typesupport_cpp: rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_introspection_cpp
-- Found rmw_implementation_cmake: 7.3.2 (/opt/ros/jazzy/share/rmw_implementation_cmake/cmake)
-- Found rmw_fastrtps_cpp: 8.4.2 (/opt/ros/jazzy/share/rmw_fastrtps_cpp/cmake)
-- Using RMW implementation 'rmw_fastrtps_cpp' as default
-- /opt/ros/jazzy/include/rclcpp/opt/ros/jazzy/include/builtin_interfaces/opt/ros/jazzy/include/libstatistics_collector/opt/ros/jazzy/include/rcl/opt/ros/jazzy/include/rcl_interfaces/opt/ros/jazzy/include/rcl_yaml_param_parser/opt/ros/jazzy/include/rcpputils/opt/ros/jazzy/include/rcutils/opt/ros/jazzy/include/rmw/opt/ros/jazzy/include/rosgraph_msgs/opt/ros/jazzy/include/rosidl_dynamic_typesupport/opt/ros/jazzy/include/rosidl_runtime_c/opt/ros/jazzy/include/rosidl_runtime_cpp/opt/ros/jazzy/include/rosidl_typesupport_cpp/opt/ros/jazzy/include/statistics_msgs/opt/ros/jazzy/include/tracetools
-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: /home/lei-wang/robot1
make命令执行:
lei-wang@lei-wang-VMware-Virtual-Platform:~/robot1$ make
[ 50%] Building CXX object CMakeFiles/ros2_cpp_node.dir/ros2_cpp_node.cpp.o
In file included from /opt/ros/jazzy/include/rcl_interfaces/rcl_interfaces/srv/list_parameters.hpp:7,
from /opt/ros/jazzy/include/rclcpp/rclcpp/copy_all_parameter_values.hpp:21,
from /opt/ros/jazzy/include/rclcpp/rclcpp/rclcpp.hpp:171,
from /home/lei-wang/robot1/ros2_cpp_node.cpp:2:
/opt/ros/jazzy/include/rcl_interfaces/rcl_interfaces/srv/detail/list_parameters__struct.hpp:267:10: fatal error: service_msgs/msg/detail/service_event_info__struct.hpp: No such file or directory
267 | #include "service_msgs/msg/detail/service_event_info__struct.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/ros2_cpp_node.dir/build.make:76: CMakeFiles/ros2_cpp_node.dir/ros2_cpp_node.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/ros2_cpp_node.dir/all] Error 2
make: *** [Makefile:101: all] Error 2
这是CmakeLISTS文件内容
cmake_minimum_required(VERSION 3.8)
project(ros2_cpp)
add_executable(ros2_cpp_node ros2_cpp_node.cpp)
find_package(rclcpp REQUIRED)
message(STATUS ${rclcpp_INCLUDE_DIRS})
message(STATUS ${rclcpp_LIBRAIES})
target_include_directories(ros2_cpp_node PUBLIC ${rclcpp_INCLUDE_DIRS})
target_link_libraries(ros2_cpp_node ${rclcpp_LIBRAIES})
734d89c5-fd99-4a3e-86b8-026d0862c6a6-image.png
4e725eb4-db98-4fd6-bb3b-a590e23ffcf2-image.png
瘫倒状态如上图。
虚拟机ubutun18.04
1.link5打错成了limk5,影响不大。
2.问题应该是出在urdf文件当中,我用已有的别人的urdf文件进行后续配置可以实现联合仿真
3.字数超限制了,部分代码放在评论区中
<robot
name="ur5">
<!-- ROS base_link to UR 'Base' Coordinates transform -->
<link name="base"/>
<joint name="base_link-base_fixed_joint" type="fixed">
<!-- NOTE: this rotation is only needed as long as base_link itself is
not corrected wrt the real robot (ie: rotated over 180
degrees)
-->
<origin rpy="0 0 -3.14159265359" xyz="0 0 0"/>
<parent link="base_link"/>
<child link="base"/>
</joint>
<link name="world"/>
<joint name="world_joint" type="fixed">
<parent link="world"/>
<child link="base_link"/>
<origin rpy="0.0 0.0 0.0" xyz="0.0 0.0 0.0"/>
</joint>
<link
name="base_link">
<inertial>
<origin
xyz="1.42583680716296E-05 0.0563056334949455 -0.0382829688559687"
rpy="0 0 0" />
<mass
value="0.00001" />
<inertia
ixx="0.00983750560931009"
ixy="-1.72050295815961E-08"
ixz="-3.83638429985162E-07"
iyy="0.00957723573222082"
iyz="-0.00134940422444298"
izz="0.000260297506066691" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/base_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://ur5/meshes/base_link.STL" />
</geometry>
</collision>
</link>
<link
name="link1">
<inertial>
<origin
xyz="-4.4675E-07 0.00011808 0.010911"
rpy="0 0 0" />
<mass
value="0.00001" />
<inertia
ixx="0"
ixy="0"
ixz="0"
iyy="0"
iyz="0"
izz="0" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/link1.STL" />
</geometry>
<material
name="">
<color
rgba="0.79216 0.81961 0.93333 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/link1.STL" />
</geometry>
</collision>
</link>
<joint
name="joint1"
type="revolute">
<origin
xyz="0 0 0.1625"
rpy="1.5708 0 0" />
<parent
link="base_link" />
<child
link="link1" />
<axis
xyz="0 1 0" />
<limit
lower="-3.14"
upper="3.14"
effort="100"
velocity="1" />
</joint>
<link
name="link2">
<inertial>
<origin
xyz="-1.4509E-06 0.21249 7.775E-05"
rpy="0 0 0" />
<mass
value="0.00001" />
<inertia
ixx="0"
ixy="0"
ixz="0"
iyy="0"
iyz="0"
izz="0" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/link2.STL" />
</geometry>
<material
name="">
<color
rgba="0.79216 0.81961 0.93333 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/link2.STL" />
</geometry>
</collision>
</link>
<joint
name="joint2"
type="revolute">
<origin
xyz="0 0 0.1378"
rpy="0 0 0" />
<parent
link="link1" />
<child
link="link2" />
<axis
xyz="0 0 1" />
<limit
lower="-3.14"
upper="3.14"
effort="100"
velocity="1" />
</joint>
<link
name="link3">
<inertial>
<origin
xyz="-8.4001E-07 0.16893 -0.12451"
rpy="0 0 0" />
<mass
value="0.00001" />
<inertia
ixx="0"
ixy="0"
ixz="0"
iyy="0"
iyz="0"
izz="0" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/link3.STL" />
</geometry>
<material
name="">
<color
rgba="0.79216 0.81961 0.93333 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/link3.STL" />
</geometry>
</collision>
</link>
<joint
name="joint3"
type="revolute">
<origin
xyz="0 0.425 0"
rpy="0 0 0" />
<parent
link="link2" />
<child
link="link3" />
<axis
xyz="0 0 1" />
<limit
lower="-3.14"
upper="3.14"
effort="100"
velocity="1" />
</joint>
<link
name="link4">
<inertial>
<origin
xyz="7.4437E-06 -0.0025477 0.11499"
rpy="0 0 0" />
<mass
value="0.00001" />
<inertia
ixx="1.4253E-06"
ixy="1.9401E-10"
ixz="7.4526E-11"
iyy="1.8328E-07"
iyz="-4.7712E-07"
izz="1.2421E-06" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/link4.STL" />
</geometry>
<material
name="">
<color
rgba="0.79216 0.81961 0.93333 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/link4.STL" />
</geometry>
</collision>
</link>
<joint
name="joint4"
type="revolute">
<origin
xyz="0 0.3922 -0.1378"
rpy="0 0 0" />
<parent
link="link3" />
<child
link="link4" />
<axis
xyz="0 0 1" />
<limit
lower="-3.14"
upper="3.14"
effort="100"
velocity="1" />
</joint>
<link
name="limk5">
<inertial>
<origin
xyz="-9.43610718074842E-06 0.0921878890416958 -0.00395720124610782"
rpy="0 0 0" />
<mass
value="0.00001" />
<inertia
ixx="0"
ixy="0"
ixz="0"
iyy="0"
iyz="0"
izz="0" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/limk5.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://ur5/meshes/limk5.STL" />
</geometry>
</collision>
</link>
<joint
name="joint5"
type="revolute">
<origin
xyz="0 0 0.1333"
rpy="0 0 0" />
<parent
link="link4" />
<child
link="limk5" />
<axis
xyz="0 1 0" />
<limit
lower="-3.14"
upper="3.14"
effort="100"
velocity="1" />
</joint>
<link
name="link6">
<inertial>
<origin
xyz="9.99267270212568E-09 -6.06182086970719E-07 0.0253985025583878"
rpy="0 0 0" />
<mass
value="0.00001" />
<inertia
ixx="0"
ixy="0"
ixz="0"
iyy="0"
iyz="0"
izz="0" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://ur5/meshes/link6.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://ur5/meshes/link6.STL" />
</geometry>
</collision>
</link>
<joint
name="joint6"
type="revolute">
<origin
xyz="0 0.0997 0.0457"
rpy="0 0 0" />
<parent
link="limk5" />
<child
link="link6" />
<axis
xyz="0 0 1" />
<limit
lower="-3.14"
upper="3.14"
effort="100"
velocity="1" />
</joint>
<!--add transmission for every joint-->
<transmission name="trans_joint1">
<type>transmission_interface/SimpleTransmission</type>
<joint name="joint1">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="joint1_motor">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="trans_joint2">
<type>transmission_interface/SimpleTransmission</type>
<joint name="joint2">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="joint2_motor">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="trans_joint3">
<type>transmission_interface/SimpleTransmission</type>
<joint name="joint3">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="joint3_motor">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="trans_joint4">
<type>transmission_interface/SimpleTransmission</type>
<joint name="joint4">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="joint4_motor">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="trans_joint5">
<type>transmission_interface/SimpleTransmission</type>
<joint name="joint5">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="joint5_motor">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="trans_joint6">
<type>transmission_interface/SimpleTransmission</type>
<joint name="joint6">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="joint6_motor">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<!-- add one gazebo plugin-->
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/</robotNamespace>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
<legacyModeNS>true</legacyModeNS>
</plugin>
</gazebo>
</robot>
#Simulation settings for using moveit_sim_controllers
moveit_sim_hw_interface:
joint_model_group: arm
joint_model_group_pose: init_pos
#Settings for ros_control_boilerplate control loop
generic_hw_control_loop:
loop_hz: 300
cycle_time_error_threshold: 0.01
#Settings for ros_control hardware interface
hardware_interface:
joints:
- joint1
- joint2
- joint3
- joint4
- joint5
- joint6
sim_control_mode: 1 # 0: position, 1: velocity
#Publish all joint states
#Creates the /joint_states topic necessary in ROS
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
controller_list:
action_ns: follow_joint_trajectory
default: True
type: FollowJointTrajectory
joints: joint1 joint2 joint3 joint4 joint5 joint6
arm_controller:
type: position_controllers/JointTrajectoryController
joints: joint1 joint2 joint3 joint4 joint5 joint6
constraints:
goal_time: 0.6
stopped_velocity_tolerance: 0.05
joint1: {
trajectory: 0.1, goal: 0.1}
joint2 : {
trajectory: 0.1, goal: 0.1}
joint3: {
trajectory: 0.1, goal: 0.1}
joint4: {
trajectory: 0.1, goal: 0.1}
joint5: {
trajectory: 0.1, goal: 0.1}
joint6: {
trajectory: 0.1, goal: 0.1}
stop_trajectory_duration: 0.5
state_publish_rate: 25
action_monitor_rate: 1 代码3:controller launch文件:
<?xml version="1.0"?>
<launch>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find ur5_moveit_config)/config/ros_controllers.yaml" command="load"/>
<!-- Load the controllers -->
<node name="controller_spawner" pkg="controller_manager" type="controller_manager" respawn="false"
output="screen" args="spawn joint_state_controller arm_controller"/>
</launch>
运行rviz显示如下所示:
39733d4b-4ac0-429d-bb0d-f38a6cfe2134-c84d8eac439a9e40664e9803ca82360.png
求大佬指点,很急!
这是终端报错:一直说什么没有定义
截图 2025-04-18 13-39-10.png
这是yaml文件
截图 2025-04-21 11-35-39.png
这是机器人中使用ros2_control定义的joint
已经在这里卡了很久了,请问这是什么问题?
我在一个英文网页看到了有人遇到了相同的问题,不过他没有给出解决方法
链接文本
bc7742d4-8fec-4d2c-b593-927ac2d5de38-图片.png
版块
-
1.3k
主题4.7k
帖子 -
411
主题2.7k
帖子 -
31
主题145
帖子 -
999
主题4.1k
帖子 -
964
主题3.5k
帖子 -
4
主题10
帖子 -
349
主题1.6k
帖子