Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
loco-3d
Multicontact-api
Commits
ee000a8a
Commit
ee000a8a
authored
May 06, 2020
by
Pierre Fernbach
Browse files
Rename ContactType enum: prefix CONTACT_ to all values
parent
6140805e
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/multicontact-api/scenario/contact-model.hpp
View file @
ee000a8a
...
...
@@ -20,10 +20,10 @@ struct ContactModelTpl : public serialization::Serializable<ContactModelTpl<_Sca
typedef
_Scalar
Scalar
;
/// \brief Default constructor.
ContactModelTpl
()
:
m_mu
(
-
1.
),
m_contact_type
(
ContactType
::
UNDEFINED
)
{}
ContactModelTpl
()
:
m_mu
(
-
1.
),
m_contact_type
(
ContactType
::
CONTACT_
UNDEFINED
)
{}
/// \brief Constructor with friction
ContactModelTpl
(
const
Scalar
mu
)
:
m_mu
(
mu
),
m_contact_type
(
ContactType
::
UNDEFINED
)
{}
ContactModelTpl
(
const
Scalar
mu
)
:
m_mu
(
mu
),
m_contact_type
(
ContactType
::
CONTACT_
UNDEFINED
)
{}
/// \brief Full constructor
ContactModelTpl
(
const
Scalar
mu
,
const
ContactType
contact_type
)
:
m_mu
(
mu
),
m_contact_type
(
contact_type
)
{}
...
...
include/multicontact-api/scenario/fwd.hpp
View file @
ee000a8a
...
...
@@ -29,7 +29,7 @@ template <typename Scalar>
struct
ContactModelTpl
;
typedef
ContactModelTpl
<
double
>
ContactModel
;
enum
ContactType
{
UNDEFINED
,
PLANAR
,
POINT
};
enum
ContactType
{
CONTACT_
UNDEFINED
,
CONTACT_PLANAR
,
CONTACT_
POINT
};
enum
ConicType
{
CONIC_SOWC
,
CONIC_DOUBLE_DESCRIPTION
,
CONIC_UNDEFINED
};
}
// namespace scenario
...
...
unittest/scenario.cpp
View file @
ee000a8a
...
...
@@ -342,24 +342,24 @@ BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
BOOST_AUTO_TEST_CASE
(
contact_model
)
{
ContactModel
mp
;
BOOST_CHECK
(
mp
.
m_mu
==
-
1.
);
BOOST_CHECK
(
mp
.
m_contact_type
==
ContactType
::
UNDEFINED
);
BOOST_CHECK
(
mp
.
m_contact_type
==
ContactType
::
CONTACT_
UNDEFINED
);
const
double
mu
=
0.3
;
ContactModel
mp_mu
(
mu
);
BOOST_CHECK
(
mp_mu
.
m_mu
==
mu
);
BOOST_CHECK
(
mp_mu
.
m_contact_type
==
ContactType
::
UNDEFINED
);
BOOST_CHECK
(
mp_mu
.
m_contact_type
==
ContactType
::
CONTACT_
UNDEFINED
);
ContactModel
mp1
(
mu
,
ContactType
::
PLANAR
);
ContactModel
mp1
(
mu
,
ContactType
::
CONTACT_
PLANAR
);
ContactModel
mp2
(
mp1
);
BOOST_CHECK
(
mp1
.
m_mu
==
mu
);
BOOST_CHECK
(
mp1
.
m_contact_type
==
ContactType
::
PLANAR
);
BOOST_CHECK
(
mp1
.
m_contact_type
==
ContactType
::
CONTACT_
PLANAR
);
BOOST_CHECK
(
mp1
==
mp2
);
mp1
.
m_mu
=
0.5
;
BOOST_CHECK
(
mp1
!=
mp2
);
ContactModel
mp3
(
mp1
);
BOOST_CHECK
(
mp1
==
mp3
);
mp3
.
m_contact_type
=
ContactType
::
POINT
;
mp3
.
m_contact_type
=
ContactType
::
CONTACT_
POINT
;
BOOST_CHECK
(
mp1
!=
mp3
);
std
::
string
fileName
(
"fileTest_contactModel"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment