p9fj35fl6/Gazebo_exercise/Exercise_code_style.md

40 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

简介此文件描述了Gazebo_7.14_exercise版本开发过程中所遵循的代码添加规范
时间2019-04-01
作者airc_exercise@163.com
主要包括三种格式:
1.新添加文件
在文件头加上如下说明其中Copyright部分格式固定[Author][Date]根据具体情况填写,为必填项,[Description]为选填项。
/*
* Copyright (C) 2019 AIRC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* [Author] zenglei
* [Date] 2018-12-04
* [Description] Head file for profiler
*/
2.在原始代码中添加一行代码
在代码后添加4个空格然后添加注释注释内容为“// Added by XXX@xxx-xx-xx”其中XXX表示作者xxx-xx-xx表示修改日期如下面代码所示
#include "gazebo/countTime.hh" // Added by zenglei@2018-12-04
3.在原始代码中添加代码块(一行以上的代码)
在代码块开始和结束位置分别添加注释,注释内容分别为:
//////////////////// AIRC begin ////////////////////
// Added by XXX@xxx-xx-xx, Modified by YYY@yyy-yy-yy
// [Description] zzzzzzzzzzzzzzzzzzzz
//////////////////// AIRC end ////////////////////
其中[Description]根据具体情况选填。