Time limited C++ coding evaluation for Senior Robotics Software Engineer at a private company (Leuven, Belgium).
Even though there is a Dockerfile to build and run the program, it works in Ubuntu 24.04.3 LTS and ROS 2 Jazzy.
-
Clone the repository to the folder you like.
-
Build the Dockerfile with:
sudo docker build -t privateCompany_teachrepeat . -
While building, please allow remote connections so that docker can open displays on the host:
xhost local:root
-
Launch the Dockerfile in case you have GPUs on your machine (otherwise, remove --gpus "all", -e NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all} and -e NVIDIA_DRIVER_CAPABILITIES=${NVIDIA_DRIVER_CAPABILITIES:-all}):
sudo docker run --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 --gpus "all" --rm -it --name privateCompany_teachrepeat -v ~/Desktop/privateCompany/:/privateCompany -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw -e NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all} -e NVIDIA_DRIVER_CAPABILITIES=${NVIDIA_DRIVER_CAPABILITIES:-all} privateCompany_teachrepeat
-
Open two extra terminals to handle all the callings:
sudo docker exec -it privateCompany_teachrepeat /bin/bash -
In all three terminals, access the workspace, and source it:
cd /root/turtlebot3_ws/ && colcon build && source install/setup.bash
-
Terminal 1 will launch Gazebo with waffle_pi:
ros2 launch turtlebot3_gazebo empty_world.launch.py
-
Terminal 2 will launch the teleoperation node:
ros2 run turtlebot3_teleop teleop_keyboard
-
Terminal 3 will launch the get_trajectories node (once the robot is positioned on the desired start position) and will save the file at /root/turtlebot3_ws/path.csv. Once the trajectory is recorded, kill all 3 processes in the three terminals:
ros2 run privateCompany_teachrepeat get_trajectories --ros-args -p parent_frame:=odom -p child_frame:=base_footprint -p output_csv:=path.csv
-
To visualize the trajectory, launch rviz2 and load the topic /robot_trajectory to visualize it in a terminal after executing the following command. Other option would be open the .csv file and edit the trajectory:
ros2 run privateCompany_teachrepeat visualize_trajectories- To replay the trajectory, relaunch Gazebo with waffle_pi (terminal 1) and the following command in terminal 2:
ros2 run privateCompany_teachrepeat replay_trajectories path.csv