Skip to content

Commit 227acb7

Browse files
committed
update messages and comments
1 parent 7f0380b commit 227acb7

13 files changed

+67
-46
lines changed

auv_msgs/DecimalLatLonMsg.cs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/**
77
* Define a geographic_msgs GeoPoint message. This has been hand-crafted from the corresponding
88
* geographic_msgs message file.
9+
*
10+
* @author Miquel Massot Campos
911
*/
1012

1113
namespace ROSBridgeLib {

auv_msgs/NEDMsg.cs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/**
77
* Define a auv_msgs NED message. This has been hand-crafted from the corresponding
88
* auv_msgs message file.
9+
*
10+
* @author Miquel Massot Campos
911
*/
1012

1113
namespace ROSBridgeLib {

auv_msgs/NavStsMsg.cs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/**
1010
* Define a auv_msgs NavSts message. This has been hand-crafted from the corresponding
1111
* auv_msgs message file.
12+
*
13+
* @author Miquel Massot Campos
1214
*/
1315

1416
namespace ROSBridgeLib {

auv_msgs/RPYMsg.cs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/**
77
* Define a auv_msgs NED message. This has been hand-crafted from the corresponding
88
* auv_msgs message file.
9+
*
10+
* @author Miquel Massot Campos
911
*/
1012

1113
namespace ROSBridgeLib {

geographic_msgs/GeoPointMsg.cs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/**
77
* Define a geographic_msgs GeoPoint message. This has been hand-crafted from the corresponding
88
* geographic_msgs message file.
9+
*
10+
* @author Miquel Massot Campos
911
*/
1012

1113
namespace ROSBridgeLib {

geometry_msgs/PointMsg.cs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/**
77
* Define a geometry_msgs point message. This has been hand-crafted from the corresponding
88
* geometry_msgs message file.
9+
*
10+
* @author Miquel Massot Campos
911
*/
1012

1113
namespace ROSBridgeLib {

geometry_msgs/PoseMsg.cs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
/**
66
* Define a geometry_msgs pose message. This has been hand-crafted from the corresponding
77
* geometry_msgs message file.
8+
*
9+
* @author Miquel Massot Campos
810
*/
911

1012
namespace ROSBridgeLib {

geometry_msgs/QuaternionMsg.cs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
/**
66
* Define a geometry_msgs quaternion message. This has been hand-crafted from the corresponding
77
* geometry_msgs message file.
8+
*
9+
* @author Miquel Massot Campos
810
*/
911

1012
namespace ROSBridgeLib {

nav_msgs/PathMsg.cs

+43-22
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
using SimpleJSON;
55
using ROSBridgeLib.std_msgs;
66
using ROSBridgeLib.geometry_msgs;
7-
// Need geometry_msgs/PoseStamped[]
7+
8+
/**
9+
* Define a nav_msgs Path message. This has been hand-crafted from the corresponding
10+
* nav_msgs message file.
11+
*
12+
* @author Miquel Massot Campos
13+
*/
814

915
namespace ROSBridgeLib {
1016
namespace nav_msgs {
@@ -19,32 +25,47 @@ public PathMsg(JSONNode msg) {
1925
_poses.Add(new PoseStampedMsg(msg["poses"][i]));
2026
}
2127
}
22-
23-
/* public CompressedImageMsg(JSONNode msg) {
24-
_format = msg ["format"];
25-
_header = new HeaderMsg (msg ["header"]);
26-
//_poses =
27-
} */
28-
29-
/* public static string GetMessageType() {
30-
return "geometry_msgs/Twist";
31-
} */
32-
33-
/* public HeaderMsg GetHeader() {
28+
29+
public static string GetMessageType() {
30+
return "nav_msgs/Path";
31+
}
32+
33+
public HeaderMsg GetHeader() {
3434
return _header;
35-
} */
35+
}
36+
37+
public PoseStampedMsg GetPoseStamped(int idx = 0) {
38+
if (idx < _poses.Count) {
39+
return _poses [idx];
40+
} else {
41+
return null;
42+
}
43+
}
3644

37-
/* public PoseStamped[] GetPoses() {
38-
return _poses;
39-
} */
40-
/*
4145
public override string ToString() {
42-
return "Twist [linear=" + _linear.ToString() + ", angular=" + _angular.ToString() + "]";
46+
string array = "[";
47+
for (int i = 0; i < _poses.Count; i++) {
48+
array = array + _poses[i].ToString();
49+
if (_poses.Count - i <= 1)
50+
array += ",";
51+
}
52+
array += "]";
53+
54+
return "Path [header=" + _header.ToString()
55+
+ ", poses=" + array + "]";
4356
}
44-
57+
4558
public override string ToYAMLString() {
46-
return "{\"linear\" : " + _linear.ToYAMLString() + ", \"angular\" : " + _angular.ToYAMLString() + "}";
47-
} */
59+
string array = "{";
60+
for (int i = 0; i < _poses.Count; i++) {
61+
array = array + _poses[i].ToYAMLString();
62+
if (_poses.Count - i <= 1)
63+
array += ",";
64+
}
65+
array += "}";
66+
return "{\"header\" : " + _header.ToYAMLString()
67+
+ ", \"poses\" : " + array + "}";
68+
}
4869
}
4970
}
5071
}

sensor_msgs/PointCloud2Msg.cs

+7-22
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/**
1212
* Define a PointCloud2 message.
13+
*
14+
* @author Miquel Massot Campos
1315
*/
1416

1517
namespace ROSBridgeLib {
@@ -23,7 +25,6 @@ public class PointCloud2Msg : ROSBridgeMsg {
2325
private bool _is_dense;
2426
private uint _point_step;
2527
private uint _row_step;
26-
private byte[] _data;
2728
private PointCloud<PointXYZRGB> _cloud;
2829

2930

@@ -91,50 +92,34 @@ public uint GetRowStep() {
9192
return _row_step;
9293
}
9394

94-
//public PointCloud<PointXYZRGB> GetCloud() {
95-
// return _cloud;
96-
//}
95+
public PointCloud<PointXYZRGB> GetCloud() {
96+
return _cloud;
97+
}
9798

9899
public static string GetMessageType() {
99100
return "sensor_msgs/PointCloud2";
100101
}
101102

102103
public override string ToString() {
103-
string array = "[";
104-
for (int i = 0; i < _data.Length; i++) {
105-
array = array + _data[i];
106-
if (_data.Length - i <= 1)
107-
array += ",";
108-
}
109-
array += "]";
110104
return "PointCloud2 [header=" + _header.ToString() +
111105
"height=" + _height +
112106
"width=" + _width +
113107
"fields=" + _fields.ToString() +
114108
"is_bigendian=" + _is_bigendian +
115109
"is_dense=" + _is_dense +
116110
"point_step=" + _point_step +
117-
"row_step=" + _row_step +
118-
"data=" + array + "]";
111+
"row_step=" + _row_step + "]";
119112
}
120113

121114
public override string ToYAMLString() {
122-
string array = "[";
123-
for (int i = 0; i < _data.Length; i++) {
124-
array = array + _data[i];
125-
if (_data.Length - i <= 1)
126-
array += ",";
127-
}
128-
array += "]";
129115
return "{\"header\" :" + _header.ToYAMLString() +
130116
"\"height\" :" + _height +
131117
"\"width\" :" + _width +
132118
"\"fields\" :" + _fields.ToYAMLString() +
133119
"\"is_bigendian\" :" + _is_bigendian +
134120
"\"is_dense\" :" + _is_dense +
135121
"\"point_step\" :" + _point_step +
136-
"\"row_step\" :" + _row_step +
137-
"\"data\" :" + array + "}";
122+
"\"row_step\" :" + _row_step + "}";
138123
}
139124
}
140125
}

sensor_msgs/PointFieldMsg.cs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/**
88
* Define a PointCloud2 message.
9+
* @author Miquel Massot Campos
910
*/
1011

1112
// Datatype:

std_msgs/Float32Msg.cs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ public class Float32Msg : ROSBridgeMsg {
99
private float _data;
1010

1111
public Float32Msg(JSONNode msg) {
12-
//Debug.Log ("Float32Msg with " + msg.ToString());
1312
_data = float.Parse(msg);
1413
}
1514

std_msgs/Float64Msg.cs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ public class Float64Msg : ROSBridgeMsg {
99
private double _data;
1010

1111
public Float64Msg(JSONNode msg) {
12-
//Debug.Log ("Float64Msg with " + msg.ToString());
1312
_data = double.Parse(msg);
1413
}
1514

0 commit comments

Comments
 (0)