프로그래밍/ROS

[ROS2] 버전 확인 , 터미네이터 설치

복습 2024. 10. 5. 14:12
728x90

우분투 22.04

humble

 

1. ros 버전 확인 

 ~$ cd /opt/ros
 /opt/ros$ ls
humble

 

/opt/ros/humble$ source /opt/ros/humble/setup.bash

 

~$ ros2
usage: ros2 [-h] [--use-python-default-buffering]
            Call `ros2 <command> -h` for more detailed usage. ...

ros2 is an extensible command-line tool for ROS 2.

options:
  -h, --help            show this help message and exit
  --use-python-default-buffering
                        Do not force line buffering in stdout and instead use the python default
                        buffering, which might be affected by PYTHONUNBUFFERED/-u and depends on
                        whatever stdout is interactive or not

Commands:
  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.

 

 

2. ros2 동작 확인

ye2202@ye2202-HP-Laptop-14s-fq0xxx:~$ ros2 run demo_nodes_cpp talker
[INFO] [1727762716.628393598] [talker]: Publishing: 'Hello World: 1'
[INFO] [1727762717.628442851] [talker]: Publishing: 'Hello World: 2'
[INFO] [1727762718.628505382] [talker]: Publishing: 'Hello World: 3'
[INFO] [1727762719.628500458] [talker]: Publishing: 'Hello World: 4'

ye2202@ye2202-HP-Laptop-14s-fq0xxx:~$ ros2 run demo_nodes_cpp listener
[INFO] [1727762769.630034020] [listener]: I heard: [Hello World: 54]
[INFO] [1727762770.629881866] [listener]: I heard: [Hello World: 55]
[INFO] [1727762771.629972303] [listener]: I heard: [Hello World: 56]
[INFO] [1727762772.629883763] [listener]: I heard: [Hello World: 57]

 

 

3. bashrc 파일 수정 

$ vi ~/.bashrc

source /opt/ros/humble/setup.bash

 

 

 

4. ros2 작업 폴더 만들기 

~$ mkdir -p ros2_ws/src

 

다른 ros 도메인과의 충돌 및 연결을 피하기 위해 도메인 아이디 설정 필요 . 

ros 작업 공간에 들어가는 명령어를 만들기는 했는데 별로 사용하지는 않을 듯. 

ye2202@ye2202-HP-Laptop-14s-fq0xxx:~$ export ROS_DOMAIN_ID=30
ye2202@ye2202-HP-Laptop-14s-fq0xxx:~$ echo $ROS_DOMAIN_ID
30
ye2202@ye2202-HP-Laptop-14s-fq0xxx:~$ alias cw='cd ~/robot_ws'

 

5. ros 패키지 확인 

ye2202@ye2202-HP-Laptop-14s-fq0xxx:~$ ros2 pkg list
action_msgs
action_tutorials_cpp
action_tutorials_interfaces
action_tutorials_py
actionlib_msgs
ament_cmake
ament_cmake_auto
ament_cmake_copyright
ament_cmake_core
ament_cmake_cppcheck
ament_cmake_cpplint
ament_cmake_export_definitions
ament_cmake_export_dependencies
ament_cmake_export_include_directories
ament_cmake_export_interfaces
ament_cmake_export_libraries
ament_cmake_export_link_flags
ament_cmake_export_targets
ament_cmake_flake8
ament_cmake_gen_version_h
ament_cmake_gmock
ament_cmake_gtest
ament_cmake_include_directories
ament_cmake_libraries
ament_cmake_lint_cmake
ament_cmake_pep257
ament_cmake_pytest
ament_cmake_python
ament_cmake_ros
ament_cmake_target_dependencies
ament_cmake_test
ament_cmake_uncrustify
ament_cmake_version
ament_cmake_xmllint
ament_copyright
ament_cppcheck
ament_cpplint
ament_flake8
ament_index_cpp
ament_index_python
ament_lint
ament_lint_auto
ament_lint_cmake
ament_lint_common
ament_package
ament_pep257
ament_uncrustify
ament_xmllint
angles
builtin_interfaces
class_loader
common_interfaces
composition
composition_interfaces
console_bridge_vendor
cv_bridge
demo_nodes_cpp
demo_nodes_cpp_native
demo_nodes_py
depthimage_to_laserscan
desktop
diagnostic_msgs
domain_coordinator
dummy_map_server
dummy_robot_bringup
dummy_sensors
eigen3_cmake_module
example_interfaces
examples_rclcpp_minimal_action_client
examples_rclcpp_minimal_action_server
examples_rclcpp_minimal_client
examples_rclcpp_minimal_composition
examples_rclcpp_minimal_publisher
examples_rclcpp_minimal_service
examples_rclcpp_minimal_subscriber
examples_rclcpp_minimal_timer
examples_rclcpp_multithreaded_executor
examples_rclpy_executors
examples_rclpy_minimal_action_client
examples_rclpy_minimal_action_server
examples_rclpy_minimal_client
examples_rclpy_minimal_publisher
examples_rclpy_minimal_service
examples_rclpy_minimal_subscriber
fastrtps_cmake_module
geometry2
geometry_msgs
image_geometry
image_tools
image_transport
interactive_markers
intra_process_demo
joy
kdl_parser
keyboard_handler
laser_geometry
launch
launch_ros
launch_testing
launch_testing_ament_cmake
launch_testing_ros
launch_xml
launch_yaml
libcurl_vendor
libstatistics_collector
libyaml_vendor
lifecycle
lifecycle_msgs
logging_demo
map_msgs
message_filters
nav_msgs
orocos_kdl_vendor
osrf_pycommon
pcl_conversions
pcl_msgs
pendulum_control
pendulum_msgs
pluginlib
pybind11_vendor
python_cmake_module
python_qt_binding
qt_dotgraph
qt_gui
qt_gui_cpp
qt_gui_py_common
quality_of_service_demo_cpp
quality_of_service_demo_py
rcl
rcl_action
rcl_interfaces
rcl_lifecycle
rcl_logging_interface
rcl_logging_spdlog
rcl_yaml_param_parser
rclcpp
rclcpp_action
rclcpp_components
rclcpp_lifecycle
rclpy
rcpputils
rcutils
resource_retriever
rmw
rmw_dds_common
rmw_fastrtps_cpp
rmw_fastrtps_shared_cpp
rmw_implementation
rmw_implementation_cmake
robot_state_publisher
ros2action
ros2bag
ros2cli
ros2cli_common_extensions
ros2component
ros2doctor
ros2interface
ros2launch
ros2lifecycle
ros2multicast
ros2node
ros2param
ros2pkg
ros2run
ros2service
ros2topic
ros_base
ros_core
ros_environment
ros_workspace
rosbag2
rosbag2_compression
rosbag2_compression_zstd
rosbag2_cpp
rosbag2_interfaces
rosbag2_py
rosbag2_storage
rosbag2_storage_default_plugins
rosbag2_transport
rosgraph_msgs
rosidl_adapter
rosidl_cli
rosidl_cmake
rosidl_default_generators
rosidl_default_runtime
rosidl_generator_c
rosidl_generator_cpp
rosidl_generator_py
rosidl_parser
rosidl_runtime_c
rosidl_runtime_cpp
rosidl_runtime_py
rosidl_typesupport_c
rosidl_typesupport_cpp
rosidl_typesupport_fastrtps_c
rosidl_typesupport_fastrtps_cpp
rosidl_typesupport_interface
rosidl_typesupport_introspection_c
rosidl_typesupport_introspection_cpp
rpyutils
rqt_action
rqt_bag
rqt_bag_plugins
rqt_common_plugins
rqt_console
rqt_graph
rqt_gui
rqt_gui_cpp
rqt_gui_py
rqt_image_view
rqt_msg
rqt_plot
rqt_publisher
rqt_py_common
rqt_py_console
rqt_reconfigure
rqt_service_caller
rqt_shell
rqt_srv
rqt_topic
rttest
rviz2
rviz_assimp_vendor
rviz_common
rviz_default_plugins
rviz_ogre_vendor
rviz_rendering
sdl2_vendor
sensor_msgs
sensor_msgs_py
shape_msgs
shared_queues_vendor
spdlog_vendor
sqlite3_vendor
sros2
sros2_cmake
statistics_msgs
std_msgs
std_srvs
stereo_msgs
tango_icons_vendor
teleop_twist_joy
teleop_twist_keyboard
tf2
tf2_bullet
tf2_eigen
tf2_eigen_kdl
tf2_geometry_msgs
tf2_kdl
tf2_msgs
tf2_py
tf2_ros
tf2_ros_py
tf2_sensor_msgs
tf2_tools
tinyxml2_vendor
tinyxml_vendor
tlsf
tlsf_cpp
topic_monitor
tracetools
trajectory_msgs
turtlesim
uncrustify_vendor
unique_identifier_msgs
urdf
urdf_parser_plugin
visualization_msgs
yaml_cpp_vendor
zstd_vendor

 

만약 패키지가 추가되지 않는다면, 혹은 워크스페이스가 추가되지 않는다면 아래 글을 참고한다. 

https://brush-up.tistory.com/320

 

[ROS2] package not found searching '/opt/ros/humble'

$ colcon build후 발생하는 아래와 같은 문제..  package not found searching '/opt/ros/humble'package not found searching '/opt/ros/foxy' 이런 오류.. 해결방법..  $ cd /path/to/workspace_root/##e.g ~/ros2_ws/$ colcon build $ s

brush-up.tistory.com

 

 

 

6. 터미네이터 설치 

$ sudo apt-get install terminator

터미널 창을 나눠서 사용할 수 있어 편리하다.

 

 

 

 

 

 

 

 

 

728x90