- Code must be formatted with the
hooks/formatAll.sh
script, before committing to the repository. - We use ArtisticStyle for code formatting.
- Download the package from SourceForge
- Installation guideliens are provided here
- Code guide at a glance:
#include <ros/ros.h>
float someFunction (int firstArgument, float secondArgument)
{
return firstArgument + secondArgument;
}
int main ()
{
int i;
int count = 10;
bool condition;
if (condition)
{
std::cout << "Print a statement." << std::endl;
}
else
{
std::cout << "Print other statement." << std::endl;
}
for (i = 0; i < count; i++)
{
std::cout << "Index: " << i << endl;
}
switch (i)
{
case 1:
{
std::cout << "This was the first case." << std::endl;
break;
}
case 2:
{
std::cout << "This was the second case." << std::endl;
break;
}
default:
{
std::cout << "This was the default case." << std::endl;
break;
}
}
return 0;
}
- Check this file to see more example code.