Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
192 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
string interface | ||
bool include_semantic | ||
--- | ||
string[] providers | ||
string default_provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
test/unit/discovery_workspaces/remapping_examples/robot_base_pkg/interfaces/Distance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
%YAML 1.1 | ||
--- | ||
name: Distance | ||
spec_version: 1 | ||
spec_type: interface | ||
interface: | ||
topics: | ||
provides: | ||
'distance': | ||
type: 'std_msgs/Float32' |
9 changes: 9 additions & 0 deletions
9
...unit/discovery_workspaces/remapping_examples/robot_base_pkg/interfaces/FrontDistance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
%YAML 1.1 | ||
--- | ||
name: FrontDistance | ||
spec_version: 1 | ||
spec_type: semantic_interface | ||
redefines: 'robot_base_pkg/Distance' | ||
remappings: | ||
topics: | ||
'distance': 'front/distance' |
9 changes: 9 additions & 0 deletions
9
.../unit/discovery_workspaces/remapping_examples/robot_base_pkg/interfaces/RearDistance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
%YAML 1.1 | ||
--- | ||
name: RearDistance | ||
spec_version: 1 | ||
spec_type: semantic_interface | ||
redefines: 'robot_base_pkg/Distance' | ||
remappings: | ||
topics: | ||
'distance': 'rear/distance' |
12 changes: 12 additions & 0 deletions
12
test/unit/discovery_workspaces/remapping_examples/robot_base_pkg/interfaces/RobotBase.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
name: RobotBase | ||
spec_version: 1 | ||
spec_type: interface | ||
interface: | ||
topics: | ||
provides: | ||
'robot/front/distance': | ||
type: 'std_msgs/Float32' | ||
'robot/rear/distance': | ||
type: 'std_msgs/Float32' |
41 changes: 41 additions & 0 deletions
41
test/unit/discovery_workspaces/remapping_examples/robot_base_pkg/package.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<name>robot_base_pkg</name> | ||
<version>0.1.0</version> | ||
<description>desc</description> | ||
<maintainer email="user@todo.todo">User Name</maintainer> | ||
<license>BSD</license> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
|
||
<export> | ||
<capability_interface> | ||
interfaces/RobotBase.yaml | ||
</capability_interface> | ||
<capability_interface> | ||
interfaces/Distance.yaml | ||
</capability_interface> | ||
<semantic_capability_interface> | ||
interfaces/FrontDistance.yaml | ||
</semantic_capability_interface> | ||
<semantic_capability_interface> | ||
interfaces/RearDistance.yaml | ||
</semantic_capability_interface> | ||
<capability_provider> | ||
providers/robot_base.yaml | ||
</capability_provider> | ||
<capability_provider> | ||
providers/distance_front.yaml | ||
</capability_provider> | ||
<capability_provider> | ||
providers/distance_rear.yaml | ||
</capability_provider> | ||
<capability_provider> | ||
providers/front_distance.yaml | ||
</capability_provider> | ||
<capability_provider> | ||
providers/rear_distance.yaml | ||
</capability_provider> | ||
|
||
</export> | ||
</package> |
12 changes: 12 additions & 0 deletions
12
...unit/discovery_workspaces/remapping_examples/robot_base_pkg/providers/distance_front.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
name: distance_front | ||
spec_version: 1 | ||
spec_type: provider | ||
implements: robot_base_pkg/Distance | ||
depends_on: | ||
'robot_base_pkg/RobotBase': | ||
provider: 'robot_base_pkg/robot_base' | ||
remappings: | ||
topics: | ||
'distance': 'robot/front/distance' |
12 changes: 12 additions & 0 deletions
12
.../unit/discovery_workspaces/remapping_examples/robot_base_pkg/providers/distance_rear.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
name: distance_rear | ||
spec_version: 1 | ||
spec_type: provider | ||
implements: robot_base_pkg/Distance | ||
depends_on: | ||
'robot_base_pkg/RobotBase': | ||
provider: 'robot_base_pkg/robot_base' | ||
remappings: | ||
topics: | ||
'distance': 'robot/rear/distance' |
12 changes: 12 additions & 0 deletions
12
...unit/discovery_workspaces/remapping_examples/robot_base_pkg/providers/front_distance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
name: front_distance | ||
spec_version: 1 | ||
spec_type: provider | ||
implements: robot_base_pkg/FrontDistance | ||
depends_on: | ||
'robot_base_pkg/Distance': | ||
provider: 'robot_base_pkg/distance_front' | ||
remappings: | ||
topics: | ||
'front/distance': 'robot/front/distance' |
3 changes: 3 additions & 0 deletions
3
...discovery_workspaces/remapping_examples/robot_base_pkg/providers/launch/robot_base.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<launch> | ||
<node name="robot_base" pkg="robot_base_pkg" type="robot_base.py" output="screen" /> | ||
</launch> |
12 changes: 12 additions & 0 deletions
12
.../unit/discovery_workspaces/remapping_examples/robot_base_pkg/providers/rear_distance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
name: rear_distance | ||
spec_version: 1 | ||
spec_type: provider | ||
implements: robot_base_pkg/RearDistance | ||
depends_on: | ||
'robot_base_pkg/Distance': | ||
provider: 'robot_base_pkg/distance_rear' | ||
remappings: | ||
topics: | ||
'rear/distance': 'robot/rear/distance' |
7 changes: 7 additions & 0 deletions
7
test/unit/discovery_workspaces/remapping_examples/robot_base_pkg/providers/robot_base.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%YAML 1.1 | ||
--- | ||
name: robot_base | ||
spec_version: 1 | ||
spec_type: provider | ||
implements: robot_base_pkg/RobotBase | ||
launch_file: 'launch/robot_base.launch' |
22 changes: 22 additions & 0 deletions
22
test/unit/discovery_workspaces/remapping_examples/robot_base_pkg/scripts/robot_base.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
import random | ||
import time | ||
|
||
import rospy | ||
|
||
from std_msgs.msg import Float32 | ||
|
||
|
||
def main(): | ||
rospy.init_node('robot_base') | ||
pub_front = rospy.Publisher('robot/front/distance', Float32) | ||
pub_rear = rospy.Publisher('robot/rear/distance', Float32) | ||
while not rospy.is_shutdown(): | ||
msg = Float32(random.choice([1, 2, 3, 4])) | ||
rospy.loginfo("Sending distance: " + str(msg)) | ||
pub_front.publish(msg) | ||
pub_rear.publish(msg) | ||
time.sleep(1) | ||
|
||
if __name__ == '__main__': | ||
main() |