Autonomous car source code for FPT Digital Race (Cuộc Đua Số) 2020 - Round 1 - Simulation Car.
This is the source code for round 1 - simulation car.
We need to initialize catkin workspace at the first time (build folders for projects).
cd main_ws
catkin_make
Add workspace to PATH:
echo "source !(pwd)/main_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
cd main_ws
conda env create -n cds -f environment.yml
conda activate cds
sudo apt-get install ros-melodic-rosbridge-server
cd main_ws
catkin_make
NOTE: Don’t use conda environment here!!!
roslaunch teamict server.launch
Enter Team name: teamict
and server address: ws://localhost:9090
.
Open another Terminal and type:
conda activate cds
roslaunch teamict teamict.launch
OR
conda activate cds
rosrun teamict teamict_node.py
Because we could not use cv2.imshow()
to show image in this environment,
Please use this command to open debug image viewer:
rosrun rqt_image_view rqt_image_view
debug_stream
instance created in teamict_node.py
to any class you want to debug.debug_stream.create_stream('<stream_name>', '<topic_path>')
debug_stream.create_stream('depth', 'debug/depth')
debug_stream.update_image('<stream_name>', <image>)
debug_stream.update_image('depth', depth_image)
rosrun rqt_image_view rqt_image_view
mkdir video_rgb
cd video_rgb
rosrun image_view image_saver image:=/teamict/camera/rgb _image_transport:=compressed
mkdir video_depth
cd video_depth
rosrun image_view image_saver image:=/teamict/camera/depth _image_transport:=compressed
In video_rgb
:
ffmpeg -framerate 25 -i left%04d.jpg -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p 01_rgb.mp4
In video_depth
:
ffmpeg -framerate 25 -i left%04d.jpg -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p 01_depth.mp4