ROS/ROS2Foxy

The command syntax for creating a new package in ROS 2

leohycho 2022. 5. 4. 14:30

source /opt/ros/foxy/setup.bash

 

mkdir -p my_ws/src

cd ~my_ws/src

 

ros2 pkg create --build-type ament_python <my_package>

ros2 pkg create --build-type ament_python --node-name <my_node> <my_package>

ros2 pkg create --build-type ament_python <my_package> --dependencies <rclpy> <my_interfaces>

 

ros2 pkg create --build-type ament_cmake <my_package>

ros2 pkg create --build-type ament_cmake --node-name <my_node> <my_package>

 

cd ~/my_ws

 

colcon build

colcon build --packages-select my_package

colcon build --symlink-install

colcon build --symlink-install --packages-select <my_package>

 

source /opt/ros/foxy/setup.bash && source ~/my_ws/install/local_setup.bash

 

ros2 run <my_package> <my_node>

ros2 launch <my_package> <my_launch>

 

rosdep install -i --from-path src --rosdistro foxy -y

 

source /usr/share/colcon_cd/function/colcon_cd.sh

export _colcon_cd_root=~/my_ws

 

gedit ~/.bashrc

source ~/.bashrc

'ROS > ROS2Foxy' 카테고리의 다른 글

ros2 launch pkg ~.launch.py  (0) 2022.06.06
Broadcasting single frames using static_transform_publisher  (0) 2022.06.03
Create a new package for interfaces  (0) 2022.05.11
ros2 launch  (0) 2022.05.04
ROS2 Foxy 입문  (0) 2022.05.01