Exemplo n.º 1
0
void TPose3DQuat::fromString(const std::string &s)
{
	CMatrixDouble  m;
	if (!m.fromMatlabStringFormat(s)) THROW_EXCEPTION("Malformed expression in ::fromString");
	ASSERTMSG_(mrpt::math::size(m,1)==1 && mrpt::math::size(m,2)==7, "Wrong size of vector in ::fromString");
	for (size_t i=0;i<m.getColCount();i++)
		(*this)[i] = m.get_unsafe(0,i);
}
Exemplo n.º 2
0
void TTwist3D::fromString(const std::string &s)
{
	CMatrixDouble  m;
	if (!m.fromMatlabStringFormat(s)) THROW_EXCEPTION("Malformed expression in ::fromString");
	ASSERTMSG_(mrpt::math::size(m,1)==1 && mrpt::math::size(m,2)==6, "Wrong size of vector in ::fromString");
	for (int i=0;i<3;i++) (*this)[i] = m.get_unsafe(0,i);
	for (int i=0;i<3;i++) (*this)[3+i] = DEG2RAD(m.get_unsafe(0,3+i));
}
Exemplo n.º 3
0
void TTwist2D::fromString(const std::string &s)
{
	CMatrixDouble  m;
	if (!m.fromMatlabStringFormat(s)) THROW_EXCEPTION("Malformed expression in ::fromString");
	ASSERTMSG_(mrpt::math::size(m,1)==1 && mrpt::math::size(m,2)==3, "Wrong size of vector in ::fromString");
	vx = m.get_unsafe(0,0);
	vy = m.get_unsafe(0,1);
	omega = DEG2RAD(m.get_unsafe(0,2));
}
Exemplo n.º 4
0
void TPose3DQuat::fromString(const std::string& s)
{
	CMatrixDouble m;
	if (!m.fromMatlabStringFormat(s))
		THROW_EXCEPTION("Malformed expression in ::fromString");
	ASSERTMSG_(
		m.rows() == 1 && m.cols() == 7, "Wrong size of vector in ::fromString");
	for (int i = 0; i < m.cols(); i++) (*this)[i] = m.get_unsafe(0, i);
}
Exemplo n.º 5
0
void TPose2D::fromString(const std::string& s)
{
	CMatrixDouble m;
	if (!m.fromMatlabStringFormat(s))
		THROW_EXCEPTION("Malformed expression in ::fromString");
	ASSERTMSG_(
		m.rows() == 1 && m.cols() == 3, "Wrong size of vector in ::fromString");
	x = m.get_unsafe(0, 0);
	y = m.get_unsafe(0, 1);
	phi = DEG2RAD(m.get_unsafe(0, 2));
}
Exemplo n.º 6
0
void TPose3D::fromString(const std::string &s)
{
	CMatrixDouble  m;
	if (!m.fromMatlabStringFormat(s)) THROW_EXCEPTION("Malformed expression in ::fromString");
	ASSERTMSG_(mrpt::math::size(m,1)==1 && mrpt::math::size(m,2)==6, "Wrong size of vector in ::fromString");
	x=m.get_unsafe(0,0);
	y=m.get_unsafe(0,1);
	z=m.get_unsafe(0,2);
	yaw=DEG2RAD(m.get_unsafe(0,3));
	pitch=DEG2RAD(m.get_unsafe(0,4));
	roll=DEG2RAD(m.get_unsafe(0,5));
}