@小鱼 试试我这个代码
import rclpy from geometry_msgs.msg import PoseStamped, Pose from nav2_simple_commander.robot_navigator import BasicNavigator, TaskResult from tf2_ros import TransformListener, Buffer from tf_transformations import euler_from_quaternion, quaternion_from_euler from rclpy.duration import Duration # 添加服务接口 from autopatrol_interfaces.srv import SpeachText from sensor_msgs.msg import Image from cv_bridge import CvBridge import cv2 class PatrolNode(BasicNavigator): def __init__(self, node_name='patrol_node'): super().__init__(node_name) # 导航相关定义 self.declare_parameter('initial_point', [0.0, 0.0, 0.0]) self.declare_parameter('target_points', [0.0, 0.0, 0.0, 1.0, 1.0, 1.57]) self.initial_point_ = self.get_parameter('initial_point').value self.target_points_ = self.get_parameter('target_points').value # 实时位置获取 TF 相关定义 self.buffer_ = Buffer() self.listener_ = TransformListener(self.buffer_, self) self.speach_client_ = self.create_client(SpeachText, 'speech_text') # 订阅与保存图像相关定义 self.declare_parameter('image_save_path', '') self.image_save_path = self.get_parameter('image_save_path').value self.bridge = CvBridge() self.latest_image = None self.subscription_image = self.create_subscription( Image, '/camera_sensor/image_raw', self.image_callback, 10) def image_callback(self, msg): """ 将最新的消息放到 latest_image 中 """ self.latest_image = msg def record_image(self): """ 记录图像 """ if self.latest_image is not None: pose = self.get_current_pose() cv_image = self.bridge.imgmsg_to_cv2(self.latest_image) cv2.imwrite(f'{self.image_save_path}image_{pose.translation.x:3.2f}_{pose.translation.y:3.2f}.png', cv_image) def speach_text(self, text): """ 调用服务播放语音 """ while not self.speach_client_.wait_for_service(timeout_sec=1.0): self.get_logger().info('语合成服务未上线,等待中。。。') request = SpeachText.Request() request.text = text future = self.speach_client_.call_async(request) rclpy.spin_until_future_complete(self, future) if future.result() is not None: result = future.result().result if result: self.get_logger().info(f'语音合成成功:{text}') else: self.get_logger().warn(f'语音合成失败:{text}') else: self.get_logger().warn('语音合成服务请求失败') def get_pose_by_xyyaw(self, x, y, yaw): """ 通过 x,y,yaw 合成 PoseStamped """ pose = PoseStamped() pose.header.frame_id = 'map' pose.pose.position.x = x pose.pose.position.y = y rotation_quat = quaternion_from_euler(0, 0, yaw) pose.pose.orientation.x = rotation_quat[0] pose.pose.orientation.y = rotation_quat[1] pose.pose.orientation.z = rotation_quat[2] pose.pose.orientation.w = rotation_quat[3] return pose def init_robot_pose(self): """ 初始化机器人位姿 """ # 从参数获取初始化点 self.initial_point_ = self.get_parameter('initial_point').value # 合成位姿并进行初始化 self.setInitialPose(self.get_pose_by_xyyaw( self.initial_point_[0], self.initial_point_[1], self.initial_point_[2])) # 等待直到导航激活 self.waitUntilNav2Active() def get_target_points(self): """ 通过参数值获取目标点集合 """ points = [] self.target_points_ = self.get_parameter('target_points').value for index in range(int(len(self.target_points_)/3)): x = self.target_points_[index*3] y = self.target_points_[index*3+1] yaw = self.target_points_[index*3+2] points.append([x, y, yaw]) self.get_logger().info(f'获取到目标点: {index}->({x},{y},{yaw})') return points def nav_to_pose(self, target_pose): """ 导航到指定位姿 """ self.waitUntilNav2Active() result = self.goToPose(target_pose) while not self.isTaskComplete(): feedback = self.getFeedback() if feedback: self.get_logger().info(f'预计: {Duration.from_msg(feedback.estimated_time_remaining).nanoseconds / 1e9} s 后到达') # 最终结果判断 result = self.getResult() if result == TaskResult.SUCCEEDED: self.get_logger().info('导航结果:成功') elif result == TaskResult.CANCELED: self.get_logger().warn('导航结果:被取消') elif result == TaskResult.FAILED: self.get_logger().error('导航结果:失败') else: self.get_logger().error('导航结果:返回状态无效') def get_current_pose(self): """ 通过TF获取当前位姿 """ while rclpy.ok(): try: tf = self.buffer_.lookup_transform( 'map', 'base_footprint', rclpy.time.Time(seconds=0), rclpy.time.Duration(seconds=1)) transform = tf.transform rotation_euler = euler_from_quaternion([ transform.rotation.x, transform.rotation.y, transform.rotation.z, transform.rotation.w ]) self.get_logger().info( f'平移:{transform.translation},旋转四元数:{transform.rotation}:旋转欧拉角:{rotation_euler}') return transform except Exception as e: self.get_logger().warn(f'不能够获取坐标变换,原因: {str(e)}') def main(): rclpy.init() patrol = PatrolNode() patrol.speach_text(text='正在初始化位置') patrol.init_robot_pose() patrol.speach_text(text='位置初始化完成') while rclpy.ok(): for point in patrol.get_target_points(): x, y, yaw = point[0], point[1], point[2] # 导航到目标点 target_pose = patrol.get_pose_by_xyyaw(x, y, yaw) patrol.speach_text(text=f'准备前往目标点{x},{y}') patrol.nav_to_pose(target_pose) patrol.speach_text(text=f"已到达目标点{x},{y},准备记录图像") patrol.record_image() patrol.speach_text(text=f"图像记录完成") rclpy.shutdown() if __name__ == '__main__': main()-
错误现象:运行仿真和导航后启动launch文件后,在准备记录图像处卡住,未武安成图像记录
import rclpy from geometry_msgs.msg import PoseStamped, Pose from nav2_simple_commander.robot_navigator import BasicNavigator, TaskResult import rclpy.time from tf2_ros import TransformListener, Buffer from tf_transformations import euler_from_quaternion, quaternion_from_euler from rclpy.duration import Duration from autopatrol_interfaces.srv import SpeachText from sensor_msgs.msg import Image from cv_bridge import CvBridge import cv2 class PatrolNode(BasicNavigator): def __init__(self, node_name='patrol_node'): super().__init__(node_name) #导航相关定义 self.declare_parameter('initial_point', [0.0, 0.0, 0.0]) self.declare_parameter('target_points', [0.0, 0.0, 0.0, 1.0, 1.0, 1.57]) self.initial_point_ = self.get_parameter('initial_point').value self.target_points_ = self.get_parameter('target_points').value self.buffer_ = Buffer() self.listener_ = TransformListener(self.buffer_, self) #语音合成客户端 self.speach_client_ = self.create_client(SpeachText, 'speech_text') #订阅和保存图像相关定义 self.declare_parameter('image_save_path', '') self.image_save_path = self.get_parameter('image_save_path').value self.bridge = CvBridge() self.latest_image = None self.subscription_image = self.create_subscription( Image, '/camera_sensor/image_raw', self.image_callback, 10) def get_pose_by_xyyaw(self, x, y, yaw): ''' 通过x,y,yaw 合成PoseStamped ''' pose = PoseStamped() pose.header.frame_id = 'map' pose.pose.position.x = x pose.pose.position.y = y rotation_quat = quaternion_from_euler(0, 0, yaw) pose.pose.orientation.x = rotation_quat[0] pose.pose.orientation.y = rotation_quat[1] pose.pose.orientation.z = rotation_quat[2] pose.pose.orientation.w = rotation_quat[3] return pose def init_robot_pose(self): ''' 初始化机器人位姿 ''' #从参数获取初始化点 self.initial_point_ = self.get_parameter('initial_point').value #合成位姿并进行初始化 self.setInitialPose(self.get_pose_by_xyyaw( self.initial_point_[0], self.initial_point_[1], self.initial_point_[2] )) #等待直到导航激活 self.waitUntilNav2Active() def get_targat_points(self): ''' 通过参数值获取目标点集合 ''' points = [] self.target_points_= self.get_parameter('target_points').value for index in range(int(len(self.target_points_)/3)): x = self.target_points_[index*3] y = self.target_points_[index*3+1] yaw = self.target_points_[index*3+2] points.append([x, y, yaw]) self.get_logger().info( f'获取到目标点:{index}->({x},{y},{yaw})') return points def nav_to_pose(self, target_pose): ''' 导航到指定位资 ''' self.waitUntilNav2Active() result = self.goToPose(target_pose) while not self.isTaskComplete(): feedback = self.getFeedback() if feedback: self.get_logger().info(f'预计:{Duration.from_msg(feedback.estimated_time_remaining).nanoseconds / 1e9} s 后到达') #最终结果判断 result = self.getResult() if result == TaskResult.SUCCEEDED: self.get_logger().info('导航结果:成功') elif result == TaskResult.CANCELED: self.get_logger().warn('导航结果:被取消') elif result == TaskResult.FAILED: self.get_logger().error('导航结果:失败') else: self.get_logger().error('导航结果:返回状态无效') def get_current_pose(self): ''' 通过TF获取当前位姿 ''' while rclpy.ok(): try: tf = self.buffer_.lookup_transform( 'map', 'base_footprint', rclpy.time.Time(seconds=0), rclpy.time.Duration(seconds=1)) transform = tf.transform rotation_euler = euler_from_quaternion([ transform.rotation.x, transform.rotation.y, transform.rotation.z, transform.rotation.w,]) self.get_logger().info( f'平移:{transform.translation},旋转四元数:{transform.rotation}:旋转欧拉角:{rotation_euler}') except Exception as e: self.get_logger().warn(f'不能获取坐标变换。原因:{e}') def speach_text(self, text): """ 调用服务播放语音 """ while not self.speach_client_.wait_for_service(timeout_sec=1.0): self.get_logger().info('语音合成服务未上线,等待中......') request = SpeachText.Request() request.text = text future = self.speach_client_.call_async(request) rclpy.spin_until_future_complete(self, future) if future.result() is not None: result = future.result().result if result: self.get_logger().info(f'语音合成成功:{text}') else: self.get_logger().warn(f'语音合成失败:{text}') else: self.get_logger().warn('语言合成请求失败') def image_callback(self, msg): """ 将最新的消息放到latest_image中 """ self.latest_image = msg def record_image(self): """ 记录图像 """ if self.latest_image is not None: pose = self.get_current_pose() cv_image = self.bridge.imgmsg_to_cv2(self.latest_image) cv2.imwrite(f'{self.image_save_path}image_{pose.translation.x:3.2f}_{pose.translation.y:3.2f}.png', cv_image) def main(): rclpy.init() patrol = PatrolNode() patrol.speach_text(text='正在初始化位置') patrol.init_robot_pose() patrol.speach_text(text='位置初始化完成') while rclpy.ok(): points = patrol.get_targat_points() for point in points: x, y, yaw = point[0], point[1], point[2] #导航到目标点 target_pose = patrol.get_pose_by_xyyaw(x, y, yaw) patrol.speach_text(text=f'准备前往目标点{x},{y}') patrol.nav_to_pose(target_pose) #记录图像 patrol.speach_text(text=f"已到达目标点{x},{y},准备记录图像") patrol.record_image() patrol.speach_text(text=f"图像记录完成") rclpy.shutdown()
patrol_node.py代码如下:仿真gazebo_sim.launch.py代码:
import launch import launch_ros from ament_index_python.packages import get_package_share_directory from launch.launch_description_sources import PythonLaunchDescriptionSource import launch_ros.parameter_descriptions def generate_launch_description(): robot_name_in_model = "fishbot" urdf_tutorial_path = get_package_share_directory('fishbot_description') default_model_path = urdf_tutorial_path + '/urdf/fishbot/fishbot.urdf.xacro' default_world_path = urdf_tutorial_path + '/world/custom_room.world' 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( ['xacro ', 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}]) launch_gazebo = launch.actions.IncludeLaunchDescription( PythonLaunchDescriptionSource([get_package_share_directory('gazebo_ros'), '/launch', '/gazebo.launch.py']), launch_arguments=[('world', default_world_path), ('verbose', 'true')]) spawn_entity_node = launch_ros.actions.Node( package='gazebo_ros', executable='spawn_entity.py', arguments=['-topic', '/robot_description', '-entity', robot_name_in_model, ]) # 加载并激活fishbot_joint_state_broadcaster控制器 load_joint_state_controller = launch.actions.ExecuteProcess( cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'fishbot_joint_state_broadcaster'], output='screen' ) load_fishbot_effort_controller = launch.actions.ExecuteProcess( cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'fishbot_effort_controller'], output='screen' ) load_fishbot_diff_drive_controller = launch.actions.ExecuteProcess( cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'fishbot_diff_drive_controller'], output='screen' ) return launch.LaunchDescription([ launch.actions.RegisterEventHandler( event_handler=launch.event_handlers.OnProcessExit( target_action=spawn_entity_node, on_exit=[load_joint_state_controller], ) ), launch.actions.RegisterEventHandler( event_handler=launch.event_handlers.OnProcessExit( target_action=load_joint_state_controller, on_exit=[load_fishbot_effort_controller], ) ), launch.actions.RegisterEventHandler( event_handler=launch.event_handlers.OnProcessExit( target_action=load_fishbot_effort_controller, on_exit=[load_fishbot_diff_drive_controller], ) ), action_declare_arg_mode_path, robot_state_publisher_node, launch_gazebo, spawn_entity_node ])导航navigation2.launch.py代码:
import os import launch import launch_ros from ament_index_python.packages import get_package_share_directory from launch.launch_description_sources import PythonLaunchDescriptionSource def generate_launch_description(): #获取并链接默认路径 fishbot_navigation2_dir = get_package_share_directory( 'fishbot_navigation2') nav2_bringup_dir = get_package_share_directory('nav2_bringup') rviz_config_dir = os.path.join( nav2_bringup_dir, 'rviz', 'nav2_default_view.rviz') #创建launch配置 use_sim_time = launch.substitutions.LaunchConfiguration( 'use_sim_time', default='true') map_yaml_path = launch.substitutions.LaunchConfiguration( 'map',default=os.path.join(fishbot_navigation2_dir, 'maps', 'room.yaml')) nav2_param_path = launch.substitutions.LaunchConfiguration( 'params_file', default=os.path.join(fishbot_navigation2_dir, 'config', 'nav2_params.yaml')) return launch.LaunchDescription([ #声明新的launch参数 launch.actions.DeclareLaunchArgument('use_sim_time', default_value=use_sim_time, description='Use simulation(Gazebo) clock if true'), launch.actions.DeclareLaunchArgument('map', default_value=map_yaml_path, description='Full path to map file to load'), launch.actions.DeclareLaunchArgument('params_file', default_value=nav2_param_path, description='Full path to param file to load'), launch.actions.IncludeLaunchDescription( PythonLaunchDescriptionSource( [nav2_bringup_dir, '/launch', '/bringup_launch.py']), #使用launch参数替换原有参数 launch_arguments={ 'map': map_yaml_path, 'use_sim_time': use_sim_time, 'params_file': nav2_param_path}.items(), ), launch_ros.actions.Node( package='rviz2', executable='rviz2', name='rviz2', arguments=['-d', rviz_config_dir], parameters=[{'use_sim_time': use_sim_time}], output='screen'), ]) -
ros2的twist消息丢失
我遇到了个奇怪的问题,反映在输出里面:
Enter command: stop() [INFO] [1714134056.214406367] [move_robot]: Robot stopped Enter command: move_forward(0.2,2) Enter command:背景:我在编写完用指令控制小车以规定速度移动固定的距离时,发现stop命令可以执行,而move_forward(0.2,2)指令却无法发送twist消息,move_forward 方法的日志,没有正确调用。
测试:代码在执行 move_forward 方法后立即退出了,而不等待机器人移动完毕,这可能是因为在发布 Twist 消息后,没有足够的时间给机器人移动到目标位置,我move_forward 方法后添加一个短暂的睡眠时间,发现还是没用;然后我在终端中输入命令来查看 /cmd_vel 话题消息,结果什么都没有,说明问题很可能出在发布速度命令的部分,但是我再次检查相关代码还是什么错误都没发现。
希望可以得到帮助,万分感谢!整个程序代码:
import rclpy from rclpy.node import Node from geometry_msgs.msg import Twist import time # Import time for time management class MoveRobot(Node): def __init__(self): super().__init__('move_robot') self.publisher_ = self.create_publisher(Twist, 'cmd_vel', 10) self.speed = 0 self.distance = 0 self.timer_ = self.create_timer(0.1, self.timer_callback) self.start_time = 0 self.command = None def timer_callback(self): if self.command == 'move_forward': self.move_forward() def move_forward(self): twist = Twist() twist.linear.x = self.speed self.publisher_.publish(twist) self.get_logger().info('Published forward command with speed: {}'.format(self.speed)) while time.time() - self.start_time < self.distance / self.speed: time.sleep(0.1) self.stop() def stop(self): twist = Twist() self.publisher_.publish(twist) self.get_logger().info('Robot stopped') self.command = None def parse_command(self, command): cmd_parts = command.split('(') cmd_name = cmd_parts[0] if cmd_name == 'stop': self.stop() return args = cmd_parts[1].strip(')').split(',') self.command = cmd_name self.speed = float(args[0]) self.distance = float(args[1]) self.start_time = time.time() # Update start time using time.time() def main(args=None): rclpy.init(args=args) move_robot = MoveRobot() try: while rclpy.ok(): command = input('Enter command: ') if command == 'exit': break move_robot.parse_command(command) finally: move_robot.destroy_node() rclpy.shutdown() if __name__ == '__main__': main() -
因为字数限制所以中间下载的过程我就没复制进来。
root@myx-P15-23:/# wget http://fishros.com/install -O fishros && . fishros --2024-04-26 15:53:48-- 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-26 15:53:48-- http://fishros.com/install/ 再次使用存在的到 fishros.com:80 的连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度: 579 [application/octet-stream] 正在保存至: ‘fishros’ fishros 100%[===========================>] 579 --.-KB/s 用时 0s 2024-04-26 15:53:48 (68.3 MB/s) - 已保存 ‘fishros’ [579/579]) 正在读取软件包列表... 完成 正在分析软件包的依赖关系树... 完成 正在读取状态信息... 完成 sudo 已经是最新版 (1.9.15p5-3ubuntu5)。 升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。 正在读取软件包列表... 完成 正在分析软件包的依赖关系树... 完成 正在读取状态信息... 完成 python3-distro 已经是最新版 (1.9.0-1)。 python3-yaml 已经是最新版 (6.0.1-2build2)。 升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。 /tmp/fishinstall/install.py:77: SyntaxWarning: invalid escape sequence '\.' book = """ --2024-04-26 15:53:49-- 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 100%[===========================>] 43.61K --.-KB/s 用时 0.09s 2024-04-26 15:53:49 (507 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 基础检查通过... =============================================================================== ======欢迎使用一键安装工具,人生苦短,三省吾身,省时省力省心!======= ======一键安装已开源,请放心使用:https://github.com/fishros/install ======= =============================================================================== .-~~~~~~~~~-._ _.-~~~~~~~~~-. __.' ~. .~ `.__ .'// 开卷有益 \./ 书山有路 \ `. .'// 可以多看看小鱼的文章 | 关注公众号鱼香ROS \ `. .'// .-~'''''''''~~~~-._ | _,-~~~~'''''''[-. \`. .'//.-" `-. | .-' "-.\`. .'//______.============-.. \ | / ..-============.______\`. .'______________________________\|/______________________________` ---------------------------------------------------------------------- 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国内源 [0]:quit 请输入[]内的数字以选择:1 --2024-04-26 15:54:05-- http://mirror.fishros.com/install/tools/tool_install_ros.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 长度: 19539 (19K) [application/octet-stream] 正在保存至: ‘/tmp/fishinstall/tools/tool_install_ros.py’ /tmp/fishinstall/tools 100%[===========================>] 19.08K --.-KB/s 用时 0.05s 2024-04-26 15:54:06 (396 KB/s) - 已保存 ‘/tmp/fishinstall/tools/tool_install_ros.py’ [19539/19539]) --2024-04-26 15:54:06-- http://mirror.fishros.com/install/tools/tool_config_rosenv.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 长度: 2457 (2.4K) [application/octet-stream] 正在保存至: ‘/tmp/fishinstall/tools/tool_config_rosenv.py’ /tmp/fishinstall/tools 100%[===========================>] 2.40K --.-KB/s 用时 0s 2024-04-26 15:54:06 (70.2 MB/s) - 已保存 ‘/tmp/fishinstall/tools/tool_config_rosenv.py’ [2457/2457]) --2024-04-26 15:54:06-- http://mirror.fishros.com/install/tools/tool_config_system_source.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 长度: 7738 (7.6K) [application/octet-stream] 正在保存至: ‘/tmp/fishinstall/tools/tool_config_system_source.py’ /tmp/fishinstall/tools 100%[===========================>] 7.56K --.-KB/s 用时 0s 2024-04-26 15:54:06 (152 MB/s) - 已保存 ‘/tmp/fishinstall/tools/tool_config_system_source.py’ [7738/7738]) 欢迎使用一键安装ROS和ROS2,支持树莓派Jetson,本工具由作者小鱼提供 欢迎使用ROS开箱子工具,本工具由[鱼香ROS]小鱼贡献.. 小鱼:检测当前系统ubuntu24.04:noble 支持一键安装ROS =========接下来这一步很很很很重要,如果不知道怎么选请选择1======== RUN Choose Task:[请输入括号内的数字] 新手或首次安装一定要一定要一定要换源并清理三方源,换源!!!系统默认国外源容易失败!! [1]:更换系统源再继续安装 [2]:不更换继续安装 [0]:quit 请输入[]内的数字以选择:1 欢迎使用一键换源工具,本工具由[鱼香ROS]小鱼贡献.. RUN Choose Task:[请输入括号内的数字] 请选择换源方式,如果不知道选什么请选2 [1]:仅更换系统源 [2]:更换系统源并清理第三方源 [0]:quit 请输入[]内的数字以选择:2 Run CMD Task:[sudo rm -rf /etc/apt/sources.list] [-]Result:success 删除一个资源文件 Run CMD Task:[sudo rm -rf /etc/apt/sources.list.d] [-]Result:success Run CMD Task:[sudo mkdir -p /etc/apt/sources.list.d] [-]Result:success Run CMD Task:[dpkg --print-architecture] [-]Result:success 检测到当前系统架构为[amd64:noble],正在为你更换对应源.. 创建文件:/etc/apt/sources.list 替换完成,尝试第一次更新.... Run CMD Task:[sudo apt update] [-]Result:success noble-security InReleasee 搞定了,不信你看,累死宝宝了,还不快去给小鱼点个赞~ ['命中:1 https://mirrors.ustc.edu.cn/ubuntu noble InRelease', '命中:2 https://mirrors.ustc.edu.cn/ubuntu noble-updates InRelease', '命中:3 https://mirrors.ustc.edu.cn/ubuntu noble-backports InRelease', '命中:4 https://mirrors.ustc.edu.cn/ubuntu noble-security InRelease', '正在读取软件包列表...', '正在分析软件包的依赖关系树...', '正在读取状态信息...', '所有软件包均为最新。'] 镜像修复完成..... Run CMD Task:[sudo apt update] [-]Result:success noble-security InReleasee Run CMD Task:[sudo apt-cache search curl ] []cl-curry-compose-reader-macros - Reader macros for function partial application and comp[]golang-github-henvic-httpretty-dev - Prints HTTP requests made with Go pretty on your te[|]golang-github-moul-http2curl-dev - Go package for convert Golang's http.Request to CURL [-]golang-github-ssgelm-cookiejarparser-dev - Go library that parses a curl cookiejar file [/]libcohttp-lwt-unix-ocaml - CoHTTP implementation for Unix and Windows using Lwt (runtime[]libcohttp-lwt-unix-ocaml-dev - CoHTTP implementation for Unix and Windows using Lwt (dev[/]libghc-curl-prof - Profiling libraries for the libcurl Haskell bindings; profiling libra[/]libghc-hxt-http-prof - Interface to native Haskell HTTP package HTTP; profiling librarie[]libghc-hxt-prof - collection of tools for processing XML with Haskell; profiling librari[/]librust-curl+force-system-lib-on-osx-dev - Rust bindings to libcurl for making HTTP requ[]librust-curl+http2-dev - Rust bindings to libcurl for making HTTP requests - feature "ht[|]librust-curl+openssl-probe-dev - Rust bindings to libcurl for making HTTP requests - fea[-]librust-curl+openssl-sys-dev - Rust bindings to libcurl for making HTTP requests - featu[/]librust-curl+ssl-dev - Rust bindings to libcurl for making HTTP requests - feature "ssl"[]librust-curl+static-curl-dev - Rust bindings to libcurl for making HTTP requests - featu[|]librust-curl+static-ssl-dev - Rust bindings to libcurl for making HTTP requests - featur[/]librust-curl-sys+http2-dev - Native bindings to the libcurl library - feature "http2" an[]librust-curl-sys+openssl-sys-dev - Native bindings to the libcurl library - feature "ope[-]librust-git2-curl-dev - Backend for an HTTP transport in libgit2 powered by libcurl - Ru[/]librust-gix-transport-dev - The gitoxide project dedicated to implementing the git trans[]librust-oauth2-dev - Extensible, strongly-typed implementation of OAuth2 - Rust source c[/]php-symfony-http-client - methods to fetch HTTP resources synchronously or asynchronousl[]php-symfony-polyfill-php81 - Symfony polyfill backporting some PHP 8.1+ features to lowe[-]Result:success Window Maker dock appIolstoolstypesmentation) Run CMD Task:[sudo apt install curl -y] [-]Result:success 卸载 0 个软件包,有 0 个软件包未被升级。 Run CMD Task:[sudo apt-cache search gnupg2 ] [-]Result:success eplacement (dummy transitional package) Run CMD Task:[sudo apt install gnupg2 -y] [-]Result:success 卸载 0 个软件包,有 0 个软件包未被升级。 Run CMD Task:[curl -s https://gitee.com/ohhuo/rosdistro/raw/master/ros.asc | sudo apt-key add -] [-]Result:success Run CMD Task:[curl -s https://gitee.com/ohhuo/rosdistro/raw/master/ros.asc | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/ros.gpg --import] [-]Result:success Run CMD Task:[sudo chmod 644 /etc/apt/trusted.gpg.d/ros.gpg] [-]Result:success Run CMD Task:[dpkg --print-architecture] [-]Result:success 根据您的系统,为您推荐安装源为['http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/'] 创建文件:/etc/apt/sources.list.d/ros-fish.list Run CMD Task:[sudo apt update] [-]Result:code:100 noble-security InReleaseeese apt更新失败,后续程序可能会继续尝试...,['\n', 'WARNING: apt does not have a stable CLI interface. Use with caution in scripts.\n', '\n', 'E: 仓库 “http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu noble Release” 没有 Release 文件。\n'] Run CMD Task:[sudo apt-cache search ros-base ] [-]Result:success migrating to MIT KerberosKerberos 换源后更新失败,第二次开始切换源,尝试更换ROS2源为华为源! 根据您的系统,为您推荐安装源为['https://repo.huaweicloud.com/ros2/ubuntu/'] Run CMD Task:[sudo rm -rf /etc/apt/sources.list.d/ros-fish.list] [-]Result:success 创建文件:/etc/apt/sources.list.d/ros-fish.list Run CMD Task:[sudo apt update] [-]Result:code:100 buntu noble Releaseseasee apt更新失败,后续程序可能会继续尝试...,['\n', 'WARNING: apt does not have a stable CLI interface. Use with caution in scripts.\n', '\n', 'E: 仓库 “https://repo.huaweicloud.com/ros2/ubuntu noble Release” 没有 Release 文件。\n'] Run CMD Task:[sudo apt-cache search ros-base ] [-]Result:success migrating to MIT KerberosKerberos 换源后更新失败,第三次开始切换源,尝试更换ROS2源为ROS2官方源! 根据您的系统,为您推荐安装源为['http://packages.ros.org/ros2/ubuntu/'] Run CMD Task:[sudo rm -rf /etc/apt/sources.list.d/ros-fish.list] [-]Result:success 创建文件:/etc/apt/sources.list.d/ros-fish.list Run CMD Task:[sudo apt update] [-]Result:success u noble/main amd64 Packages [406 kB] Run CMD Task:[sudo apt-cache search ros-base ] [-]ros-rolling-mqtt-client - Node that enables connected ROS-based devices or robots to exc[/]ros-rolling-ros-base - A package which extends 'ros_core' and includes other basic funct[-]Result:success 换源后更新失败,第四次开始切换源,尝试使用https-ROS2官方源~! 根据您的系统,为您推荐安装源为['https://packages.ros.org/ros2/ubuntu/'] Run CMD Task:[sudo rm -rf /etc/apt/sources.list.d/ros-fish.list] [-]Result:success 创建文件:/etc/apt/sources.list.d/ros-fish.list Run CMD Task:[sudo apt update] [] Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verifica[-]Result:success Run CMD Task:[sudo apt-cache search ros-base ] [-]ros-rolling-mqtt-client - Node that enables connected ROS-based devices or robots to exc[/]ros-rolling-ros-base - A package which extends 'ros_core' and includes other basic funct[-]Result:success Run CMD Task:[sudo apt update] [] Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verifica[-]Result:success Run CMD Task:[sudo apt-cache search ros-base ] [-]ros-rolling-mqtt-client - Node that enables connected ROS-based devices or robots to exc[/]ros-rolling-ros-base - A package which extends 'ros_core' and includes other basic funct[-]Result:success RUN Choose Task:[请输入括号内的数字] 请选择你要安装的ROS版本名称(请注意ROS1和ROS2区别): [1]:rolling(ROS2) [0]:quit 请输入[]内的数字以选择:1 RUN Choose Task:[请输入括号内的数字] 请选择安装的具体版本(如果不知道怎么选,请选1桌面版): [1]:rolling(ROS2)桌面版 [2]:rolling(ROS2)基础版(小) [0]:quit 请输入[]内的数字以选择:1 Run CMD Task:[sudo apt-cache search aptitude ] [-]Result:success end for Debian/Ubuntupdates - systemd version Run CMD Task:[sudo apt install aptitude -y] [-]Result:success 卸载 0 个软件包,有 0 个软件包未被升级。 Run CMD Task:[sudo apt-cache search aptitude ] [-]Result:success end for Debian/Ubuntupdates - systemd version Run CMD Task:[sudo apt install aptitude -y] [-]Result:success 卸载 0 个软件包,有 0 个软件包未被升级。 Run CMD Task:[sudo apt install ros-rolling-desktop -y] 正在读取软件包列表... 完成 正在分析软件包的依赖关系树... 完成 正在读取状态信息... 完成 有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是 因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件 包尚未被创建或是它们已被从新到(Incoming)目录移出。 下列信息可能会对解决问题有所帮助: 下列软件包有未满足的依赖关系: ros-rolling-pcl-conversions : 依赖: libpcl-common1.13 但无法安装它 依赖: libpcl-io1.13 但无法安装它 E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。 Run CMD Task:[sudo apt install ros-rolling-desktop -y] [-]Result:code:100 l-io1.13 但无法安装它装它 ============================================================ 请注意我,检测你在安装过程中出现依赖问题,请在稍后输入n,再选择y,即可解决(若无法解决,清在稍后手动运行命令: sudo aptitude install ros-rolling-desktop) 确认了解情况,请输入回车继续安装 Run CMD Task:[sudo aptitude install ros-rolling-desktop] 下列“新”软件包将被安装。 babeltrace{a} catch2{a} cmake{a} cmake-data{a} cppcheck{a} docutils-common{a} fonts-liberation2{a} fonts-lyx{a} g++{a} g++-13{a} g++-13-x86-64-linux-gnu{a} g++-x86-64-linux-gnu{a} gdal-data{a} gdal-plugins{a} google-mock{a} googletest{a} graphviz{a} isympy-common{a} isympy3{a} javascript-common{a} libaec0{a} libamd-comgr2{a} libamdhip64-5{a} libann0{a} libarmadillo12{a} libarpack2t64{a} libasound2-dev{a} libassimp-dev{a} libassimp5{a} libavcodec-dev{a} libavformat-dev{a} libavutil-dev{a} libblkid-dev{a} libblosc1{a} libboost-python1.83.0{a} libbrotli-dev{a} libbullet-dev{a} libbullet3.24t64{a} libbz2-dev{a} libcdt5{a} libcfitsio10t64{a} libcgraph6{a} libcharls2{a} ros-rolling-rcl-lifecycle{a} ros-rolling-rcl-logging-interface{a} ros-rolling-rcl-logging-spdlog{a} ros-rolling-rcl-yaml-param-parser{a} ros-rolling-rclcpp{a} ros-rolling-rclcpp-action{a} ros-rolling-rclcpp-components{a ros-rolling-rosidl-dynamic-typesupport-fastrtps{a} ros-rolling-rosidl-generator-c{a} ros-rolling-rosidl-generator-cpp{a} ros-rolling-rosidl-generator-py{a} g-std-srvs{a} ros-rolling-stereo-msgs{a} ros-rolling-tango-icons-vendor{a} ros-rolling-teleop-twist-joy{a} ros-rolling-teleop-twist-keyboard{a} ros-rolling-tf2{a} ros-rolling-tf2-bullet{a} ros-rolling-tf2-eigen{a} ros-rolling-tf2-eigen-kdl{a} ros-rolling-tf2-geometry-msgs{a} ros-rolling-tf2-kdl{a} ros-rolling-tf2-msgs{a} ros-rolling-tf2-py{a} ros-rolling-tf2-ros{a} ros-rolling-tf2-ros-py{a} ros-rolling-tf2-sensor-msgs{a} ros-rolling-tf2-tools{a} ros-rolling-tinyxml2-vendor{a} ros-rolling-tlsf{a} ros-rolling-tlsf-cpp{a} ros-rolling-topic-monitor{a} ros-rolling-tracetools{a} ros-rolling-trajectory-msgs{a} ros-rolling-turtlesim{a} ros-rolling-type-description-interfaces{a} ros-rolling-uncrustify-vendor{a} ros-rolling-unique-identifier-msgs{a} ros-rolling-urdf{a} ros-rolling-urdf-parser-plugin{a} ros-rolling-urdfdom{a} ros-rolling-urdfdom-headers{a} ros-rolling-visualization-msgs{a} ros-rolling-yaml-cpp-vendor{a} ros-rolling-zstd-vendor{a} shiboken2{a} sip-dev{a} tango-icon-theme{a} uncrustify{a} unicode-data{a} unixodbc-common{a} uuid-dev{a} x11proto-dev{a} xorg-sgml-doctools{a} xtrans-dev{a} zlib1g-dev{a} 0 个软件包被升级,新安装 653 个,0 个将被删除, 同时 0 个将不升级。 需要获取 294 MB/295 MB 的存档。解包后将要使用 1,371 MB。 下列软件包存在未满足的依赖关系: ros-rolling-desktop : 依赖: ros-rolling-pcl-conversions 但它是不可安装的 下列动作将解决这些依赖关系: 保持 下列软件包于其当前版本: 1) ros-rolling-desktop [未安装的] 是否接受该解决方案?[Y/n/q/?] n *** 没有更多的解决方案了 *** 下列动作将解决这些依赖关系: 保持 下列软件包于其当前版本: 1) ros-rolling-desktop [未安装的] 是否接受该解决方案?[Y/n/q/?] n *** 没有更多的解决方案了 *** 下列动作将解决这些依赖关系: 保持 下列软件包于其当前版本: 1) ros-rolling-desktop [未安装的] 是否接受该解决方案?[Y/n/q/?] n *** 没有更多的解决方案了 *** 下列动作将解决这些依赖关系: 保持 下列软件包于其当前版本: 1) ros-rolling-desktop [未安装的] 是否接受该解决方案?[Y/n/q/?] y 将不会安装,升级或者删除任何软件包。 0 个软件包被升级,新安装 0 个,0 个将被删除, 同时 0 个将不升级。 需要获取 0 B 的存档。解包后将要使用 0 B。 Run CMD Task:[sudo aptitude install ros-rolling-desktop -y] [] babeltrace{a} catch2{a} cmake{a} cmake-data{a} cppcheck{a} docutils-common{a} fonts-liberation2{a} fonts-lyx{a} g++{a} g+urdfdom{a} ros-rolling-urdfdom-headers{a} ros-rolling-visualization-msgs{a} ros-rolling-yaml-cpp-vendor{a} ros-rolling-zstd-vendor{a} shiboken2{a} sip-dev{a} tango-icon-theme{a} uncrustify{a} unicode-data{a} unixodbc-common{a} uuid-dev{a} x11proto-dev{a} xorg[-]Result:success 除, 同时 0 个将不升级。可安装的 Run CMD Task:[sudo apt-cache search python3-colcon-common-extensions ] []python3-colcon-common-extensions - Meta package aggregating colcon-core and common exten[-]Result:success Run CMD Task:[sudo apt install python3-colcon-common-extensions -y] Certificate verification failed: The certificate is NOT trusted. The failed: The certificate is NOT trusted. The name in the certificate does not handshake: Error in the certificate verifica[-]错误:11 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-colcon-override-ch[/] Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verifica[-]Result:code:100 Run CMD Task:[sudo apt-cache search python3-argcomplete ] [-]Result:success for argparse (for Python 3) Run CMD Task:[sudo apt install python3-argcomplete -y] [-]Result:success 卸载 0 个软件包,有 0 个软件包未被升级。 Run CMD Task:[sudo apt-cache search python3-rosdep ] [-]Result:success anager abstraction tool for ROS Run CMD Task:[sudo apt install python3-rosdep -y] []忽略:1 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-catkin-pkg-modules [|]忽略:2 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rospkg-modules all [-]忽略:3 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rosdistro-modules a[/]忽略:4 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rosdep-modules all [|]忽略:1 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-catkin-pkg-modules [-]忽略:2 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rospkg-modules all [/]忽略:3 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rosdistro-modules a[]忽略:4 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rosdep-modules all [-]忽略:1 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-catkin-pkg-modules [/]忽略:2 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rospkg-modules all []忽略:3 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rosdistro-modules a[|]忽略:4 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rosdep-modules all [/]错误:1 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-catkin-pkg-modules [] Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verifica[|]错误:2 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rospkg-modules all [-] Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verifica[/]错误:3 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rosdistro-modules a[] Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verifica[|]错误:4 https://packages.ros.org/ros2/ubuntu noble/main amd64 python3-rosdep-modules all [-] Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verifica[] Certificate verification failed: The certificate is NOT trusted. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verifica[-]Result:code:100 Run CMD Task:[ls /opt/ros/rolling/setup.bash] [-]Result:code:2 安装失败了,请打开鱼香社区:https://fishros.org.cn/forum 在一键安装专区反馈问题... Run CMD Task:[ls /opt/ros/rolling/setup.bash] [-]Result:code:2 欢迎加入机器人学习交流QQ群:438144612(入群口令:一键安装) 鱼香小铺正式开业,最低499可入手一台能建图会导航的移动机器人,淘宝搜店:鱼香ROS 或打开链接查看:https://item.taobao.com/item.htm?id=696573635888 如在使用过程中遇到问题,请打开:https://fishros.org.cn/forum 进行反馈 -
-
-
构建空间报错代码:
tingbo@DESKTOP-NHH5E05:~/chapt7/chapt7_ws$ colcon build Starting >>> autopatrol_interfaces Starting >>> autopatrol_robot Starting >>> fishbot_application Starting >>> fishbot_description Starting >>> fishbot_navigation2 Finished <<< fishbot_description [0.53s] Finished <<< fishbot_navigation2 [0.53s] Finished <<< fishbot_application [1.02s] Finished <<< autopatrol_robot [1.04s] --- stderr: autopatrol_interfaces CMake Error at CMakeLists.txt:10 (find_package): By not providing "Findrosidl_generate_interfaces.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "rosidl_generate_interfaces", but CMake did not find one. Could not find a package configuration file provided by "rosidl_generate_interfaces" with any of the following names: rosidl_generate_interfacesConfig.cmake rosidl_generate_interfaces-config.cmake Add the installation prefix of "rosidl_generate_interfaces" to CMAKE_PREFIX_PATH or set "rosidl_generate_interfaces_DIR" to a directory containing one of the above files. If "rosidl_generate_interfaces" provides a separate development package or SDK, be sure it has been installed. --- Failed <<< autopatrol_interfaces [1.40s, exited with code 1] Summary: 4 packages finished [1.65s] 1 package failed: autopatrol_interfaces 1 package had stderr output: autopatrol_interfacesSpeachText.srv代码:
string text --- bool resultCmakeLists.txt代码:
cmake_minimum_required(VERSION 3.8) project(autopatrol_interfaces) 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(rosidl_generate_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() rosidl_generate_interfaces(${PROJECT_NAME} "srv/SpeachText.srv" ) ament_package()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>autopatrol_interfaces</name> <version>0.0.0</version> <description>TODO: Package description</description> <maintainer email="tingbo01@qq.com">tingbo</maintainer> <license>Apache-2.0</license> <buildtool_depend>ament_cmake</buildtool_depend> <depend>rosidl_generate_interfaces</depend> <member_of_group>rosidl_interface_packages</member_of_group> <test_depend>ament_lint_auto</test_depend> <test_depend>ament_lint_common</test_depend> <export> <build_type>ament_cmake</build_type> </export> </package> -
-
-
参照ROS2官方例程,在server端配置cancel_callback,在client端调用cancel_goal_async,但是不生效!
链接:https://github.com/ros2/examples/blob/master/rclpy/actions/minimal_action_client/examples_rclpy_minimal_action_client/client_cancel.py -
你的应用版本过低,请升至最新版本后登陆
-
使用easy_handeye 标定点击plan找不到没有good plan,
6507e0ec-ba1d-4c7b-af02-bf6809d8971b-image.png多试几次姿势后找到了解决plan 但是没有execute
会报这个错误
7aff9030-f65e-46e0-a068-854ab2e5caf2-image.png -
最近发了这样一个问题,在Intel 13代 CPU上 分别是 i9-13900HX i7-13700KF i5-13600KF 上安装ROS2 humble,然后播放ros2 bag,打开rviz2 查看点云数据,如下图,当选择Best Effort时,会出现点云丢帧现象,表现为画面卡顿。用ros2 topic hz 查看点云话题,显示远低于10hz
在c++代码实现中,如果为下午中RMW QOS POLICY RELIABILITY BEST EFFORT,则订阅点云频率很低,改为RMW QOS POLICY RELIABILITY RELIABLE时则正常。
以上现象在3台设备上的都出现,系统为Ubuntu22.04.4 内核版本为 6.5
不知道各位安装在13代 intel cpu上 ubuntu22.04 ros2 humble 环境下有无上述现象
FrsrCmBBxHA77E_svnfxFU0Ik6-U.jpg FoCjLu4brYqduvRBXcC4M4FWXety.png -
远程连接指令ssh -X unitree@xxxxxx;此步没有问题
但是运行rosrun rviz rviz后出现如下问题
本机ubuntu版本为18.04-melodicdccc7b17-4af4-4c96-b25d-63dbc6a96244-图片.png
-
launch文件:09fca5a1-9ae1-4f6c-95aa-f1a02852c1e5-image.png
setup.py文件:0bf1f2c5-9db4-4585-ac3c-20d2852c87be-image.png
运行时报错ros2 launch charging_hub_recognition launch_display.launch.py
0f19054a-dcc9-484e-96be-594f9b1c1d4c-image.png
这个命令可以:ros2 run charging_hub_recognition charging_hub_recognition 运行,为什么?
用launch启动自己本身不可以吗? -
sudo apt install ros-noetic-desktop-full
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
ros-noetic-desktop-full 已经是最新版 (1.5.0-1focal.20240402.145422)。
您也许需要运行“apt --fix-broken install”来修正上面的错误。
下列软件包有未满足的依赖关系:
python3-rosdep-modules : 依赖: python3-rospkg-modules (>= 1.4.0) 但是它将不会被安装
依赖: python3-catkin-pkg-modules (>= 0.4.0) 但是它将不会被安装
python3-rosdistro-modules : 依赖: python3-catkin-pkg-modules 但是它将不会被安装
依赖: python3-rospkg-modules 但是它将不会被安装
ros-noetic-rospack : 依赖: python3-catkin-pkg-modules 但是它将不会被安装
ros-noetic-rqt-gui : 依赖: python3-rospkg-modules 但是它将不会被安装
ros-noetic-rqt-robot-monitor : 依赖: python3-rospkg-modules 但是它将不会被安装
E: 有未能满足的依赖关系。请尝试不指明软件包的名字来运行“apt --fix-broken install”(也可以指定一个解决办法)。
jinjieyan@jinjieyan-virtual- -
[ERROR] [cartographer_node-2]: process has died [pid 10541, exit code -6, cmd '/opt/ros/humble/lib/cartographer_ros/cartographer_node -configuration_directory /opt/ros/humble/share/cartographer_ros/configuration_files -configuration_basename map_builder.lua --ros-args --params-file /tmp/launch_params_z3tr0g8s -r echoes:=horizontal_laser_2d'].
-
369baaca-2beb-4f8b-8068-2f6a57153669-image.png
再之后
005f7164-5709-42f5-a039-fb7e274dea83-image.png -
下列软件包有未满足的依赖关系:
ros-melodic-desktop-full : 依赖: ros-melodic-desktop 但是它将不会被安装
依赖: ros-melodic-perception 但是它将不会被安装
依赖: ros-melodic-simulators 但是它将不会被安装
依赖: ros-melodic-urdf-sim-tutorial 但是它将不会被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
Run CMD Task:[sudo apt install ros-melodic-desktop-full -y]
[-]Result:code:100 dic-urdf-sim-tutorial 但是它将不会被安装
重要提示
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码