经测试:win10系统需要在X64 native tools command prompt for VS里面运行!
第一步 先设置环境
打开X64 native tools command prompt for VS,call C:\opt\ros\foxy\x64\local_setup.bat
第二步
运行ros2 run turtlesim turtlesim_node
会弹出小乌龟窗口
第三部 新开一个 native tools command prompt for VS
call C:\opt\ros\foxy\x64\local_setup.bat
ros2 run turtlesim turtle_teleop_key
保持此窗口为活动窗口,移动方向键,小乌龟就会移动起来!