怎么解决 _DeprecatedConfig: Deprecated config in `setup.cfg`
时间: 2024-06-07 15:09:30 浏览: 18
_DeprecatedConfig: Deprecated config in `setup.cfg` 表示你的 setup.cfg 文件中存在已经被弃用的配置项。通常这是由于你使用了过时的配置项或者已经被移除的配置项所导致的。为了解决这个问题,你需要查看 setup.cfg 文件中的相关配置项,并将其替换成新的配置项或者删除它。
你可以查阅官方文档或者相关的社区讨论来了解最新的配置选项。如果你不确定哪些配置项是过时的,你可以通过在命令行中运行 `python -m pip check` 来检查你的项目中是否存在过时的依赖项和配置项。在进行更新之前,建议先备份你的 setup.cfg 文件以防万一。
相关问题
WARNING:tensorflow:From E:\anaconda\envs\tensorflow1\lib\site-packages\tensorflow_core\python\compat\v2_compat.py:68: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term WARNING:tensorflow:From test.py:167: start_queue_runners (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
这些警告是因为你正在使用的 TensorFlow 版本中的一些功能已被弃用,并且在将来的版本中将被移除。具体来说,两个警告分别是:
1. `disable_resource_variables` 被弃用警告:这是因为 TensorFlow 将不再支持非资源变量(non-resource variables),并且建议在未来的代码中使用资源变量(resource variables)。你可以尝试更新你的代码,以适应 TensorFlow 的新版本。参考 TensorFlow 的文档,了解如何迁移代码以适应新的资源变量机制。
2. `start_queue_runners` 被弃用警告:这是因为在将来的 TensorFlow 版本中,`start_queue_runners` 将被移除。相反,建议使用 `tf.compat.v1.train.start_queue_runners`。你可以通过更新代码来解决这个问题。
在处理这些警告时,可以考虑以下几点:
- 确保你正在使用的 TensorFlow 版本与代码兼容。
- 更新代码以适应最新版本的 TensorFlow API。
- 查阅 TensorFlow 的官方文档,以了解如何迁移代码以适应新的 API 变化。
如果你需要更具体的帮助,请提供更多的上下文和代码细节。
给下列程序添加注释:void DWAPlannerROS::initialize( std::string name, tf2_ros::Buffer* tf, costmap_2d::Costmap2DROS* costmap_ros) { if (! isInitialized()) { ros::NodeHandle private_nh("~/" + name); g_plan_pub_ = private_nh.advertise<nav_msgs::Path>("global_plan", 1); l_plan_pub_ = private_nh.advertise<nav_msgs::Path>("local_plan", 1); tf_ = tf; costmap_ros_ = costmap_ros; costmap_ros_->getRobotPose(current_pose_); // make sure to update the costmap we'll use for this cycle costmap_2d::Costmap2D* costmap = costmap_ros_->getCostmap(); planner_util_.initialize(tf, costmap, costmap_ros_->getGlobalFrameID()); //create the actual planner that we'll use.. it'll configure itself from the parameter server dp_ = boost::shared_ptr<DWAPlanner>(new DWAPlanner(name, &planner_util_)); if( private_nh.getParam( "odom_topic", odom_topic_ )) { odom_helper_.setOdomTopic( odom_topic_ ); } initialized_ = true; // Warn about deprecated parameters -- remove this block in N-turtle nav_core::warnRenamedParameter(private_nh, "max_vel_trans", "max_trans_vel"); nav_core::warnRenamedParameter(private_nh, "min_vel_trans", "min_trans_vel"); nav_core::warnRenamedParameter(private_nh, "max_vel_theta", "max_rot_vel"); nav_core::warnRenamedParameter(private_nh, "min_vel_theta", "min_rot_vel"); nav_core::warnRenamedParameter(private_nh, "acc_lim_trans", "acc_limit_trans"); nav_core::warnRenamedParameter(private_nh, "theta_stopped_vel", "rot_stopped_vel"); dsrv_ = new dynamic_reconfigure::Server<DWAPlannerConfig>(private_nh); dynamic_reconfigure::Server<DWAPlannerConfig>::CallbackType cb = boost::bind(&DWAPlannerROS::reconfigureCB, this, _1, 2); dsrv->setCallback(cb); } else{ ROS_WARN("This planner has already been initialized, doing nothing."); } }
/**
* @brief 初始化DWAPlannerROS的函数
*
* @param name: 节点名字
* @param tf: tf2_ros::Buffer类型指针,用于获取tf信息
* @param costmap_ros: costmap_2d::Costmap2DROS类型指针,用于获取costmap信息
*/
void DWAPlannerROS::initialize(std::string name, tf2_ros::Buffer* tf, costmap_2d::Costmap2DROS* costmap_ros) {
// 判断是否已经初始化
if (!isInitialized()) {
// 创建私有命名空间
ros::NodeHandle private_nh("~/" + name);
// 创建两个Publisher,用于发布全局规划和局部规划
g_plan_pub_ = private_nh.advertise<nav_msgs::Path>("global_plan", 1);
l_plan_pub_ = private_nh.advertise<nav_msgs::Path>("local_plan", 1);
// 获取tf信息和costmap信息
tf_ = tf;
costmap_ros_ = costmap_ros;
costmap_ros_->getRobotPose(current_pose_);
// 更新costmap
costmap_2d::Costmap2D* costmap = costmap_ros_->getCostmap();
// 初始化planner_util_
planner_util_.initialize(tf, costmap, costmap_ros_->getGlobalFrameID());
// 创建DWAPlanner对象,从参数服务器上获取参数
dp_ = boost::shared_ptr<DWAPlanner>(new DWAPlanner(name, &planner_util_));
if (private_nh.getParam("odom_topic", odom_topic_)) {
odom_helper_.setOdomTopic(odom_topic_);
}
// 设置initialized_为true
initialized_ = true;
// 警告已经被弃用的参数
nav_core::warnRenamedParameter(private_nh, "max_vel_trans", "max_trans_vel");
nav_core::warnRenamedParameter(private_nh, "min_vel_trans", "min_trans_vel");
nav_core::warnRenamedParameter(private_nh, "max_vel_theta", "max_rot_vel");
nav_core::warnRenamedParameter(private_nh, "min_vel_theta", "min_rot_vel");
nav_core::warnRenamedParameter(private_nh, "acc_lim_trans", "acc_limit_trans");
nav_core::warnRenamedParameter(private_nh, "theta_stopped_vel", "rot_stopped_vel");
// 创建dynamic_reconfigure::Server对象,用于动态参数配置
dsrv_ = new dynamic_reconfigure::Server<DWAPlannerConfig>(private_nh);
dynamic_reconfigure::Server<DWAPlannerConfig>::CallbackType cb = boost::bind(&DWAPlannerROS::reconfigureCB, this, _1, 2);
dsrv_->setCallback(cb);
} else {
// 如果已经初始化,输出警告信息
ROS_WARN("This planner has already been initialized, doing nothing.");
}
}
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)