Fix for copy constructor bug, and add equality operator.
The Orocos ProjectSmarter control in robotics & automation! |
|
KDL jacobian patch
Fix for copy constructor bug, and add equality operator. |
Inline patch (how do you attach files to forum posts?)
{{{
Index: src/jacobian.cpp
===================================================================
--- src/jacobian.cpp (revision 29354)
+++ src/jacobian.cpp (working copy)
@@ -30,7 +30,8 @@
}
Jacobian::Jacobian(const Jacobian& arg):
@@ -45,8 +46,17 @@
- size(arg.columns())
+ size(arg.columns()),
+ nr_blocks(arg.nr_blocks)
{
twists = new Twist[size*nr_blocks];
for(unsigned int i=0;i
twists[i]=arg.twists[i];
return *this;
}
-
+ bool Jacobian::operator == (const Jacobian& rhs)
+ {
+ {
+ bool rc = true; // prove otherwise
+ for(unsigned int i=0;i
+ rc &= (twists[i] == rhs.twists[i]);
+ }
+ return rc;
+ }
+
Jacobian::~Jacobian()
{
delete [] twists;
Index: src/jacobian.hpp
===================================================================
--- src/jacobian.hpp (revision 29354)
+++ src/jacobian.hpp (working copy)
@@ -41,6 +41,7 @@
Jacobian(const Jacobian& arg);
Jacobian& operator=(const Jacobian& arg);
+ bool operator == (const Jacobian& rhs);
~Jacobian();
}}}
Inline patch (how do you attach files to forum posts?)
On Monday 16 June 2008 21:16:43 snrkiwi wrote:
> {{{
> Index: src/jacobian.cpp
> ===================================================================
> --- src/jacobian.cpp (revision 29354)
> +++ src/jacobian.cpp (working copy)
> @@ -30,7 +30,8 @@
> }
>
> Jacobian::Jacobian(const Jacobian& arg):
> - size(arg.columns())
> + size(arg.columns()),
> + nr_blocks(arg.nr_blocks)
> {
> twists = new Twist[size*nr_blocks];
> for(unsigned int i=0;i
fixed on trunk:
svn ci -m "Fix for copy constructor bug by snrkiwi"
Sending src/jacobian.cpp
Transmitting file data .
Committed revision 29397.