diff --git a/include/sweet_webots_robot/PathVisualizer.hpp b/include/sweet_webots_robot/PathVisualizer.hpp index 03b9a73..3c3021c 100644 --- a/include/sweet_webots_robot/PathVisualizer.hpp +++ b/include/sweet_webots_robot/PathVisualizer.hpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "geometry_msgs/msg/twist.hpp" #include "rclcpp/rclcpp.hpp" #include "nav_msgs/msg/odometry.hpp" @@ -58,8 +59,9 @@ private: // 定位订阅 rclcpp::Subscription::SharedPtr odom_sub_; rclcpp::TimerBase::SharedPtr timer_; - // - std::unique_ptr tf_broadcaster_; + + // 坐标转换broadcaster + std::unique_ptr tf_broadcaster_; // odom -> baselink private: // odom path info diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..87d37b0 --- /dev/null +++ b/readme.md @@ -0,0 +1,13 @@ +/***************************Webots simulation*************************/ +This repository contains the simulation code based on Webots2023a. +And it is communcatied by ros2 foxy, visualized by rviz2. + +Package name: sweet_webots_robot +Communication Schematic diagram: + ![通信示意图](./src/sweet_webots_robot/whiteboard_exported_image.png) +1. rm -rf build install log +2. colcon build +3. source install/setup.bash +4. ros2 launch sweet_webots_robot sweet_webots_robot.launch.py +5. ros2 run sweet_webots_robot path_visualizer + diff --git a/src/PathVisualizer.cpp b/src/PathVisualizer.cpp index ad90b61..9ad2f5f 100644 --- a/src/PathVisualizer.cpp +++ b/src/PathVisualizer.cpp @@ -639,9 +639,6 @@ void PathVisualizer::publishVehicleTF() tf_broadcaster_->sendTransform(transform); } -#include -#include -#include void PathVisualizer::densifyPath(double interval) { diff --git a/whiteboard_exported_image.png b/whiteboard_exported_image.png new file mode 100644 index 0000000..9d581e3 Binary files /dev/null and b/whiteboard_exported_image.png differ