之前看教程有安装了ros2 foxy的东西
然后会有bash找不到文件夹,就在文件中ctrl+h打开隐藏的文件,进入.bashrc 把foxy修改为humble
输入
ros2
出现
ommands:
action Various action related sub-commands
bag Various rosbag related sub-commands
component Various component related sub-commands
daemon Various daemon related sub-commands
doctor Check ROS setup and other potential issues
interface Show information about ROS interfaces
launch Run a launch file
lifecycle Various lifecycle related sub-commands
multicast Various multicast related sub-commands
node Various node related sub-commands
param Various param related sub-commands
pkg Various package related sub-commands
run Run a package specific executable
security Various security related sub-commands
service Various service related sub-commands
topic Various topic related sub-commands
wtf Use `wtf` as alias to `doctor`
Call `ros2 <command> -h` for more detailed usage.
输入
ros2 pkg executables turtlesim
出现turtlesim draw_square
turtlesim mimic
turtlesim turtle_teleop_key
turtlesim turtlesim_node
再输入
ros2 run turtlesim turtlesim_node
出现蓝色屏幕有海龟即可