setting up your robot with tf(一)

本文介绍如何使用ROS中的TF库建立和应用坐标变换。首先通过实例解释了TF的基本概念,随后提供了具体的C++代码示例,展示了如何发布和使用坐标变换。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1,setting up your robot using tf     官网学习http://wiki.ros.org/tf/Tutorials

2,transform configuration

Many ROS packages require the transform tree of a robot to be published using thetf software library. At an abstract level, a transform tree defines offsets in terms of both translation and rotation between different coordinate frames. To make this more concrete, consider the example of a simple robot that has a mobile base with a single laser mounted on top of it. In referring to the robot let's define two coordinate frames: one corresponding to the center point of the base of the robot and one for the center point of the laser that is mounted on top of the base. Let's also give them names for easy reference. We'll call the coordinate frame attached to the mobile base "base_link" (for navigation, its important that this be placed at the rotational center of the robot) and we'll call the coordinate frame attached to the laser "base_laser."

许多ROS包需要机器人转换树用tf软件包来发布。在抽象层次来看,一棵转换树定义了不同的坐标系之间的转换和旋转的偏差。为了更具体,用一个例子如一个简单的机器人带有一个移动的躯干和一个简单的激光器在躯干的上面。为了更好区分,我们称这个躯干的坐标系为base_link(这个坐标系通常放在正中间),激光器的坐标系称作base_laser.

At this point, let's assume that we have some data from the laser in the form of distances from the laser's center point. In other words, we have some data in the "base_laser" coordinate frame. Now suppose we want to take this data and use it to help the mobile base avoid obstacles in the world. To do this successfully, we need a way of transforming the laser scan we've received from the "base_laser" frame to the "base_link" frame. In essence, we need to define a relationship between the "base_laser" and "base_link" coordinate frames

这样来说,让我们假设我们有一些数据来自激光器正中间的前方,也就是说,我们有一些数据在base_laser坐标系上,现在假设我们想得到这些数据并利用它来帮助躯干移动来避开障碍物,这样的话,我们需要一种方式来将我们得到的base_laser数据转换给base_link框架,因此,我们需要在base_laser和base_link坐标系之间定义一种关系。(这段话说明的是,比如我们的机器人想用激光测距来使机器人避障,当激光器得到数据之后,怎样把相对的坐标位置转换给躯干,然后使躯干移动避障,这样就需要定义激光器和躯干也就是不同的frame之间要定义一种关系)

In defining this relationship, assume we know that the laser is mounted 10cm forward and 20cm above the center point of the mobile base. This gives us a translational offset that relates the "base_link" frame to the "base_laser" frame. Specifically, we know that to get data from the "base_link" frame to the "base_laser" frame we must apply a translation of (x: 0.1m, y: 0.0m, z: 0.2m), and to get data from the "base_laser" frame to the "base_link" frame we must apply the opposite translation (x: -0.1m, y: 0.0m, z: -0.20m).

为了定义这种关系,假设我们知道激光器是在躯干的前方10cm和上方20cm,这样框架base_link和base_laser之间有一个转换偏差。如果要定义base_laser对应于base_link的数据,则需要添加一个转换关系(x:0.1......),而要定义base_link对应与base_laser的数据,只需要添加一个转换关系(x:-0.1.....)

We could choose to manage this relationship ourselves, meaning storing and applying the appropriate translations between the frames when necessary, but this becomes a real pain as the number of coordinate frames increase. Luckily, however, we don't have to do this work ourselves. Instead we'll define the relationship between "base_link" and "base_laser" once using tf and let it manage the transformation between the two coordinate frames for us. 

我们需要自己管理这种转换关系,意思是当需要的时候,我们要存储并条用合适的转换关系,但是这是一项很复杂很令人头痛的工作,尤其是当坐标系的数量增加时。幸运的是,我们不用自己做这件事了。我们只需要用tf将base_link和base_laser之间的关系定义一次,之后就让tf来帮我们管理这两个坐标系之间的转换微笑

To define and store the relationship between the "base_link" and "base_laser" frames using tf, we need to add them to a transform tree. Conceptually, each node in the transform tree corresponds to a coordinate frame and each edge corresponds to the transform that needs to be applied to move from the current node to its child. Tf uses a tree structure to guarantee that there is only a single traversal that links any two coordinate frames together, and assumes that all edges in the tree are directed from parent to child nodes

为了用tf来定义和存储base_link和base_laser框架之间的关系,我们需要将它们添加进转换树。概念上来说,转化树上的每一个节点对应一个坐标系,每一条边对应从现在的节点到它子节点之间的转换。TF利用了树形结构来定义而且是单遍历的关系来将两个坐标系连接在一起,也即假设所有的边都是从父节点到子节点。

总的来说,就是定义了一个TF转换树,而且是单遍历的树,即关系是从父节点到子节点,tf定义和存储这棵关系树后,这样框架之间的关系就很明确了,tf会帮我们调用这些关系,比如当激光器测量到距离障碍物0.3米时,由关系树知道躯干距离障碍物为0.4米,这样就能使躯干决定是否移动来躲避障碍物了微笑

3,writing code(C++)

首先要创建一个节点负责发布转换消息,然后再创建一个节点来收听通过ROS发布的转换消息并用它来转换一个点。

3.1 broadcasting a transform发布转换,发布转换base_laser-->base_link之间的转换

tf_broadcaster.cpp:

   1 #include <ros/ros.h>
   2 #include <tf/transform_broadcaster.h>
//要使用TransformBroadcaster来发布转换消息,这样就必须包括tf包里面的tranform_broadcaster.h头文件
   3 
   4 int main(int argc, char** argv){
   5   ros::init(argc, argv, "robot_tf_publisher");
   6   ros::NodeHandle n;
   7 
   8   ros::Rate r(100);
   9 
  10   tf::TransformBroadcaster broadcaster;
//创建一个TransformBroadcaster对象来发送base_link转换消息给base_laser
 11 
  12   while(n.ok()){
  13     broadcaster.sendTransform(
  14       tf::StampedTransform(
  15         tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0.1, 0.0, 0.2)),
  16         ros::Time::now(),"base_link", "base_laser"));
  17     r.sleep();
//用TransformBroadcaster来发布一个转换需要五个参数:第一个为旋转转换,那个包括btQuaternion和btVector3,其中btQuaternion包括pitch,roll,yaw,而btVector3
//就对应一个转换,对应robot base的laser的偏差为x轴偏差为10cm,z轴偏差为20cm;第三个为发布一个时间戳,这里设置为now();第四个为父节点的名称,这里为base_link;第五个为子节点的
//名称,这里为base_laser
 18   }
  19 }
3.2 using a transform

创建完一个节点来发布base_laser-->base_link的转换消息,也就是base_laser-->base_link之间的tf转换为(0.1,0.0,0.2).

现在来创建一个节点用来使用这个转换,给base_laser框架一个值之后,使用转换来获得base_link的值。

tf_listener.cpp:

   1 #include <ros/ros.h>
   2 #include <geometry_msgs/PointStamped.h>
   3 #include <tf/transform_listener.h>
//获得TransformListener来自动订阅转换消息,也即订阅到TransformBroadcaster发布的消息
   4 
   5 void transformPoint(const tf::TransformListener& listener)
//创建一个函数,给base_laser一个点,并将它转换为base_link框架
{
   6   //we'll create a point in the base_laser frame that we'd like to transform to the base_link frame
   7   geometry_msgs::PointStamped laser_point;
//创建一个geometry_msgs::PointStamped的点,其中Stamped意思是包含一个头文件,允许我们连接一个timestamp时间戳和一个frame_id框架id,其中timestamp设为
//ros::Time(),而frame_id设为base_laser,并将它的点值设为以下那些值x:1.0,y:0.2,z:0.0;
 8   laser_point.header.frame_id = "base_laser";
   9 
  10   //we'll just use the most recent transform available for our simple example
  11   laser_point.header.stamp = ros::Time();
  12 
  13   //just an arbitrary point in space
  14   laser_point.point.x = 1.0;
  15   laser_point.point.y = 0.2;
  16   laser_point.point.z = 0.0;
  17 
  18   try{
  19     geometry_msgs::PointStamped base_point;
  20     listener.transformPoint("base_link", laser_point, base_point);
  21 
  22     ROS_INFO("base_laser: (%.2f, %.2f. %.2f) -----> base_link: (%.2f, %.2f, %.2f) at time %.2f",
  23         laser_point.point.x, laser_point.point.y, laser_point.point.z,
  24         base_point.point.x, base_point.point.y, base_point.point.z, base_point.header.stamp.toSec());
  25   }
//为了将base_laser转换为base_link框架,需要使用TransformListener对象,并调用它的转换点函数transformPoint(),里面含有三个参数:想转换点的框架的名称这里为
base_link,我们从哪里转换的点这里为laser_point,转换后存储点这里为base_point
 26   catch(tf::TransformException& ex){
  27     ROS_ERROR("Received an exception trying to transform a point from \"base_laser\" to \"base_link\": %s", ex.what());
  28   }
  29 }
  30 
  31 int main(int argc, char** argv){
  32   ros::init(argc, argv, "robot_tf_listener");
  33   ros::NodeHandle n;
  34 
  35   tf::TransformListener listener(ros::Duration(10));
  36 
  37   //we'll transform a point once every second每隔一秒调用一次transformPoint函数,每隔一秒转换一次
  38   ros::Timer timer = n.createTimer(ros::Duration(1.0), boost::bind(&transformPoint, boost::ref(listener)));
  39 
  40   ros::spin();
  41 
  42 }
总结: 先运行节点tf_broadcaster,在运行节点tf_listener,即先发布base_link与base_laser的关系,再通过关系来计算使用。利用的是TransformBroadcaster和TransformListener这两个对象。


























ros2中晃动imu,但是我的机器人模型不跟着晃动,而且里程计开,里程计跑走,但是imu和机器人模型还在原地,以下是我的各个文件代码,情分析下为什么:wheeltec_robot.cpp文件代码为: #include "turn_on_wheeltec_robot/wheeltec_robot.h" #include "turn_on_wheeltec_robot/Quaternion_Solution.h" #include "wheeltec_robot_msg/msg/data.hpp" sensor_msgs::msg::Imu Mpu6050;//Instantiate an IMU object //实例化IMU对象 using std::placeholders::_1; using namespace std; rclcpp::Node::SharedPtr node_handle = nullptr; //自动回充使用相关变量 bool check_AutoCharge_data = false; bool charge_set_state = false; /************************************** Date: January 28, 2021 Function: The main function, ROS initialization, creates the Robot_control object through the Turn_on_robot class and automatically calls the constructor initialization 功能: 主函数,ROS初始化,通过turn_on_robot类创建Robot_control对象并自动调用构造函数初始化 ***************************************/ int main(int argc, char** argv) { rclcpp::init(argc, argv); //ROS initializes and sets the node name //ROS初始化 并设置节点名称 turn_on_robot Robot_Control;//Instantiate an object //实例化个对象 Robot_Control.Control();//Loop through data collection and publish the topic //循环执行数据采集和发布话题等操作 return 0; } /************************************** Date: January 28, 2021 Function: Data conversion function 功能: 数据转换函数 ***************************************/ short turn_on_robot::IMU_Trans(uint8_t Data_High,uint8_t Data_Low) { short transition_16; transition_16 = 0; transition_16 |= Data_High<<8; transition_16 |= Data_Low; return transition_16; } float turn_on_robot::Odom_Trans(uint8_t Data_High,uint8_t Data_Low) { float data_return; short transition_16; transition_16 = 0; transition_16 |= Data_High<<8; //Get the high 8 bits of data //获取数据的高8位 transition_16 |= Data_Low; //Get the lowest 8 bits of data //获取数据的低8位 data_return = (transition_16 / 1000)+(transition_16 % 1000)*0.001; // The speed unit is changed from mm/s to m/s //速度单位从mm/s转换为m/s return data_return; } /************************************** Date: January 28, 2021 Function: The speed topic subscription Callback function, according to the subscribed instructions through the serial port command control of the lower computer 功能: 速度话题订阅回调函数Callback,根据订阅的指令通过串口发指令控制下位机 ***************************************/ void turn_on_robot::Cmd_Vel_Callback(const geometry_msgs::msg::Twist::SharedPtr twist_aux) { short transition; //intermediate variable //中间变量 Send_Data.tx[0]= 0x06; //frame head 0x7B //帧头0X7B //Send_Data.tx[1] = AutoRecharge; //set aside //预留位 Send_Data.tx[1] = FRAME_HEADER; Send_Data.tx[2] = 0; //set aside //预留位 //The target velocity of the X-axis of the robot //机器人x轴的目标线速度 transition=0; transition = twist_aux->linear.x*1000; //将浮点数放大千倍,简化传输 (mm/s) Send_Data.tx[4] = transition; //取数据的低8位 Send_Data.tx[3] = transition>>8; //取数据的高8位 //The target velocity of the Y-axis of the robot //机器人y轴的目标线速度 transition=0; transition = twist_aux->linear.y*1000; Send_Data.tx[6] = transition; Send_Data.tx[5] = transition>>8; //The target angular velocity of the robot's Z axis //机器人z轴的目标角速度 transition=0; transition = twist_aux->angular.z*1000; //(1000*rad/s) Send_Data.tx[8] = transition; Send_Data.tx[7] = transition>>8; Send_Data.tx[9]=Check_Sum(9,SEND_DATA_CHECK); //For the BCC check bits, see the Check_Sum function //BCC校验位,规则参见Check_Sum函数 Send_Data.tx[10]=0x0d; //frame tail 0x7D //帧尾0X7D Send_Data.tx[11]=0x0a; try { Stm32_Serial.write(Send_Data.tx,sizeof (Send_Data.tx)); //Sends data to the downloader via serial port //通过串口向下位机发送数据 } catch (serial::IOException& e) { RCLCPP_ERROR(this->get_logger(),("Unable to send data through serial port")); //If sending data fails, an error message is printed //如果发送数据失败,打印错误信息 } } /************************************** Date: January 28, 2021 Function: Publish the IMU data topic 功能: 发布IMU数据话题 ***************************************/ void turn_on_robot::Publish_ImuSensor() { sensor_msgs::msg::Imu Imu_Data_Pub; //Instantiate IMU topic data //实例化IMU话题数据 Imu_Data_Pub.header.stamp = rclcpp::Node::now(); Imu_Data_Pub.header.frame_id = gyro_frame_id; //IMU corresponds to TF coordinates, which is required to use the robot_pose_ekf feature pack //IMU对应TF坐标,使用robot_pose_ekf功能包需要设置此项 Imu_Data_Pub.orientation.x = Mpu6050.orientation.x; //A quaternion represents a three-axis attitude //四元数表达三轴姿态 Imu_Data_Pub.orientation.y = Mpu6050.orientation.y; Imu_Data_Pub.orientation.z = Mpu6050.orientation.z; Imu_Data_Pub.orientation.w = Mpu6050.orientation.w; Imu_Data_Pub.orientation_covariance[0] = 1e6; //Three-axis attitude covariance matrix //三轴姿态协方差矩阵 Imu_Data_Pub.orientation_covariance[4] = 1e6; Imu_Data_Pub.orientation_covariance[8] = 1e-6; Imu_Data_Pub.angular_velocity.x = Mpu6050.angular_velocity.x; //Triaxial angular velocity //三轴角速度 Imu_Data_Pub.angular_velocity.y = Mpu6050.angular_velocity.y; Imu_Data_Pub.angular_velocity.z = Mpu6050.angular_velocity.z; Imu_Data_Pub.angular_velocity_covariance[0] = 1e6; //Triaxial angular velocity covariance matrix //三轴角速度协方差矩阵 Imu_Data_Pub.angular_velocity_covariance[4] = 1e6; Imu_Data_Pub.angular_velocity_covariance[8] = 1e-6; Imu_Data_Pub.linear_acceleration.x = Mpu6050.linear_acceleration.x; //Triaxial acceleration //三轴线性加速度 Imu_Data_Pub.linear_acceleration.y = Mpu6050.linear_acceleration.y; Imu_Data_Pub.linear_acceleration.z = Mpu6050.linear_acceleration.z; imu_publisher->publish(Imu_Data_Pub); //Pub IMU topic //发布IMU话题 } /************************************** Date: January 28, 2021 Function: Publish the odometer topic, Contains position, attitude, triaxial velocity, angular velocity about triaxial, TF parent-child coordinates, and covariance matrix 功能: 发布里程计话题,包含位置、姿态、三轴速度、绕三轴角速度、TF父子坐标、协方差矩阵 ***************************************/ void turn_on_robot::Publish_Odom() { //Convert the Z-axis rotation Angle into a quaternion for expression //把Z轴转角转换为四元数进行表达 tf2::Quaternion q; q.setRPY(0,0,Mpu6050_Data.imu_yaw); geometry_msgs::msg::Quaternion odom_quat=tf2::toMsg(q); nav_msgs::msg::Odometry odom; //Instance the odometer topic data //实例化里程计话题数据 odom.header.stamp = rclcpp::Node::now(); ; odom.header.frame_id = odom_frame_id; // Odometer TF parent coordinates //里程计TF父坐标 odom.pose.pose.position.x = Robot_Pos.X; //Position //位置 odom.pose.pose.position.y = Robot_Pos.Y; //odom.pose.pose.position.z = Robot_Pos.Z; odom.pose.pose.orientation = odom_quat; //Posture, Quaternion converted by Z-axis rotation //姿态,通过Z轴转角转换的四元数 odom.child_frame_id = robot_frame_id; // Odometer TF subcoordinates //里程计TF子坐标 odom.twist.twist.linear.x = Robot_Vel.X; //Speed in the X direction //X方向速度 //odom.twist.twist.linear.y = Robot_Vel.Y; //Speed in the Y direction //Y方向速度 odom.twist.twist.angular.z = Mpu6050.angular_velocity.z; //Angular velocity around the Z axis //绕Z轴角速度 //There are two types of this matrix, which are used when the robot is at rest and when it is moving.Extended Kalman Filtering officially provides 2 matrices for the robot_pose_ekf feature pack //这个矩阵有两种,分别在机器人静止和运动的时候使用。扩展卡尔曼滤波官方提供的2个矩阵,用于robot_pose_ekf功能包 //if(Robot_Vel.X== 0&&Robot_Vel.Y== 0&&Robot_Vel.Z== 0) if(Robot_Vel.X== 0) //If the velocity is zero, it means that the error of the encoder will be relatively small, and the data of the encoder will be considered more reliable //如果velocity是零,说明编码器的误差会比较小,认为编码器数据更可靠 memcpy(&odom.pose.covariance, odom_pose_covariance2, sizeof(odom_pose_covariance2)), memcpy(&odom.twist.covariance, odom_twist_covariance2, sizeof(odom_twist_covariance2)); else //If the velocity of the trolley is non-zero, considering the sliding error that may be brought by the encoder in motion, the data of IMU is considered to be more reliable //如果小车velocity非零,考虑到运动中编码器可能带来的滑动误差,认为imu的数据更可靠 memcpy(&odom.pose.covariance, odom_pose_covariance, sizeof(odom_pose_covariance)), memcpy(&odom.twist.covariance, odom_twist_covariance, sizeof(odom_twist_covariance)); odom_publisher->publish(odom); //Pub odometer topic //发布里程计话题 } /************************************** Date: January 28, 2021 Function: Publish voltage-related information 功能: 发布电压相关信息 ***************************************/ void turn_on_robot::Publish_Voltage() { std_msgs::msg::Float32 voltage_msgs; //Define the data type of the power supply voltage publishing topic //定义电源电压发布话题的数据类型 static float Count_Voltage_Pub=0; if(Count_Voltage_Pub++>10) { Count_Voltage_Pub=0; voltage_msgs.data = Power_voltage; //The power supply voltage is obtained //电源供电的电压获取 voltage_publisher->publish(voltage_msgs); //Post the power supply voltage topic unit: V, volt //发布电源电压话题单位:V、伏特 } } ////////// 回充发布与回调 //////// /************************************** Date: January 17, 2022 Function: Pub the topic whether the robot finds the infrared signal (charging station) 功能: 发布机器人是否寻找到红外信号(充电桩)的话题 ***************************************/ void turn_on_robot::Publish_RED() { std_msgs::msg::UInt8 msg; msg.data=Red; RED_publisher->publish(msg); } /************************************** Date: January 14, 2022 Function: Publish a topic about whether the robot is charging 功能: 发布机器人是否在充电的话题 ***************************************/ void turn_on_robot::Publish_Charging() { static bool last_charging; std_msgs::msg::Bool msg; msg.data=Charging; Charging_publisher->publish(msg); if(last_charging==false && Charging==true)cout<<GREEN<<"Robot is charging."<<endl<<RESET; if(last_charging==true && Charging==false)cout<<RED <<"Robot charging has disconnected."<<endl<<RESET; last_charging=Charging; } /************************************** Date: January 28, 2021 Function: Publish charging current information 功能: 发布充电电流信息 ***************************************/ void turn_on_robot::Publish_ChargingCurrent() { std_msgs::msg::Float32 msg; msg.data=Charging_Current; Charging_current_publisher->publish(msg); } /************************************** Date: March 1, 2022 Function: Infrared connection speed topic subscription Callback function, according to the subscription command through the serial port to set the infrared connection speed 功能: 红外对接速度话题订阅回调函数Callback,根据订阅的指令通过串口发指令设置红外对接速度 ***************************************/ void turn_on_robot::Red_Vel_Callback(const geometry_msgs::msg::Twist::SharedPtr twist_aux) { short transition; //intermediate variable //中间变量 Send_Data.tx[0]=FRAME_HEADER; //frame head 0x7B //帧头0X7B Send_Data.tx[1] = 3; //Infrared docking speed setting flag bit = 3 //红外对接速度设置标志位=3 Send_Data.tx[2] = 0; //set aside //预留位 //The target velocity of the X-axis of the robot //机器人x轴的目标线速度 transition=0; transition = twist_aux->linear.x*1000; //将浮点数放大千倍,简化传输 Send_Data.tx[4] = transition; //取数据的低8位 Send_Data.tx[3] = transition>>8; //取数据的高8位 //The target velocity of the Y-axis of the robot //机器人y轴的目标线速度 transition=0; transition = twist_aux->linear.y*1000; Send_Data.tx[6] = transition; Send_Data.tx[5] = transition>>8; //The target angular velocity of the robot's Z axis //机器人z轴的目标角速度 transition=0; transition = twist_aux->angular.z*1000; Send_Data.tx[8] = transition; Send_Data.tx[7] = transition>>8; Send_Data.tx[9]=Check_Sum(9,SEND_DATA_CHECK); //BCC check //BCC校验 Send_Data.tx[10]=FRAME_TAIL; //frame tail 0x7D //帧尾0X7D try { Stm32_Serial.write(Send_Data.tx,sizeof (Send_Data.tx)); //Sends data to the downloader via serial port //通过串口向下位机发送数据 } catch (serial::IOException& e) { RCLCPP_ERROR(this->get_logger(),("Unable to send data through serial port")); //If sending data fails, an error message is printed //如果发送数据失败,打印错误信息 } } /************************************** Date: January 14, 2022 Function: Subscription robot recharge flag bit topic, used to tell the lower machine speed command is normal command or recharge command 功能: 订阅机器人是否回充标志位话题,用于告诉下位机速度命令是正常命令还是回充命令 ***************************************/ void turn_on_robot::Recharge_Flag_Callback(const std_msgs::msg::Int8::SharedPtr Recharge_Flag) { AutoRecharge=Recharge_Flag->data; } //服务 void turn_on_robot::Set_Charge_Callback(const shared_ptr<turtlesim::srv::Spawn::Request> req,shared_ptr<turtlesim::srv::Spawn::Response> res) { Send_Data.tx[0]=FRAME_HEADER; //frame head 0x7B //֡ͷ0X7B if(round(req->x)==1) Send_Data.tx[1] = 1; else if(round(req->x)==2) Send_Data.tx[1] = 2; else if(round(req->x)==0) Send_Data.tx[1] = 0,AutoRecharge=0; Send_Data.tx[2] = 0; Send_Data.tx[3] = 0; Send_Data.tx[4] = 0; Send_Data.tx[5] = 0; Send_Data.tx[6] = 0; Send_Data.tx[7] = 0; Send_Data.tx[8] = 0; Send_Data.tx[9]=Check_Sum(9,SEND_DATA_CHECK); //For the BCC check bits, see the Check_Sum function //BCCУ��λ������μ�Check_Sum���� Send_Data.tx[10]=FRAME_TAIL; //frame tail 0x7D //֡β0X7D try { Stm32_Serial.write(Send_Data.tx,sizeof (Send_Data.tx)); //Sends data to the downloader via serial port //ͨ����������λ���������� } catch (serial::IOException& e) { res->name = "false"; } if( Send_Data.tx[1]==0 ) { if(charge_set_state==0) AutoRecharge=0,res->name = "true"; else res->name = "false"; } else { if(charge_set_state==1) res->name = "true"; else res->name = "false"; } return; } ////////// 回充发布与回调 //////// /************************************** Date: January 28, 2021 Function: Serial port communication check function, packet n has a byte, the NTH -1 byte is the check bit, the NTH byte bit frame end.Bit XOR results from byte 1 to byte n-2 are compared with byte n-1, which is a BCC check Input parameter: Count_Number: Check the first few bytes of the packet 功能: 串口通讯校验函数,数据包n有个字节,第n-1个字节为校验位,第n个字节位帧尾。第1个字节到第n-2个字节数据按位异或的结果与第n-1个字节对比,即为BCC校验 输入参数: Count_Number:数据包前几个字节加入校验 mode:对发送数据还是接收数据进行校验 ***************************************/ unsigned char turn_on_robot::Check_Sum(unsigned char Count_Number,unsigned char mode) { unsigned char check_sum=0,k; if(mode==0) //Receive data mode //接收数据模式 { for(k=0;k<Count_Number;k++) { check_sum=check_sum^Receive_Data.rx[k]; //By bit or by bit //按位异或 } } if(mode==1) //Send data mode //发送数据模式 { for(k=1;k<Count_Number;k++) { check_sum=check_sum^Send_Data.tx[k]; //By bit or by bit //按位异或 } } return check_sum; //Returns the bitwise XOR result //返回按位异或结果 } //自动回充专用校验位 unsigned char turn_on_robot::Check_Sum_AutoCharge(unsigned char Count_Number,unsigned char mode) { unsigned char check_sum=0,k; if(mode==0) //Receive data mode //接收数据模式 { for(k=0;k<Count_Number;k++) { check_sum=check_sum^Receive_AutoCharge_Data.rx[k]; //By bit or by bit //按位异或 } } return check_sum; } /************************************** Date: November 18, 2021 Function: Read and verify the data sent by the lower computer frame by frame through the serial port, and then convert the data into international units 功能: 通过串口读取并逐帧校验下位机发送过来的数据,然后数据转换为国际单位 ***************************************/ bool turn_on_robot::Get_Sensor_Data_New() { short transition_16=0; //Intermediate variable //中间变量 //uint8_t i=0; uint8_t check=0,check2=0, error=1,error2=1,Receive_Data_Pr[1]; //Temporary variable to save the data of the lower machine //临时变量,保存下位机数据 static int count,count2; //Static variable for counting //静态变量,用于计数 Stm32_Serial.read(Receive_Data_Pr,sizeof(Receive_Data_Pr)); //Read the data sent by the lower computer through the serial port //通过串口读取下位机发送过来的数据 /*//View the received raw data directly and debug it for use//直接查看接收到的原始数据,调试使用 ROS_INFO("%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x", Receive_Data_Pr[0],Receive_Data_Pr[1],Receive_Data_Pr[2],Receive_Data_Pr[3],Receive_Data_Pr[4],Receive_Data_Pr[5],Receive_Data_Pr[6],Receive_Data_Pr[7], Receive_Data_Pr[8],Receive_Data_Pr[9],Receive_Data_Pr[10],Receive_Data_Pr[11],Receive_Data_Pr[12],Receive_Data_Pr[13],Receive_Data_Pr[14],Receive_Data_Pr[15], Receive_Data_Pr[16],Receive_Data_Pr[17],Receive_Data_Pr[18],Receive_Data_Pr[19],Receive_Data_Pr[20],Receive_Data_Pr[21],Receive_Data_Pr[22],Receive_Data_Pr[23]); */ Receive_Data.rx[count] = Receive_Data_Pr[0]; //Fill the array with serial data //串口数据填入数组 Receive_AutoCharge_Data.rx[count2] = Receive_Data_Pr[0]; Receive_Data.Frame_Header = Receive_Data.rx[0]; //The first part of the data is the frame header 0X7B //数据的第位是帧头0X7B Receive_Data.Frame_Tail = Receive_Data.rx[23]; //The last bit of data is frame tail 0X7D //数据的最后位是帧尾0X7D //接收到自动回充数据的帧头、上个数据是24字节的帧尾,表明自动回充数据开始到来 if((Receive_Data_Pr[0] == AutoCharge_HEADER )||count2>0) count2++; else count2=0; if(Receive_Data_Pr[0] == FRAME_HEADER || count>0) //Ensure that the first data in the array is FRAME_HEADER //确保数组第个数据为FRAME_HEADER count++; else count=0; //自动回充数据处理 if(count2 == AutoCharge_DATA_SIZE) { count2=0; if(Receive_AutoCharge_Data.rx[AutoCharge_DATA_SIZE-1]==AutoCharge_TAIL) //确认帧尾 { check2 = Check_Sum_AutoCharge(6,0);//校验位计算 if(check2 == Receive_AutoCharge_Data.rx[AutoCharge_DATA_SIZE-2]) //校验正确 { error2=0; } if(error2 == 0) //校验正确开始赋值 { transition_16 = 0; transition_16 |= Receive_AutoCharge_Data.rx[1]<<8; transition_16 |= Receive_AutoCharge_Data.rx[2]; Charging_Current = transition_16/1000+(transition_16 % 1000)*0.001; //充电电流 Red = Receive_AutoCharge_Data.rx[3]; //红外接受状态 Charging = Receive_AutoCharge_Data.rx[4];//小车充电状态 charge_set_state = Receive_AutoCharge_Data.rx[5]; check_AutoCharge_data = true; //数据成功接收标志位 } } } if(count == 24) //Verify the length of the packet //验证数据包的长度 { count=0; //Prepare for the serial port data to be refill into the array //为串口数据重新填入数组做准备 if(Receive_Data.Frame_Tail == FRAME_TAIL) //Verify the frame tail of the packet //验证数据包的帧尾 { check=Check_Sum(22,READ_DATA_CHECK); //BCC check passes or two packets are interlaced //BCC校验通过或者两组数据包交错 if(check == Receive_Data.rx[22]) { error=0; //XOR bit check successful //异或位校验成功 } if(error == 0) { /*//Check receive_data.rx for debugging use //查看Receive_Data.rx,调试使用 ROS_INFO("%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x", Receive_Data.rx[0],Receive_Data.rx[1],Receive_Data.rx[2],Receive_Data.rx[3],Receive_Data.rx[4],Receive_Data.rx[5],Receive_Data.rx[6],Receive_Data.rx[7], Receive_Data.rx[8],Receive_Data.rx[9],Receive_Data.rx[10],Receive_Data.rx[11],Receive_Data.rx[12],Receive_Data.rx[13],Receive_Data.rx[14],Receive_Data.rx[15], Receive_Data.rx[16],Receive_Data.rx[17],Receive_Data.rx[18],Receive_Data.rx[19],Receive_Data.rx[20],Receive_Data.rx[21],Receive_Data.rx[22],Receive_Data.rx[23]); */ Receive_Data.Flag_Stop=Receive_Data.rx[1]; //set aside //预留位 Robot_Vel.X = Odom_Trans(Receive_Data.rx[2],Receive_Data.rx[3]); //Get the speed of the moving chassis in the X direction //获取运动底盘X方向速度 //Robot_Vel.Y = Odom_Trans(Receive_Data.rx[4],Receive_Data.rx[5]); //Get the speed of the moving chassis in the Y direction, The Y speed is only valid in the omnidirectional mobile robot chassis //获取运动底盘Y方向速度,Y速度仅在全向移动机器人底盘有效 //Robot_Vel.Z = Odom_Trans(Receive_Data.rx[6],Receive_Data.rx[7]); //Get the speed of the moving chassis in the Z direction //获取运动底盘Z方向速度 //MPU6050 stands for IMU only and does not refer to a specific model. It can be either MPU6050 or MPU9250 //Mpu6050仅代表IMU,不指代特定型号,既可以是MPU6050也可以是MPU9250 Mpu6050_Data.imu_rol = IMU_Trans(Receive_Data.rx[4],Receive_Data.rx[5]) * 0.01 * 3.14159/180; Mpu6050_Data.imu_yaw = IMU_Trans(Receive_Data.rx[6],Receive_Data.rx[7]) * 0.01 * 3.14159/180; Mpu6050_Data.accele_x_data = IMU_Trans(Receive_Data.rx[8],Receive_Data.rx[9]); //Get the X-axis acceleration of the IMU //获取IMU的X轴加速度 Mpu6050_Data.accele_y_data = IMU_Trans(Receive_Data.rx[10],Receive_Data.rx[11]); //Get the Y-axis acceleration of the IMU //获取IMU的Y轴加速度 Mpu6050_Data.accele_z_data = IMU_Trans(Receive_Data.rx[12],Receive_Data.rx[13]); //Get the Z-axis acceleration of the IMU //获取IMU的Z轴加速度 Mpu6050_Data.gyros_x_data = IMU_Trans(Receive_Data.rx[14],Receive_Data.rx[15]); //Get the X-axis angular velocity of the IMU //获取IMU的X轴角速度 Mpu6050_Data.gyros_y_data = IMU_Trans(Receive_Data.rx[16],Receive_Data.rx[17]); //Get the Y-axis angular velocity of the IMU //获取IMU的Y轴角速度 Mpu6050_Data.gyros_z_data = IMU_Trans(Receive_Data.rx[18],Receive_Data.rx[19]); //Get the Z-axis angular velocity of the IMU //获取IMU的Z轴角速度 //Linear acceleration unit conversion is related to the range of IMU initialization of STM32, where the range is ±2g=19.6m/s^2 //线性加速度单位转化,和STM32的IMU初始化的时候的量程有关,这里量程±2g=19.6m/s^2 Mpu6050.linear_acceleration.x = Mpu6050_Data.accele_x_data * 0.01 * 9.8; Mpu6050.linear_acceleration.y = Mpu6050_Data.accele_y_data * 0.01 * 9.8; Mpu6050.linear_acceleration.z = Mpu6050_Data.accele_z_data * 0.01 * 9.8; //The gyroscope unit conversion is related to the range of STM32's IMU when initialized. Here, the range of IMU's gyroscope is ±500°/s //Because the robot generally has a slow Z-axis speed, reducing the range can improve the accuracy //陀螺仪单位转化,和STM32的IMU初始化的时候的量程有关,这里IMU的陀螺仪的量程是±500°/s //因为机器人般Z轴速度不快,降低量程可以提高精度 Mpu6050.angular_velocity.x = Mpu6050_Data.gyros_x_data * 0.01 *3.14159/180; Mpu6050.angular_velocity.y = Mpu6050_Data.gyros_y_data * 0.01 *3.14159/180; Mpu6050.angular_velocity.z = Mpu6050_Data.gyros_z_data * 0.01 *3.14159/180; //Get the battery voltage //获取电池电压 transition_16 = 0; transition_16 |= Receive_Data.rx[20]<<8; transition_16 |= Receive_Data.rx[21]; Power_voltage = transition_16/1000+(transition_16 % 1000)*0.001; //Unit conversion millivolt(mv)->volt(v) //单位转换毫伏(mv)->伏(v) return true; } } } return false; } /************************************** Date: January 28, 2021 Function: Loop access to the lower computer data and issue topics 功能: 循环获取下位机数据与发布话题 ***************************************/ void turn_on_robot::Control() { //_Last_Time = ros::Time::now(); _Last_Time = rclcpp::Node::now(); while(rclcpp::ok()) { try { //_Now = ros::Time::now(); _Now = rclcpp::Node::now(); Sampling_Time = (_Now - _Last_Time).seconds(); //Retrieves time interval, which is used to integrate velocity to obtain displacement (mileage) //获取时间间隔,用于积分速度获得位移(里程) if (true == Get_Sensor_Data_New()) //The serial port reads and verifies the data sent by the lower computer, and then the data is converted to international units //通过串口读取并校验下位机发送过来的数据,然后数据转换为国际单位 { //Robot_Pos.X+=(Robot_Vel.X * cos(Robot_Pos.Z) - Robot_Vel.Y * sin(Robot_Pos.Z)) * Sampling_Time; //Calculate the displacement in the X direction, unit: m //计算X方向的位移,单位:m //Robot_Pos.Y+=(Robot_Vel.X * sin(Robot_Pos.Z) + Robot_Vel.Y * cos(Robot_Pos.Z)) * Sampling_Time; //Calculate the displacement in the Y direction, unit: m //计算Y方向的位移,单位:m //Robot_Pos.Z+=Robot_Vel.Z * Sampling_Time; //The angular displacement about the Z axis, in rad //绕Z轴的角位移,单位:rad Robot_Pos.X+=(Robot_Vel.X * cos(Mpu6050_Data.imu_yaw)) * Sampling_Time; //Calculate the displacement in the X direction, unit: m //计算X方向的位移,单位:m Robot_Pos.Y+=(Robot_Vel.X * sin(Mpu6050_Data.imu_yaw)) * Sampling_Time; //Calculate the displacement in the Y direction, unit: m //计算Y方向的位移,单位:m //Robot_Pos.Z = 0 ; //Calculate the three-axis attitude from the IMU with the angular velocity around the three-axis and the three-axis acceleration //通过IMU绕三轴角速度与三轴加速度计算三轴姿态 Quaternion_Solution(Mpu6050.angular_velocity.x, Mpu6050.angular_velocity.y, Mpu6050.angular_velocity.z,\ Mpu6050.linear_acceleration.x, Mpu6050.linear_acceleration.y, Mpu6050.linear_acceleration.z); Publish_Odom(); //Pub the speedometer topic //发布里程计话题 Publish_ImuSensor(); //Pub the IMU topic //发布IMU话题 Publish_Voltage(); //Pub the topic of power supply voltage //发布电源电压话题 _Last_Time = _Now; //Record the time and use it to calculate the time interval //记录时间,用于计算时间间隔 } //自动回充数据话题 if(check_AutoCharge_data) { Publish_Charging(); //Pub a topic about whether the robot is charging //发布机器人是否在充电的话题 Publish_RED(); //Pub the topic whether the robot finds the infrared signal (charging station) //发布机器人是否寻找到红外信号(充电桩)的话题 Publish_ChargingCurrent(); //Pub the charging current topic //发布充电电流话题 check_AutoCharge_data = false; } rclcpp::spin_some(this->get_node_base_interface()); //The loop waits for the callback function //循环等待回调函数 } catch (const rclcpp::exceptions::RCLError & e ) { RCLCPP_ERROR(this->get_logger(),"unexpectedly failed whith %s",e.what()); } } } /************************************** Date: January 28, 2021 Function: Constructor, executed only once, for initialization 功能: 构造函数, 只执行次,用于初始化 ***************************************/ turn_on_robot::turn_on_robot():rclcpp::Node ("wheeltec_robot") { Sampling_Time=0; Power_voltage=0; //Clear the data //清空数据 memset(&Robot_Pos, 0, sizeof(Robot_Pos)); memset(&Robot_Vel, 0, sizeof(Robot_Vel)); memset(&Receive_Data, 0, sizeof(Receive_Data)); memset(&Send_Data, 0, sizeof(Send_Data)); memset(&Mpu6050_Data, 0, sizeof(Mpu6050_Data)); //ros::NodeHandle private_nh("~"); //Create a node handle //创建节点句柄 //The private_nh.param() entry parameter corresponds to the initial value of the name of the parameter variable on the parameter server //private_nh.param()入口参数分别对应:参数服务器上的名称 参数变量名 初始值 this->declare_parameter<int>("serial_baud_rate",115200); this->declare_parameter<std::string>("usart_port_name", "/dev/ttyACM0"); this->declare_parameter<std::string>("odom_frame_id", "odom_combined"); this->declare_parameter<std::string>("robot_frame_id", "base_footprint"); this->declare_parameter<std::string>("gyro_frame_id", "gyro_link"); this->get_parameter("serial_baud_rate", serial_baud_rate);//Communicate baud rate 115200 to the lower machine //和下位机通信波特率115200 this->get_parameter("usart_port_name", usart_port_name);//Fixed serial port number //固定串口号 this->get_parameter("odom_frame_id", odom_frame_id);//The odometer topic corresponds to the parent TF coordinate //里程计话题对应父TF坐标 this->get_parameter("robot_frame_id", robot_frame_id);//The odometer topic corresponds to sub-TF coordinates //里程计话题对应子TF坐标 this->get_parameter("gyro_frame_id", gyro_frame_id);//IMU topics correspond to TF coordinates //IMU话题对应TF坐标 odom_publisher = create_publisher<nav_msgs::msg::Odometry>("odom", 2);//Create the odometer topic publisher //创建里程计话题发布者 imu_publisher = create_publisher<sensor_msgs::msg::Imu>("imu/data_raw", 2); //Create an IMU topic publisher //创建IMU话题发布者 voltage_publisher = create_publisher<std_msgs::msg::Float32>("PowerVoltage", 1);//Create a battery-voltage topic publisher //创建电池电压话题发布者 //回充发布者 Charging_publisher = create_publisher<std_msgs::msg::Bool>("robot_charging_flag", 10); Charging_current_publisher = create_publisher<std_msgs::msg::Float32>("robot_charging_current", 10); RED_publisher = create_publisher<std_msgs::msg::UInt8>("robot_red_flag", 10); //回充订阅者 Red_Vel_Sub = create_subscription<geometry_msgs::msg::Twist>( "red_vel", 10, std::bind(&turn_on_robot::Red_Vel_Callback, this, std::placeholders::_1)); Recharge_Flag_Sub = create_subscription<std_msgs::msg::Int8>( "robot_recharge_flag", 10, std::bind(&turn_on_robot::Recharge_Flag_Callback, this,std::placeholders::_1)); //回充服务提供 SetCharge_Service=this->create_service<turtlesim::srv::Spawn>\ ("/set_charge",std::bind(&turn_on_robot::Set_Charge_Callback,this, std::placeholders::_1 ,std::placeholders::_2)); //Set the velocity control command callback function //速度控制命令订阅回调函数设置 Cmd_Vel_Sub = create_subscription<geometry_msgs::msg::Twist>( "cmd_vel", 2, std::bind(&turn_on_robot::Cmd_Vel_Callback, this, _1)); RCLCPP_INFO(this->get_logger(),"wheeltec_robot Data ready"); //Prompt message //提示信息 try { //Attempts to initialize and open the serial port //尝试初始化与开启串口 Stm32_Serial.setPort(usart_port_name); //Select the serial port number to enable //选择要开启的串口号 Stm32_Serial.setBaudrate(serial_baud_rate); //Set the baud rate //设置波特率 serial::Timeout _time = serial::Timeout::simpleTimeout(2000); //Timeout //超时等待 Stm32_Serial.setTimeout(_time); Stm32_Serial.open(); //Open the serial port //开启串口 } catch (serial::IOException& e) { RCLCPP_ERROR(this->get_logger(),"wheeltec_robot can not open serial port,Please check the serial port cable! "); //If opening the serial port fails, an error message is printed //如果开启串口失败,打印错误信息 } if(Stm32_Serial.isOpen()) { RCLCPP_INFO(this->get_logger(),"wheeltec_robot serial port opened"); //Serial port opened successfully //串口开启成功提示 } } /************************************** Date: January 28, 2021 Function: Destructor, executed only once and called by the system when an object ends its life cycle 功能: 析构函数,只执行次,当对象结束其生命周期时系统会调用这个函数 ***************************************/ turn_on_robot::~turn_on_robot() { //Sends the stop motion command to the lower machine before the turn_on_robot object ends //对象turn_on_robot结束前向下位机发送停止运动命令 Send_Data.tx[0]=0x06; Send_Data.tx[1] = FRAME_HEADER; Send_Data.tx[2] = 0; //The target velocity of the X-axis of the robot //机器人X轴的目标线速度 Send_Data.tx[4] = 0; Send_Data.tx[3] = 0; //The target velocity of the Y-axis of the robot //机器人Y轴的目标线速度 Send_Data.tx[6] = 0; Send_Data.tx[5] = 0; //The target velocity of the Z-axis of the robot //机器人Z轴的目标角速度 Send_Data.tx[8] = 0; Send_Data.tx[7] = 0; Send_Data.tx[9]=Check_Sum(9,SEND_DATA_CHECK); //Check the bits for the Check_Sum function //校验位,规则参见Check_Sum函数 Send_Data.tx[10]=0x0d; Send_Data.tx[11]=0x0a; try { Stm32_Serial.write(Send_Data.tx,sizeof (Send_Data.tx)); //Send data to the serial port //向串口发数据 } catch (serial::IOException& e) { RCLCPP_ERROR(this->get_logger(),"Unable to send data through serial port"); //If sending data fails, an error message is printed //如果发送数据失败,打印错误信息 } Stm32_Serial.close(); //Close the serial port //关闭串口 RCLCPP_INFO(this->get_logger(),"Shutting down"); //Prompt message //提示信息 } turn_on_wheeltec_robot.launch.py文件代码为: import os from pathlib import Path import launch from launch.actions import SetEnvironmentVariable from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.actions import (DeclareLaunchArgument, GroupAction, IncludeLaunchDescription, SetEnvironmentVariable) from launch.launch_description_sources import PythonLaunchDescriptionSource from launch.substitutions import LaunchConfiguration, PythonExpression from launch_ros.actions import PushRosNamespace import launch_ros.actions from launch.conditions import IfCondition from launch.conditions import UnlessCondition def generate_launch_description(): # Get the launch directory bringup_dir = get_package_share_directory('turn_on_wheeltec_robot') launch_dir = os.path.join(bringup_dir, 'launch') ekf_config = Path(get_package_share_directory('turn_on_wheeltec_robot'), 'config', 'ekf.yaml') ekf_carto_config = Path(get_package_share_directory('turn_on_wheeltec_robot'), 'config', 'ekf_carto.yaml') imu_config = Path(get_package_share_directory('turn_on_wheeltec_robot'), 'config', 'imu.yaml') carto_slam = LaunchConfiguration('carto_slam', default='false') carto_slam_dec = DeclareLaunchArgument('carto_slam',default_value='false') wheeltec_robot = IncludeLaunchDescription( PythonLaunchDescriptionSource(os.path.join(launch_dir, 'base_serial.launch.py')), ) robot_ekf = IncludeLaunchDescription( PythonLaunchDescriptionSource(os.path.join(launch_dir, 'wheeltec_ekf.launch.py')), launch_arguments={'carto_slam':carto_slam}.items(), ) base_to_link = launch_ros.actions.Node( package='tf2_ros', executable='static_transform_publisher', name='base_to_link', arguments=['0', '0', '0','0', '0','0','base_footprint','base_link'], ) base_to_gyro = launch_ros.actions.Node( package='tf2_ros', executable='static_transform_publisher', name='base_to_gyro', arguments=['0', '0', '0','0', '0','0','base_link','gyro_link'], ) imu_filter_node = launch_ros.actions.Node( package='imu_filter_madgwick', executable='imu_filter_madgwick_node', parameters=[imu_config] ) # joint_state_publisher_node = launch_ros.actions.Node( # package='joint_state_publisher', # executable='joint_state_publisher', # name='joint_state_publisher', # ) #select a robot model,the default model is mini_mec #minibot.launch.py contains commonly used robot models #launch_arguments choices:mini_mec/mini_akm/mini_tank/mini_4wd/mini_diff/mini_omni/brushless_senior_diff #!!!At the same time, you need to modify ld.add_action(minibot_type) and #ld.add_action(flagship_type) minibot_type = IncludeLaunchDescription( PythonLaunchDescriptionSource(os.path.join(launch_dir, 'robot_mode_description_minibot.launch.py')), launch_arguments={'bike_robot': 'true'}.items(), ) #robot_mode_description.launch.py contains flagship products, usually larger chassis robots #launch_arguments choices: #senior_akm/top_akm_bs/top_akm_dl #senior_mec_bs/senior_mec_dl/top_mec_bs/top_mec_dl/ mec_EightDrive_robot/flagship_mec_bs_robot/flagship_mec_dl_robot�� #senior_omni/top_omni #senior_4wd_bs_robot/senior_4wd_dl_robot/flagship_4wd_bs_robot/flagship_4wd_dl_robot/top_4wd_bs_robot/top_4wd_dl_robot #senior_diff_robot/four_wheel_diff_bs/four_wheel_diff_dl/flagship_four_wheel_diff_bs_robot/flagship_four_wheel_diff_dl_robot #!!!At the same time, you need to modify ld.add_action(flagship_type) and #ld.add_action(minibot_type) flagship_type = IncludeLaunchDescription( PythonLaunchDescriptionSource(os.path.join(launch_dir, 'robot_mode_description.launch.py')), launch_arguments={'senior_akm': 'true'}.items(), ) ld = LaunchDescription() ld.add_action(minibot_type) #ld.add_action(flagship_type) ld.add_action(carto_slam_dec) ld.add_action(wheeltec_robot) ld.add_action(base_to_link) ld.add_action(base_to_gyro) # ld.add_action(joint_state_publisher_node) ld.add_action(imu_filter_node) ld.add_action(robot_ekf) return ld base_serial.launch.py文件代码为: from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch.substitutions import LaunchConfiguration from launch.conditions import IfCondition from launch.conditions import UnlessCondition import launch_ros.actions #def launch(launch_descriptor, argv): def generate_launch_description(): return LaunchDescription([ launch_ros.actions.Node( package='turn_on_wheeltec_robot', executable='wheeltec_robot_node', output='screen', parameters=[{'usart_port_name': '/dev/ttyACM0', 'serial_baud_rate':115200, 'robot_frame_id': 'base_footprint', 'odom_frame_id': 'odom_combined', 'cmd_vel': 'cmd_vel',}], ) ]) robot_mode_description_minibot.launch.py文件代码为: import os from ament_index_python.packages import get_package_share_directory import launch_ros.actions from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression from launch_ros.actions import LoadComposableNodes from launch_ros.actions import Node from launch_ros.descriptions import ComposableNode from nav2_common.launch import RewrittenYaml def generate_robot_node(robot_urdf,child): return launch_ros.actions.Node( package='robot_state_publisher', executable='robot_state_publisher', name=f'robot_state_publisher_{child}', arguments=[os.path.join(get_package_share_directory('wheeltec_robot_urdf'), 'urdf', robot_urdf)], ) def generate_static_transform_publisher_node(translation, rotation, parent, child): return launch_ros.actions.Node( package='tf2_ros', executable='static_transform_publisher', name=f'base_to_{child}', arguments=[translation[0], translation[1], translation[2], rotation[0], rotation[1], rotation[2], parent, child], ) def generate_launch_description(): bike_robot = LaunchConfiguration('bike_robot', default='false') bike_robot_ = GroupAction( condition=IfCondition(bike_robot), actions=[ generate_robot_node('xuan_bike_robot.urdf','bike_robot'), generate_static_transform_publisher_node(['0.048', '0', '0.18'], ['0', '0', '0'], 'base_link', 'laser'), generate_static_transform_publisher_node(['0.048', '0', '0.18'], ['0', '0', '0'], 'base_link', 'camera_link'), ]) # Create the launch description and populate ld = LaunchDescription() # Set environment variables # Declare the launch options #ld.add_action(declare_use_composition_cmd) # Add the actions to launch all of the localiztion nodes ld.add_action(mini_mec_) ld.add_action(mini_akm_) ld.add_action(mini_tank_) ld.add_action(mini_4wd_) ld.add_action(mini_diff_) ld.add_action(brushless_senior_diff_) ld.add_action(bike_robot_) return ld xuan_bike_robot.urdf文件代码为: <?xml version="1.0"?> <robot name="wheeltec_robot"> <link name="base_link"> <visual> <geometry> <mesh filename="file:///home/deepbot/ros-relate/wheeltec_ros2/src/wheeltec_robot_urdf/wheeltec_robot_urdf/meshes/Xuan-release.stl"scale="0.001 0.001 0.001"/> </geometry> <origin xyz="0 0 0" rpy="0 0 0"/> <material name="blue"> <color rgba="0 0 0.8 0.5"/> </material> </visual> </link> </robot>
05-14
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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值