UBC Snowbots Repository for competitions.
You will be downloading an Ubuntu ISO and multiple ROS packages with their respective dependencies.
It is highly recommended that you have access to high speed internet while doing this entire setup;
if you're on campus use the ubcsecure
or resnet
networks for best results.
sudo apt-get install git
git clone --recursive https://github.com/YOUR_USERNAME/Snowflake.git
(YOUR_USERNAME
is your github username)cd ~/Snowflake && ./setup_scripts/install_tools.sh
(Do not run this script as root).
source /opt/ros/noetic/setup.sh
.catkin_make
. If everything compiles correctly and you don't get any errors, then you're good to go!./setup_scripts/install_dependencies.sh
.cd ~/Snowflake
), run source devel/setup.sh
and then from the same terminal run clion
zed_ros_wrapper
as a src/external_pkgs/zed_ros_wrapper
(As of 4/27/2018 submodules have been migrated to wstool)zed.launch
and place it in the folder /usr/local/zed/settings/
Note: External packages are defined as packages which does not have an installable build from apt.
To manually install external packages using wstool, run wstool set src/external_pkgs/<pkg_name> https://github.com/some_org/<pkg_name>.git --git
in the workspace root.
The full syntax and options can be found with wstool set -h
To pull in the external package we call wstool update
Note: wstool
is addressed and run in install_dependencies.sh
, should there be any need to run manual, wstool
should be run after all steps from installation and setup has been completed.
Current packages included under wstool:
See here
Tutorials and advice for new members.
First of all, if you're new to the Ubuntu command line: it is primarily used over the graphical user interface as it allows you to do more.
In case you're new to GitHub, get started with this tutorial
Pretty cool right? Now you're wondering how you can use GitHub from the terminal/command line, it's called Git
Now you're wondering how we develop our software, the first place to start is understanding how our workflow works. We use the Forking Workflow, which you can learn more about under Github Conventions in README.md
(located in the same directory you opened this readme from) and other important information you should know. If you have questions, you may find your answers over there.
This is the language we use to develop most of our software, so if you are new with C++, understand the fundamentals from this tutorial, but there are much more resources online as well.
By now you understand the basics of ROS, but to learn more about it, you can complete the intermediate tutorials or brush up on the basics if you need to here
Rarely will your Github issues contain all the information that you need to resolve them. Using google to search for that missing piece you need is sometimes useful (think like an optimist when you're understanding/interpreting your project/issue: "If only I knew how to do...", then search "how to do..."), or of course don't hesitate to ask for help, clarification, or just more information from any of the software leads.
Remember it is much better to get help when you're stuck than to waste time trying to figure out what's wrong. This way, you're more or less continuously progressing, and as a whole, we develop efficiently and our software stack progresses.
clang-format
tool.
Snowflake
folder run ./clang_format/fix_formatting.sh BRANCH_NAME
, where BRANCH_NAME
is the name of the branch you intend to merge your code into (ex. iarrc
or core
). This script will fix any improperly formatted code, but will refuse to change any files with uncommited changes (to prevent you losing work)Below are some notes we would like to highlight about pull requests:
Every .cpp and .h file should start with
/*
* Created By: Someone
* Created On: December 1st, 2000
* Description: A quick description of what this file does/is for
*/
Functions should be commented a la JavaDoc
The Javadoc comment (below) should be directly above every function in the header file
/**
* One line description of the function
*
* A longer and more in depth description of the function
* if it is needed.
*
* @param param_one the first parameter of the function
* @param param_two the second parameter of the function whose
* description goes longer than one line
* @return what the function returns if it returns anything
*
*/
Classes are CamelCase
Variables are non_camel_case
Constants are ALL_CAPS_WITH_UNDERSCORES
Functions are camelCase
Indentations are 4 spaces
CMakeLists.txt
files should be reduced to only contain the minimum amount of comments. The version in sample_package
has all the comments left in (for the sake of verbosity), so for a more representative example of what yours should look like, see sb_vision/CMakeLists.txt
(or really any package aside from sample_package
)
+X
^
|
+θ +<----->+ -θ
| | |
V | V
+Y <---------------------> -Y
|
|
|
V
-X
src/sample_package
some_ros_package | CMakeLists.txt | package.xml └───src | | MyNode.cpp | | my_node.cpp | └───launch | | my_node.launch | └───include | | MyNode.h | └───test | | my-node-test.cpp | | my_node_rostest.cpp | | sample_package_test.test
while(ros::ok()){}
loop
some_ros_package | CMakeLists.txt | package.xml └───src | | my_node.cpp
roslaunch package_name package_launch_file.launch
catkin_make run_tests
to run themcatkin_make run_tests_MY_PACKAGE_NAME
<test></test>
tag. This also needs a special entry under CMakelists as shown in the sample package. See more details hererostest package_name package_test_file.test
.cd ~/Snowflake
and then source devel/setup.sh
sb_gazebo/urdf/**ROBOT_NAME**.gazebo
and switch around the lidar settings (see comments in said file)sb_gazebo/worlds
foldersb_gazebo/launch
cd ~/Snowflake
and then source devel/setup.sh
, then run the appriate launchfile from src/sb_gazebo/launch
by running roslaunch LAUNCH_FILE.launch
(from within the launch folder). Note: At least with PS3 controllers, you have to hold down L1
while using the joystick for the controller to worksrc/firmware
. This way you don't need to worry about downloading the libraries yourself!/your/path/to/Snowflake/src/firmware
as your sketchbook directory. Open arduino sketches in the workspace and they will work!Intel Realsense is a sensor that captures a 3D depth map of the environment in front of the sensor. This 3D depth map is called a point cloud, which is essentially just a list (vector in c++) that contains a bunch of points, where each point contains the x, y, and z coordinates, as well as a color value associated to it.
roslaunch realsense2_camera rs_rgbd.launch
to launch realsense. You should be able to see the point cloud at the topic named /camera/depth_registered/points
in rviz
.roslaunch realsense2_camera rs_rgbd.launch
.rosbag record /camera/depth_registered/points <options>
. See rosbag record -h
for the list of options. To stop the recording, just press ctrl+c. E.g. rosbag record /camera/depth_registered/points --split --duration 1m --max-splits 3 -o ../rosbags/tennis_ball/
- split files every 1 minute, split for maximum of 3 times, and store the rosbag in ../rosbags/tennis_ball/
folder.rosbag play path/to/rosbag/file -l
. path/to/rosbag/file
is the path to the rosbag generated in step 2. Note that the -l
flag loops the recording so it will play forever until you terminate it manually (using ctrl+c).rviz
. You should be able to see the recording of the point cloud at /camera/depth_registered/points
.build
and devel
folders (if present) to remove any "cached" information