Skip to content

Commit c6898b8

Browse files
committed
fixing indent width
1 parent 2944cf2 commit c6898b8

File tree

1 file changed

+60
-60
lines changed

1 file changed

+60
-60
lines changed

src/core/Ros.js

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -278,17 +278,17 @@ ROSLIB.Ros.prototype.getParams = function(callback) {
278278
* * type - String of the topic type
279279
*/
280280
ROSLIB.Ros.prototype.getTopicType = function(topic, callback) {
281-
var topicTypeClient = new ROSLIB.Service({
282-
ros : this,
283-
name : '/rosapi/topic_type',
284-
serviceType : 'rosapi/TopicType'
285-
});
286-
var request = new ROSLIB.ServiceRequest({
287-
topic: topic
288-
});
289-
topicTypeClient.callService(request, function(result) {
290-
callback(result.type);
291-
});
281+
var topicTypeClient = new ROSLIB.Service({
282+
ros : this,
283+
name : '/rosapi/topic_type',
284+
serviceType : 'rosapi/TopicType'
285+
});
286+
var request = new ROSLIB.ServiceRequest({
287+
topic: topic
288+
});
289+
topicTypeClient.callService(request, function(result) {
290+
callback(result.type);
291+
});
292292
};
293293

294294
/**
@@ -299,28 +299,28 @@ ROSLIB.Ros.prototype.getTopicType = function(topic, callback) {
299299
* @param message - String of a topic type
300300
*/
301301
ROSLIB.Ros.prototype.getMessageDetails = function(message, callback) {
302-
var messageDetailClient = new ROSLIB.Service({
303-
ros : this,
304-
name : '/rosapi/message_details',
305-
serviceType : 'rosapi/MessageDetails'
306-
});
307-
var request = new ROSLIB.ServiceRequest({
308-
type: message
309-
});
310-
messageDetailClient.callService(request, function(result) {
311-
var typedefs = result.typedefs;
312-
callback(result.typedefs);
313-
});
302+
var messageDetailClient = new ROSLIB.Service({
303+
ros : this,
304+
name : '/rosapi/message_details',
305+
serviceType : 'rosapi/MessageDetails'
306+
});
307+
var request = new ROSLIB.ServiceRequest({
308+
type: message
309+
});
310+
messageDetailClient.callService(request, function(result) {
311+
var typedefs = result.typedefs;
312+
callback(result.typedefs);
313+
});
314314
};
315315

316316
/**
317317
* Encode a typedefs into a dictionary like `rosmsg show foo/bar`
318318
* @param type_defs - array of type_def dictionary
319319
*/
320320
ROSLIB.Ros.decodeTypeDefs = function(type_defs) {
321-
var type_def_dict = {};
322-
var the_type = type_defs[0];
323-
return ROSLIB.Ros._decodeTypeDefs(type_defs[0], type_defs);
321+
var type_def_dict = {};
322+
var the_type = type_defs[0];
323+
return ROSLIB.Ros._decodeTypeDefs(type_defs[0], type_defs);
324324
};
325325

326326
/**
@@ -331,42 +331,42 @@ ROSLIB.Ros.decodeTypeDefs = function(type_defs) {
331331
* @param hint_defs - array of typedefs
332332
*/
333333
ROSLIB.Ros._decodeTypeDefs = function(the_type, hint_defs) {
334-
var type_def_dict = {};
335-
for (var i = 0; i < the_type.fieldnames.length; i++) {
336-
var array_len = the_type.fieldarraylen[i];
337-
var field_name = the_type.fieldnames[i];
338-
var field_type = the_type.fieldtypes[i];
339-
if (field_type.indexOf("/") === -1) { // check the field_type includes "/" or not
340-
if (array_len == -1) {
341-
type_def_dict[field_name] = field_type;
342-
}
343-
else {
344-
type_def_dict[field_name] = [field_type];
345-
}
334+
var type_def_dict = {};
335+
for (var i = 0; i < the_type.fieldnames.length; i++) {
336+
var array_len = the_type.fieldarraylen[i];
337+
var field_name = the_type.fieldnames[i];
338+
var field_type = the_type.fieldtypes[i];
339+
if (field_type.indexOf("/") === -1) { // check the field_type includes "/" or not
340+
if (array_len == -1) {
341+
type_def_dict[field_name] = field_type;
342+
}
343+
else {
344+
type_def_dict[field_name] = [field_type];
345+
}
346+
}
347+
else {
348+
// lookup the name
349+
var sub_type = false;
350+
for (var j = 0; j < hint_defs.length; j++) {
351+
if (hint_defs[j].type == field_type) {
352+
sub_type = hint_defs[j];
353+
break;
354+
}
355+
}
356+
if (sub_type) {
357+
var sub_type_result = ROSLIB.Ros._decodeTypeDefs(sub_type, hint_defs);
358+
if (array_len == -1) {
359+
type_def_dict[field_name] = sub_type_result;
346360
}
347361
else {
348-
// lookup the name
349-
var sub_type = false;
350-
for (var j = 0; j < hint_defs.length; j++) {
351-
if (hint_defs[j].type == field_type) {
352-
sub_type = hint_defs[j];
353-
break;
354-
}
355-
}
356-
if (sub_type) {
357-
var sub_type_result = ROSLIB.Ros._decodeTypeDefs(sub_type, hint_defs);
358-
if (array_len == -1) {
359-
type_def_dict[field_name] = sub_type_result;
360-
}
361-
else {
362-
type_def_dict[field_name] = [sub_type_result];
363-
}
364-
}
365-
else {
366-
throw "cannot find " + field_type;
367-
}
368-
//ROSLIB.Ros._decodeTypeDefs(field_type, hint_defs)
362+
type_def_dict[field_name] = [sub_type_result];
369363
}
364+
}
365+
else {
366+
throw "cannot find " + field_type;
367+
}
368+
//ROSLIB.Ros._decodeTypeDefs(field_type, hint_defs)
370369
}
371-
return type_def_dict;
370+
}
371+
return type_def_dict;
372372
};

0 commit comments

Comments
 (0)