Skip to content

Commit

Permalink
Revert "successfull imu levelling with the test node, only performs s…
Browse files Browse the repository at this point in the history
…tatic transform"

Not needed in master

This reverts commit 2decf97.
  • Loading branch information
Jeff Vickers committed Feb 29, 2020
1 parent 5f1fea0 commit b73c68c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 53 deletions.
6 changes: 0 additions & 6 deletions ouster_ros/launch/lidar_imu_transformation.launch

This file was deleted.

1 change: 0 additions & 1 deletion ouster_ros/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<!-- <exec_depend>ouster_viz</exec_depend> -->
<exec_depend>latency_testing</exec_depend>
<exec_depend>am_utils</exec_depend>
<depend>vb_util_lib</depend>

<export></export>
</package>
32 changes: 0 additions & 32 deletions ouster_ros/src/lidar_imu_transformation_test.cpp

This file was deleted.

22 changes: 8 additions & 14 deletions ouster_ros/src/os1_cloud_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ int main(int argc, char** argv) {
auto it = cloud.begin();
sensor_msgs::PointCloud2 msg{};
sensor_msgs::PointCloud2 msg_raw{};
ros::Time reading_time;

auto batch_and_publish = OS1::batch_to_iter<CloudOS1::iterator>(xyz_lut,
W,
Expand All @@ -245,21 +244,18 @@ int main(int argc, char** argv) {
&PointOS1::make,
[&](uint64_t scan_ts) mutable {
CloudOS1 *thiscloud;
reading_time = ros::Time::now();
if ( organized ) {
filter_pointcloud( cloud, scaled_cloud );
thiscloud = &scaled_cloud;
} else {
thiscloud = &send_cloud;
}
tf2::Quaternion result;


for ( uint32_t i = 0; i < (*thiscloud).size() ; i ++ ) {
if ( !raw ) {
if (std::sqrt((*thiscloud)[i].x*(*thiscloud)[i].x + (*thiscloud)[i].y*(*thiscloud)[i].y + (*thiscloud)[i].z*(*thiscloud)[i].z) >= min_distance) {
auto imu = average_imus( imu_entries[i],imu_entries[i+1] );

geometry_msgs::Point outmsg;
tf2::Quaternion qimu(imu.orientation.x,imu.orientation.y,imu.orientation.z,imu.orientation.w);
tf2::Matrix3x3 m(qimu);
Expand All @@ -275,12 +271,12 @@ int main(int argc, char** argv) {
tf2::Quaternion ntprime = tf2::Quaternion{-static_transform.transform.rotation.x,
-static_transform.transform.rotation.y,
-static_transform.transform.rotation.z,
static_transform.transform.rotation.w}; //*
//tf2::Quaternion{-qimu.x(),
// -qimu.y(),
// -qimu.z(),
// qimu.w()};
result = ntransform * tf2::Quaternion{(*thiscloud)[i].x,(*thiscloud)[i].y,(*thiscloud)[i].z,0}*ntprime;
static_transform.transform.rotation.w} *
tf2::Quaternion{-qimu.x(),
-qimu.y(),
-qimu.z(),
qimu.w()};
result = ntransform * tf2::Quaternion{(*thiscloud)[i].x,(*thiscloud)[i].y,(*thiscloud)[i].z,0}; //*ntprime;
} else {
result.setX(0);
result.setY(0);
Expand All @@ -295,7 +291,7 @@ int main(int argc, char** argv) {
(*thiscloud)[i].y = result.y();
(*thiscloud)[i].z = result.z();
}

msg = ouster_ros::OS1::cloud_to_cloud_msg(
*thiscloud,
std::chrono::nanoseconds{scan_ts},
Expand All @@ -314,8 +310,6 @@ int main(int argc, char** argv) {
msg.header.frame_id = "body_Level_FLU";
//am::MeasureDelayStop (ros::this_node::getName() + "/ouster_pcl_delay" );
//am::MeasureDelayStart(ros::this_node::getName() + "/ouster_pcl_delay" );

msg.header.stamp = reading_time;
lidar_pub.publish(msg);
send_cloud.clear();
imu_entries.clear();
Expand Down

0 comments on commit b73c68c

Please sign in to comment.