Skip to content

Commit

Permalink
[MSA] Merge main into feature/msa (Part III) (moveit#1249)
Browse files Browse the repository at this point in the history
  • Loading branch information
DLu committed Jun 13, 2022
1 parent 0eeca58 commit 29c7d82
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ add_library(${PROJECT_NAME}
src/perception_config.cpp
src/perception.cpp
src/perception_widget.cpp
src/xml_manipulation.cpp
${MOC_FILES}
)
target_include_directories(${PROJECT_NAME} PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
// SA
#include "simulation_widget.h"
#include "header_widget.h"
#include "../tools/xml_syntax_highlighter.h"
#include <moveit/setup_assistant/tools/xml_manipulation.h>
#include <moveit_setup_framework/qt/xml_syntax_highlighter.hpp>
#include <moveit_setup_app_plugins/xml_manipulation.hpp>

// Qt
#include <QColor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ add_library(${PROJECT_NAME}
src/rviz_panel.cpp
src/data_warehouse.cpp
src/templates.cpp
src/xml_syntax_highlighter.cpp
${MOC_FILES}
)
target_include_directories(${PROJECT_NAME} PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

namespace moveit_setup_framework
{
const std::string SETUP_ASSISTANT_FILE = ".setup_assistant";
static const std::string SETUP_ASSISTANT_FILE = ".setup_assistant";

class PackageSettingsConfig : public SetupConfig
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ class URDFConfig : public SetupConfig
return urdf_model_;
}

std::string getURDFPackageName() const
{
return urdf_pkg_name_;
}

std::string getURDFContents() const
{
return urdf_string_;
}

std::string getURDFPath() const
{
return urdf_path_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include <QRegularExpression>
#include <map>

namespace moveit_setup_framework
{
/** XML SyntaxHighlighter allowing nested highlighting of XML tags */
class XmlSyntaxHighlighter : public QSyntaxHighlighter
{
Expand All @@ -63,3 +65,5 @@ class XmlSyntaxHighlighter : public QSyntaxHighlighter

Rules::const_iterator highlight(Rules::const_iterator active, QStringRef text, int start, bool search_end, int& end);
};

} // namespace moveit_setup_framework
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@

/* Author: Robert Haschke */

#include "xml_syntax_highlighter.h"
#include <moveit_setup_framework/qt/xml_syntax_highlighter.hpp>
#include <assert.h>

namespace moveit_setup_framework
{
XmlSyntaxHighlighter::XmlSyntaxHighlighter(QTextDocument* parent) : QSyntaxHighlighter(parent)
{
}
Expand Down Expand Up @@ -122,3 +124,5 @@ void XmlSyntaxHighlighter::highlightBlock(const QString& text)
active = highlight(active, QStringRef(&text, 0, text.size()), 0, active != rules.cend(), unused);
setCurrentBlockState(active != rules.cend() ? active->first : -1);
}

} // namespace moveit_setup_framework
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@
/* Author: Robert Haschke */

#pragma once

// TODO: This header uses tinyxml.h whereas moveit_setup_framework/utilities.hpp uses tinyxml2.h
// One xml library should be selected and used throughout moveit_setup_assistant

#include <tinyxml.h>
#include <vector>

namespace moveit_setup_assistant
namespace moveit_setup_app_plugins
{
struct Attribute
{
Expand All @@ -56,4 +60,4 @@ struct Attribute
TiXmlElement* uniqueInsert(TiXmlElement& element, const char* tag, const std::vector<Attribute>& attributes = {},
const char* text = nullptr);

} // namespace moveit_setup_assistant
} // namespace moveit_setup_app_plugins
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@

/* Author: Robert Haschke */

#include <moveit/setup_assistant/tools/xml_manipulation.h>
#include <moveit_setup_app_plugins/xml_manipulation.hpp>

namespace moveit_setup_assistant
namespace moveit_setup_app_plugins
{
namespace
{
Expand Down Expand Up @@ -81,4 +81,4 @@ TiXmlElement* uniqueInsert(TiXmlElement& element, const char* tag, const std::ve
return result;
}

} // namespace moveit_setup_assistant
} // namespace moveit_setup_app_plugins
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ struct CollisionPairLess
{
bool operator()(const srdf::Model::CollisionPair& left, const srdf::Model::CollisionPair& right) const
{
return left.link1_ < right.link1_ && left.link2_ < right.link2_;
// use std::pair's operator<: (left.link1_, left.link2_) < (right.link1_, right.link2_)
return left.link1_ < right.link1_ || (!(right.link1_ < left.link1_) && left.link2_ < right.link2_);
}
};

Expand Down

0 comments on commit 29c7d82

Please sign in to comment.