Skip to content

Commit

Permalink
Update due to changes in tesseract and tesseract_planning repos
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Jan 5, 2025
1 parent 0c1d747 commit 70dc113
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 7 additions & 6 deletions tesseract_monitoring/src/contact_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
#include <tesseract_rosutils/plotting.h>
#include <tesseract_monitoring/constants.h>

#include <tesseract_common/contact_allowed_validator.h>
#include <tesseract_collision/core/discrete_contact_manager.h>
#include <tesseract_scene_graph/scene_state.h>
#include <tesseract_environment/environment.h>
Expand Down Expand Up @@ -140,21 +141,21 @@ struct ContactMonitor::Implementation
// Create a new manager
std::vector<std::string> active;
tesseract_collision::CollisionMarginData contact_margin_data;
tesseract_collision::IsContactAllowedFn fn;
tesseract_common::ContactAllowedValidator::ConstPtr fn;

{
auto lock_read = monitor->environment().lockRead();

env_revision = monitor->environment().getRevision();
active = manager->getActiveCollisionObjects();
contact_margin_data = manager->getCollisionMarginData();
fn = manager->getIsContactAllowedFn();
fn = manager->getContactAllowedValidator();
manager = monitor->environment().getDiscreteContactManager();
}

manager->setActiveCollisionObjects(active);
manager->setCollisionMarginData(contact_margin_data);
manager->setIsContactAllowedFn(fn);
manager->setContactAllowedValidator(fn);
for (const auto& disabled_link_name : disabled_link_names)
manager->disableCollisionObject(disabled_link_name);
}
Expand Down Expand Up @@ -237,19 +238,19 @@ struct ContactMonitor::Implementation
// Create a new manager
std::vector<std::string> active;
tesseract_collision::CollisionMarginData contact_margin_data;
tesseract_collision::IsContactAllowedFn fn;
tesseract_common::ContactAllowedValidator::ConstPtr fn;

{
auto lock_read = monitor->environment().lockRead();
active = manager->getActiveCollisionObjects();
contact_margin_data = manager->getCollisionMarginData();
fn = manager->getIsContactAllowedFn();
fn = manager->getContactAllowedValidator();
manager = monitor->environment().getDiscreteContactManager();
}

manager->setActiveCollisionObjects(active);
manager->setCollisionMarginData(contact_margin_data);
manager->setIsContactAllowedFn(fn);
manager->setContactAllowedValidator(fn);
for (const auto& disabled_link_name : disabled_link_names)
manager->disableCollisionObject(disabled_link_name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <memory>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_common/resource_locator.h>
#include <tesseract_environment/environment.h>
#include <tesseract_environment/environment_cache.h>
#include <tesseract_environment/environment_monitor.h>
Expand Down Expand Up @@ -83,8 +84,9 @@ int main(int argc, char** argv)

if (!task_composer_config.empty())
{
tesseract_common::GeneralResourceLocator locator;
tesseract_common::fs::path config(task_composer_config);
planning_server->getTaskComposerServer().loadConfig(config);
planning_server->getTaskComposerServer().loadConfig(config, locator);
}

ros::Timer update_cache = nh.createTimer(ros::Duration(cache_refresh_rate), updateCacheCallback);
Expand Down

0 comments on commit 70dc113

Please sign in to comment.