DRC vehicle tele operation - modulabs/gazebo-tutorial GitHub Wiki
๊ฐ์
๋ณธ ์ง์นจ์๋ DRC Vehicle์ VRC Plugin์์ ์ ๊ณต๋ฐ์ ROS topics์ ์ด์ฉํด์ ์ด๋ป๊ฒ ์ ์ด๋ฅผ ํ๋์ง ๋ณด์ฌ์ค๋๋ค. ์ด ์ง์นจ์๋ ํ ์คํธ๋ฅผ ์ํ ๋ณด์กฐ๊ฐ๋ฐํด๋ก์ ๋ณด์ฌ์ค๋๋ค, ๊ฒฝ์ํ๋๋์์ ์ฌ์ฉ๋ ์ ์์ต๋๋ค. ์ด ์ง์นจ์์ ์ฝ์ค์์์, ์ฐ๋ฆฌ๋ DRC Vehicle์ ์ด์ ํ ๊ฒ์ ๋๋ค. ์กฐํฅ์ฅ์น,ํธ๋๋ธ๋ ์ดํฌ, ๊ฐ์คํจ๋ฌ,๋ธ๋ ์ดํฌ ํจ๋ฌ์ ๋ช ๋ น์ด๋ฅผ ์ด์ฉํฉ๋๋ค. ์ด๋ฌํ ๋ช ๋ น๋ค์ Atlas์์ด vehicle navigation์ ํ ์คํธ ํ ๋๋ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์ค์น DRC Simulator
DRC simulator๋ฅผ ์ค์นํ๊ณ , ๊ทธ์ ๊ด๋ จ๋ ํด์ ์ค์นํ๊ธฐ ์ํด์ ๋ณธ ๊ณผ์ ์ ๋ณด์ธ์ ์ด ์ง์นจ์๋ drcsim-3.1์ด์์ ์๊ตฌํฉ๋๋ค.
Launch the DRC Simulator
atlas_drc_vehicle_fire_hose.launch๋ฅผ ์์ํ์ฌ ์๋ฌผ๋ ์ดํฐ๋ฅผ ๋ฐ์นญํ๊ณ , ๋ณด์กฐ๊ฐ๋ฐํด์ ์ด์ฉํ ์ ์์ต๋๋ค.
VRC_CHEATS_ENABLED=1 roslaunch drcsim_gazebo atlas_drc_vehicle_fire_hose.launch
DRC Vehicle interface states ๋ฅผ ์ฝ์ผ์ธ์
VRC plugin๋ DRC Vehicle interface์์๋ฅผ ์ํ ROS topics์ ๋ณด์ฌ์ค๋๋ค. ๊ฒ๋ค๊ฐ the steering wheel, hand brake, and pedals, the DRC Vehicle์ ์ค์์น ํค๋ฅผ ๊ฐ๊ณ ์์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ์ธ๋ฐฉํฅ์ ๋ฐฉํฅ ์ค์์น๋ (์ ์ง/์ค๋ฆฝ/ํ์ง)์ ๋๋ค. ํ์ฌ์ ๊ฐ ์ธํฐํ์ด์ค ์์์ ํ์ฌ์ํ๋ ROS topic ์์์ ์ฝํ์ง์ ์์ต๋๋ค, 1hz ๋ก ์ค๊ฐํฉ๋๋ค.
/drc_vehicle_xp900/brake_pedal/state
/drc_vehicle_xp900/direction/state
/drc_vehicle_xp900/gas_pedal/state
/drc_vehicle_xp900/hand_brake/state
/drc_vehicle_xp900/hand_wheel/state
/drc_vehicle_xp900/key/state
์ด ํ ํฝ์ ๋ช ๋ น๋ผ์ธ์ผ๋ก ๋ถํฐ ๋ณด์ฌ์ง์ ์์ต๋๋ค. ์๋ฅผ๋ค์ด
rostopic echo /drc_vehicle_xp900/brake_pedal/state
์ด brake_pedal, gas_pedal, and hand_brake topics ์ Float64 ๊ฐ์ 0(๋นํ์ํ)~1(ํ์ฑํ)์ฌ์ด์ ์ซ์๋ฅผ ๋ณด๋ธ๋ค DRC Vehicle defaults๋ ๋นํ์ฑ์ ๋ชจ๋์ ๋๋ค. hand_wheel topic์ ์กฐํฅํ ์ ๊ฐ๋๋ฅผ ๋ ํฌํ ํด ์ค๋๋ค. ๋ผ๋์ ๊ฐ์ผ๋ก. ์กฐํฅํ ์ -7๋ผ๋์์์ 7๋ผ๋์๋ณด๋ค ๋ ํฐ ๋ฒ์๋ฅผ ๊ฐ๋๋ค๋๊ฒ์ ์์๋์ญ์์ค.
๋ฐฉํฅ๋ฐ ํค์ํ ํ ํฝ์ Int8 value๋ฅผ ๋ณด๋ ๋๋ค. ๋ฐฉํฅ์ํ๋ ์์ผ๋ก๋ "1" , ์ค๋ฆฝ์ "0" , ํ์ง์ "-1" ๊ฐ์ ๋ ํฌํ ํฉ๋๋ค.
๋ฐฉํฅ์ค์์น๊ฐ ์ค๋ฆฝ์ ์์ง์์๋, ํค๋ฅผ ๋๋ฆฌ๋๊ฒ์ ์ํด ์ผ๊ธฐ๋ ์๋ฌ๋ฅผ ์ํด ํค ์ํ 1์ "On", 0์ off ๋ผ๊ณ ๋ฆฌํฌํ ์ ํด์ค๋๋ค. ๋ฐฉํฅ์ค์๋ฅผ ์ค๋ฆฝ์ผ๋ก ๋๋๊ฒ์ ํค ์ํ๋ฅผ 1๋ก ์ ์ฅํ ๊ฒ์ ๋๋ค. ํค ์ค์์น์ ์ด๊ธฐ์น๋ on , ์ ๋ฐฉํฅ ์ ๋๋ค. ๊ทธ๋ฌ๋ ์ด๊ฒ์ ๋ฏธ๋์ ์ํํธ์จ์ด ๋๋ ๊ฒฝ์์ ๋ฏธ๋๋ฒ์ ์ ๋ํ ์๊ฐ ์๋๋๋ค.
DRC Vehicle๋ฅผ open-loop commands ๋ก ์ ์ดํฉ๋๋ค.
The DRC Vehicle model์ ํ์ฌ ๋น์ฃผ์ผ ์์๋ฅผ ๊ฐ๊ณ ์์ง ์์ต๋๋ค. ์กฐํฅ์ ๋ณด๊ธฐ์ํด์ DRC Vehicle model transparent๋ฅผ ๋ง๋์ธ์ ์ด๊ฒ์ ๋ชจ๋ ๋ชจ๋ธ์ ์ํด ๋์ด์ง์ ์์ต๋๋ค.View->Transparent and View->Collisions,๋ฉ๋ด์ต์ ์ ์ ํํ๋๊ฒ์ผ๋ก ๋ชจ๋ ๋ชจ๋ธ์ ์ ์ฉ๋์ด์ง์ ์์ต๋๋ค.
rostopic pub --once /drc_vehicle_xp900/hand_wheel/cmd std_msgs/Float64 '{ data : 3.14 }'
์๋ฐํด์ด ๋ณํ๋ฅผ ๋ณด์ธ์
์ค๋ฅธ๋ฐฉํฅ ์กฐํฅ(์๋ฐํด)
rostopic pub --once /drc_vehicle_xp900/hand_wheel/cmd std_msgs/Float64 '{ data : -3.14 }'
gas pedal ๋๋ฅด๊ธฐ:
rostopic pub --once /drc_vehicle_xp900/gas_pedal/cmd std_msgs/Float64 '{ data : 1 }'
๊ทธ๋ฌ๋ the vehicle_xp900's์ ์์ง์ด์ง ์์ต๋๋ค. ์ด ํธ๋๋ธ๋ ์ดํฌ๋ ๋ํดํธ๊ฐ ํ์ฑํ ์ํ์ ๋๋ค.
rostopic pub --once /drc_vehicle_xp900/hand_brake/cmd std_msgs/Float64 '{ data : 0 }'
The vehicle_xp900์ ์์ผ๋ก ๋๋ผ์ด๋น์ ์์ํฉ๋๋ค. ์์ง ์คํํ๋ ๋ช ๋ น์ด๋ฅผ ๋ณด๋ด์ธ์
rostopic pub --once /drc_vehicle_xp900/key/cmd std_msgs/Int8 '{ data : 0 }'