Skip to content

Commit 940de44

Browse files
committed
IFF case study changes
1 parent 9ebacf9 commit 940de44

File tree

9 files changed

+59
-42
lines changed

9 files changed

+59
-42
lines changed

examples/iff_dsu.lola

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
in rawHuman
2+
in useNucOne // Not used yet - comment out to show bug
3+
out numberOfHumans
4+
out bugPrevent // TC bug...
5+
out hasError
6+
out hadError
7+
aux cameraChange
8+
numberOfHumans = Map.get(rawHuman, "number_of_humans")
9+
bugPrevent = useNucOne
10+
// Camera starts as being true
11+
cameraChange = !(default(useNucOne[1], true) == useNucOne)
12+
hasError = !(!cameraChange || numberOfHumans == 0) // Negated implication
13+
hadError = hasError == true || default(hadError[1], false) // Globally

examples/iff_dsu_map.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"rawHuman": {
3+
"topic": "/human_safety_volume",
4+
"msg_type": "HumanModelList"
5+
},
6+
"useNucOne": {
7+
"topic": "/use_nuc_1",
8+
"msg_type": "Bool"
9+
}
10+
}

ros_interfaces/robo_sapiens_interfaces/CMakeLists.txt

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,19 @@ endif()
88
# find dependencies
99
find_package(ament_cmake REQUIRED)
1010
find_package(rosidl_default_generators REQUIRED)
11+
find_package(builtin_interfaces REQUIRED)
12+
find_package(std_msgs REQUIRED)
13+
find_package(geometry_msgs REQUIRED)
14+
1115

1216
rosidl_generate_interfaces(${PROJECT_NAME}
13-
"msg/HumanBodyPart.msg"
14-
"msg/Human.msg"
15-
"msg/HumanList.msg"
16-
)
17+
"msg/HumanModelList.msg"
18+
"msg/HumanModel.msg"
19+
"msg/HumanModelPart.msg"
20+
DEPENDENCIES builtin_interfaces std_msgs geometry_msgs
21+
)
1722

18-
if(BUILD_TESTING)
19-
find_package(ament_lint_auto REQUIRED)
20-
# the following line skips the linter which checks for copyrights
21-
# comment the line when a copyright and license is added to all source files
22-
set(ament_cmake_copyright_FOUND TRUE)
23-
# the following line skips cpplint (only works in a git repo)
24-
# comment the line when this package is in a git repo and when
25-
# a copyright and license is added to all source files
26-
set(ament_cmake_cpplint_FOUND TRUE)
27-
ament_lint_auto_find_test_dependencies()
28-
endif()
23+
ament_export_dependencies(rosidl_default_runtime)
2924

3025
ament_package()
26+

ros_interfaces/robo_sapiens_interfaces/msg/Human.msg

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
int64 human_id
2+
HumanModelPart[] human_model_parts

ros_interfaces/robo_sapiens_interfaces/msg/HumanList.msg renamed to ros_interfaces/robo_sapiens_interfaces/msg/HumanModelList.msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
int64 number_of_humans
22
int64 time
33
float64 start_time
4-
Human[] humans
4+
HumanModel[] human_models

ros_interfaces/robo_sapiens_interfaces/msg/HumanBodyPart.msg renamed to ros_interfaces/robo_sapiens_interfaces/msg/HumanModelPart.msg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
string body_part
2-
float64 x # Transoformation von Roboter Base zu Kamera
1+
string human_model_part
2+
float64 x
33
float64 y
44
float64 z
55
float64 q_x
66
float64 q_y
77
float64 q_z
88
float64 q_w
99
string geometry # Sphere (Ellypsoid) , Box, Kegel
10-
float64 p_1
10+
float64 p_1
1111
float64 p_2
1212
float64 p_3
13-
bool collision
13+
bool collision

src/io/ros/input_provider.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,31 +84,31 @@ impl ROSMsgType {
8484
node.subscribe::<r2r::std_msgs::msg::Float32>(topic, qos)?
8585
.map(|val| Value::Float(val.data.into())),
8686
),
87-
ROSMsgType::Human => Box::pin(
88-
node.subscribe::<r2r::robo_sapiens_interfaces::msg::Human>(topic, qos)?
87+
ROSMsgType::HumanModelPart => Box::pin(
88+
node.subscribe::<r2r::robo_sapiens_interfaces::msg::HumanModelPart>(topic, qos)?
8989
.map(|val| {
9090
serde_json::to_value(val)
91-
.expect("Failed to serialize ROS2 Human msg to JSON")
91+
.expect("Failed to serialize ROS2 HumanModelPart msg to JSON")
9292
.try_into()
93-
.expect("Failed to serialize ROS2 Human msg to internal representation")
93+
.expect("Failed to serialize ROS2 HumanModelPart msg to internal representation")
9494
}),
9595
),
96-
ROSMsgType::HumanList => Box::pin(
97-
node.subscribe::<r2r::robo_sapiens_interfaces::msg::HumanList>(topic, qos)?
96+
ROSMsgType::HumanModel => Box::pin(
97+
node.subscribe::<r2r::robo_sapiens_interfaces::msg::HumanModel>(topic, qos)?
9898
.map(|val| {
9999
serde_json::to_value(val)
100-
.expect("Failed to serialize ROS2 HumanList msg to JSON")
100+
.expect("Failed to serialize ROS2 HumanModel msg to JSON")
101101
.try_into()
102-
.expect("Failed to serialize ROS2 HumanList msg to internal representation")
102+
.expect("Failed to serialize ROS2 HumanModel msg to internal representation")
103103
}),
104104
),
105-
ROSMsgType::HumanBodyPart => Box::pin(
106-
node.subscribe::<r2r::robo_sapiens_interfaces::msg::HumanBodyPart>(topic, qos)?
105+
ROSMsgType::HumanModelList => Box::pin(
106+
node.subscribe::<r2r::robo_sapiens_interfaces::msg::HumanModelList >(topic, qos)?
107107
.map(|val| {
108108
serde_json::to_value(val)
109-
.expect("Failed to serialize ROS2 HumanBodyPart msg to JSON")
109+
.expect("Failed to serialize ROS2 HumanModelList msg to JSON")
110110
.try_into()
111-
.expect("Failed to serialize ROS2 HumanBodyPart msg to internal representation")
111+
.expect("Failed to serialize ROS2 HumanModelList msg to internal representation")
112112
}),
113113
),
114114
})

src/io/ros/ros_topic_stream_mapping.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ pub enum ROSMsgType {
1515
Int8,
1616
Float64,
1717
Float32,
18-
Human,
19-
HumanList,
20-
HumanBodyPart,
18+
HumanModelPart,
19+
HumanModel,
20+
HumanModelList,
2121
}
2222

2323
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug)]
@@ -38,9 +38,9 @@ pub fn string_to_ros_msg_type(typ: &str) -> Result<ROSMsgType, anyhow::Error> {
3838
"Int8" => Ok(ROSMsgType::Int8),
3939
"Float64" => Ok(ROSMsgType::Float64),
4040
"Float32" => Ok(ROSMsgType::Float32),
41-
"Human" => Ok(ROSMsgType::Human),
42-
"HumanList" => Ok(ROSMsgType::HumanList),
43-
"HumanBodyPart" => Ok(ROSMsgType::HumanBodyPart),
41+
"HumanModelPart" => Ok(ROSMsgType::HumanModelPart),
42+
"HumanModel" => Ok(ROSMsgType::HumanModel),
43+
"HumanModelList" => Ok(ROSMsgType::HumanModelList),
4444
typ => Err(anyhow!("Unsupported type {}", typ)),
4545
}
4646
}

0 commit comments

Comments
 (0)