入力した数字を素数かどうか判定し,合成数の場合,素因数分解して出力します.
- Ubuntu 20.04 LTS
- ROS Noetic
- Raspberry Pi 4 Model B
以下のコマンドを入力してください.
cd ~/catkin_ws/src
git clone https://github.com/HoshinoMasafumi/robosys_ros.git
cd ..
catkin_make
source ~/.bashrc
まず以下のコマンドを入力してください.
cd ~/catkin_ws/src/robosys_ros/scripts
chmod +x imput.py
chmod +x prime_number.py
次に,端末を3つ開きそれぞれの端末で以下のコマンドを入力してください.
1つ目
roscore
2つ目
rosrun robosys_ros imput.py
3つ目
rosrun robosys_ros prime_number.py
2つ目の端末に数字を入力すると,3つ目の端末に結果が出力されます.