adlink-ros / bt_ros2 Goto Github PK
View Code? Open in Web Editor NEWBehavior Tree that runs on ROS2
Behavior Tree that runs on ROS2
Hello,
I would like to know if there are any plans to update the repository with the ROS Galaxy version?
Right now I'm having trouble building everything without any deeper changes.
Best regards
Łukasz Janiec
您好,如果您還在維護這個項目,這裡有點小問題。
當我在執行下面這條命令時,colcon提示找不到object-msgs包。
colcon build --symlink-install --cmake-args -DBUILD_OPENVINO=ON
於是我像以往一樣使用sudo apt-get install ros-foxy-object-msgs來安裝這個包時,他提示:
當我懷著疑惑查找了ros官方中是否還在使用這個包,發現它已經被停用了。下面這個圖片來自這個網址:
https://robostack.github.io/foxy.html
我在項目中找到了該問題出在哪裡,這個頭文件使用了已經停用的包。
關羽已經被停用的包,我在github上也找到了它的鏈接,但是我不會使用它,在這裡也提供給您。
https://github.com/intel/object_msgs
當然,如果項目已經不再被維護,也感謝您的閱讀,謝謝!
I write a Subscription callback of ros2 in my IsHomeCondition, but it didn't work. Though I send topic /localizaiton in terminal, it didn't output log, and other things, Could you please look my code, check what problem happend?
THIS IS MY CODE.
#include <string>
#include "somo_behavior_tree/plugins/condition/is_home_condition.hpp"
namespace behavior_tree
{
IsHomeCondition::IsHomeCondition(
const std::string &condition_name,
const BT::NodeConfiguration &conf)
: BT::ConditionNode(condition_name, conf),
is_home_(false),
localization_topic_("/localization")
{
node_ = node_ = rclcpp::Node::make_shared("IsHomeCondition");
// node_ = config().blackboard->get<rclcpp::Node::SharedPtr>("node");
localization_sub_ = node_->create_subscription<geometry_msgs::msg::PoseStamped>(
localization_topic_,
rclcpp::SystemDefaultsQoS(),
std::bind(&IsHomeCondition::localization_cb, this, std::placeholders::_1));
//parameters declare
std::vector<std::double_t> home_position={0,0,0};
node_->declare_parameter<std::vector<std::double_t>>("home_position",home_position);
node_->declare_parameter<std::double_t>("check_threshold", 0.5);
check_threshold_ = node_->get_parameter("check_threshold").as_double();
home_position_.position.x = node_->get_parameter("home_position").as_double_array()[0];
home_position_.position.y = node_->get_parameter("home_position").as_double_array()[1];
std::cout << "Init completed" << std::endl;
}
IsHomeCondition::~IsHomeCondition()
{
RCLCPP_DEBUG(node_->get_logger(), "Shutting down IsHomeCondition BT node");
}
BT::NodeStatus IsHomeCondition::tick()
{
std::cout << "home flag is" <<is_home_ << std::endl;
if (is_home_) {
std::cout << "SOMO is in not home"<< std::endl;
return BT::NodeStatus::SUCCESS;
}
std::cout << "SOMO is in not home"<< std::endl;
return BT::NodeStatus::FAILURE;
}
void IsHomeCondition::localization_cb(geometry_msgs::msg::PoseStamped::SharedPtr msg)
{
std::cout << "In localization callback" << std::endl;
current_position_ = msg->pose;
is_home_ = isHome();
}
bool IsHomeCondition::isHome(){
return utils->check_distance(current_position_,home_position_,check_threshold_);
}
}
#include "behaviortree_cpp_v3/bt_factory.h"
BT_REGISTER_NODES(factory)
{
factory.registerNodeType<behavior_tree::IsHomeCondition>("IsHomeCondition");
}
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.