Hopefully last fixes to colors of robot and trees
This commit is contained in:
parent
88100990af
commit
72a37287eb
@ -2,11 +2,10 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
|
|||||||
project(btree)
|
project(btree)
|
||||||
|
|
||||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# find dependencies
|
# find dependencies
|
||||||
|
|
||||||
set(DEPENDENCIES
|
set(DEPENDENCIES
|
||||||
|
|||||||
@ -64,7 +64,7 @@ namespace BT {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<> inline
|
template<> inline
|
||||||
std::shared_ptr<geometry_msgs::msg::Point> BT::convertFromString(StringView str) {
|
std::shared_ptr<geometry_msgs::msg::Point> convertFromString(StringView str) {
|
||||||
auto parts = splitString(str, ',');
|
auto parts = splitString(str, ',');
|
||||||
if (parts.size() != 3) {
|
if (parts.size() != 3) {
|
||||||
throw RuntimeError("Incorrect number of arguments, expected 3 in format '<x>,<y>,<z>'.");
|
throw RuntimeError("Incorrect number of arguments, expected 3 in format '<x>,<y>,<z>'.");
|
||||||
|
|||||||
@ -78,7 +78,7 @@ int main(int argc, char **argv) {
|
|||||||
NodeBuilder builderActorMovement = [&actorMovementNode, &blackboard, &blackboardMutex](const std::string &name, const NodeConfiguration &config) {
|
NodeBuilder builderActorMovement = [&actorMovementNode, &blackboard, &blackboardMutex](const std::string &name, const NodeConfiguration &config) {
|
||||||
return std::make_unique<ActorMovement>(name, config, actorMovementNode, "/ActorPlugin/movement",[&blackboard,&blackboardMutex](std::shared_ptr<const Movement::Feedback> feedback){
|
return std::make_unique<ActorMovement>(name, config, actorMovementNode, "/ActorPlugin/movement",[&blackboard,&blackboardMutex](std::shared_ptr<const Movement::Feedback> feedback){
|
||||||
blackboardMutex.lock();
|
blackboardMutex.lock();
|
||||||
//blackboard->set("actorPos", std::make_shared<geometry_msgs::msg::Pose>(feedback->current));
|
blackboard->set("actorPos", std::make_shared<geometry_msgs::msg::Pose>(feedback->current));
|
||||||
blackboardMutex.unlock();
|
blackboardMutex.unlock();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -8,11 +8,11 @@
|
|||||||
</Inverter>
|
</Inverter>
|
||||||
|
|
||||||
<Sequence>
|
<Sequence>
|
||||||
<Control ID="WeightedRandom" weights="100,5,2">
|
<WeightedRandom weights="100,5,2">
|
||||||
<Action ID="GenerateXYPose" area="{safeArea}" pose="{actorTarget}"/>
|
<Action ID="GenerateXYPose" area="{safeArea}" pose="{actorTarget}"/>
|
||||||
<Action ID="GenerateXYPose" area="{warningArea}" pose="{actorTarget}"/>
|
<Action ID="GenerateXYPose" area="{warningArea}" pose="{actorTarget}"/>
|
||||||
<Action ID="GenerateXYPose" area="{unsafeArea}" pose="{actorTarget}"/>
|
<Action ID="GenerateXYPose" area="{unsafeArea}" pose="{actorTarget}"/>
|
||||||
</Control>
|
</WeightedRandom>
|
||||||
<Action ID="ActorMovement" animation_distance="1.5" animation_name="standing_walk" target="{actorTarget}"/>
|
<Action ID="ActorMovement" animation_distance="1.5" animation_name="standing_walk" target="{actorTarget}"/>
|
||||||
</Sequence>
|
</Sequence>
|
||||||
</ReactiveSequence>
|
</ReactiveSequence>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<Action ID="ActorMovement" animation_distance="1.5" animation_name="standing_walk" target="{actorTarget}"/>
|
<Action ID="ActorMovement" animation_distance="1.5" animation_name="standing_walk" target="{actorTarget}"/>
|
||||||
<Action ID="ActorAnimation" animation_name="standing_to_low"/>
|
<Action ID="ActorAnimation" animation_name="standing_to_low"/>
|
||||||
<Action ID="ActorAnimation" animation_name="low_inspect"/>
|
<Action ID="ActorAnimation" animation_name="low_inspect"/>
|
||||||
<Action ID="ActorAnimation" animation_name="low_put_back"/>
|
<Action ID="ActorAnimation" animation_name="low_grab"/>
|
||||||
<Action ID="ActorAnimation" animation_name="low_to_standing"/>
|
<Action ID="ActorAnimation" animation_name="low_to_standing"/>
|
||||||
<Action ID="ActorMovement" animation_distance="1.5" animation_name="standing_walk" target="1,0.5,0,0,0,0,1"/>
|
<Action ID="ActorMovement" animation_distance="1.5" animation_name="standing_walk" target="1,0.5,0,0,0,0,1"/>
|
||||||
<Action ID="ActorAnimation" animation_name="standing_extend_arm"/>
|
<Action ID="ActorAnimation" animation_name="standing_extend_arm"/>
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
<Action ID="ActorAnimation" animation_name="standing_extend_arm"/>
|
<Action ID="ActorAnimation" animation_name="standing_extend_arm"/>
|
||||||
<Action ID="ActorAnimation" animation_name="standing_retract_arm"/>
|
<Action ID="ActorAnimation" animation_name="standing_retract_arm"/>
|
||||||
<Action ID="SetCalledTo" state="false"/>
|
<Action ID="SetCalledTo" state="false"/>
|
||||||
|
<SubTree ID="DepositToShelf"/>
|
||||||
</Sequence>
|
</Sequence>
|
||||||
</BehaviorTree>
|
</BehaviorTree>
|
||||||
<BehaviorTree ID="DepositToShelf">
|
<BehaviorTree ID="DepositToShelf">
|
||||||
|
|||||||
@ -20,29 +20,4 @@
|
|||||||
</Control>
|
</Control>
|
||||||
</ReactiveSequence>
|
</ReactiveSequence>
|
||||||
</BehaviorTree>
|
</BehaviorTree>
|
||||||
<BehaviorTree ID="Slowdown">
|
|
||||||
<ReactiveSequence>
|
|
||||||
<Inverter>
|
|
||||||
<Condition ID="InAreaTest" area="{unsafeArea}" pose="{actorPos}"/>
|
|
||||||
</Inverter>
|
|
||||||
<IfThenElse>
|
|
||||||
<Condition ID="InAreaTest" area="{warningArea}" pose="{actorPos}"/>
|
|
||||||
<Action ID="SetRobotVelocity" velocity="0.1"/>
|
|
||||||
<Action ID="SetRobotVelocity" velocity="1"/>
|
|
||||||
</IfThenElse>
|
|
||||||
<SubTree ID="SafeTree" _autoremap="1"/>
|
|
||||||
</ReactiveSequence>
|
|
||||||
</BehaviorTree>
|
|
||||||
<BehaviorTree ID="SafeTree">
|
|
||||||
<Fallback>
|
|
||||||
<Control ID="InterruptableSequence">
|
|
||||||
<Action ID="GenerateXYPose" area="{negativeYTable}" pose="{target}"/>
|
|
||||||
<Action ID="OffsetPose" input="{target}" offset="0,0,1.1" orientation="0,0,1,0" output="{target}"/>
|
|
||||||
<Action ID="RobotMove" target="{target}"/>
|
|
||||||
<Action ID="GenerateXYPose" area="{positiveYTable}" pose="{target}"/>
|
|
||||||
<Action ID="OffsetPose" input="{target}" offset="0,0,1.1" orientation="0,0,1,0" output="{target}"/>
|
|
||||||
<Action ID="RobotMove" target="{target}"/>
|
|
||||||
</Control>
|
|
||||||
</Fallback>
|
|
||||||
</BehaviorTree>
|
|
||||||
</root>
|
</root>
|
||||||
@ -258,39 +258,76 @@
|
|||||||
<mechanicalReduction>1</mechanicalReduction>
|
<mechanicalReduction>1</mechanicalReduction>
|
||||||
</actuator>
|
</actuator>
|
||||||
</transmission>
|
</transmission>
|
||||||
|
<gazebo reference="table">
|
||||||
|
<mu1>0.2</mu1>
|
||||||
|
<mu2>0.2</mu2>
|
||||||
|
<visual>
|
||||||
|
<material>
|
||||||
|
<diffuse>0.8 0.8 0.8 1 </diffuse>
|
||||||
|
</material>
|
||||||
|
</visual>
|
||||||
|
</gazebo>
|
||||||
<gazebo reference="base_bottom">
|
<gazebo reference="base_bottom">
|
||||||
<mu1>0.2</mu1>
|
<mu1>0.2</mu1>
|
||||||
<mu2>0.2</mu2>
|
<mu2>0.2</mu2>
|
||||||
<material>Gazebo/Orange</material>
|
<visual>
|
||||||
|
<material>
|
||||||
|
<diffuse>0.5 0.5 0.5 1 </diffuse>
|
||||||
|
</material>
|
||||||
|
</visual>
|
||||||
</gazebo>
|
</gazebo>
|
||||||
<gazebo reference="base_top">
|
<gazebo reference="base_top">
|
||||||
<mu1>0.2</mu1>
|
<mu1>0.2</mu1>
|
||||||
<mu2>0.2</mu2>
|
<mu2>0.2</mu2>
|
||||||
<material>Gazebo/Orange</material>
|
<visual>
|
||||||
|
<material>
|
||||||
|
<diffuse>1 0.35 0 1 </diffuse>
|
||||||
|
</material>
|
||||||
|
</visual>
|
||||||
</gazebo>
|
</gazebo>
|
||||||
<gazebo reference="link1_full">
|
<gazebo reference="link1_full">
|
||||||
<mu1>0.2</mu1>
|
<mu1>0.2</mu1>
|
||||||
<mu2>0.2</mu2>
|
<mu2>0.2</mu2>
|
||||||
<material>Gazebo/Orange</material>
|
<visual>
|
||||||
|
<material>
|
||||||
|
<diffuse>1 0.35 0 1 </diffuse>
|
||||||
|
</material>
|
||||||
|
</visual>
|
||||||
</gazebo>
|
</gazebo>
|
||||||
<gazebo reference="link2_bottom">
|
<gazebo reference="link2_bottom">
|
||||||
<mu1>0.2</mu1>
|
<mu1>0.2</mu1>
|
||||||
<mu2>0.2</mu2>
|
<mu2>0.2</mu2>
|
||||||
<material>Gazebo/Orange</material>
|
<visual>
|
||||||
|
<material>
|
||||||
|
<diffuse>1 0.35 0 1 </diffuse>
|
||||||
|
</material>
|
||||||
|
</visual>
|
||||||
</gazebo>
|
</gazebo>
|
||||||
<gazebo reference="link2_top">
|
<gazebo reference="link2_top">
|
||||||
<mu1>0.2</mu1>
|
<mu1>0.2</mu1>
|
||||||
<mu2>0.2</mu2>
|
<mu2>0.2</mu2>
|
||||||
<material>Gazebo/Orange</material>
|
<visual>
|
||||||
|
<material>
|
||||||
|
<diffuse>1 0.35 0 1 </diffuse>
|
||||||
|
</material>
|
||||||
|
</visual>
|
||||||
</gazebo>
|
</gazebo>
|
||||||
<gazebo reference="link3_bottom">
|
<gazebo reference="link3_bottom">
|
||||||
<mu1>0.2</mu1>
|
<mu1>0.2</mu1>
|
||||||
<mu2>0.2</mu2>
|
<mu2>0.2</mu2>
|
||||||
<material>Gazebo/Orange</material>
|
<visual>
|
||||||
|
<material>
|
||||||
|
<diffuse>1 0.35 0 1 </diffuse>
|
||||||
|
</material>
|
||||||
|
</visual>
|
||||||
</gazebo>
|
</gazebo>
|
||||||
<gazebo reference="link3_top">
|
<gazebo reference="link3_top">
|
||||||
<mu1>0.2</mu1>
|
<mu1>0.2</mu1>
|
||||||
<mu2>0.2</mu2>
|
<mu2>0.2</mu2>
|
||||||
<material>Gazebo/Grey</material>
|
<visual>
|
||||||
|
<material>
|
||||||
|
<diffuse>0.5 0.5 0.5 1 </diffuse>
|
||||||
|
</material>
|
||||||
|
</visual>
|
||||||
</gazebo>
|
</gazebo>
|
||||||
</robot>
|
</robot>
|
||||||
|
|||||||
@ -25,7 +25,9 @@ void sendAction(mqd_t queue, ActionMessage *message) {
|
|||||||
|
|
||||||
void waitForState(FeedbackMessage *currentFeedback,ActorPluginState state){
|
void waitForState(FeedbackMessage *currentFeedback,ActorPluginState state){
|
||||||
std::unique_lock lock(feedbackMutex);
|
std::unique_lock lock(feedbackMutex);
|
||||||
stateCondition.wait(lock,[¤tFeedback,state]{return currentFeedback->state==state;});
|
stateCondition.wait(lock,[¤tFeedback,state]{
|
||||||
|
return currentFeedback->state==state;
|
||||||
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user