This is the quick-reference guide for Fly4Future software development. When in doubt, follow the tables below.
💻 C++ Development​
| Category | Convention | Examples |
|---|
| Files | .h .cpp .tpp | uav_controller.h math_utils.tpp |
| Classes & Structs | PascalCase | PathPlanner StateEstimator |
| Functions & Methods | camelCase | computeTrajectory() initialize() |
| Variables | snake_case | current_height iter_count |
| Member Variables | snake_case_ | target_pose_ battery_level_ |
| Mutexes | mutex_snake_case_ | mutex_pose_ mutex_buffer_ |
| Constants & Defines | SCREAMING_SNAKE_CASE | MAX_ALTITUDE PI_CONSTANT |
🤖 ROS & MRS Framework​
| Category | Convention | Examples |
|---|
| Topics & Services | snake_case | laser_scan get_uav_state |
| Msg & Srv Files | PascalCase | UavStatus.msg SetGoal.srv |
| Message Fields | snake_case | range_min header_stamp |
| ROS Parameters | _snake_case_ | _mass_ _timer_rate_ |
| Subscribers | sub_ | sub_pose_ sub_odometry_ |
| Publishers | pub_ | pub_cmd_vel_ pub_status_ |
| Service Servers | server_ | service_land_ service_reset_ |
| Service Clients | client_ | client_takeoff_ clinet_get_map_ |
| Subscriber Handlers | sh_ | sh_pose_ sh_odometry_ |
| Publisher Handlers | ph_ | ph_cmd_vel_ ph_status_ |
| Srv Server Handlers | ss_ | ss_land_ ss_reset_ |
| Srv Clients Handlers | sc_ | sc_takeoff_ sc_get_map_ |
| Timers | timer_ | timer_main_loop_ timer_watchdog_ |
| Callback Groups | cbkgrp_ | cbkgrp_sensors_ cbkgrp_timers_ |
🔄 Remapping & Direction​
We use suffixes to clarify the direction of data flow in launch files and code.
| Logic | Suffix | Context | Examples |
|---|
| Input | _in | Subscribers & Servers | topic_in service_in |
| Output | _out | Publishers & Clients | topic_out service_out |
💡 The Golden Rules​
- English Only: No native language in code or comments.
- Be Descriptive:
is_timer_active beats flag, don't overdo it.
- Use Infinitives:
initialize() rather than initializer().
- Use Past or Continuous: If appropriate, use
is_initialized or startInitializing().