Skip to content

Commit 6a1e7f7

Browse files
committed
changed order of rotation
1 parent d52be11 commit 6a1e7f7

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

source/dbot/gpu/kinect_image_model_gpu.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,11 @@ class KinectImageModelGPU
378378

379379
osr::PoseVector pose;
380380

381-
pose.orientation() = delta.orientation() * pose_0.orientation();
382-
pose.position() = delta.position() + pose_0.position();
381+
/// \todo: this should be done through the the apply_delta
382+
/// function
383+
pose.position() = pose_0.orientation().rotation_matrix()
384+
* delta.position() + pose_0.position();
385+
pose.orientation() = pose_0.orientation() * delta.orientation();
383386

384387
poses[i_state][i_obj] = pose.homogeneous().cast<float>();
385388
}

source/dbot/model/depth_pixel_model.hpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,21 @@ class DepthPixelModel
189189
if (render_cache_.find(current_state) == render_cache_.end())
190190
{
191191
State current_pose = current_state;
192-
current_pose.component(0).orientation() =
193-
current_state.component(0).orientation() *
194-
nominal_pose_.component(0).orientation();
192+
193+
194+
/// \todo: this transformation should not be done in here
195195

196196
current_pose.component(0).position() =
197-
current_state.component(0).position() +
197+
nominal_pose_.component(0).orientation().rotation_matrix() *
198+
current_state.component(0).position() +
198199
nominal_pose_.component(0).position();
199200

201+
current_pose.component(0).orientation() =
202+
nominal_pose_.component(0).orientation() *
203+
current_state.component(0).orientation();
204+
205+
206+
200207
std::lock_guard<std::mutex> lock(*mutex);
201208
map(current_pose, render_cache_[current_state]);
202209
poses_cache_[current_state] = current_pose;

source/dbot/model/kinect_image_model.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545

4646
namespace dbot
4747
{
48-
/// \todo get rid of traits
4948
// Forward declarations
5049
template <typename Scalar, typename State, int OBJECTS>
5150
class KinectImageModel;
@@ -152,8 +151,12 @@ class KinectImageModel
152151
auto delta = deltas[i_state].component(i_obj);
153152

154153
osr::PoseVector pose;
155-
pose.orientation() = delta.orientation() * pose_0.orientation();
156-
pose.position() = delta.position() + pose_0.position();
154+
155+
/// \todo: this should be done through the the apply_delta
156+
/// function
157+
pose.position() = pose_0.orientation().rotation_matrix()
158+
* delta.position() + pose_0.position();
159+
pose.orientation() = pose_0.orientation() * delta.orientation();
157160

158161
poses[i_obj] = pose.affine();
159162
}

source/dbot/model/rao_blackwell_sensor.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class RbSensor
5252
typedef Eigen::Array<int, -1, 1> IntArray;
5353
typedef Eigen::Matrix<fl::Real, -1, 1> RealVector;
5454
// typedef State PoseArray;
55+
56+
/// \todo: this should be a different type, only containing poses
5557
typedef osr::FreeFloatingRigidBodiesState<> PoseArray;
5658

5759
public:

source/dbot/tracker/gaussian_tracker.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ auto GaussianTracker::on_track(const Obsrv& obsrv) -> State
5454
// geometry sense, the covariance matrix would also have to change due
5555
// to the parallel transport
5656

57+
58+
/// \todo: this transformation has to be checked and shoudl not be done here
59+
5760
State old_pose = belief_.mean();
5861
filter_->sensor().local_sensor().body_model().nominal_pose(old_pose);
5962

0 commit comments

Comments
 (0)