jason-lang / jason_ros Goto Github PK
View Code? Open in Web Editor NEWJason and ROS integration
License: GNU General Public License v3.0
Jason and ROS integration
License: GNU General Public License v3.0
RosArch
RosJasonNode
jason_msgs
When trying to perform an action that is not being described in action_manifest a key_error occurs in hw_bridge.py.
File "/jason_ws/src/hw_bridge/src/hw_controller.py", line 87, in perform_action
action = self.comm_dict[action_name]
Instead of raising the error in hw_bridge.py the action must be set as not done to jason
Perceptions:
string name
string[] params
int id
bool replaced
Actions:
string name
string[] params
int id
When an agent uses RosArch it is not possible to send/receive msgs via kqml, only via the ROS topics jason/send_msg
and jason/receive_msg
. Should it be like this? Allow the programmer to choose? Or create an additional architecture for when the agent needs to communicate via ROS? Like RosArchComm.
Services responses are not being sent to the agent. This should be implemented.
A possible way to do this would be to publish the response into a topic defined in the action description in action manifest, something like the response field below.
[set_fcu_param]
method = service
name = mavros/param/set
msg_type = mavros_msgs/ParamSet
params_name = param_id, value.integer, value.real
params_type = str, int, float
response = mavros/param/set/response
The response can be treated as a perception:
[set_fcu_param_response]
name = mavros/param/set/response
msg_type = mavros_msgs/ParamSetResponse
args = success, value.integer, value.float
buf = add
Allow the user to set rosparams via a configuration file.
Params manifest?
As instructed in the PR: ros/rosdistro#23751 (review)
Allow the user to set the perception rate in the perception manifest. Use the default field ([Default])
Instead of storing the perception in a dict and publishing it in a specific rate the perception should be pusblished in all callbacks
When the message type being published in action doesn't contain Header the following error arises:
raise AttributeError("%s is not an attribute of %s"%(k, self.__class__.__name__)) AttributeError: header is not an attribute of String
action_manifest:
[teste]
method = topic
name = /hw/teste
msg_type = String
dependencies = std_msgs.msg
params_name = teste1, teste2
params_type = str, bool
There are 2 problems with having more than one agent in the same MAS using jasonros.RosArch:
The quickest solution I can think of is to:
Example:
header = std_msgs.msg.Header()
header.stamp = rospy.Time.now()
kw['header'] = header
Instead of set_mode("custom_mode=GUIDED") use set_mode(GUIDED)
Use what is defined in actions_manifest params_names field
./hw_bridge.py -a path_action_man -p path_perception_man
place RosArch and other classes in a java package
Add field in perceptions_manifest to indicate if perception must be updated or added in the agents belief base
Design and implement unit and integration tests
data -> args
insertion - > buf
rate = rospy.Rate(perception_controller.rate)
while not rospy.is_shutdown():
for p in perception_controller.perceptions.values():
jason_percepts_pub.publish(p)
Add a parameter in action_manifest to indicate if the action should be latched or not
Latched actions are generating issues when used for communication. Maybe when the communication gets a separated topic this problem will be solved.
Override sendMsg to send messages via a rostopic
method = service
name = /mavros/set_mode
msg_type = SetMode
Implement ROS 2 version
usar API da classe jason…Agent
addBel
delBel
e cia
getTS().getAg().addBel(bel)
getTS().getAg().getBB().
getBB().contains(l)
getBB().getCandidateBeliefs(new PredicateIndicator("altidude", 1));
Iterator<Literal> ibb = getBB().getCandidateBeliefs(new PredicateIndicator("altidude", 1));
while (ibb.hasNext()) {
Literal l = ibb.next();
// if for altidude e diferente do atual
// ibb.remove();
// add event for l
}
// no futuro: get annots source(percept)
Create a brief tutorial on how to use this project.
Include examples.
Perception msg 1 is added in the belief base as a Term and perception msg 2 is added as a String. Why is this happening? Is this the expected treatment? I think they should be both added as Term.
Percept msg 1:
header:
seq: 679
stamp:
secs: 0
nsecs: 0
frame_id: ''
agent_name: ''
perception_name: "diagnostics"
parameters:
- '[[[energy, 6.208817140973544e-10]]]'
update: True
Perception manifest 1:
[diagnostics]
name = diagnostics
msg_type = diagnostic_msgs/DiagnosticArray
dependencies = diagnostic_msgs.msg
args = status[](values[](key, value))
buf = update
Percept msg 2:
header:
seq: 33
stamp:
secs: 0
nsecs: 0
frame_id: ''
agent_name: "metacontrol"
perception_name: "diagnostics"
parameters:
- '[[[Received packets:, 8867], [Dropped packets:, 0], [Buffer overruns:, 0], [Parse
errors:, 0], [Rx sequence number:, 215], [Tx sequence number:, 0], [Rx total bytes:,
286009], [Tx total bytes:, 17200], [Rx speed:, 7497.000000], [Tx speed:, 532.000000]],
[[Satellites visible, 10], [Fix type, 6], [EPH (m), 1.21], [EPV (m), 2.00]], [[Heartbeats
since startup, 45], [Frequency (Hz), 1.000003], [Vehicle type, Submarine], [Autopilot
type, ArduPilot], [Mode, MANUAL], [System status, Active]], [[Sensor present, 0x1330FD2F],
[Sensor enabled, 0x13209D2F], [Sensor health, 0x13309D2F], [3D gyro, Ok], [3D accelerometer,
Ok], [3D magnetometer, Ok], [absolute pressure, Ok], [GPS, Ok], [laser based position,
Ok], [3D angular rate control, Ok], [attitude stabilization, Ok], [yaw position,
Ok], [motor outputs / control, Ok], [AHRS subsystem health, Ok], [Logging, Ok],
[Battery, Ok], [pre-arm check status. Always healthy when armed, Ok], [CPU Load
(%), 0.0], [Drop rate (%), 0.0], [Errors comm, 0], [Errors count #1, 0], [Errors
count #2, 0], [Errors count #3, 0], [Errors count #4, 0]], [[Voltage, 12.59], [Current,
0.0], [Remaining, 90.0]], [[Timesyncs since startup, 455], [Frequency (Hz), 10.000050],
[Last RTT (ms), 5.155978], [Mean RTT (ms), 5.670888], [Last remote time (s), 958.590668000],
[Estimated time offset (s), 1639747256.374345064]]]'
update: True
Perception manifest 2:
[diagnostics]
name = diagnostics
msg_type = diagnostic_msgs/DiagnosticArray
dependencies = diagnostic_msgs.msg
args = status[](values[](key, value))
buf = update
Create doc folder
In perform_action:
Should service_aux and topic_pub be moved into CommInfo and just be called in this method?
This might make perform_action faster, however, possible it can make it use more memory
create 2 subclasses? ActionInfo and PercetionInfo?
Override checkMail
Message.msg
Header header
string receiver
string sender
string data
string itlforce
The manifest files uses the .ini format, and it was necessary to implement how to deal with this files.
I think it is worth exploring if the manifest files can be changed to .yaml format and used with rosparam, instead of reading it in hwbridge.py. With this, it will make the jason-ros package more similar to what is usually done in ROS, and it will leverage what is already implemented in rosparam.
The robot_localization package makes a good use of this, check this example file
Design a way to inform the hw_bridge node that the agent node started, and when this happens the perception "buffer" should be restarted.
When the agent node starts after the hw_bridge node it is missing the first perceptions, since hw_bridge node does not send a perception if it is equal to the last one.
Suppose that a particular msg type is:
MyMsg:
string myname
MyCustomMsg mycustommsg
MyCustomMsg:
string custom
In perception_manifest if we want to read the custom field of MyCustomMsg we would need to write the data field as:
data = custom
However, if we are reading MyMsg and want to get the custom field we want to write:
data = mycustommsg.custom
In hw_controller.py at subscriber_callback hasattr doesn't find fields that are concataneted
In CommInfo class data must be an array of array and then at subscriber_callback hasattr/getattr must be called iteratively
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.