Skip to content

Commit

Permalink
fix: for broadcasters too
Browse files Browse the repository at this point in the history
  • Loading branch information
bpapaspyros committed Dec 5, 2024
1 parent 6fc6256 commit 20a1bfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ template<typename T>
inline void BaseControllerInterface::publish_transforms(
const std::vector<state_representation::CartesianPose>& transforms, const std::shared_ptr<T>& tf_broadcaster,
bool is_static) {
if (this->get_node() == nullptr) {
if (!is_node_initialized()) {
throw modulo_core::exceptions::CoreException("Failed send transform(s): Node is not initialized yet.");
}
std::string modifier = is_static ? "static " : "";
Expand Down
4 changes: 2 additions & 2 deletions source/modulo_controllers/src/BaseControllerInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ geometry_msgs::msg::TransformStamped BaseControllerInterface::lookup_ros_transfo
}

void BaseControllerInterface::add_tf_broadcaster() {
if (this->get_node() == nullptr) {
if (!is_node_initialized()) {
throw modulo_core::exceptions::CoreException("Failed to add TF broadcaster: Node is not initialized yet.");
}
if (this->tf_broadcaster_ == nullptr) {
Expand All @@ -609,7 +609,7 @@ void BaseControllerInterface::add_tf_broadcaster() {
}

void BaseControllerInterface::add_static_tf_broadcaster() {
if (this->get_node() == nullptr) {
if (!is_node_initialized()) {
throw modulo_core::exceptions::CoreException("Failed to add static TF broadcaster: Node is not initialized yet.");
}
if (this->static_tf_broadcaster_ == nullptr) {
Expand Down

0 comments on commit 20a1bfb

Please sign in to comment.