rvmi / skiros2 Goto Github PK
View Code? Open in Web Editor NEWA skill-based platform for ROS v.2
License: Other
A skill-based platform for ROS v.2
License: Other
In one Skill I update a parameter which I want to use in the "next skill".
This is getspeed that outputs forwardspeed and rotationspeed. It works great when used in the SkillManager, but it gives me always "forward speed: 0.0" (upon self.success) if used in a serialstar (while it is not 0.0, as tested standalone).
How can I get updated parameters from one skill to another?
`
class GetSpeed(SkillDescription):
def createDescription(self):
self.addParam("Distance", 0.0, ParamTypes.Required)
self.addParam("Angle", 0.0, ParamTypes.Required)
self.addParam("Duration", 1.0, ParamTypes.Required)
self.addParam("ForwardSpeed", 1.0, ParamTypes.Inferred)
self.addParam("RotationSpeed", 1.0, ParamTypes.Inferred)
class getspeed(PrimitiveBase):
def createDescription(self):
self.setDescription(GetSpeed(), self.class.name)
def execute(self):
t = self.params["Duration"].value
self.params["ForwardSpeed"].value = self.params["Distance"].value / t
self.params["RotationSpeed"].value = self.params["Angle"].value / t
return self.success("forward speed:" + str(self.params["ForwardSpeed"].value))
def onEnd(self):
return True
`
while not working when used in :
`
class MoveDistance(SkillDescription):
def createDescription(self):
self.addParam("Turtle", Element("cora:Robot"), ParamTypes.Required)
self.addParam("Distance", 0.0, ParamTypes.Required)
self.addParam("Angle", 0.0, ParamTypes.Required)
self.addParam("Duration", 1.0, ParamTypes.Required)
self.addParam("ForwardSpeed", 0.0, ParamTypes.Optional)
self.addParam("RotationSpeed", 0.0, ParamTypes.Optional)
class movedistance(SkillBase):
def createDescription(self):
self.setDescription(MoveDistance(), self.class.name)
def expand(self, skill):
skill.setProcessor(SerialStar())
uid = id(self)
skill(
self.skill("GetSpeed", "getspeed"),
self.skill("Move2", "move2") <-- this one has ForwardSpeed as inputparameter (!)
}
`
Currently the SkillManagerNode
that brings up the skill manager needs spinning during the __init__
function to register the skills with the world model:
skiros2/skiros2_skill/skiros2_skill/ros/skill_manager.py
Lines 187 to 188 in ed5bc90
However after we're done starting up the SkillManagerNode
, we enter a rclpy.spin
. This means that the WorldModelInterface
that is used inside the SkillManager
must not spin anymore.
skiros2/skiros2_skill/skiros2_skill/ros/skill_manager.py
Lines 498 to 501 in ed5bc90
Currently this is resolved by setting an allow_spinning
variable in the WorldModelInterface
that is used here:
skiros2/skiros2_world_model/skiros2_world_model/ros/ontology_interface.py
Lines 299 to 310 in ed5bc90
That works, but it's not a very sound solution.
When adding a property such as
el = self.params["Param"].value
el.setProperty("skiros:myProperty", [0.0, 0.0, 0.0, 0.0])
self._wmi.update_element_properties(el)
Converting the list to a string yields to the expected behavior.
Hi,
I created a skill that makes a robot pick parts from a container. In the world model, part instances are associated to a container instance through the following relations:
Scene-0 | hasA | Container-175 |
---|---|---|
Container-175 | contain | Part-184 |
Container-175 | contain | Part-186 |
Container-175 | contain | Part-188 |
Container-175 | contain | ... |
I created a skill description where I specify a robot and a container, and I let SkiROS automatically parametrize the Part parameter by imposing a precondition. This way, the skill chooses one of the parts in the container to pick:
class PickPart(SkillDescription):
def CreateDescription(self):
#=======Params==
self.addParam('Robot', Element('cora:Robot'), ParamTypes.Required)
self.addParam('Container', Element('skiros:Container'), ParamTypes.Required)
self.addParam('Part', Element('skiros:Part'), ParamTypes.Inferred)
#=======PreConditions==
self.addPreCondition(self.getRelationCond('InferPart', 'skiros:contain', 'Container', 'Part', True))
During skill execution, the relation of the Part with the Container is broken once the robot picks the part from the container. This way, each time we launch the skill, another part instance is found when the parameter Part is autoparametrized through the preconditions. By launching the skill several times, the robot unloads the container.
However, we want the iterative behaviour to be automatic, i.e. instead of manually launching the picking skill several times in a row, it should automatically start looping the skill until there are no more Part instances linked to the Container.
Let's try to follow my way of reasoning:
skill()
statement in the skill's expand(self, skill)
method, but that didn't work out.Repeating()
which is basically the same as SerialStar()
, but it restarts the sequence of children if they all succeeded.Status.Idle
. So, since I want to loop over the skill as long as the preconditions can render a suitable parametrization, I implemented the Repeating()
processor such that it exits once the skill I want to loop returns Status.Idle
. This way, I have a processor that keeps on executing the same skill as long as a parametrization can be obtained.In short, I have now something like this:
class unload_container(SkillBase):
def expand(self, skill):
skill.setProcessor(Repeating())
skill(
self.skill('PickPart', 'pick_part', specify={'Robot': robot, 'Container': container})
)
The skill PickPart is now executed, and SkiROS autoparametrized a suitable Part instance that has the desired relation to the Container. Also, after successful execution, the Repeating()
processor tries to restart the skill PickPart again.
However, The skill returns Status.Idle
the second time, and I receive the message that the relation for the given Part instance is not met. Here, the message mentions the Part instance that has been autoparametrized in the previous iteration.
Actually, I want that the skill re-evaluates its pre-conditions each time the skill is triggered, and that the parameters are updated accordingly.
Since the first iteration always involves a suitable autoparametrization, and since I can entirely unload the container by manually pressing the playbutton several times, I definitely think it should be possible somehow, although I don't manage to find the right way to do it.
Thus far, I have been attracted to
def process(self, procedure):
in visitors.pydef specifyParams(self, input_params, keep_default=True):
in abstract_skill.py, skill.py and params.py.def checkRules(self, p1, p2):
in visitors_optimizer.pyCould you please point me in the right direction?
Regards,
Toon Daemen
Robotics engineer at Flanders Make, Belgium
When not returning anything in the execute
function of a primitive this ends a task immediately without explicitly saying why (if i remember correctly).
Hello people. What is "the map"?
I altered the turtles example and added in the owl-file a named individual turtlebot.owl#planonce with class Sumo:Agent.
First of all, all the named individuals I defined are not added to the world model, but the robot turtle_robot is used in the world model (!)
But once I started the skillmanager I was able to add the namedindivudal under Scene:0 and use it.
However, when I use this as a parameter defined in a skill I get:
"error: Param turtlebot:Once is not in the map. Debug: Turtle: cora:Robot-1-turtlebot:turtle_robot Robot: sumo:Agent- DoOnce: sumo:Object-35-planonce ".
So probably I need to add it to a map, it is already in the world model, what more do I need to do to be able to use additional namedindividuals????
in world_element.py
there's a function appendProperty
I wrote some unit tests for
def appendProperty(self, key, value):
"""
@brief Append a value to the property. If property doesn't exist it is created.
>>> e = Element()
>>> e.setProperty("Integer", 2, "xsd:int")
>>> e.getProperty("Integer").value
2
>>> e.appendProperty("Integer", 3)
>>> e.getProperty("Integer")
[2, 3]
"""
self._setLastUpdate()
if self.hasProperty(key):
self._properties[key].append(value)
else:
self.setProperty(key, value, is_list=True)
this one fails with AttributeError: 'Property' object has no attribute 'append'
When I try to launch the task planner example with
roslaunch skiros2_examples planning_example.launch
and I run "task_plan"
skill from skiros GUI with a Goal in PDDL format.
skiros:contain skiros:LargeBox-80 skiros:Starter-145
I get the following error message
Task planner unsupported operand type(s) for +: 'NoneType' and 'string'
in the skiros GUI.
Any idea why this happens? I installed the Fast Downward planner using the script in skiros2/skiros2/scripts
before running.
Kind regards
Hi,
I experience the following problem when I want to use parameters of the type inferred:
Consider two skills that implement the functionality to respectively pick a part from a container, and place a part in a container. Both skills have a very similar SkillDescription:
class PickSkill(SkillDescription):
def createDescription(self):
#=======Params=========
self.addParam("Container", Element("skiros:Container") , ParamTypes.Required)
self.addParam("Part", Element("skiros:Part") , ParamTypes.Inferred)
#=======PreConditions=========
self.addPreCondition(self.getPropCond("PartPresent", "hasObject", "Part", "=", True, True))
self.addPreCondition(self.getRelationCond("InferPart", "skiros:contain", "Container", "Part", True))
#=======PostConditions=========
self.addPostCondition(self.getPropCond("PartPresent", "hasObject", "Part", "=", False, True))
class PlaceSkill(SkillDescription):
def createDescription(self):
#=======Params=========
self.addParam("Container", Element("skiros:Container") , ParamTypes.Required)
self.addParam("Part", Element("skiros:Part") , ParamTypes.Inferred)
#=======PreConditions=========
self.addPreCondition(self.getPropCond("PartPresent", "hasObject", "Part", "=", False, True))
self.addPreCondition(self.getRelationCond("InferPart", "skiros:contain", "Container", "Part", True))
#=======PostConditions=========
self.addPostCondition(self.getPropCond("PartPresent", "hasObject", "Part", "=", True, True))
The skills expect the container where we want to pick or place a part to be specified, and will infer the Part instance from the world model through the pre-condition labeled "InferPart": It will look which Part instance is related to the given Container instance through the predicate 'skiros:contain'. The Part instance here is actually a placeholder for a part, and the actual presence of a part is indicated by a parameter 'hasObject', that is being checked by the condition labeled "PartPresent".
This works as expected, If I run the pick skill or place skill, the right Part instance is inferred, and the skill only executes when the condition labeled 'PartPresent' is fulfilled.
however, it fails when I make a pick-and-place skill, which sequences the pick skill and place skill respectively:
skill(
self.skill('PickSkill', 'pick_skill', specify={Container: container_pick}),
self.skill('PlaceSkill', 'place_skill', specify={Container: container_place})
)
What happens now is that SkiROS fails to infer the part that is related to the container where we want to place the part, because it tries to find a relation between the container we specify for placing, and the part that was previously inferred in the picking skill. I suspect that it somehow is caused by world model elements that are listed on the Blackboard, because:
When I add parameters, I tried to specify parameter options, like Consume or Unspecify. According to the source code these options should result in the world model elements being removed from the blackboard after skill execution.
self.addParam("Part", Element("skiros:Part") , ParamTypes.Inferred, [ParamOptions.Unspecify])
However, I notice that it does not work when two skills are sequenced...
Could you please provide me some information on how I should address my issue?
I also would be happy if you could provide me some good examples on inference and resolving from the world model, as these are really powerful features.
Regards,
Toon Daemen
Robotics Researcher at Flanders Make, Belgium
Hi there,
I have a setup with multiple robots, and want to separate the skills for each of them.
On the wiki, I read sentences wherein the skill manager node is referenced in singular, and in the architecture there seems to be only one skill manager node.
At deployment time the skill manager node loads the desired skills [...].
However, when building the launch file for my application, I encounter an argument for the skill manager node, robot_name
, singular.
<arg name="robot_name" value="$(arg robot_name)"/>
This makes me believe each robot should have its own skill manager node.
When I make two of these <include>
blocks in the launch file, with a different libraries_list
, skill_list
and robot_name
, two skill manager nodes are indeed started and two separate xterms pop up, all skills are loaded fine, the rostopics come up for each of them and everything seems in perfect harmony.
However, as soon as I execute some of those skills from the GUI, it fails (No plugin with name ... found
), because all skills execute on the skill manager node that loaded first, the second skill manager never does anything.
How should I do this? Should I make two skill manager nodes, or is there a way to tell the skill manager node that I have two separate robots? What should I put for robot_name
then?
Best regards,
Robbert
SkiROS2 has an interactive marker server that allows to manipulate the pose of a world model element directly in RViz.
When having the marker activated in RViz2 it prints a lot of log messages until a first world model element is selected in the world model.
Possibly this could be resolved in "our" server side. The current situation means that we can not really have RViz configurations that have the marker enabled.
python2 will not be maintained past 2020.
A countdown can be found here https://pythonclock.org/
Currently it says 7 months and we know how fast those pass.
Also I need to remember to open spyder for python2 every time.
How to reproduce:
Run any example you like that uses the GUI. Click on the plus to add an object to the scene. As type choose Location
, as subtype choose TransformationPose
and as individual choose new TransformationPose
. This should give the following output:
SkirosWidget Create element based on skiros:TransformationPose
[get_individual] error: Ignoring skiros:TransformationPose-rdfs:subClassOf-skiros:Location. Predicate is not defined in the ontology.
SkirosWidget Added element owl:Class-33-TransformationPose to skiros:Scene-0
Now select the object and add a property like PositionX. The GUI then crashes and the following error message is printed:
setValues error: skiros:PositionX: Input <type 'unicode'> != <type 'float'>. Debug: skiros:PositionX:[]
Service call failed: service [/wm/modify] responded with an error: error processing request: list index out of range
Traceback (most recent call last):
File "/home/emmanuel/rvmi_ws/src/libs/skiros2/skiros2/skiros2_gui/src/skiros2_gui/core/skiros_widget.py", line 681, in on_add_property_button_clicked
self._wmi.update_element_properties(elem)
File "/home/emmanuel/rvmi_ws/src/libs/skiros2/skiros2/skiros2_world_model/src/skiros2_world_model/ros/world_model_interface.py", line 230, in update_element_properties
res = self._call(self._modify, msg)
File "/home/emmanuel/rvmi_ws/src/libs/skiros2/skiros2/skiros2_world_model/src/skiros2_world_model/ros/ontology_interface.py", line 305, in _call
raise WmException("Service call failed: %s" % e)
skiros2_world_model.core.world_model_abstract_interface.WmException: Service call failed: service [/wm/modify] responded with an error: error processing request: list index out of range
[skiros_gui-3] process has died [pid 22690, exit code -6, cmd /opt/ros/melodic/lib/rqt_gui/rqt_gui -s gui.skiros __name:=skiros_gui __log:=/home/emmanuel/.ros/log/44ef3bea-8985-11ea-be3b-a86daad6e8db/skiros_gui-3.log].
log file: /home/emmanuel/.ros/log/44ef3bea-8985-11ea-be3b-a86daad6e8db/skiros_gui-3*.log
How to reproduce:
Launch turtlesim_example.The default path to save a scene should be scenes/simulation.turtle. Click save scene. The gui should then crash if the scenes folder does not exist in skiros2_test_lib/owl.
When installing rdflib using, e.g.: pip install --user rdflib (installing the following: isodate-0.6.0 pyparsing-2.4.7 rdflib-5.0.0 six-1.14.0) on ubuntu 18.04 leads to the following:
[ERROR] [1588781225.330220]: Error processing request: cannot import name parser
['Traceback (most recent call last):\n', ' File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 632, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n', ' File "/home/francesco/ros_ws/rvmi_ws/src/libs/skiros2/skiros2/skiros2_world_model/src/skiros2_world_model/ros/ontology_server.py", line 44, in _wo_query_cb\n for s in self._ontology.query(msg.query_string, context_id=msg.context):\n', ' File "/home/francesco/.local/lib/python2.7/site-packages/wrapt/decorators.py", line 502, in _synchronized_wrapper\n return wrapped(*args, **kwargs)\n', ' File "/home/francesco/ros_ws/rvmi_ws/src/libs/skiros2/skiros2/skiros2_world_model/src/skiros2_world_model/core/ontology_rdflib.py", line 138, in query\n return self.ontology(context_id).query(query)\n', ' File "/home/francesco/.local/lib/python2.7/site-packages/rdflib/graph.py", line 1127, in query\n result = plugin.get(result, query.Result)\n', ' File "/home/francesco/.local/lib/python2.7/site-packages/rdflib/plugin.py", line 107, in get\n return p.getClass()\n', ' File "/home/francesco/.local/lib/python2.7/site-packages/rdflib/plugin.py", line 69, in getClass\n module = import(self.module_path, globals(), locals(), [""])\n', ' File "/home/francesco/.local/lib/python2.7/site-packages/rdflib/plugins/sparql/init.py", line 33, in \n from . import parser\n', 'ImportError: cannot import name parser\n']
In ROS 1 we installed wrapt
and inflection
as pip packages with requirements.txt
.
In ROS 2 Humble on 22.04 we used the system packages so far. This should be a more stable choice, however, there is currently no procedure to install them.
The easiest way is to have again an install script and/or some instructions.
The nice way would be to make a PR for rosdep
and make a PR for a new rule and put them in the package.xml
Hi, I am using skiros2 for a simple navigation planning. I uses a connection relation that shows the connectivity between way-points and the relation should be symmetric. But in precondition check, it seems to be a directional relation.
E.g. I have a graph showing
point1 connected point2
point2 connected point3
point3 connected point1,
and with the precondition " Connected, ns:hasConnection, Start, Target, True", and point1 as Start, point3 as Target, I can get a plan that goes from point1 to point2 and point3. However, a plan that goes from point1 to point3 is also possible.
How can I check the symmetric property in condition check? Sorry for non-native expressions.
Thanks.
When running the Gazebo simulation of the WARA robotics, the robot TF frames are published in simulation time like in ROS 1, so a number in the several hundreds.
However frames that came from the world model were shown to be published in Linux time (about 1709320098) in rqt_tf_tree
. This usually means that the transformations can not be resolved due to the time mismatch.
I already checked that skiros:TfTimestamp
was not set in the world model. Maybe one needs to pay attention to what clock to use in tf2 in ROS 2.
The task_manager_interface
would wait forever for the task manager to come up.
If the task manager was not started, this results in a stalled system without feedback.
I am getting a strange error. I think it's caused by the /wm/ontology/query service not being able to set an attribute due to a "Parse error with following query: SELECT ?x WHERE { ?x rdfs:subPropertyOf* skiros:spatiallyRelated . } . "
Below is the output and error.
$roslaunch skiros2 skiros.launch
PARAMETERS
NODES
/
map2world (tf/static_transform_publisher)
skiros_gui (rqt_gui/rqt_gui)
test_robot (skiros2_skill/skill_manager_node)
tm (skiros2_task/task_manager_node)
wm (skiros2_world_model/world_model_server_node)
[WorldModelServer] Workspace folder: /home/me/catkin_ws/src/skiros2/skiros2/owl
[load_reasoner] Loaded AauSpatialReasoner
[WorldModelInterface] Wm communications active.
[WorldModelInterface] Waiting wm communications...
[WorldModelInterface] Wm communications active.
AauSpatialReasoner warn: Adding relation to cora:Robot-1-skiros:test_robot
[AauSpatialReasoner] Publishing cora:Robot-1-skiros:test_robot parent: map
AauSpatialReasoner warn: Adding relation to skiros:Location-5-skiros:unknown_location
[SkillManager] Registered robot cora:Robot-1-skiros:test_robot
[wm_update] Wm not in sync, querying wm scene
[WoQuery] error: Parse error with following query: SELECT ?x WHERE { ?x rdfs:subPropertyOf* skiros:spatiallyRelated . } .
[ERROR] [1700793233.610550]: Error processing request: can't set attribute
['Traceback (most recent call last):\n', ' File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 633, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n', ' File "/home/me/catkin_ws/src/skiros2/skiros2_world_model/src/skiros2_world_model/ros/ontology_server.py", line 60, in _wo_query_cb\n raise e\n', ' File "/home/me/catkin_ws/src/skiros2/skiros2_world_model/src/skiros2_world_model/ros/ontology_server.py", line 44, in _wo_query_cb\n for s in self._ontology.query(msg.query_string, context_id=msg.context):\n', ' File "/usr/lib/python3/dist-packages/wrapt/decorators.py", line 500, in _synchronized_wrapper\n return wrapped(*args, **kwargs)\n', ' File "/home/me/catkin_ws/src/skiros2/skiros2_world_model/src/skiros2_world_model/core/ontology_rdflib.py", line 138, in query\n return self.ontology(context_id).query(query)\n', ' File "/home/me/.local/lib/python3.8/site-packages/rdflib/graph.py", line 1084, in query\n result = plugin.get(result, query.Result)\n', ' File "/home/me/.local/lib/python3.8/site-packages/rdflib/plugin.py", line 104, in get\n return p.getClass()\n', ' File "/home/me/.local/lib/python3.8/site-packages/rdflib/plugin.py", line 66, in getClass\n module = import(self.module_path, globals(), locals(), [""])\n', ' File "/home/me/.local/lib/python3.8/site-packages/rdflib/plugins/sparql/init.py", line 35, in \n from . import parser\n', ' File "/home/me/.local/lib/python3.8/site-packages/rdflib/plugins/sparql/parser.py", line 182, in \n Param('prefix', PN_PREFIX)) + Suppress(':').leaveWhitespace()\n', ' File "/home/me/.local/lib/python3.8/site-packages/rdflib/plugins/sparql/parserutils.py", line 113, in init\n self.name = name\n', "AttributeError: can't set attribute\n"]
Service call failed: service [/wm/ontology/query] responded with an error: b"error processing request: can't set attribute"
Traceback (most recent call last):
File "/home/me/catkin_ws/src/skiros2/skiros2_world_model/src/skiros2_world_model/ros/ontology_interface.py", line 301, in _call
resp1 = service(msg)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 442, in call
return self.call(*args, **kwds)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 523, in call
responses = transport.receive_once()
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 742, in receive_once
p.read_messages(b, msg_queue, sock)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 360, in read_messages
self._read_ok_byte(b, sock)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 343, in _read_ok_byte
raise ServiceException("service [%s] responded with an error: %s"%(self.resolved_name, str))
rospy.service.ServiceException: service [/wm/ontology/query] responded with an error: b"error processing request: can't set attribute"
Loading reasoners in ROS 2 needs to be tackled:
reasoners_pkgs
parameter that is passedAauSpatialReasoner
is not spinning and therefore does not receive TF dataAs a workaround we hard-coded this parameter here for now:
skiros2/skiros2_common/skiros2_common/core/world_element.py
Lines 119 to 122 in ed5bc90
When loading the reasoners for the first time we create a new node. Not only should that prevent us from accessing the parameter (afaik), but if the name of the "SkillManagerNode" is overwritten in the launch file, this name would also be used here when creating the second node. This leads to issues with ROS.
skiros2/skiros2_common/skiros2_common/core/world_element.py
Lines 119 to 120 in ed5bc90
It looks like the reasoner that is started with the procedure above does not spin. The would make sense since this node is never spun by any executor.
The observation is that TF operations from within skills can not be performed.
Solution:
All those 3 issues could be resolved if the node is passed.
If a skill with optional parameters is started with the optional parameters being set, this parameter can not be "unset" or not set in subsequent executions.
So even if one selects the empty entry for that optional parameter in the SkiROS GUI, the next time the skill is started, it would still receive the old value.
Setting new values works as expected, but not setting a value is currently not possible.
This can be cured by restarting the GUI.
https://github.com/RVMI/skiros2/wiki/Overview:-Data-model
Example doesn't run:
import skiros2_world_model.ros.world_model_interface as wmi
(scene, scene_id) = wmi.get_scene()
for e in scene:
print e.printState()
On develop
it seems that it should rather be:
import skiros2_world_model.ros.world_model_interface as wmi
wmi_inst = wmi.WorldModelInterface()
(scene, scene_id) = wmi.WorldModelInterface.get_scene(wmi_inst)
for e in scene:
print e.printState()
Hi,
i am trying to create a scene for the robot operation environment. I have defined the owl in Protege and then i launch it but only robot is added on the scene with skills list which i can see in WorldModel tab of Rviz. I have manually converted individuals to elements for accessing their properties. How can i use the owl to automatically add individuals to the WorldModel scene upon launching?
Thank you.
I am working on an integration where I want an external python script to initiate the execution of a skill available in SkiROS2.
On the wiki home page, it says
The skills can be parametrized and executed through the SkiROS GUI, or directly through a ROS service for integrated solutions.
While everything works fine using the SkiROS GUI, I haven't got the ROS service working yet.
I just type in rosservice call
, and then use tab completion until I see the name of the robot that lives in SkiROS. This give me four options:
/robot_name/command
/robot_name/get_skills
/robot_name/get_loggers
/robot_name/set_logger_level
of which I assume only the first two to be relevant for this problem.
Calling rosservice call /robot_name/get_skills
prints a quite verbose list of skills with their parameters.
Then, further using tab completion on rosservice call /robot_name/command
results in a multi-line completion in my terminal, with some parameters to be filled in:
author
, where I put my own name between the quotesaction
, where I put lower-case start
between the quotesexecution_id
, where I've tried -1
, 0
, and some bigger integersskills
, which expands to type
, name
and params
To keep things simple, I made a dummy_primitive
, which takes no parameters, and on execution just prints dummy_primitive called
and then returns success.
For type
, I set skiros:DummyPrimitive
, just like I named the SkillDescription class, and just like how it appears in the world model.
For name
, I set dummy_primitive
, like I named it in the primitives file, and also how it appears in the world model.
The params
section, I either leave unchanged, or remove entirely.
Executing this command results in ok: True
and yields the following output in the skill_manager_node terminal:
[start] Starting task 0.
[BtTicker] Execution starts.
[BtTicker] Execution stops.
However, when executing this very same primitive through the use of the GUI, we can already observe a difference:
[SkillManager] Add task skiros:DummyPrimitive:dummy_primitive
[start] Starting task 23.
[BtTicker] Execution starts.
MatchWm skiros:DummyPrimitive:[Robot=cora:Robot-1-robot_type:robot_name]
dummy_primitive called
[BtTicker] Execution stops.
It seems that the GUI also makes sure that the SkillManager adds a task, which is then executed.
So to summarize, my question is: how can I execute a skill from an external python script or command line?
In a compound skill, it is possible to not have the the skill description and the explicitly set skill implementation to match. iirc, the chosen skill implementation is executed, but the post-conditions of the skill description are checked.
I think that this should result in an error. Otherwise it can be hard to track down.
The task manager package in SkiROS2 and the SkiROS2 examples are not ported to ROS 2 yet.
In ROS 1 we had patterns to load different sets of skills depending on arguments in the launch files. For example:
<arg name="fake_vision" default="true"/>
<arg if="$(arg fake_vision)" name="fake_vision_suffix" default="_fake"/>
<arg unless="$(arg fake_vision)" name="fake_vision_suffix" default=""/>
<arg name="skill_list" default="[object_localization$(arg fake_plugging_suffix),
This would load object_localization_fake
if fake_vision
is set.
It would be great to explore some patterns for ROS 2.
E.g. skiros2 world_model_server.launch
relies on xterm
to be present which wasn't installed on my machine.
When expanding a skill like this:
skill.setProcessor(Selector())
skill(
self.skill("check_if_reached", ""),
self.skill("PoseThreeAxis", "pose_three_axis"),
)
instead of this
skill.setProcessor(Selector())
skill(
self.skill("Check", "check_if_reached"),
self.skill("PoseThreeAxis", "pose_three_axis"),
)
leads to a
Exception in thread Thread-17:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager.py", line 61, in _run
printer.traverse(t)
File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/core/visitors.py", line 40, in traverse
self._setState(root.visit(self))
File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/core/skill.py", line 223, in visit
return visitor.process(self)
File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/core/visitors.py", line 51, in process
state = self.processChildren(procedure)
File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/core/visitors.py", line 106, in processChildren
[...]
File "/usr/lib/python2.7/copy.py", line 182, in deepcopy
rv = reductor(2)
TypeError: can't pickle thread.lock objects
that is not very descriptive.
In eb2195f I disabled to load the GUI directly with arguments from the launch file with this block:
skiros2/skiros2/launch/skiros2.launch.py
Lines 56 to 59 in eb2195f
For some reason it does not find it and then rqt does not startup at all.
Things that I checked:
/opt/ros/humble/lib/rqt_gui/rqt_gui -s skiros2_gui.gui.Skiros --ros-args
For now this just does not load the GUI directly. Once rqt is up, one can select it from the menu. When rqt is started again, it would also automatically show the SkiROS2 GUI again.
Unfortunately I could not find a launch file example on the internet that directly loads an rqt plugin.
Here a new skill has parameters "Target" and "Task", but the parent skill does not set them.
The expectation is that this is displayed in a nicer way than showing the exception in the UI
[skill_manager_node-4] File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_skill/skiros2_skill/core/visitors.py", line 145, in processNode
[skill_manager_node-4] state = self.execute(procedure)
[skill_manager_node-4] File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_skill/skiros2_skill/core/skill_utils.py", line 229, in execute
[skill_manager_node-4] if not self._ground(skill):
[skill_manager_node-4] File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_skill/skiros2_skill/core/skill_utils.py", line 181, in _ground
[skill_manager_node-4] if not self._autoParametrizeBB(skill):
[skill_manager_node-4] File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_skill/skiros2_skill/core/skill_utils.py", line 143, in _autoParametrizeBB
[skill_manager_node-4] raise Exception("Missing required parameter(s): {}".format(missing_params))
[skill_manager_node-4] Exception: Missing required parameter(s): ['Target', 'Task']
[skill_manager_node-4]
When restarting the skill manager while a skill is running, the GUI crashes when starting the first skill after the skill manager becomes online again:
Traceback (most recent call last):
File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_gui/skiros2_gui/core/skiros_widget.py", line 1331, in on_skill_exe_button_clicked
if self._sli.agent.execute(execution_id=self._sli.agent.task):
File "/home/matthias/Workspaces/skiros2_ws/build/skiros2_skill/skiros2_skill/ros/skill_manager_interface.py", line 42, in task
return self.tasks[0]
IndexError: list index out of range
I ran into a couple of warning in the fashion:
PluginLoader warn: WARNING: Multiple plugins with name demo_piston_insertion found!
[<class 'skills_sandbox.coordinator_psa_demos.demo_piston_insertion'>, <class 'skills_sandbox.demos.piston_insertion_demo.demo_piston_insertion'>]
As you might remember you recently restructured this repo. So I could find the current .py
and the corresponding .pyc
file. But I could also still find the .pyc
at the old location and apparently the skill_manager tried to load that one as well.
I am not sure what the best solution would be. Delete pyc
files on a regular basis? Check if there are still corresponding python file?
But I guess the result of this behavior could be that only the first implementation found will be loaded, which would probably confuse non-expert users.
In the turtlesim_example, in turtlesim_skills.py, I tried to import ConditionAbstractRelation from skiros2_common.core.conditions (to use it in a precondition) and it gave me an error.
Not related :
While still being quite new to "professional" python development, I would argue that it makes sense to follow some codestyle guidelines.
My current IDE spyder has a built-in parser that does some style checks following "pycodestyle" [1] - formerly pep8 - but also some checks about deprecated access types and so on.
They seem to be quite helpful to me, well supported and accepted in the python community.
What do you think?
[1] https://pypi.org/project/pycodestyle/
P.S.: While using spyder now, I am open for suggestions
What about doing static code analysis with pylint
or something similar?
It seems to catch a lot of errors that can easily be found with static code analysis and could prevent annoying crashes at runtime.
It would also be possible to easily integrate it with travis_ci
so one wouldn't need to check manually.
If remaps are done wrongly, there is no direct indication.
A minimal example is a compound "SkillB" with
In this compound skill a wrong remap has been performed:
self.skill("SkillA "skill_a", remap={'param':'param_c'}),
Notably, param_c
does not exist in "SkillB". Such a wrong remap does not lead to any error messages.
When using param
inside "skill_a", it actually remapped to param_a
.
Hello,
I have a part which has a label "coupling_middle" and two frames that are linked to this part ([part_name]_approach and [part_name]_handle) in the ontology and when I access these elements as on line 17 and 18 I have the correct element, however it looks like the id is not updated in the element.
When I execute the skill ArmMove, the parameter "frame" is not giving the correct label when accessing it this way:
self.frame = self.params["frame"].value.label
On the gui I always receive the first frame as a success message suggesting that the label is not refreshed or something like this. Do you have an idea how to solve this?
1.
2. class PickSkill(SkillDescription):
3.
4. def createDescription(self):
5. self.addParam("object_to_pick",Element("skiros:Part"),ParamTypes.Required)
6.
7.
8. class pick_skill_fake(SkillBase):
9.
10. def createDescription(self):
11. self.setDescription(PickSkill(), self.__class__.__name__)
12.
13. def expand(self, skill):
14.
15. part =self.params["object_to_pick"].value
16. part_name = part.label
17. approach_frame = Element(etype="infraflex:ApproachPose", elabel=part_name+"_approach")
18. handle_frame = Element(etype="infraflex:HandlePose", elabel=part_name+"_handle")
19.
20. skill.setProcessor(SerialStar())
21. skill(
22. self.skill("FindHandlePose", "find_handlePose", specify={"method": "skiros_wm","object_to_handle": self.params["object_to_pick"].value}),
23. self.skill("ArmMove", "arm_move_fake", specify={ "frame":handle_frame}),
24. self.skill("ArmMove", "arm_move_fake", specify={ "frame":approach_frame}),
25.
26. )
ArmMove primitive implementation:
class ArmMove(SkillDescription):
"""
@brief returns moving until "done"
"""
def createDescription(self):
# =======Params=========
self.addParam("frame",Element("skiros:TransformationPose"), ParamTypes.Required)
class arm_move_fake(PrimitiveBase):
def createDescription(self):
self.setDescription(ArmMove(), self.__class__.__name__)
def onPreempt(self):
return self.success("Interrupted")
def onStart(self):
self.actual_time = 50
self.frame = self.params["frame"].value.label
return True
def execute(self):
self.actual_time = self.actual_time - 1.0
if self.actual_time <0 :
return self.success("Arm moved to {}".format(self.frame))
return self.step("Arm moving {}".format(self.actual_time))
Returning
return self.fail(-1, "Location not reached")
in a primitive leads to
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager.py", line 64, in _run
self._tick()
File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager.py", line 77, in _tick
self.publish_progress(uid, visitor)
File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager.py", line 100, in publish_progress
self._progress_cb(task_id=uid, id=id, **desc)
File "/home/ar-14/catkin_ws/src/libs/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager.py", line 400, in _on_progress_update
self._monitor.publish(msg)
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/topics.py", line 886, in publish
raise ROSSerializationException(str(e))
ROSSerializationException: field progress_code must be an integer type
which is not very descriptive.
The title of the pop-ups when clicking the plus sign to add a property or to add relations says "add object" instead off "add property" and "add relation".
When testing the YuMi gripper skill I started out by calling the actuate_yumi_gripper
primitive with the left arm from the GUI.
When starting to test it on the right arm, it still received the world model element for the right arm inside the skill in the onStart
function.
I haven't checked if this is a GUI issue or skill manager/world model issue. When debugging one can think about starting the skill directly from python.
@marcusklang: This should be possible to reproduce with that skill. I just set a breakpoint in onStart
before it initializes the robot interface since that would not connect.
Hi,
Last Friday, we were getting a cryptic error resulting from an argumentless "raise" in world_model_interface. In python2, that results in TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType
.
This was resolved by simply increasing iters = 5
to iters = 10
. The problem is: we have no clue if 10 is a sensible choice or whether it will scale to large world models, because we don't understand what _resolve_elements2
is doing.
The brief description for this function is to "Find all possible inputs for one or more keys of a skill parameter handler".
Does that mean that when you have a certain skill where parameters need to be inferred, this method will go into the world model to find out which world elements can be used to fill in those parameters?
If so, how does it differ from resolve_elements() or ontology_interface.get_individuals ?
Kind regards,
Robbert
I am currently looking at the unit tests and quite a lot of them fail on my platform and there could be several reasons for that.
========= Testing json serialization =========
**********************************************************************
File "/home/matthias/catkin_ws/src/skiros2/skiros2_common/src/skiros2_common/ros/utils.py", line 226, in skiros2_common.ros.utils.serializeParamMap
Failed example:
serializeParamMap(ph._params)
Expected:
[param: {"values": [], "specType": 2, "type": "dict", "description": "", "key": "MyDict"}]
Got:
[param: "{\"values\": [], \"specType\": 0, \"type\": \"dict\", \"description\": \"\", \"key\"\
: \"MyDict\"}"]
**********************************************************************
File "/home/matthias/catkin_ws/src/skiros2/skiros2_common/src/skiros2_common/ros/utils.py", line 229, in skiros2_common.ros.utils.serializeParamMap
Failed example:
serializeParamMap(ph._params)
Expected:
[param: {"values": [], "specType": 2, "type": "list", "description": "", "key": "MyList"}, param: {"values": [], "specType": 2, "type": "dict", "description": "", "key": "MyDict"}]
Got:
[param: "{\"values\": [], \"specType\": 0, \"type\": \"list\", \"description\": \"\", \"key\"\
: \"MyList\"}", param: "{\"values\": [], \"specType\": 0, \"type\": \"dict\", \"description\": \"\", \"key\"\
: \"MyDict\"}"]
There's several things here:
I get a lot of those backslashes in my results. I can compensate in the test result of course, but I was wondering if this is something platform specific since I am running Ubuntu 18.04 and python 2.7.
In both tests specType
should be 2
but is 0
. Is the unittest outdated or is there a bug in the code?
There is also some of those:
File "/home/matthias/catkin_ws/src/skiros2_std_lib/skiros2_std_reasoners/src/skiros2_std_reasoners/aau_spatial_reasoner.py", line 465, in skiros2_std_reasoners.aau_spatial_reasoner.AauSpatialReasoner._getAIRelations
Failed example:
sr._getAIRelations(3, 3, 3, 3, 'X')
Expected:
[':mX']
Got:
[':mX', 0.0]
But looking at the code it looks like the test hasn't been updated.
When having the whole real WARA robotics setup in the same ROS_DOMAIN_ID
, the world model interface service calls to the world model become very slow. It looked like 3-4 per second. This means that the skill manager needs several second per skill to launch. Starting a new skill takes at least one or two seconds.
I am not sure if this is an issue in our current usage of the ROS 2 service client. Maybe a MultiThreadedExecutor could help, but it would probably also have other implications.
I am running a lot of tasks with SkiROS and received one of these recently:
1603701395.683933973 INFO /worker_manager [skiros_rl_client.py:215(SkirosRlClient.next_callback)] [topics: /skill_managers/discovery, /bh_robot_4/tick_rate, /bh_robot_4/set_debug, /rosout, /bh_robot_4/monitor, /skill_managers/description, /bh_robot_2/monitor, /bh_robot_3/monitor, /bh_robot_1/set_debug, /bh_robot_1/monitor, /bh_robot_3/tick_rate, /wm/monitor, /bh_robot_3/set_debug, /bh_robot_2/tick_rate, /bh_robot_1/tick_rate, /bh_robot_2/set_debug] 2: Ending task 65451
1603701395.701773881 INFO /worker_manager [skiros_rl_client.py:181(SkirosRlClient.next_callback)] [topics: /skill_managers/discovery, /bh_robot_4/tick_rate, /bh_robot_4/set_debug, /rosout, /bh_robot_4/monitor, /skill_managers/description, /bh_robot_2/monitor, /bh_robot_3/monitor, /bh_robot_1/set_debug, /bh_robot_1/monitor, /bh_robot_3/tick_rate, /wm/monitor, /bh_robot_3/set_debug, /bh_robot_2/tick_rate, /bh_robot_1/tick_rate, /bh_robot_2/set_debug] 4: Starting new task
1603701395.706203937 ERROR /worker_manager [tcpros_service.py:581(Service.error_handler)] [topics: /skill_managers/discovery, /bh_robot_4/tick_rate, /bh_robot_4/set_debug, /rosout, /bh_robot_4/monitor, /skill_managers/description, /bh_robot_2/monitor, /bh_robot_3/monitor, /bh_robot_1/set_debug, /bh_robot_1/monitor, /bh_robot_3/tick_rate, /wm/monitor, /bh_robot_3/set_debug, /bh_robot_2/tick_rate, /bh_robot_1/tick_rate, /bh_robot_2/set_debug] Error processing request: 32Broken pipe
['Traceback (most recent call last):\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 632, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/blackdrops/src/skiros_integration/skiros_rl_client.py", line 193, in next_callback\n self.task_id = self.agent.tick_once(skill_list=[skill], param_list=params_des)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py", line 113, in tick_once\n return self.execute(execution_id, skill_list, srvs.SkillCommandRequest().TICK_ONCE, param_list)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py", line 101, in execute\n res = self.call(self._skill_exe_client, msg)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py", line 199, in call\n resp1 = service(msg)\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 442, in __call__\n return self.call(*args, **kwds)\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 519, in call\n transport.send_message(request, self.seq)\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 673, in send_message\n self.write_data(self.write_buff.getvalue())\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 698, in write_data\n raise TransportTerminated(str(ioe_errno)+msg)\n', 'TransportTerminated: 32Broken pipe\n']
1603701395.707558000 ERROR /blackdrops_1603679732000701267 [/tmp/binarydeb/ros-melodic-roscpp-1.14.9/src/libros/service_server_link.cpp:378(ServiceServerLink::call)] [topics: /rosout] Service call failed: service [/skiros_worker_4] responded with an error: error processing request: 32Broken pipe
1603701395.708432912 ERROR /worker_manager [tcpros_service.py:581(Service.error_handler)] [topics: /skill_managers/discovery, /bh_robot_4/tick_rate, /bh_robot_4/set_debug, /rosout, /bh_robot_4/monitor, /skill_managers/description, /bh_robot_2/monitor, /bh_robot_3/monitor, /bh_robot_1/set_debug, /bh_robot_1/monitor, /bh_robot_3/tick_rate, /wm/monitor, /bh_robot_3/set_debug, /bh_robot_2/tick_rate, /bh_robot_1/tick_rate, /bh_robot_2/set_debug] Error processing request: 'NoneType' object has no attribute 'close'
['Traceback (most recent call last):\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 632, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/blackdrops/src/skiros_integration/skiros_rl_client.py", line 193, in next_callback\n self.task_id = self.agent.tick_once(skill_list=[skill], param_list=params_des)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py", line 113, in tick_once\n return self.execute(execution_id, skill_list, srvs.SkillCommandRequest().TICK_ONCE, param_list)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py", line 101, in execute\n res = self.call(self._skill_exe_client, msg)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py", line 199, in call\n resp1 = service(msg)\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 442, in __call__\n return self.call(*args, **kwds)\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 535, in call\n transport.close()\n', ' File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 846, in close\n self.socket.close()\n', "AttributeError: 'NoneType' object has no attribute 'close'\n"]
1603701395.709977804 ERROR /blackdrops_1603679732000701267 [/tmp/binarydeb/ros-melodic-roscpp-1.14.9/src/libros/service_server_link.cpp:378(ServiceServerLink::call)] [topics: /rosout] Service call failed: service [/skiros_worker_4] responded with an error: error processing request: 'NoneType' object has no attribute 'close'
1603701395.761034965 INFO /worker_manager [skiros_rl_client.py:181(SkirosRlClient.next_callback)] [topics: /skill_managers/discovery, /bh_robot_4/tick_rate, /bh_robot_4/set_debug, /rosout, /bh_robot_4/monitor, /skill_managers/description, /bh_robot_2/monitor, /bh_robot_3/monitor, /bh_robot_1/set_debug, /bh_robot_1/monitor, /bh_robot_3/tick_rate, /wm/monitor, /bh_robot_3/set_debug, /bh_robot_2/tick_rate, /bh_robot_1/tick_rate, /bh_robot_2/set_debug] 4: Starting new task
h_robot_1/tick_rate, /bh_robot_2/set_debug] 4: Starting new task
1603701395.771452903 ERROR /worker_manager [tcpros_service.py:581(Service.error_handler)] [topics: /skill_managers/discovery, /bh_robot_4/tick_rate, /bh_robot_4/set_debug, /rosout, /bh_robot_4/monitor, /skill_managers/description, /bh_robot_2/monitor, /bh_robot_3/monitor, /bh_robot_1/set_debug, /bh_robot_1/monitor, /bh_robot_3/tick_rate, /wm/monitor, /bh_robot_3/set_debug, /bh_robot_2/tick_rate, /bh_robot_1/tick_rate, /bh_robot_2/set_debug] Error processing request: 'NoneType' object has no attribute 'tell'
['Traceback (most recent call last):\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 632, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/blackdrops/src/skiros_integration/skiros_rl_client.py", line 193, in next_callback\n self.task_id = self.agent.tick_once(skill_list=[skill], param_list=params_des)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py", line 113, in tick_once\n return self.execute(execution_id, skill_list, srvs.SkillCommandRequest().TICK_ONCE, param_list)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py", line 101, in execute\n res = self.call(self._skill_exe_client, msg)\n', '
File "/home/ubuntu/Workspaces/blackdrops_ws/src/skiros2/skiros2/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py", line 199, in call\n resp1 = service(msg)\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 442, in __call__\n return self.call(*args, **kwds)\n', ' File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 519, in call\n transport.send_message(request, self.seq)\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 672, in send_message\n serialize_message(self.write_buff, seq, msg)\n', '
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/msg.py", line 139, in serialize_message\n start = b.tell()\n', "AttributeError: 'NoneType' object has no attribute 'tell'\n"]
My current workaround is this patch:
--- a/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py
+++ b/skiros2_skill/src/skiros2_skill/ros/skill_manager_interface.py
@@ -84,6 +84,16 @@ class SkillManagerInterface:
def get_skill(self, name):
return self._skill_list[name]
+ # Hack: This is a workaround because the connection breaks occasionally
+ def call_execute_client(self, msg):
+ try:
+ resp1 = self._skill_exe_client(msg)
+ return resp1
+ except rospy.ServiceException as e:
+ log.error("[call]", "Service call failed: %s. Renewing connection."%e)
+ self._skill_exe_client = rospy.ServiceProxy(self._skill_mgr_name + '/command', srvs.SkillCommand)
+ return
+
def execute(self, execution_id=-1, skill_list=None, action=srvs.SkillCommandRequest().START, param_list=None):
"""
@brief Execute a list of skills
@@ -98,7 +108,7 @@ class SkillManagerInterface:
if skill_list is not None:
for s in skill_list:
msg.skills.append(s.toMsg())
- res = self.call(self._skill_exe_client, msg)
+ res = self.call_execute_client(msg)
if res is None:
return -1
if not res.ok:
Since the call
function does not easily have the information available to re-instantiate the connection.
It seems like the uni-freiburg has changed their download address for the tfd planner.
In the "install_fd_task_planner.sh" I had to change the url in line 23
from: "https://gki.informatik.uni-freiburg.de/tools/tfd/downloads/version-0.4/${tfd}.tgz"
to: "https://tfd.informatik.uni-freiburg.de/downloads/version-0.4/${tfd}.tgz"
Hi,
I am getting a must be an rdflib term errors. An example of the error message looks like this, "Subject http://www.inf.ufrgs.br/phi-group/ontologies/cora.owl#Robot-1 must be an rdflib term". It doesn't seem that the errors are due to the skiros.owl and skirosExtra.owl files but rather from the owl files in the IEEE-1872-2015 folder. However, this doesn't make sense because I am able to view the owl files from the IEEE-1872-2015 folder in Protégé 5.6.3.
I have attached to outputs below.
Please also note that there are _SyntaxWarning: "is" with a literal. Did you mean "=="?_ errors but this is related to python 3.8 raising a SyntaxWarning due to the usage of "is" instead of "==".
Environment:
Ubuntu 20.04.6
Python 3.8.10
ROS Noetic
rdflib 7.0.0
Please advise.
Thank you.
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.