Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
add covariance & disable tf
Browse files Browse the repository at this point in the history
  • Loading branch information
borongyuan committed May 27, 2021
1 parent 25ac370 commit e43216d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ catkin_package(
)

add_executable(livox_repub src/livox_repub.cpp)
add_dependencies(livox_repub ${catkin_EXPORTED_TARGETS})
target_link_libraries(livox_repub ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBS})

add_executable(loam_scanRegistration src/scanRegistration.cpp)
Expand Down
31 changes: 19 additions & 12 deletions src/laserMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1157,21 +1157,28 @@ int main(int argc, char** argv)
odomAftMapped.pose.pose.position.x = transformAftMapped[3];
odomAftMapped.pose.pose.position.y = transformAftMapped[4];
odomAftMapped.pose.pose.position.z = transformAftMapped[5];
odomAftMapped.pose.covariance = {
0.1, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.1, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.1, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.1, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.1, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.1};

pubOdomAftMapped.publish(odomAftMapped);

static tf::TransformBroadcaster br;
tf::Transform transform;
tf::Quaternion q;
transform.setOrigin( tf::Vector3( odomAftMapped.pose.pose.position.x,
odomAftMapped.pose.pose.position.y,
odomAftMapped.pose.pose.position.z ) );
q.setW( odomAftMapped.pose.pose.orientation.w );
q.setX( odomAftMapped.pose.pose.orientation.x );
q.setY( odomAftMapped.pose.pose.orientation.y );
q.setZ( odomAftMapped.pose.pose.orientation.z );
transform.setRotation( q );
br.sendTransform( tf::StampedTransform( transform, odomAftMapped.header.stamp, "camera_init", "aft_mapped" ) );
// static tf::TransformBroadcaster br;
// tf::Transform transform;
// tf::Quaternion q;
// transform.setOrigin( tf::Vector3( odomAftMapped.pose.pose.position.x,
// odomAftMapped.pose.pose.position.y,
// odomAftMapped.pose.pose.position.z ) );
// q.setW( odomAftMapped.pose.pose.orientation.w );
// q.setX( odomAftMapped.pose.pose.orientation.x );
// q.setY( odomAftMapped.pose.pose.orientation.y );
// q.setZ( odomAftMapped.pose.pose.orientation.z );
// transform.setRotation( q );
// br.sendTransform( tf::StampedTransform( transform, odomAftMapped.header.stamp, "camera_init", "aft_mapped" ) );

kfNum++;

Expand Down

0 comments on commit e43216d

Please sign in to comment.