Skip to content

Commit

Permalink
Address some windows build issues (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong authored Dec 9, 2024
1 parent 8729b17 commit 193db12
Show file tree
Hide file tree
Showing 8 changed files with 364 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix:
config:
- runner: macos-12
- runner: macos-13
vcpkg_triplet: x64-osx-dynamic-release
arch: x64
homebrew_root: /usr/local
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
#include <tesseract_common/fwd.h>

#include <tesseract_task_composer/core/task_composer_keys.h>
#include <tesseract_task_composer/core/task_composer_node_types.h>
#include <tesseract_task_composer/core/task_composer_node_ports.h>
#include <tesseract_task_composer/core/task_composer_node_info.h>

namespace YAML
{
Expand All @@ -52,15 +54,6 @@ namespace tesseract_planning
class TaskComposerDataStorage;
class TaskComposerContext;
class TaskComposerExecutor;
class TaskComposerNodeInfo;

enum class TaskComposerNodeType
{
NODE,
TASK,
PIPELINE,
GRAPH
};

/** @brief Represents a node the pipeline to be executed */
class TaskComposerNode
Expand All @@ -71,6 +64,9 @@ class TaskComposerNode
using UPtr = std::unique_ptr<TaskComposerNode>;
using ConstUPtr = std::unique_ptr<const TaskComposerNode>;

// @brief The results map
using ResultsMap = std::map<boost::uuids::uuid, std::unique_ptr<TaskComposerNodeInfo>>;

/** @brief Most task will not require a executor so making it optional */
using OptionalTaskComposerExecutor = std::optional<std::reference_wrapper<TaskComposerExecutor>>;

Expand Down Expand Up @@ -148,12 +144,10 @@ class TaskComposerNode
TaskComposerNodePorts getPorts() const;

/** @brief Generate the Dotgraph as a string */
std::string
getDotgraph(const std::map<boost::uuids::uuid, std::unique_ptr<TaskComposerNodeInfo>>& results_map = {}) const;
std::string getDotgraph(const ResultsMap& results_map = ResultsMap()) const;

/** @brief Generate the Dotgraph and save to file */
bool saveDotgraph(const std::string& filepath,
const std::map<boost::uuids::uuid, std::unique_ptr<TaskComposerNodeInfo>>& results_map = {}) const;
bool saveDotgraph(const std::string& filepath, const ResultsMap& results_map = ResultsMap()) const; // NOLINT

/** @brief Rename input keys */
virtual void renameInputKeys(const std::map<std::string, std::string>& input_keys);
Expand All @@ -168,10 +162,9 @@ class TaskComposerNode
* @brief dump the task to dot
* @brief Return additional subgraphs which should get appended if needed
*/
virtual std::string
dump(std::ostream& os,
const TaskComposerNode* parent = nullptr,
const std::map<boost::uuids::uuid, std::unique_ptr<TaskComposerNodeInfo>>& results_map = {}) const;
virtual std::string dump(std::ostream& os,
const TaskComposerNode* parent = nullptr,
const ResultsMap& results_map = ResultsMap()) const;

bool operator==(const TaskComposerNode& rhs) const;
bool operator!=(const TaskComposerNode& rhs) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_common/any_poly.h>

#include <tesseract_task_composer/core/task_composer_node.h>
#include <tesseract_task_composer/core/task_composer_node_types.h>
#include <tesseract_task_composer/core/task_composer_keys.h>
#include <tesseract_task_composer/core/task_composer_data_storage.h>

namespace tesseract_planning
{
class TaskComposerNode;

/** Stores information about a node */
class TaskComposerNodeInfo
{
Expand All @@ -57,7 +59,7 @@ class TaskComposerNodeInfo

TaskComposerNodeInfo() = default; // Required for serialization
TaskComposerNodeInfo(const TaskComposerNode& node);
~TaskComposerNodeInfo() = default;
~TaskComposerNodeInfo();
TaskComposerNodeInfo(const TaskComposerNodeInfo&) = default;
TaskComposerNodeInfo& operator=(const TaskComposerNodeInfo&) = default;
TaskComposerNodeInfo(TaskComposerNodeInfo&&) = default;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* @file task_composer_node_types.h
* @brief A node types enum
*
* @author Levi Armstrong
* @date July 29. 2022
* @version TODO
* @bug No known bugs
*
* @copyright Copyright (c) 2022, Levi Armstrong
*
* @par License
* Software License Agreement (Apache License)
* @par
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* @par
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TESSERACT_TASK_COMPOSER_TASK_COMPOSER_NODE_TYPES_H
#define TESSERACT_TASK_COMPOSER_TASK_COMPOSER_NODE_TYPES_H

namespace tesseract_planning
{
enum class TaskComposerNodeType
{
NODE,
TASK,
PIPELINE,
GRAPH
};
}

#endif // TESSERACT_TASK_COMPOSER_TASK_COMPOSER_NODE_TYPES_H
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ class TaskComposerPluginFactory
~TaskComposerPluginFactory();
TaskComposerPluginFactory(const TaskComposerPluginFactory&) = delete;
TaskComposerPluginFactory& operator=(const TaskComposerPluginFactory&) = delete;
TaskComposerPluginFactory(TaskComposerPluginFactory&&) = default;
TaskComposerPluginFactory& operator=(TaskComposerPluginFactory&&) = default;
TaskComposerPluginFactory(TaskComposerPluginFactory&&) noexcept = default;
TaskComposerPluginFactory& operator=(TaskComposerPluginFactory&&) noexcept = default;

/**
* @brief Load plugins from a configuration object
Expand Down
29 changes: 8 additions & 21 deletions tesseract_task_composer/core/src/task_composer_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/uuid_serialize.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <yaml-cpp/yaml.h>
#include <console_bridge/console.h>
#include <tesseract_common/serialization.h>
Expand Down Expand Up @@ -384,8 +385,7 @@ const TaskComposerKeys& TaskComposerNode::getOutputKeys() const { return output_

TaskComposerNodePorts TaskComposerNode::getPorts() const { return ports_; }

std::string TaskComposerNode::getDotgraph(
const std::map<boost::uuids::uuid, std::unique_ptr<TaskComposerNodeInfo>>& results_map) const
std::string TaskComposerNode::getDotgraph(const ResultsMap& results_map) const
{
try
{
Expand All @@ -402,9 +402,7 @@ std::string TaskComposerNode::getDotgraph(
return {};
}

bool TaskComposerNode::saveDotgraph(
const std::string& filepath,
const std::map<boost::uuids::uuid, std::unique_ptr<TaskComposerNodeInfo>>& results_map) const
bool TaskComposerNode::saveDotgraph(const std::string& filepath, const ResultsMap& results_map) const
{
try
{
Expand Down Expand Up @@ -435,10 +433,9 @@ void TaskComposerNode::renameOutputKeys(const std::map<std::string, std::string>

void TaskComposerNode::setConditional(bool enable) { conditional_ = enable; }

std::string
TaskComposerNode::dump(std::ostream& os,
const TaskComposerNode* /*parent*/,
const std::map<boost::uuids::uuid, std::unique_ptr<TaskComposerNodeInfo>>& results_map) const
std::string TaskComposerNode::dump(std::ostream& os,
const TaskComposerNode* /*parent*/,
const ResultsMap& results_map) const
{
const std::string tmp = toString(uuid_, "node_");

Expand Down Expand Up @@ -543,18 +540,8 @@ void TaskComposerNode::serialize(Archive& ar, const unsigned int /*version*/)

std::string TaskComposerNode::toString(const boost::uuids::uuid& u, const std::string& prefix)
{
std::string result;
result.reserve(36);

std::size_t i = 0;
for (const auto* it_data = u.begin(); it_data != u.end(); ++it_data, ++i)
{
const size_t hi = ((*it_data) >> 4) & 0x0F;
result += boost::uuids::detail::to_char(hi);

const size_t lo = (*it_data) & 0x0F;
result += boost::uuids::detail::to_char(lo);
}
auto result = boost::uuids::to_string(u);
boost::replace_all(result, "-", "");
return (prefix + result);
}

Expand Down
3 changes: 3 additions & 0 deletions tesseract_task_composer/core/src/task_composer_node_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_task_composer/core/task_composer_node_info.h>
#include <tesseract_task_composer/core/task_composer_node.h>
#include <tesseract_task_composer/core/task_composer_graph.h>

namespace tesseract_planning
Expand Down Expand Up @@ -66,6 +67,8 @@ TaskComposerNodeInfo::TaskComposerNodeInfo(const TaskComposerNode& node)
}
}

TaskComposerNodeInfo::~TaskComposerNodeInfo() = default;

bool TaskComposerNodeInfo::operator==(const TaskComposerNodeInfo& rhs) const
{
static auto max_diff = static_cast<double>(std::numeric_limits<float>::epsilon());
Expand Down

0 comments on commit 193db12

Please sign in to comment.