从 ros::Rate loop_rate(10) 说起 2021/10/29

本文详细解释了ROS中的ros::Rate用于设定循环频率,并探讨了它与loop_rate.sleep的配合使用。同时,介绍了ros_spin()和ros_spinOnce()在处理回调函数和消息轮转中的作用,说明了它们如何控制消息的接收与执行流程,以及它们之间的区别。
部署运行你感兴趣的模型镜像

1: ros::Rate loop_rate(10)
Rate is a type included in

ros/ros.h

which is used to give a specific time period for a task.

Thus it has been written as:

ROS:: Rate variable_name(time_delay_HZ);

You can give any name to your variable they have given loop_rate and you can give any time delay in HZ (10HZ=100ms). 因为 1s = 1000ms.
ref: https://stackoverflow.com/questions/56565275/can-you-explain-this-syntax-rosrate-loop-rate10
2: ref: https://blog.youkuaiyun.com/qq_37802555/article/details/107670710
ros::Rate loop_rate(10)

ros::Rate loop_rate() 与 loop_rate.sleep 这两个函数必须一起使用,控制的是循环的频率,与消息或者服务的发布 publish 频率没有直接关系。
这两者一个写在循环内部(loop_rate.sleep()),一个写在循环外部(ros::Rate loop_rate(); )

ros::Rate loop_rate(10) 意思为,我想控制我的程序的发布信息的快慢速度。这个应该和 loop_rate.sleep 一起使用才能达到控制速度的目的。

3:ros_spin() 和 ros_spinOnce()

这个是 ros 内部 信息数据 (消息,服务,topic)的轮转。

3.1 ros_spin() 和 ros_spinOnce() 的作用对象

集中处理本节点的所有的回调函数
集中处理本节点的所有的回调函数
集中处理本节点的所有的回调函数

回调函数即为 call back 函数
一般 subscriber 和 server 有回调函数

ros_spin() 和 spin_once 控制的是 callback 函数。他们通过 callback 函数来间接处理节点订阅的消息或者服务的 request.

所以 ros_spin() 和 spin_once 是怎么控制 callback 函数的呢?

3.2 ros 的消息 message 接收机制
消息,即为 message, 是指 topic 通信中的messages. 但是,在这里的 service 的 request 和 response 的接收机制 和 topic 中的messages 类似。

任何一个发布 publish 和订阅 subscribe, 都会有对应的发布缓存区和订阅缓存区,**正如 publisher 和 subscriber 函数中都有缓存数量的参数(队列长度)。**这一点不太清楚。是什么在排队?是发布和订阅的内容,在排队。

其实也可以理解是 参数 (作用在回调函数上的那些参数)在排队。

publisher 的实现,就是靠在一个 while 循环里面一直循环发送 “hello world” 到话题 (topic) chatter 上。subscriber 一旦知道chatter 上有 data, 就会把这些 data 作为参数传入到 callback 函数中。

此时还没有执行callback 函数,而是把 callback 函数放到了一个回调函数队列中。所以,事实上,这里是,发布器 publisher 不断发送 data / (参数) 到 chatter 上,然后相应的 callback 函数进入队列中,它们的函数名一样,函数实参不一样。
已经排好队了,
那么什么时候才会执行 callback 函数呢?
这个时候就会用到 ros::spin() 和 ros::spinOnce() 的事了。
当 spinOnce 函数被调用时,spinOnce 会调用回调函数队列中的第一个 callback 函数,此时 callback 函数才被执行,然后等到下次 spinOnce 函数又被调用时,回调函数队列中的第二个 callback 函数又会被调用,以此类推。

spin() 和 spinOnce() 起到开关的作用,即消息经过 spin() 或者 spinOnce() 后才恢复轮转。
所以 spin() 和 spinOnce() 的主要区别如下:
3.3 spinOnce()
当程序运行到 spinOnce() 时,程序到相应的 topic 订阅缓存区查看是否存在消息,如果有消息,则将消息传入回调函数执行回调函数;如果没有消息则继续向后执行。
spinOnce() 不是说等待到一个消息才向后执行,而是查看有没有消息。

2.4 spin()

spin 可以当作是对 spinOnce() 的循环,即:

> while(1) {
>     ros:: spinOnce();  }

spin() 后面的代码将不会再被执行,表现出来的功能就是持续等待消息。
感觉这个函数应该用得蛮少的。
当程序运行到 spin() 时,程序同样会去相应的 topic 订阅缓存区查看是否有消息,如果有,则将消息传入回调函数,如果没有,则重复上述过程。

您可能感兴趣的与本文相关的镜像

TensorFlow-v2.9

TensorFlow-v2.9

TensorFlow

TensorFlow 是由Google Brain 团队开发的开源机器学习框架,广泛应用于深度学习研究和生产环境。 它提供了一个灵活的平台,用于构建和训练各种机器学习模型

#ifndef CTRL_FSM_FIX_TRAJECTORY_H #define CTRL_FSM_FIX_TRAJECTORY_H #include <cmath> #include <string> #include <ros/ros.h> #include <ros/callback_queue.h> #include <std_msgs/Bool.h> #include <std_msgs/Int32.h> #include <sensor_msgs/Imu.h> #include <nav_msgs/Odometry.h> #include <geometry_msgs/PoseArray.h> #include <geometry_msgs/PoseStamped.h> #include <mavros_msgs/State.h> #include <common/visual.hpp> #include <common/trajectory.hpp> #include <common/quat_euler_convert.hpp> #include <ctrl/motion_controller_separate.h> class CtrlFSMFixTrajectory { public: // Constructor CtrlFSMFixTrajectory() = delete; CtrlFSMFixTrajectory(const ros::NodeHandle &nh, const ros::NodeHandle &pnh); CtrlFSMFixTrajectory(const CtrlFSMFixTrajectory &rhs) = delete; CtrlFSMFixTrajectory &operator=(const CtrlFSMFixTrajectory &rhs) = delete; CtrlFSMFixTrajectory(CtrlFSMFixTrajectory &&rhs) = delete; CtrlFSMFixTrajectory &operator=(CtrlFSMFixTrajectory &&rhs) = delete; virtual ~CtrlFSMFixTrajectory() {} private: // State Machine enum FSM_EXEC_STATE { INIT, HOVER, CMD_CTRL, WAIT }; FSM_EXEC_STATE exec_state_; std_msgs::Int32 exec_state_int_; float hover_yaw_; Eigen::Vector2f hover_pos_; bool have_odom_; bool have_traj_; bool new_hover_flag_; bool is_ground_; bool follow_traj_finished_; bool is_armed_; // ROS NodeHandle ros::NodeHandle nh_; ros::NodeHandle pnh_; // ROS Subscribers ros::Subscriber odom_sub_; ros::Subscriber run_trigger_sub_; ros::Subscriber flight_status_sub_; ros::Subscriber mavros_state_sub_; // ROS Publishers ros::Publisher attitude_target_pub_; ros::Publisher follow_traj_finished_pub_; ros::Publisher ground_ctrl_fsm_pub_; // ROS Timers ros::Timer run_timer_; // ROS Topics std::string odometry_topic_; std::string run_trigger_topic_; std::string attitude_target_topic_; std::string flight_status_topic_; std::string follow_traj_finished_topic_; std::string ground_ctrl_fsm_topic_; std::string mavros_state_topic_; // Variables common::trajectory::CurEstimate<float> cur_estimate_; double traj_duration_; ros::Time start_time_; minco_utils::Trajectory follow_traj_; common::trajectory::Trajectory<double> follow_traj_visual_; geometry_msgs::PoseStamped run_trigger_msg_; bool loop_tracking_flag_; // PID Controller Parameters PIDParams position_pid_params_; PIDParams velocity_pid_params_; PIDParams pitch_pid_params_; PIDParams yaw_pid_params_; // Common Parameters CommonParams common_params_; // Thrust Parameters float thrust_return_; bool use_thrust_change_; // Minco Trajectory Parameters minco_utils::MincoTrajParams traj_params_; // Visualizer the trajectory common::visual::TrajectoryVisualizer::Ptr traj_visualizer_; // Motion Controller MotionControllerSeparate::Ptr motion_controller_; // Functions void changeFSMExecState(FSM_EXEC_STATE new_state, string pos_call); void printFSMExecState(); // Callback functions void odomCallback(const nav_msgs::Odometry::ConstPtr &msg_ptr); void runTriggerCallback(const geometry_msgs::PoseStamped::ConstPtr &msg_ptr); void flightStatusCallback(const std_msgs::Bool::ConstPtr &msg_ptr); void mavrosStateCallback(const mavros_msgs::State::ConstPtr &msg_ptr); void runTimerCallback(const ros::TimerEvent &event); void publishAttitudeTarget(const std::pair<float, float> &desired_attitude, const float &feedforward_pitch_rate, const float &feedforward_yaw_rate); }; #endif // CTRL_FSM_FIX_TRAJECTORY_H 补充注释上述代码
09-20
#ifndef CTRL_FSM_WAYPOINTS_H #define CTRL_FSM_WAYPOINTS_H #include <cmath> #include <string> #include <ros/ros.h> #include <ros/callback_queue.h> #include <std_msgs/Bool.h> #include <std_msgs/Int32.h> #include <sensor_msgs/Imu.h> #include <nav_msgs/Odometry.h> #include <geometry_msgs/PoseArray.h> #include <geometry_msgs/PoseStamped.h> #include <mavros_msgs/State.h> #include <common/visual.hpp> #include <common/trajectory.hpp> #include <common/quat_euler_convert.hpp> #include <ctrl/motion_controller_separate.h> class CtrlFSMWaypoints { public: // Constructor CtrlFSMWaypoints() = delete; CtrlFSMWaypoints(const ros::NodeHandle &nh, const ros::NodeHandle &pnh); CtrlFSMWaypoints(const CtrlFSMWaypoints &rhs) = delete; CtrlFSMWaypoints &operator=(const CtrlFSMWaypoints &rhs) = delete; CtrlFSMWaypoints(CtrlFSMWaypoints &&rhs) = delete; CtrlFSMWaypoints &operator=(CtrlFSMWaypoints &&rhs) = delete; virtual ~CtrlFSMWaypoints() {} private: // State Machine enum FSM_EXEC_STATE { INIT, HOVER, CMD_CTRL, WAIT }; FSM_EXEC_STATE exec_state_; std_msgs::Int32 exec_state_int_; float hover_yaw_; Eigen::Vector2f hover_pos_; bool have_odom_; bool have_traj_; bool new_hover_flag_; bool is_ground_; bool follow_traj_finished_; bool is_armed_; bool emergency_stop_flag_; // ROS NodeHandle ros::NodeHandle nh_; ros::NodeHandle pnh_; // ROS Subscribers ros::Subscriber odom_sub_; ros::Subscriber run_trigger_sub_; ros::Subscriber flight_status_sub_; ros::Subscriber mavros_state_sub_; ros::Subscriber waypoints_list_sub_; ros::Subscriber goal_sub_; ros::Subscriber emergency_stop_sub_; // ROS Publishers ros::Publisher attitude_target_pub_; ros::Publisher follow_traj_finished_pub_; ros::Publisher ground_ctrl_fsm_pub_; // ROS Timers ros::Timer run_timer_; // ROS Topics std::string odometry_topic_; std::string run_trigger_topic_; std::string attitude_target_topic_; std::string flight_status_topic_; std::string follow_traj_finished_topic_; std::string waypoints_list_topic_; std::string ground_ctrl_fsm_topic_; std::string goal_topic_; std::string emergency_stop_topic_; // Variables common::trajectory::CurEstimate<float> cur_estimate_; double traj_duration_; ros::Time start_time_; minco_utils::Trajectory follow_traj_; geometry_msgs::PoseStamped run_trigger_msg_; bool loop_tracking_flag_; int eight_count_; // Only used in subscribe waypoints_list_callback int eight_count_expected_; double eight_length_; double eight_width_; bool adding_eight_traj_; // PID Controller Parameters PIDParams position_pid_params_; PIDParams velocity_pid_params_; PIDParams pitch_pid_params_; PIDParams yaw_pid_params_; // Common Parameters CommonParams common_params_; // Thrust Parameters float thrust_return_; bool use_thrust_change_; // Waypoints Parameters int waypoint_num_; double interpolation_dis_; bool using_waypoints_params_; Eigen::MatrixXd final_state_; std::vector<Eigen::Vector3d> Q_; std::vector<Eigen::Vector3d> waypoints_; // Minco Trajectory Parameters minco_utils::MincoTrajParams traj_params_; // Visualizer the trajectory common::visual::TrajectoryVisualizer::Ptr traj_visualizer_; // Motion Controller MotionControllerSeparate::Ptr motion_controller_; // Functions void changeFSMExecState(FSM_EXEC_STATE new_state, string pos_call); void printFSMExecState(); // Callback functions void odomCallback(const nav_msgs::Odometry::ConstPtr &msg_ptr); void runTriggerCallback(const geometry_msgs::PoseStamped::ConstPtr &msg_ptr); void flightStatusCallback(const std_msgs::Bool::ConstPtr &msg_ptr); void mavrosStateCallback(const mavros_msgs::State::ConstPtr &msg_ptr); void waypointsListCallback(const geometry_msgs::PoseArray::ConstPtr &msg_ptr); void goalCallback(const geometry_msgs::PoseStamped::ConstPtr &msg_ptr); void emergencyStopCallback(const std_msgs::Bool::ConstPtr &msg_ptr); void runTimerCallback(const ros::TimerEvent &event); void publishAttitudeTarget(const std::pair<float, float> &desired_attitude, const float &feedforward_pitch_rate, const float &feedforward_yaw_rate); }; #endif // CTRL_FSM_WAYPOINTS_H 注释上述代码
最新发布
09-20
yuan@yuan-virtual-machine:~/catkin_ws$ roslaunch ur_robot_driver ur5_bringup.launch robot_ip:=192.168.1.120 ... logging to /home/yuan/.ros/log/a5368822-6eb4-11f0-afbe-05d467d6740f/roslaunch-yuan-virtual-machine-9380.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. started roslaunch server http://yuan-virtual-machine:37881/ SUMMARY ======== PARAMETERS * /controller_stopper/consistent_controllers: ['joint_state_con... * /force_torque_sensor_controller/publish_rate: 125 * /force_torque_sensor_controller/type: force_torque_sens... * /forward_cartesian_traj_controller/joints: ['shoulder_pan_jo... * /forward_cartesian_traj_controller/type: pass_through_cont... * /forward_joint_traj_controller/joints: ['shoulder_pan_jo... * /forward_joint_traj_controller/type: pass_through_cont... * /hardware_control_loop/loop_hz: 125 * /joint_based_cartesian_traj_controller/base: base * /joint_based_cartesian_traj_controller/joints: ['shoulder_pan_jo... * /joint_based_cartesian_traj_controller/tip: tool0 * /joint_based_cartesian_traj_controller/type: position_controll... * /joint_group_vel_controller/joints: ['shoulder_pan_jo... * /joint_group_vel_controller/type: velocity_controll... * /joint_state_controller/publish_rate: 125 * /joint_state_controller/type: joint_state_contr... * /pos_joint_traj_controller/action_monitor_rate: 20 * /pos_joint_traj_controller/constraints/elbow_joint/goal: 0.1 * /pos_joint_traj_controller/constraints/elbow_joint/trajectory: 0.2 * /pos_joint_traj_controller/constraints/goal_time: 0.6 * /pos_joint_traj_controller/constraints/shoulder_lift_joint/goal: 0.1 * /pos_joint_traj_controller/constraints/shoulder_lift_joint/trajectory: 0.2 * /pos_joint_traj_controller/constraints/shoulder_pan_joint/goal: 0.1 * /pos_joint_traj_controller/constraints/shoulder_pan_joint/trajectory: 0.2 * /pos_joint_traj_controller/constraints/stopped_velocity_tolerance: 0.05 * /pos_joint_traj_controller/constraints/wrist_1_joint/goal: 0.1 * /pos_joint_traj_controller/constraints/wrist_1_joint/trajectory: 0.2 * /pos_joint_traj_controller/constraints/wrist_2_joint/goal: 0.1 * /pos_joint_traj_controller/constraints/wrist_2_joint/trajectory: 0.2 * /pos_joint_traj_controller/constraints/wrist_3_joint/goal: 0.1 * /pos_joint_traj_controller/constraints/wrist_3_joint/trajectory: 0.2 * /pos_joint_traj_controller/joints: ['shoulder_pan_jo... * /pos_joint_traj_controller/state_publish_rate: 125 * /pos_joint_traj_controller/stop_trajectory_duration: 0.5 * /pos_joint_traj_controller/type: position_controll... * /pose_based_cartesian_traj_controller/base: base * /pose_based_cartesian_traj_controller/joints: ['shoulder_pan_jo... * /pose_based_cartesian_traj_controller/tip: tool0_controller * /pose_based_cartesian_traj_controller/type: pose_controllers/... * /robot_description: <?xml version="1.... * /robot_status_controller/handle_name: industrial_robot_... * /robot_status_controller/publish_rate: 10 * /robot_status_controller/type: industrial_robot_... * /rosdistro: noetic * /rosversion: 1.17.4 * /scaled_pos_joint_traj_controller/action_monitor_rate: 20 * /scaled_pos_joint_traj_controller/constraints/elbow_joint/goal: 0.1 * /scaled_pos_joint_traj_controller/constraints/elbow_joint/trajectory: 0.2 * /scaled_pos_joint_traj_controller/constraints/goal_time: 0.6 * /scaled_pos_joint_traj_controller/constraints/shoulder_lift_joint/goal: 0.1 * /scaled_pos_joint_traj_controller/constraints/shoulder_lift_joint/trajectory: 0.2 * /scaled_pos_joint_traj_controller/constraints/shoulder_pan_joint/goal: 0.1 * /scaled_pos_joint_traj_controller/constraints/shoulder_pan_joint/trajectory: 0.2 * /scaled_pos_joint_traj_controller/constraints/stopped_velocity_tolerance: 0.05 * /scaled_pos_joint_traj_controller/constraints/wrist_1_joint/goal: 0.1 * /scaled_pos_joint_traj_controller/constraints/wrist_1_joint/trajectory: 0.2 * /scaled_pos_joint_traj_controller/constraints/wrist_2_joint/goal: 0.1 * /scaled_pos_joint_traj_controller/constraints/wrist_2_joint/trajectory: 0.2 * /scaled_pos_joint_traj_controller/constraints/wrist_3_joint/goal: 0.1 * /scaled_pos_joint_traj_controller/constraints/wrist_3_joint/trajectory: 0.2 * /scaled_pos_joint_traj_controller/joints: ['shoulder_pan_jo... * /scaled_pos_joint_traj_controller/state_publish_rate: 125 * /scaled_pos_joint_traj_controller/stop_trajectory_duration: 0.5 * /scaled_pos_joint_traj_controller/type: position_controll... * /scaled_vel_joint_traj_controller/action_monitor_rate: 20 * /scaled_vel_joint_traj_controller/constraints/elbow_joint/goal: 0.1 * /scaled_vel_joint_traj_controller/constraints/elbow_joint/trajectory: 0.1 * /scaled_vel_joint_traj_controller/constraints/goal_time: 0.6 * /scaled_vel_joint_traj_controller/constraints/shoulder_lift_joint/goal: 0.1 * /scaled_vel_joint_traj_controller/constraints/shoulder_lift_joint/trajectory: 0.1 * /scaled_vel_joint_traj_controller/constraints/shoulder_pan_joint/goal: 0.1 * /scaled_vel_joint_traj_controller/constraints/shoulder_pan_joint/trajectory: 0.1 * /scaled_vel_joint_traj_controller/constraints/stopped_velocity_tolerance: 0.05 * /scaled_vel_joint_traj_controller/constraints/wrist_1_joint/goal: 0.1 * /scaled_vel_joint_traj_controller/constraints/wrist_1_joint/trajectory: 0.1 * /scaled_vel_joint_traj_controller/constraints/wrist_2_joint/goal: 0.1 * /scaled_vel_joint_traj_controller/constraints/wrist_2_joint/trajectory: 0.1 * /scaled_vel_joint_traj_controller/constraints/wrist_3_joint/goal: 0.1 * /scaled_vel_joint_traj_controller/constraints/wrist_3_joint/trajectory: 0.1 * /scaled_vel_joint_traj_controller/gains/elbow_joint/d: 0.1 * /scaled_vel_joint_traj_controller/gains/elbow_joint/i: 0.05 * /scaled_vel_joint_traj_controller/gains/elbow_joint/i_clamp: 1 * /scaled_vel_joint_traj_controller/gains/elbow_joint/p: 5.0 * /scaled_vel_joint_traj_controller/gains/shoulder_lift_joint/d: 0.1 * /scaled_vel_joint_traj_controller/gains/shoulder_lift_joint/i: 0.05 * /scaled_vel_joint_traj_controller/gains/shoulder_lift_joint/i_clamp: 1 * /scaled_vel_joint_traj_controller/gains/shoulder_lift_joint/p: 5.0 * /scaled_vel_joint_traj_controller/gains/shoulder_pan_joint/d: 0.1 * /scaled_vel_joint_traj_controller/gains/shoulder_pan_joint/i: 0.05 * /scaled_vel_joint_traj_controller/gains/shoulder_pan_joint/i_clamp: 1 * /scaled_vel_joint_traj_controller/gains/shoulder_pan_joint/p: 5.0 * /scaled_vel_joint_traj_controller/gains/wrist_1_joint/d: 0.1 * /scaled_vel_joint_traj_controller/gains/wrist_1_joint/i: 0.05 * /scaled_vel_joint_traj_controller/gains/wrist_1_joint/i_clamp: 1 * /scaled_vel_joint_traj_controller/gains/wrist_1_joint/p: 5.0 * /scaled_vel_joint_traj_controller/gains/wrist_2_joint/d: 0.1 * /scaled_vel_joint_traj_controller/gains/wrist_2_joint/i: 0.05 * /scaled_vel_joint_traj_controller/gains/wrist_2_joint/i_clamp: 1 * /scaled_vel_joint_traj_controller/gains/wrist_2_joint/p: 5.0 * /scaled_vel_joint_traj_controller/gains/wrist_3_joint/d: 0.1 * /scaled_vel_joint_traj_controller/gains/wrist_3_joint/i: 0.05 * /scaled_vel_joint_traj_controller/gains/wrist_3_joint/i_clamp: 1 * /scaled_vel_joint_traj_controller/gains/wrist_3_joint/p: 5.0 * /scaled_vel_joint_traj_controller/joints: ['shoulder_pan_jo... * /scaled_vel_joint_traj_controller/state_publish_rate: 125 * /scaled_vel_joint_traj_controller/stop_trajectory_duration: 0.5 * /scaled_vel_joint_traj_controller/type: velocity_controll... * /scaled_vel_joint_traj_controller/velocity_ff/elbow_joint: 1.0 * /scaled_vel_joint_traj_controller/velocity_ff/shoulder_lift_joint: 1.0 * /scaled_vel_joint_traj_controller/velocity_ff/shoulder_pan_joint: 1.0 * /scaled_vel_joint_traj_controller/velocity_ff/wrist_1_joint: 1.0 * /scaled_vel_joint_traj_controller/velocity_ff/wrist_2_joint: 1.0 * /scaled_vel_joint_traj_controller/velocity_ff/wrist_3_joint: 1.0 * /speed_scaling_state_controller/publish_rate: 125 * /speed_scaling_state_controller/type: scaled_controller... * /twist_controller/frame_id: tool0_controller * /twist_controller/joints: ['shoulder_pan_jo... * /twist_controller/publish_rate: 125 * /twist_controller/type: ros_controllers_c... * /ur_hardware_interface/headless_mode: False * /ur_hardware_interface/input_recipe_file: /opt/ros/noetic/s... * /ur_hardware_interface/joints: ['shoulder_pan_jo... * /ur_hardware_interface/kinematics/forearm/pitch: 0 * /ur_hardware_interface/kinematics/forearm/roll: 0 * /ur_hardware_interface/kinematics/forearm/x: -0.425 * /ur_hardware_interface/kinematics/forearm/y: 0 * /ur_hardware_interface/kinematics/forearm/yaw: 0 * /ur_hardware_interface/kinematics/forearm/z: 0 * /ur_hardware_interface/kinematics/hash: calib_20954911754... * /ur_hardware_interface/kinematics/shoulder/pitch: 0 * /ur_hardware_interface/kinematics/shoulder/roll: 0 * /ur_hardware_interface/kinematics/shoulder/x: 0 * /ur_hardware_interface/kinematics/shoulder/y: 0 * /ur_hardware_interface/kinematics/shoulder/yaw: 0 * /ur_hardware_interface/kinematics/shoulder/z: 0.089159 * /ur_hardware_interface/kinematics/upper_arm/pitch: 0 * /ur_hardware_interface/kinematics/upper_arm/roll: 1.570796327 * /ur_hardware_interface/kinematics/upper_arm/x: 0 * /ur_hardware_interface/kinematics/upper_arm/y: 0 * /ur_hardware_interface/kinematics/upper_arm/yaw: 0 * /ur_hardware_interface/kinematics/upper_arm/z: 0 * /ur_hardware_interface/kinematics/wrist_1/pitch: 0 * /ur_hardware_interface/kinematics/wrist_1/roll: 0 * /ur_hardware_interface/kinematics/wrist_1/x: -0.39225 * /ur_hardware_interface/kinematics/wrist_1/y: 0 * /ur_hardware_interface/kinematics/wrist_1/yaw: 0 * /ur_hardware_interface/kinematics/wrist_1/z: 0.10915 * /ur_hardware_interface/kinematics/wrist_2/pitch: 0 * /ur_hardware_interface/kinematics/wrist_2/roll: 1.570796327 * /ur_hardware_interface/kinematics/wrist_2/x: 0 * /ur_hardware_interface/kinematics/wrist_2/y: -0.09465 * /ur_hardware_interface/kinematics/wrist_2/yaw: 0 * /ur_hardware_interface/kinematics/wrist_2/z: -1.94130395089760... * /ur_hardware_interface/kinematics/wrist_3/pitch: 3.141592653589793 * /ur_hardware_interface/kinematics/wrist_3/roll: 1.570796326589793 * /ur_hardware_interface/kinematics/wrist_3/x: 0 * /ur_hardware_interface/kinematics/wrist_3/y: 0.0823 * /ur_hardware_interface/kinematics/wrist_3/yaw: 3.141592653589793 * /ur_hardware_interface/kinematics/wrist_3/z: -1.68800121668117... * /ur_hardware_interface/output_recipe_file: /opt/ros/noetic/s... * /ur_hardware_interface/reverse_ip: * /ur_hardware_interface/reverse_port: 50001 * /ur_hardware_interface/robot_ip: 192.168.1.120 * /ur_hardware_interface/robot_receive_timeout: 0.02 * /ur_hardware_interface/script_command_port: 50004 * /ur_hardware_interface/script_file: /opt/ros/noetic/s... * /ur_hardware_interface/script_sender_port: 50002 * /ur_hardware_interface/servoj_gain: 2000 * /ur_hardware_interface/servoj_lookahead_time: 0.03 * /ur_hardware_interface/tf_prefix: * /ur_hardware_interface/tool_baud_rate: 115200 * /ur_hardware_interface/tool_parity: 0 * /ur_hardware_interface/tool_rx_idle_chars: 1.5 * /ur_hardware_interface/tool_stop_bits: 1 * /ur_hardware_interface/tool_tx_idle_chars: 3.5 * /ur_hardware_interface/tool_voltage: 0 * /ur_hardware_interface/trajectory_port: 50003 * /ur_hardware_interface/use_spline_interpolation: True * /ur_hardware_interface/use_tool_communication: False * /vel_joint_traj_controller/action_monitor_rate: 20 * /vel_joint_traj_controller/constraints/elbow_joint/goal: 0.1 * /vel_joint_traj_controller/constraints/elbow_joint/trajectory: 0.1 * /vel_joint_traj_controller/constraints/goal_time: 0.6 * /vel_joint_traj_controller/constraints/shoulder_lift_joint/goal: 0.1 * /vel_joint_traj_controller/constraints/shoulder_lift_joint/trajectory: 0.1 * /vel_joint_traj_controller/constraints/shoulder_pan_joint/goal: 0.1 * /vel_joint_traj_controller/constraints/shoulder_pan_joint/trajectory: 0.1 * /vel_joint_traj_controller/constraints/stopped_velocity_tolerance: 0.05 * /vel_joint_traj_controller/constraints/wrist_1_joint/goal: 0.1 * /vel_joint_traj_controller/constraints/wrist_1_joint/trajectory: 0.1 * /vel_joint_traj_controller/constraints/wrist_2_joint/goal: 0.1 * /vel_joint_traj_controller/constraints/wrist_2_joint/trajectory: 0.1 * /vel_joint_traj_controller/constraints/wrist_3_joint/goal: 0.1 * /vel_joint_traj_controller/constraints/wrist_3_joint/trajectory: 0.1 * /vel_joint_traj_controller/gains/elbow_joint/d: 0.1 * /vel_joint_traj_controller/gains/elbow_joint/i: 0.05 * /vel_joint_traj_controller/gains/elbow_joint/i_clamp: 1 * /vel_joint_traj_controller/gains/elbow_joint/p: 5.0 * /vel_joint_traj_controller/gains/shoulder_lift_joint/d: 0.1 * /vel_joint_traj_controller/gains/shoulder_lift_joint/i: 0.05 * /vel_joint_traj_controller/gains/shoulder_lift_joint/i_clamp: 1 * /vel_joint_traj_controller/gains/shoulder_lift_joint/p: 5.0 * /vel_joint_traj_controller/gains/shoulder_pan_joint/d: 0.1 * /vel_joint_traj_controller/gains/shoulder_pan_joint/i: 0.05 * /vel_joint_traj_controller/gains/shoulder_pan_joint/i_clamp: 1 * /vel_joint_traj_controller/gains/shoulder_pan_joint/p: 5.0 * /vel_joint_traj_controller/gains/wrist_1_joint/d: 0.1 * /vel_joint_traj_controller/gains/wrist_1_joint/i: 0.05 * /vel_joint_traj_controller/gains/wrist_1_joint/i_clamp: 1 * /vel_joint_traj_controller/gains/wrist_1_joint/p: 5.0 * /vel_joint_traj_controller/gains/wrist_2_joint/d: 0.1 * /vel_joint_traj_controller/gains/wrist_2_joint/i: 0.05 * /vel_joint_traj_controller/gains/wrist_2_joint/i_clamp: 1 * /vel_joint_traj_controller/gains/wrist_2_joint/p: 5.0 * /vel_joint_traj_controller/gains/wrist_3_joint/d: 0.1 * /vel_joint_traj_controller/gains/wrist_3_joint/i: 0.05 * /vel_joint_traj_controller/gains/wrist_3_joint/i_clamp: 1 * /vel_joint_traj_controller/gains/wrist_3_joint/p: 5.0 * /vel_joint_traj_controller/joints: ['shoulder_pan_jo... * /vel_joint_traj_controller/state_publish_rate: 125 * /vel_joint_traj_controller/stop_trajectory_duration: 0.5 * /vel_joint_traj_controller/type: velocity_controll... * /vel_joint_traj_controller/velocity_ff/elbow_joint: 1.0 * /vel_joint_traj_controller/velocity_ff/shoulder_lift_joint: 1.0 * /vel_joint_traj_controller/velocity_ff/shoulder_pan_joint: 1.0 * /vel_joint_traj_controller/velocity_ff/wrist_1_joint: 1.0 * /vel_joint_traj_controller/velocity_ff/wrist_2_joint: 1.0 * /vel_joint_traj_controller/velocity_ff/wrist_3_joint: 1.0 NODES / controller_stopper (ur_robot_driver/controller_stopper_node) robot_state_publisher (robot_state_publisher/robot_state_publisher) ros_control_controller_spawner (controller_manager/spawner) ros_control_stopped_spawner (controller_manager/spawner) ur_hardware_interface (ur_robot_driver/ur_robot_driver_node) /ur_hardware_interface/ ur_robot_state_helper (ur_robot_driver/robot_state_helper) auto-starting new master process[master]: started with pid [9390] ROS_MASTER_URI=http://localhost:11311 setting /run_id to a5368822-6eb4-11f0-afbe-05d467d6740f process[rosout-1]: started with pid [9400] started core service [/rosout] process[robot_state_publisher-2]: started with pid [9407] process[ur_hardware_interface-3]: started with pid [9408] process[ros_control_controller_spawner-4]: started with pid [9409] process[ros_control_stopped_spawner-5]: started with pid [9411] process[controller_stopper-6]: started with pid [9416] [INFO] [1754038260.481594732]: Initializing dashboard client [INFO] [1754038260.487405631]: Connected: Universal Robots Dashboard Server process[ur_hardware_interface/ur_robot_state_helper-7]: started with pid [9425] [INFO] [1754038260.506479611]: Waiting for controller manager service to come up on /controller_manager/switch_controller [INFO] [1754038260.508678646]: waitForService: Service [/controller_manager/switch_controller] has not been advertised, waiting... [INFO] [1754038260.510850350]: Initializing urdriver [WARN] [1754038260.515403691]: Your system/user seems not to be setup for FIFO scheduling. We recommend using a lowlatency kernel with FIFO scheduling. See https://docs.universal-robots.com/Universal_Robots_ROS_Documentation/doc/ur_client_library/doc/real_time.html for details. [INFO] [1754038260.758709]: Controller Spawner: Waiting for service controller_manager/load_controller [INFO] [1754038260.858406]: Controller Spawner: Waiting for service controller_manager/load_controller [INFO] [1754038260.872882426]: Negotiated RTDE protocol version to 2. [INFO] [1754038260.874552649]: Setting up RTDE communication with frequency 125.000000 [INFO] [1754038261.909298599]: Starting primary client pipeline [INFO] [1754038261.911420659]: Checking if calibration data matches connected robot. [ERROR] [1754038262.911943409]: The calibration parameters of the connected robot don't match the ones from the given kinematics config file. Please be aware that this can lead to critical inaccuracies of tcp positions. Use the ur_calibration tool to extract the correct calibration from the robot and pass that into the description. See [https://github.com/UniversalRobots/Universal_Robots_ROS_Driver#extract-calibration-information] for details. [WARN] [1754038262.924839016]: Your system/user seems not to be setup for FIFO scheduling. We recommend using a lowlatency kernel with FIFO scheduling. See https://docs.universal-robots.com/Universal_Robots_ROS_Documentation/doc/ur_client_library/doc/real_time.html for details. [INFO] [1754038262.926228217]: Loaded ur_robot_driver hardware_interface [INFO] [1754038262.968037918]: waitForService: Service [/controller_manager/switch_controller] is now available. [INFO] [1754038262.968304438]: Service available. [INFO] [1754038262.968342370]: Waiting for controller list service to come up on /controller_manager/list_controllers [INFO] [1754038262.969123410]: Service available. [INFO] [1754038262.977452]: Controller Spawner: Waiting for service controller_manager/switch_controller [INFO] [1754038262.980766]: Controller Spawner: Waiting for service controller_manager/unload_controller [INFO] [1754038262.983952]: Loading controller: pos_joint_traj_controller [INFO] [1754038263.034800]: Loading controller: joint_group_vel_controller [INFO] [1754038263.049548]: Controller Spawner: Loaded controllers: pos_joint_traj_controller, joint_group_vel_controller [INFO] [1754038263.181526427]: Robot mode is now POWER_OFF [INFO] [1754038263.183844862]: Robot's safety mode is now NORMAL [INFO] [1754038263.184011]: Controller Spawner: Waiting for service controller_manager/switch_controller [INFO] [1754038263.187691]: Controller Spawner: Waiting for service controller_manager/unload_controller [INFO] [1754038263.191352]: Loading controller: joint_state_controller [INFO] [1754038263.209029]: Loading controller: scaled_pos_joint_traj_controller [INFO] [1754038263.257595]: Loading controller: speed_scaling_state_controller [INFO] [1754038263.273802]: Loading controller: force_torque_sensor_controller [INFO] [1754038263.289856]: Controller Spawner: Loaded controllers: joint_state_controller, scaled_pos_joint_traj_controller, speed_scaling_state_controller, force_torque_sensor_controller [INFO] [1754038263.297306]: Started controllers: joint_state_controller, scaled_pos_joint_traj_controller, speed_scaling_state_controller, force_torque_sensor_controller
08-02
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值