Skip to content

Commit

Permalink
Verify standard ROS messages are correctly collected
Browse files Browse the repository at this point in the history
  • Loading branch information
mullr committed May 3, 2024
1 parent 1639e51 commit 08ff046
Show file tree
Hide file tree
Showing 71 changed files with 1,344 additions and 9 deletions.
14 changes: 5 additions & 9 deletions integration-test/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ docker run -t --rm \
-v ~/.config/modality_cli:/root/.config/modality_cli \
modality-ros2-integration-test


docker run -t --rm --net=host \
-e PATH=/ \
-e MODALITY_AUTH_TOKEN=${modality_auth_token} \
--entrypoint /bin/bash \
-v ./smoke.speqtr:/smoke.speqtr \
${reflector_image} \
-c "conform spec eval --file /smoke.speqtr --dry-run"

docker run -t --rm --net=host -e PATH=/ -e MODALITY_AUTH_TOKEN=${modality_auth_token} \
-v ./specs:/specs \
-v ./inner_verify.sh:/inner_verify.sh \
--entrypoint /bin/bash ${reflector_image} \
-c "/inner_verify.sh"
13 changes: 13 additions & 0 deletions integration-test/inner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
source /opt/ros/humble/setup.bash
export LD_PRELOAD=/libmodality_ros_hook.so:/opt/ros/humble/lib/librmw_fastrtps_cpp.so

set -ex

(
cd /messages
for msg_file in $(find . -name "*.json"); do
schema=$(dirname ${msg_file})/$(basename ${msg_file} .json)
schema=$(echo ${schema} | sed "s/\\.\\///" )
topic=${schema}
ros2 topic pub -t 1 -w 0 ${topic} ${schema} "$(cat ${msg_file})"
done
)


/opt/ros/humble/lib/demo_nodes_py/listener &
sleep 1
/opt/ros/humble/lib/demo_nodes_py/talker &
Expand Down
8 changes: 8 additions & 0 deletions integration-test/inner_verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set -ex

modality workspace sync-indices
modality query *@*

for s in /specs/*; do
conform spec eval --file ${s} --dry-run
done
4 changes: 4 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Accel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
linear: { x: 1.0, y: 2.0, z: 3.0 },
angular: { x: 4.0, y: 5.0, z: 6.0 }
}
10 changes: 10 additions & 0 deletions integration-test/messages/geometry_msgs/msg/AccelStamped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
accel: {
linear: { x: 1.0, y: 2.0, z: 3.0 },
angular: { x: 4.0, y: 5.0, z: 6.0 }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
accel: {
linear: { x: 1.0, y: 2.0, z: 3.0 },
angular: { x: 4.0, y: 5.0, z: 6.0 }
},
covariance: [
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
header: {
stamp: { sec: 42, nanosec: 43},
frame_id: "test"
},
accel: {
accel: {
linear: { x: 1.0, y: 2.0, z: 3.0 },
angular: { x: 4.0, y: 5.0, z: 6.0 }
},
covariance: [
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0
]
}
}
10 changes: 10 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Inertia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
m: 1.0,
com: { x: 2.0, y: 3.0, z: 4.0},
ixx: 5.0,
ixy: 6.0,
ixz: 7.0,
iyy: 8.0,
iyz: 9.0,
izz: 10.0
}
16 changes: 16 additions & 0 deletions integration-test/messages/geometry_msgs/msg/InertiaStamped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
header: {
stamp: { sec: 42, nanosec: 43},
frame_id: "test"
},
inertia: {
m: 1.0,
com: { x: 2.0, y: 3.0, z: 4.0},
ixx: 5.0,
ixy: 6.0,
ixz: 7.0,
iyy: 8.0,
iyz: 9.0,
izz: 10.0
}
}
5 changes: 5 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Point.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
x: 1.0,
y: 2.0,
z: 3.0
}
5 changes: 5 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Point32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
x: 1.0,
y: 2.0,
z: 3.0
}
11 changes: 11 additions & 0 deletions integration-test/messages/geometry_msgs/msg/PointStamped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
point: {
x: 1.0,
y: 2.0,
z: 3.0
}
}
7 changes: 7 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Polygon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
points: [
{x: 1, y: 2, z: 3},
{x: 4, y: 5, z: 6},
{x: 7, y: 8, z: 9}
]
}
13 changes: 13 additions & 0 deletions integration-test/messages/geometry_msgs/msg/PolygonStamped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
polygon: {
points: [
{x: 1, y: 2, z: 3},
{x: 4, y: 5, z: 6},
{x: 7, y: 8, z: 9}
]
}
}
4 changes: 4 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Pose.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
position: { x: 1.0, y: 2.0, z: 3.0 },
orientation: { x: 4.0, y: 5.0, z: 6.0, w: 7.0 }
}
5 changes: 5 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Pose2D.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
x: 1.0,
y: 2.0,
theta: 3.0
}
16 changes: 16 additions & 0 deletions integration-test/messages/geometry_msgs/msg/PoseArray.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
header: {
stamp: { sec: 42, nanosec: 43},
frame_id: "test"
},
poses: [
{
position: { x: 1.0, y: 2.0, z: 3.0 },
orientation: { x: 4.0, y: 5.0, z: 6.0, w: 7.0 }
},
{
position: { x: 8.0, y: 9.0, z: 10.0 },
orientation: { x: 11.0, y: 12.0, z: 13.0, w: 14.0 }
}
]
}
10 changes: 10 additions & 0 deletions integration-test/messages/geometry_msgs/msg/PoseStamped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
pose: {
position: { x: 1.0, y: 2.0, z: 3.0 },
orientation: { x: 4.0, y: 5.0, z: 6.0, w: 7.0 }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
pose: {
position: { x: 1.0, y: 2.0, z: 3.0 },
orientation: { x: 4.0, y: 5.0, z: 6.0, w: 7.0 }
},
covariance: [
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
pose: {
pose: {
position: { x: 1.0, y: 2.0, z: 3.0 },
orientation: { x: 4.0, y: 5.0, z: 6.0, w: 7.0 }
},
covariance: [
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0
]
}
}
6 changes: 6 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Quaternion.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
x: 1.0,
y: 2.0,
z: 3.0,
w: 4.0,
}
12 changes: 12 additions & 0 deletions integration-test/messages/geometry_msgs/msg/QuaternionStamped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
quaternion: {
x: 1.0,
y: 2.0,
z: 3.0,
w: 4.0,
}
}
4 changes: 4 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Transform.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
translation: { x: 1.0, y: 2.0, z: 3.0 },
rotation: { x: 4.0, y: 5.0, z: 6.0, w: 7.0 }
}
10 changes: 10 additions & 0 deletions integration-test/messages/geometry_msgs/msg/TransformStamped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
transform: {
translation: { x: 1.0, y: 2.0, z: 3.0 },
rotation: { x: 4.0, y: 5.0, z: 6.0, w: 7.0 }
}
}
4 changes: 4 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Twist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
linear: { x: 1.0, y: 2.0, z: 3.0 },
angular: { x: 4.0, y: 5.0, z: 6.0 }
}
10 changes: 10 additions & 0 deletions integration-test/messages/geometry_msgs/msg/TwistStamped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
twist: {
linear: { x: 1.0, y: 2.0, z: 3.0 },
angular: { x: 4.0, y: 5.0, z: 6.0 }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
twist: {
linear: { x: 1.0, y: 2.0, z: 3.0 },
angular: { x: 4.0, y: 5.0, z: 6.0 }
},
covariance: [
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
twist: {
twist: {
linear: { x: 1.0, y: 2.0, z: 3.0 },
angular: { x: 4.0, y: 5.0, z: 6.0 }
},
covariance: [
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0
]
}
}
5 changes: 5 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Vector3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
x: 1.0,
y: 2.0,
z: 3.0
}
11 changes: 11 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Vector3Stamped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
vector: {
x: 1.0,
y: 2.0,
z: 3.0
}
}
4 changes: 4 additions & 0 deletions integration-test/messages/geometry_msgs/msg/Wrench.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
force: { x: 1.0, y: 2.0, z: 3.0 },
torque: { x: 4.0, y: 5.0, z: 6.0 }
}
10 changes: 10 additions & 0 deletions integration-test/messages/geometry_msgs/msg/WrenchStamped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
wrench: {
force: { x: 1.0, y: 2.0, z: 3.0 },
torque: { x: 4.0, y: 5.0, z: 6.0 }
}
}
12 changes: 12 additions & 0 deletions integration-test/messages/nav_msgs/msg/GridCells.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
header: {
stamp: { sec: 42, nanosec: 43 },
frame_id: "test"
},
cell_width: 1.0,
cell_height: 2.0,
cells: [
{ x: 1.0, y: 2.0, z: 3.0 },
{ x: 4.0, y: 5.0, z: 6.0 }
]
}
10 changes: 10 additions & 0 deletions integration-test/messages/nav_msgs/msg/MapMetaData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
map_load_time: { sec: 42, nanosec: 43 },
resolution: 1.0,
width: 2,
height: 3,
origin: {
position: { x: 1.0, y: 2.0, z: 3.0 },
orientation: { x: 4.0, y: 5.0, z: 6.0, w: 7.0 }
}
}
Loading

0 comments on commit 08ff046

Please sign in to comment.