Comments (4)
You are correct that the order in relations needs to be right. This often makes sense, because ObjA onTop ObjB
is not the same as ObjB onTop ObjA
.
There are several ways, your use-case could be tackled:
- Complete the world model with relations. This is the easiest thing to do. You can write a simple python script that checks all the connections and sets the reverse connections if they are not there yet. A big plus on this is that no other modifications are needed
- Improved pre-condition check: There is a special condition type that can connect two conditions. The ConditionOr that can connect several conditions. Its usage is shown here. It could be used to check either relation.
- Extend the relation-condition check: The relation condition check could also be extended with an additional argument to check in either direction.
I am not sure how well options 2-3 go with the planner. I haven't seen anyone doing 2. and at least 3. would require coding. My recommendation would be to just complement the relations. It's the safest and easiest.
from skiros2.
Thanks for your recommendations! This offers some solutions to me. I assume that the Option 1 would works well and treat it as the last choice because in my point of view, it would almost double the world model with completed relations.
I tried Option 2 in my case, using ConditionOr to combine both direction with addCondition.
self.connections = ConditionOr(True)
self.Target2Start = ConditionRelation("Connected", "ns1:hasConnection", "TargetLocation", "StartLocation", True)
self.Start2Target = ConditionRelation("Connected", "ns1:hasConnection", "StartLocation", "TargetLocation", True)
self.connections.addCondition(self.Target2Start)
self.connections.addCondition(self.Start2Target)
So far, the code seems to work well, self.connections
combine both direction with "or" and I get the description as expect in the terminal:
[or] ( [Connected) TargetLocation-ns1:hasConnection-StartLocation(True) [Connected] StartLocation-ns1:hasConnection-TargetLocation(True) )
I uses self.addPreCondition(self.connections)
and expects a both direction relation check. In self._pre_condition
, self.connections
is included.
However, when a goal was given, the generated domain file did not include the condition in self.connections
, what's more, all the connection relations are not generated in problem file. Also, when I ran a single skill, the error "can't autoparametrize param" occured. Would you please give more details?
Regards.
from skiros2.
Thanks for your recommendations! This offers some solutions to me. I assume that the Option 1 would works well and treat it as the last choice because in my point of view, it would almost double the world model with completed relations.
I would not really worry about the extra relations, but I can see why you want to check out the other options first.
However, when a goal was given, the generated domain file did not include the condition in self.connections
That could be. I haven't taken a look at the code that translates preconditions to PDDL
what's more, all the connection relations are not generated in problem file.
That could be an effect of the missing preconditions. iirc only things that play a role end up in the problem. So if the connection is not relevant, because the nested precondition is not processed, the connection would not be in the problem file
Also, when I ran a single skill, the error "can't autoparametrize param" occured. Would you please give more details?
This typically means that some inferred connection could not be resolved. To really help you with that, it would be helpful to see the skill description and the exact error message.
from skiros2.
Thank you for your patience! I finished working on Option1 with a simple changes as the addInitState
function in pddlInterface
would reduces duplicate state, which treated the bi-direction relation as one state.
And, when I want to use ConditionOr
and run the "move" skill, I get the follow information from the X-term:
Here is my skill description:
class TestMove(SkillDescription):
def createDescription(self):
#self.addParam("Turtle", Element("cora:Robot"), ParamTypes.Inferred)
self.addParam("StartLocation", Element("skiros:Location"), ParamTypes.Inferred)
self.addParam("TargetLocation", Element("skiros:Location"), ParamTypes.Required)
self.addParam("Duration", 1.0, ParamTypes.Optional)
#====PreConditions====
self.addPreCondition(self.getRelationCond("RobotAt", "skiros:at", "Robot", "StartLocation", True))
self.connections = ConditionOr(True)
self.Target2Start = ConditionRelation("Connected", "ns1:hasConnection", "TargetLocation", "StartLocation", True)
self.Start2Target = ConditionRelation("Connected", "ns1:hasConnection", "StartLocation", "TargetLocation", True)
self.connections.addCondition(self.Target2Start)
self.connections.addCondition(self.Start2Target)
print(self.Target2Start.getDescription())
print(self.Start2Target.getDescription())
print(self.connections.getDescription())
self.addPreCondition(self.connections)
print(self._pre_conditions)
#====PostConditions====
self.addPostCondition(self.getRelationCond("NoRobotAt", "skiros:at", "Robot", "StartLocation", False))
self.addPostCondition(self.getRelationCond("RobotAt", "skiros:at", "Robot", "TargetLocation", True))
The description was changed from turtlesim and planning example, for a simple verification that combining planning, skills, and ROS.
Update 1: During the debug process in Opition 1, the print-out information show me that I had 3 relation on skiros:at
, one for cora:Robot
and two for my own robot description. And after I successfully ran the first plan, my own robot changed position, presenting with skiros:at
, when I want to run a second plan, I got all three skiros:at
relation, one for cora:Robot
and one for my own robot at the very start location, and one for my own robot at the previous target location.
Update 2: Also problem at planning process, with goal (skiros:at quadruped_description:test_quadruped ns1:TargetLocation
, the generated problem file would set my robot at different class, eg. sumo:Device, or some un-regconizable.
What reason do you think that would cause this. Regards!
from skiros2.
Related Issues (20)
- Getting error that the owl "must be an rdflib term" HOT 7
- Installing td task planner HOT 2
- Load SkiROS2 GUI from ROS 2 launch file
- Skill crashes ungracefully if a required parameter is not set
- Python dependencies "wrapt" and "inflection" in 22.04 ROS 2
- GUI crashes when skill manager is restarted while a skill is running and a new skill is started afterwards
- Interactive Marker in RViz2 throws log messages until a world model element is selected
- Explore patterns to load different skill sets when launching in ROS 2
- Loading of reasoners in ROS 2 - Missing TF reasoning in skills
- Check timestamps of TF frames published by the world model in simulation
- SkillManagerNode startup needs to turn on and off spinning
- Skill (primitive) can receive an older parameter selection
- Port task manager and skiros2_examples
- WorldModel service calls become slow on busy ROS 2 network
- Use Lifecycle Nodes
- Documentation format (and ROS 2 docs)
- Support different logging levels in ROS 2
- World model element member last_tf_timestamp in ROS 2
- ros2 launch error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skiros2.