Camera test === Hey Bunny! Wake up! ![](https://i.imgur.com/FuMKr2G.jpg) #### TODO * start camera node * record sensor data using rosbag * scp xxx.bag user@duckietop:~/data ### start canera node **ssh to your pi** ``` bunnybot $ cd ~/duckietown bunnybot $ source environment.sh bunnybot $ source set_ros_master.sh alphaduck ``` This sets your duckiebot as ROS master. ``` duckiebot $ roslaunch duckietown camera.launch veh:=alphaduck ``` This launches camera node and a roscore(like a data center). ##### In laptop, open another terminal ``` laptop $ cd ~/duckietown laptop $ source environment.sh laptop $ source set_ros_master.sh alphaduck ``` This sets your bunnybot as ROS master, so your laptop and bunnybot have same ROS master. ``` laptop $ rostopic list ``` This lists what topics in your ROS master. You can see: ``` /rosout /rosout_agg /alphaduck/camera_node/camera_info /alphaduck/camera_node/image/compressed /alphaduck/camera_node/image/raw ``` **To visualize what bunny see** ``` laptop $ rviz ``` On left display window, click ``` Add->By topic->/alphaduck/camera_node/image/compressed ``` It will show the image of camera in your bunnybot. ### record sensor data using rosbag **ssh to your pi** bunnybot $ cd ~/duckietown bunnybot $ source environment.sh This initials ROS environment. duckiebot $ source set_ros_master.sh alphaduck This sets your bunnybot as ROS master. bunnybot $ byobu ``` Byobu tips: to open multi terminal in original terminal hot-key F2 create new terminal tab. F3,F4 switch between terminals <ctrl>+ F6 close one tab you can also Shift+F2 to split the current tab into two horizontally. Shift+<arrow keys> switches between panes. Shift+Alt+<arrow keys> changes the current pane size. ``` terminal#1, ``` bunnybot $ roslaunch duckietown camera.launch veh:=duckiebot ``` This launches camera node and a roscore(like a data center). terminal#2, ``` bunnybot $ rostopic list ``` This lists what topics in your ROS master. You can see: ``` /rosout /rosout_agg /alphaduck/camera_node/camera_info /alphaduck/camera_node/image/compressed /alphaduck/camera_node/image/raw bunnybot $ rosbag record /alphaduck/camera_node/image/raw ``` It starts recording the data. ### transfer data from pi--> laptop **scp xxx.bag user@duckietop:~/data** ``` bunnybot $ scp xxx.bag ubuntu@bunnytown:~/data/ ``` scp command $ scp -r <source> <destination> ex: scp -r <source> remoteUser@remoteIP:<remote location-u-want-to-put> The xxx.bag will be copied to laptop from bunnybot. ###### tags: `duckietown-bunny`