@3508827352 你好,我也遇到了和你一样的问题,colcon build失败,请问您解决了吗
重要提示
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
2693226252 发布的最新帖子
-
RE: dashing版安装navigation2报错rosdepc还有colcon build
-
在第11章Nav2导航仿真实战 的入门篇使用fishbot进行自主导航的这一节,编译fishbot_navigation2功能包的时候出现下边这个错误
在第11章Nav2导航仿真实战 的入门篇使用fishbot进行自主导航的这一节,编译fishbot_navigation2功能包的时候出现下边这个错误
WARNING:colcon.colcon_core.package_identification:Failed to parse ROS package manifest in 'fishbot_navigation2': Error(s) in package 'fishbot_navigation2/package.xml':
Error(s):- The generic dependency on 'nav2_bringup' is redundant with: exec_depend
……
--- stderr: nav2_util
CMake Error at test/CMakeLists.txt:7 (find_package):
By not providing "Findtest_msgs.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"test_msgs", but CMake did not find one.
求助求助怎么解决
- The generic dependency on 'nav2_bringup' is redundant with: exec_depend
-
RE: 第九章第四节没有node和topic节点,没有插件订阅的的/cmd_vel和发布的/odom
@小鱼 鱼哥,我用的是humble版本,跟着教程做的,用ros2 node list 输出只有gazebo ,运行指令ros2 topic list 输出没有/cmd_vel和/odom
-
ID问题
鱼哥,我驱动雷达驱动板和主控板的时候OLED屏幕上显示的板子的IP是192.168.137.30
但是我的虚拟机的IP是192.168.3.142
可以正常进行进行烧录和配置,但是这种情况是不是两者之间不能ping通 -
建图前的准备2 发布odom的TF
ros2 run fishbot_bringup fishbot_bringup
运行该指令之后没有输出(全部按照教程进行)fishbot_bringup.cpp 代码
#include <rclcpp/rclcpp.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <tf2/utils.h>
#include <tf2_ros/transform_broadcaster.h>class TopicSubscribe01 : public rclcpp::Node
{
public:
TopicSubscribe01(std::string name) : Node(name)
{
// 创建一个订阅者,订阅"odom"话题的nav_msgs::msg::Odometry类型消息
odom_subscribe_ = this->create_subscription<nav_msgs::msg::Odometry>(
"odom", rclcpp::SensorDataQoS(),
std::bind(&TopicSubscribe01::odom_callback, this, std::placeholders::1));
// 创建一个tf2_ros::TransformBroadcaster用于广播坐标变换
tf_broadcaster = std::make_unique<tf2_ros::TransformBroadcaster>(this);
}private:
rclcpp::Subscription<nav_msgs::msg::Odometry>::SharedPtr odom_subscribe_;
std::unique_ptr<tf2_ros::TransformBroadcaster> tf_broadcaster_;
nav_msgs::msg::Odometry odom_msg_;// 回调函数,处理接收到的odom消息
void odom_callback(const nav_msgs::msg::Odometry::SharedPtr msg)
{
(void)msg;
RCLCPP_INFO(this->get_logger(), "接收到里程计信息->底盘坐标系 tf :(%f,%f)",
msg->pose.pose.position.x, msg->pose.pose.position.y)
// 更新odom_msg_的姿态信息
odom_msg_.pose.pose.position.x = msg->pose.pose.position.x;
odom_msg_.pose.pose.position.y = msg->pose.pose.position.y;
odom_msg_.pose.pose.position.z = msg->pose.pose.position.z;
odom_msg_.pose.pose.orientation.x = msg->pose.pose.orientation.x;
odom_msg_.pose.pose.orientation.y = msg->pose.pose.orientation.y;
odom_msg_.pose.pose.orientation.z = msg->pose.pose.orientation.z;
odom_msg_.pose.pose.orientation.w = msg->pose.pose.orientation.w;
};public:
// 发布坐标变换信息
void publish_tf()
{
geometry_msgs::msg::TransformStamped transform;
double seconds = this->now().seconds();
transform.header.stamp = rclcpp::Time(static_cast<uint64_t>(seconds * 1e9));
transform.header.frame_id = "odom";
transform.child_frame_id = "base_footprint";
transform.transform.translation.x = odom_msg_.pose.pose.position.x;
transform.transform.translation.y = odom_msg_.pose.pose.position.y;
transform.transform.translation.z = odom_msg_.pose.pose.position.z;
transform.transform.rotation.x = odom_msg_.pose.pose.orientation.x;
transform.transform.rotation.y = odom_msg_.pose.pose.orientation.y;
transform.transform.rotation.z = odom_msg_.pose.pose.orientation.z;
transform.transform.rotation.w = odom_msg_.pose.pose.orientation.w;
// 广播坐标变换信息
tf_broadcaster_->sendTransform(transform);
}
};int main(int argc, char **argv)
{
// 初始化ROS节点
rclcpp::init(argc, argv);// 创建一个TopicSubscribe01节点
auto node = std::make_shared<TopicSubscribe01>("fishbot_bringup");// 设置循环频率
rclcpp::WallRate loop_rate(20.0);
while (rclcpp::ok())
{
// 处理回调函数
rclcpp::spin_some(node);
// 发布坐标变换信息
node->publish_tf();
// 控制循环频率
loop_rate.sleep();
}
// 关闭ROS节点
rclcpp::shutdown();
return 0;
}CMakeLists.txt 代码
cmake_minimum_required(VERSION 3.8)
project(fishbot_bringup)if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
#find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)set(dependencies
rclcpp
geometry_msgs
nav_msgs
tf2
tf2_ros
)#uncomment the following section in order to fill in
#further dependencies manually.
#find_package(<dependency> REQUIRED)add_executable(fishbot_bringup src/fishbot_bringup.cpp)
target_include_directories(fishbot_bringup PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_compile_features(fishbot_bringup PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17ament_target_dependencies(fishbot_bringup
${dependencies}
)
install(TARGETS fishbot_bringup
DESTINATION lib/${PROJECT_NAME})if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
#the following line skips the linter which checks for copyrights
#comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
#the following line skips cpplint (only works in a git repo)
#comment the line when this package is in a git repo and when
#a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()ament_package()