初学ROS2, 很多命令背不住,常用到的放一起备查备忘
用小鱼的一键安装:
wget http://fishros.com/install -O fishros && . Fishros
colcon build --packages-select packageName
ros2 pkg list | grep navigation2
rosdep install --from-paths src --ignore-src -r -y
cd ~/dev_ws/src
ros2 pkg create --build-type ament_python package_name
or
ros2 pkg create --build-type ament_cmake package_name
ros2 node info node_name
ros2 run tf2_tools view_frames
(save to a pdf file)
ros2 run tf2_ros static_transform_publisher 0.58 0 0.58 0 0 0 base_link laser_link
ros2 run tf2_ros static_transform_publisher 0 0 0.01 0 0 0 base_footprint base_link
ros2 run tf2_ros tf2_echo [reference_frame] [target_frame]
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
ld = LaunchDescription()
node = Node(package = "tf2_ros",
executable = "static_transform_publisher",
arguments = ["0 0 0 0 0 0 odom laser"])
ld.add_action(node)
return ld
ros2 topic list
ros2 topic info /tf_static
ros2 topic echo topicname
$ ros2 topic echo /velodyne_points --field header
ros2 bag record -a
-a means all topics
ros2 topic pub --once topic_name topic_type "{ var1 : value1, var2 : value2}"
–once 表示发布一次,–rate 1 表示每秒发一次
ros2 service call service_name service_type "{var:value}"
e.g.
ros2 service call /lifecycle_manager_navigation/is_active std_srvs/srv/Trigger “{timeout:3}”
查询Navigation服务是否active状态,参数设置为3秒超时
ros2 param set <node_name> <parameter_name> <value>
ros2 param get <node_name> <parameter_name>
ros2 param dump <node_name>
ros2 run <package_name> <executable_name> --ros-args --params-file <file_name>
ros2 action list
ros2 action list -t
ros2 action info action_name
ros2 interface show turtlesim/action/RotateAbsolute.action
ros2 action send_goal <action_name> <action_type> <values>
cp /opt/ros/ROS_DISTRO/share/nav2_bringup/params/nav2_params.yaml src/fishbot_navigation2/config
ros2 launch slam_toolbox online_async_launch.py
ros2 run nav2_map_server map_saver_cli -t map -f filename
ros2 run teleop_twist_keyboard teleop_twist_keyboard
ros2 interface list
ros2 interface show interface_name
ros2 interface proto interface_name
ros2 interface package package_name
ros2 interface packaes interface_name
rqt
sudo dpkg -i Sxssw.deb
or
sudo apt-get install ./tx4.deb
ros2 node list
killall <node_name_from_nodes_list>
——————————
需要500关注,拜托点个关注,谢谢