@@ -14,9 +14,6 @@ import ros.ServiceClient
1414import ros.ServiceServer
1515import ros.Subscriber
1616import ros.Parameter
17- import ros.ParameterValue
18- import ros.ParameterBase64Type
19- import ros.ParameterDate
2017
2118/**
2219 * This class contains custom validation rules.
@@ -45,19 +42,23 @@ class RosValidator extends AbstractRosValidator {
4542 }}
4643 @Check
4744 def void checkNameConventionsPackage (Package rospackage ) {
48- for (char c : rospackage. name. toCharArray){
49- if (Character . isUpperCase(c)){
50- error(" The name of a package has to follow the ROS naming conventions: Capital letters are not allowed" , null , INVALID_NAME );
51- }
52- }
45+ for (char c : rospackage. name. toCharArray){
46+ if (Character . isUpperCase(c)){
47+ error(" The name of a package has to follow the ROS naming conventions: Capital letters are not allowed" , null , INVALID_NAME );
48+ }
49+ }
5350 }
5451 @Check
5552 def void checkNameConventionsParameters (Parameter parameter ) {
56- for (char c : parameter. name. toCharArray){
57- if (Character . isUpperCase(c)){
58- warning(" The name of a parameter has to follow the ROS naming conventions: Capital letters are not recommended" , null , INVALID_NAME );
59- }
60- }
53+ for (i : 0 .. < parameter. name. length) {
54+ val c = parameter. name. charAt(i)
55+ if (Character . isUpperCase(c)) {
56+ val remaining = parameter. name. substring(i)
57+ if (! remaining. contains(" ." )) {
58+ warning(" The name of a parameter has to follow the ROS naming conventions: Capital letters are not recommended" , null , INVALID_NAME );
59+ }
60+ }
61+ }
6162 }
6263
6364 /* Customize Syntax Error Messages */
0 commit comments