Skip to content

Fifth Task: Adding a camera

Open up the Pioneer Node -> extension -> add a node -> camera Note that the camera can be moved using the translation coordinates. I.e., you can move the camera forward and backwards Lets make a new controller for the robot which we can edit. Wizards -> new controller -> c -> gcc/makefile -> make sure open in editor is selected. Copy and paste the code into the new file and save both the code (top right above the editor) and world (top left above the editor). If you cant see the original code it is also on canvas under unit 3 Back to the robot Click controller -> select -> change this to the file you just made. Six Task: Enable the camera In the main() function add the following lines under the velocity. Around line 79 WbDeviceTag camera = wb_robot_get_device("camera"); wb_camera_enable(camera, time_step); Your camera is now active, you may need to move Kinect camera (black and white camera) by dragging and dropping the window. You should see something along the lines of the following figure. Let the robot run, it should be showing some default braitenberg behaviour. SAVE! And back up!