Skip to content

Commit 01d4643

Browse files
committed
✨ update examples
1 parent 1a5de4f commit 01d4643

File tree

10 files changed

+206
-5
lines changed

10 files changed

+206
-5
lines changed

jason_ros/config/actions_manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[teste]
22
method = topic
3-
name = hw/teste
3+
name = hw/teste1
44
msg_type = String
55
dependencies = std_msgs.msg
66
params_name = data

jason_ros/config/actions_manifest2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[teste]
2+
method = topic
3+
name = hw/teste2
4+
msg_type = String
5+
dependencies = std_msgs.msg
6+
params_name = data
7+
latch = True
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[DEFAULT]
2+
rate = 1
3+
4+
[state]
5+
name = hw/teste1
6+
msg_type = String
7+
dependencies = std_msgs.msg
8+
args = data
9+
buf = add
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
Project multiple_ags
3+
4+
Gradle build file for Jason Application
5+
December 07, 2021 - 19:44:15
6+
*/
7+
8+
defaultTasks 'run'
9+
10+
apply plugin: 'java'
11+
apply plugin: 'eclipse'
12+
13+
version '1.0'
14+
group 'org.jason'
15+
16+
java {
17+
toolchain {
18+
languageVersion = JavaLanguageVersion.of(15)
19+
}
20+
}
21+
22+
repositories {
23+
mavenCentral()
24+
jcenter()
25+
google()
26+
27+
//maven { url "http://jacamo.sourceforge.net/maven2" }
28+
maven { url "https://raw.github.com/jacamo-lang/mvn-repo/master" }
29+
maven { url "https://jade.tilab.com/maven/" }
30+
maven { url "https://raw.github.com/rosjava/rosjava_mvn_repo/master" }
31+
maven { url "https://raw.github.com/jason-lang/mvn-repo/master" }
32+
33+
flatDir { dirs 'lib' }
34+
}
35+
36+
dependencies {
37+
implementation group: 'org.jason', name: 'jason' , version: '3.0'
38+
implementation 'org.ros.rosjava_core:rosjava:[0.3,0.4)'
39+
implementation 'org.ros.rosjava_messages:std_msgs:[0.5,0.6)'
40+
implementation 'org.ros.rosjava_bootstrap:message_generation:[0.3,0.4)'
41+
implementation files('../../src/rosjava_agents/lib/jason_ros_msgs.jar') //(name:'jason_ros_msgs', ext:'jar')
42+
43+
implementation 'com.google.guava:guava:12.0'
44+
implementation 'org.apache.commons:com.springsource.org.apache.commons.logging:1.1.1'
45+
}
46+
47+
sourceSets {
48+
main {
49+
java {
50+
srcDir '../../src/rosjava_agents/src/java'
51+
}
52+
resources {
53+
srcDir '../../src/rosjava_agents/src/java'
54+
}
55+
}
56+
}
57+
58+
task run (type: JavaExec, dependsOn: 'classes') {
59+
description 'runs the application'
60+
main = 'jason.infra.local.RunLocalMAS'
61+
args 'multiple_ags.mas2j'
62+
// options:
63+
// args = ['multiple_ags.mas2j', '--debug']
64+
// args = ['multiple_ags.mas2j', '--log-conf', 'l.p'] // to use file l.p to configure logging
65+
classpath sourceSets.main.runtimeClasspath
66+
}
67+
68+
clean {
69+
delete 'bin'
70+
delete 'build'
71+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Jason Default log configuration
2+
#
3+
# Comment/uncomment the following lines to setup your log
4+
#
5+
6+
# default Jason MAS Console
7+
#handlers = jason.runtime.MASConsoleLogHandler
8+
9+
# To use the ConsoleHandler, use the following line instead.
10+
handlers= java.util.logging.ConsoleHandler
11+
12+
# To also add the FileHandler, use the following line instead.
13+
#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
14+
15+
# Default logging level. Other values are:
16+
# SEVERE (only severe messages)
17+
# WARNING (only warnings and severe messages)
18+
# INFO (normal output)
19+
# FINE (debug level of messages)
20+
.level = INFO
21+
22+
############################################################
23+
# Handler specific properties.
24+
# Describes specific configuration info for Handlers.
25+
############################################################
26+
27+
# Jason Handler parameters
28+
jason.runtime.MASConsoleLogHandler.level = ALL
29+
jason.runtime.MASConsoleLogHandler.formatter = jason.runtime.MASConsoleLogFormatter
30+
# set one text area for each agent
31+
jason.runtime.MASConsoleLogHandler.tabbed = false
32+
jason.runtime.MASConsoleLogHandler.colors = false
33+
34+
# default file output is in project's directory.
35+
java.util.logging.FileHandler.pattern = mas.log
36+
#java.util.logging.FileHandler.pattern = mas-%u.log
37+
java.util.logging.FileHandler.limit = 500000
38+
java.util.logging.FileHandler.count = 1
39+
java.util.logging.FileHandler.formatter = jason.runtime.MASConsoleLogFormatter
40+
#java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
41+
42+
# Limit the message that are printed on the console to FINE and above.
43+
java.util.logging.ConsoleHandler.level = FINE
44+
java.util.logging.ConsoleHandler.formatter = jason.runtime.MASConsoleLogFormatter
45+
46+
java.level=OFF
47+
javax.level=OFF
48+
sun.level=OFF
49+
jade.level=OFF
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
multiple_ags
3+
---------------------------
4+
5+
Jason Project File
6+
7+
This file defines the initial state of the MAS
8+
9+
Jason 3.0
10+
December 07, 2021 - 19:44:15
11+
*/
12+
13+
MAS multiple_ags {
14+
15+
infrastructure: Local
16+
17+
agents: sample_agent agentArchClass jasonros.RosArch;
18+
sample_agent2 agentArchClass jasonros.RosArch;
19+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Agent sample_agent in project multiple_ags
2+
3+
/* Initial beliefs and rules */
4+
5+
/* Initial goals */
6+
7+
!start.
8+
9+
/* Plans */
10+
11+
+!start : true <-
12+
teste("oi, sou agente 1");
13+
.print("hello world.");
14+
.send("bob", tell, oi("oi")).
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Agent sample_agent in project multiple_ags
2+
3+
/* Initial beliefs and rules */
4+
5+
/* Initial goals */
6+
7+
!start.
8+
9+
/* Plans */
10+
11+
+!start : true <-
12+
teste("oi, sou agente 2");
13+
.print("hello world.");
14+
.send("bob", tell, oi("oi")).

jason_ros/launch/example.launch

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<launch>
22
<group ns="myagent">
3-
<node name="jason_hw_bridge" pkg="jason_ros" type="hw_bridge.py"
4-
args="-a $(find jason_ros)/config/actions_manifest
5-
-p $(find jason_ros)/config/perceptions_manifest" output="screen"/>
3+
<node name="jason_hw_bridge" pkg="jason_ros" type="hw_bridge.py" output="screen">
4+
<param name="actions_manifest" value="$(find jason_ros)/config/actions_manifest"/>
5+
<param name="perceptions_manifest" value="$(find jason_ros)/config/perceptions_manifest"/>
6+
<param name="agent_name" value="sample_agent"/>
7+
</node>
68

79
<node name="jason_agent" pkg="jason_ros" type="gradle_starter.sh"
8-
args="$(find jason_ros)/src/rosjava_agents/build.gradle" output="screen"/>
10+
args="$(find jason_ros)/src/rosjava_agents/build.gradle"/>
911
</group>
1012
</launch>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<launch>
2+
<node name="jason_hw_bridge" pkg="jason_ros" type="hw_bridge.py" output="screen">
3+
<param name="actions_manifest" value="$(find jason_ros)/config/actions_manifest"/>
4+
<param name="perceptions_manifest" value="$(find jason_ros)/config/perceptions_manifest"/>
5+
<param name="agent_name" value="sample_agent"/>
6+
</node>
7+
8+
<node name="jason_hw_bridge2" pkg="jason_ros" type="hw_bridge.py" output="screen">
9+
<param name="actions_manifest" value="$(find jason_ros)/config/actions_manifest2"/>
10+
<param name="perceptions_manifest" value="$(find jason_ros)/config/perceptions_manifest2"/>
11+
<param name="agent_name" value="sample_agent2"/>
12+
</node>
13+
14+
<node name="jason_agent" pkg="jason_ros" type="gradle_starter.sh"
15+
args="$(find jason_ros)/examples/multiple_ags/build.gradle" output="screen"/>
16+
</launch>

0 commit comments

Comments
 (0)