GithubHelp home page GithubHelp logo

Comments (17)

taihup avatar taihup commented on August 11, 2024 3

Hi, you must run
roscore &
rosparam set use_sim_time true

And then run the rosbag and S-PTAM

from sptam.

sunzwdd avatar sunzwdd commented on August 11, 2024

Thanks, I have solved it according to your instruction. But I face a new problem. When I run sptam on the kitti dataset using "roslaunch sptam kitti.launch" , the problem is shown as follows:

root@HP:/home/cui/test/src# roslaunch sptam kitti.launch
... logging to /root/.ros/log/b0ed62f2-aeb3-11e9-81ef-68ecc56614d0/roslaunch-HP-14840.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://HP:3185/

SUMMARY

PARAMETERS

  • /rosdistro: kinetic
  • /rosversion: 1.12.14
  • /sptam/BundleAdjustmentActiveKeyframes: 10
  • /sptam/DescriptorExtractor/Name: BRIEF
  • /sptam/DescriptorExtractor/bytes: 32
  • /sptam/DescriptorMatcher/Name: BruteForce-Hamming
  • /sptam/DescriptorMatcher/crossCheck: False
  • /sptam/EpipolarDistance: 0
  • /sptam/FeatureDetector/Name: GFTT
  • /sptam/FeatureDetector/minDistance: 15.0
  • /sptam/FeatureDetector/nfeatures: 1000
  • /sptam/FeatureDetector/qualityLevel: 0.01
  • /sptam/FeatureDetector/useHarrisDetector: False
  • /sptam/FrustumFarPlaneDist: 10000.0
  • /sptam/FrustumNearPlaneDist: 0.1
  • /sptam/LoopDetectorVocabulary: /home/cui/test/sr...
  • /sptam/MatchingCellSize: 15
  • /sptam/MatchingDistance: 25
  • /sptam/MatchingNeighborhood: 2
  • /sptam/approximate_sync: False
  • /sptam/base_frame: left_camera
  • /sptam/camera_frame: left_camera
  • /sptam/minimumTrackedPointsRatio: 0.9
  • /sptam/publish_on_fail: True
  • /sptam/publish_transform: True
  • /sptam/reference_frame: left_camera
  • /sptam/use_prediction: False
  • /use_sim_time: True

NODES
/
sptam (sptam/sptam_node)
sptam_path (ros_utils/pose_to_path)
start_broadcaster (tf2_ros/static_transform_publisher)

auto-starting new master
process[master]: started with pid [14850]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to b0ed62f2-aeb3-11e9-81ef-68ecc56614d0
process[rosout-1]: started with pid [14863]
started core service [/rosout]
process[start_broadcaster-2]: started with pid [14878]
process[sptam_path-3]: started with pid [14893]
process[sptam-4]: started with pid [14903]
[ INFO] [1564042240.690737484]: Initializing nodelet with 12 worker threads.
crossCheck: 0
OpenCV: threads set to -1
nfeatures: 1000
qualityLevel: 0.01
minDistance: 15
blockSize: 3
useHarrisDetector: 0
k: 0.04
nfeatures: 1000
qualityLevel: 0.01
minDistance: 15
blockSize: 3
useHarrisDetector: 0
k: 0.04
bytes: 32
use_orientation: 0
bytes: 32
use_orientation: 0
[ INFO] [1564042240.868007458]: S-PTAM stereo node initialized.
[ INFO] [1564042297.910024098, 1385798152.932168090]: init calib
[ INFO] [1564042297.910434780, 1385798152.932168090]: baseline: 0.537166
[ INFO] [1564042297.956391693, 1385798152.972690218]: Trying to intialize map...
[ INFO] [1564042297.978346674, 1385798152.992914468]: Map initialized with 83 points.
sptam_node: /usr/include/eigen3/Eigen/src/Core/CoreEvaluators.h:838: Eigen::internal::block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, true>::block_evaluator(const XprType&) [with ArgType = const Eigen::Matrix<double, 4, 1>; int BlockRows = 4; int BlockCols = 1; bool InnerPanel = true; Eigen::internal::block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, true>::XprType = Eigen::Block<const Eigen::Matrix<double, 4, 1>, 4, 1, true>]: Assertion `((size_t(block.data()) % (((int)1 >= (int)evaluator::Alignment) ? (int)1 : (int)evaluator::Alignment)) == 0) && "data is not aligned"' failed.
[sptam-4] process has died [pid 14903, exit code -6, cmd /home/cui/test/devel/lib/sptam/sptam_node /stereo/left/image_rect:=/kitti_stereo/left/image_rect /stereo/right/image_rect:=/kitti_stereo/right/image_rect /stereo/left/camera_info:=/kitti_stereo/left/camera_info /stereo/right/camera_info:=/kitti_stereo/right/camera_info __name:=sptam __log:=/root/.ros/log/b0ed62f2-aeb3-11e9-81ef-68ecc56614d0/sptam-4.log].
log file: /root/.ros/log/b0ed62f2-aeb3-11e9-81ef-68ecc56614d0/sptam-4*.log

I guess it may be the eigen library. Need I reinstall the eigen? Is there an another solution?
Looking forward to your reply, Thanks.

from sptam.

taihup avatar taihup commented on August 11, 2024

Try the fix that works in Dense-SPTAM CIFASIS/dense-sptam#5. Try with the eigen version 3.2.10.

from sptam.

sunzwdd avatar sunzwdd commented on August 11, 2024

Thanks a lot, I have reinstalled the eigen with the version 3.2.10, and the code can successfully run on the kitti dataset. I am sorry to ask a simple question. After running the KITTI bag, I interrupt the ros and the terminal is shown as follows:

[ INFO] [1564059543.520064749]: S-PTAM stereo node initialized.
[ INFO] [1564059573.745868505, 1385799662.061790705]: init calib
[ INFO] [1564059573.746017181, 1385799662.061790705]: baseline: 0.537151
[ INFO] [1564059573.758396834, 1385799662.061790705]: Trying to intialize map...
[ INFO] [1564059573.770670967, 1385799662.061790705]: Map initialized with 106 points.
^C^C[sptam-4] killing on exit
[start_broadcaster-2] killing on exit
[sptam_path-3] killing on exit
starting sptam node cleanup...
stopping sptam threads...
-- -- -- WAIT QUEUE - -- --
-- -- -- WAIT JOIN -- -- --
saving measurements...
saving keyframes...
saving map cloud...
done!

It shows save the measurements, keyframes and map cloud. But I don't find these files in the sptam workspace. It's very kind of you to tell me where it is, and I am sorry for asking this so simple question.

from sptam.

taihup avatar taihup commented on August 11, 2024

They are not in the S-PTAM workspace. You can find them in the default ros directory. This is: $HOME/.ros/

from sptam.

sunzwdd avatar sunzwdd commented on August 11, 2024

Thanks a lot for your help, I find the 'map cloud.dat' file in the $HOME/.ros/. But I did not find the measurements file and keyframe file. I want to get the camera pose of each frame. I find the camera pose of some frames in the log files. Can you tell me where I can find the measurements and keyframe file? And how can I get the camera pose of each frame? Thanks for your help again.

root@HP:~/.ros# ls
2019-07-25_15:42:10.log 2019-08-01_16:41:36.log
2019-07-25_15:43:18.log 2019-08-01_16:48:21.log
2019-07-25_15:43:42.log 2019-08-01_17:01:40.log
2019-07-25_15:46:44.log 2019-08-01_17:03:24.log
2019-07-25_15:57:32.log 2019-08-01_17:10:44.log
2019-07-25_16:08:26.log 2019-08-01_19:27:32.log
2019-07-25_16:10:40.log 2019-08-01_21:34:50.log
2019-07-25_17:10:49.log debug.txt
2019-07-25_19:52:08.log log
2019-07-25_20:05:05.log map cloud.dat
2019-07-25_20:08:12.log roscore-11311.pid
2019-07-25_20:30:09.log rosdep
2019-07-25_20:59:03.log rosmake
2019-08-01_16:32:05.log rospack_cache_02032891937331164123
2019-08-01_16:38:41.log rospack_cache_11134725904490598093

from sptam.

taihup avatar taihup commented on August 11, 2024

All the information is in the .log file. If you want you can add the information that you want. If I do not remember bad, the keyframe pose are logged at the end of the log, when you close S-PTAM. Look in the log for some keywords like: KF, POSE, TRACKED_POSE, etc.

from sptam.

taihup avatar taihup commented on August 11, 2024

The pose of each frame you can find it in the log with the following labels:
TRACKED_FRAME_POSE: in initial camera corrdinate system
REFINED_CAMERA_POSE: in the odom coordinate system (in general is the same than the camera coordinate system)

from sptam.

sunzwdd avatar sunzwdd commented on August 11, 2024

Thanks a lot for your help. I find the pose of each frame in the 'log' file. Now, I want to make kitti dataset to bag file. I utilize the code you have recommended in "https://github.com/lrse/dataset2bag". I use the left images, right images, left and right camera information. But the parameters of generated bag is different from the corresponding bag downloaded from Internet.

For example, I used the code "rosrun dataset2bag dataset2bag -l xxx -r xxx -c xxx -calib_right xxx -t xxx -o xxx".

  1. For image, I do not know which images to use (KITTI provide the [synced+rectified] and [unsynced+unrectified data] ).

  2. For calibration information, we provide the intrinsic matrix, rotation matrix, tranformation vector, distortion coefficients from the calibration file provided by kitti, as shown in the following figure

2019-08-08_180933

  1. For timestamp, KITTI provide the timestamp for each image sequence. Thus, I use the timestamp of left image sequence.

Another question: in the bag download from the Internet, the topic contain "tf" information. I do not understand the function of this informaiton. If there is no "tf" in the generated bag, will the results be affected.

Thanks a lot for your help again.

from sptam.

taihup avatar taihup commented on August 11, 2024

I think you are getting the information from the wrong place. the download page is: http://www.cvlibs.net/datasets/kitti/eval_odometry.php

You should download the images from: http://www.cvlibs.net/download.php?file=data_odometry_gray.zip

The raw information from: http://www.cvlibs.net/download.php?file=data_odometry_calib.zip

The TF is a message that ROS use to change stuffs () from one coordinate system to another. It impacts in the visualization of the trajectory or the map in rviz, and when we try to jump from coord. system to another in the code using ROS.

from sptam.

sunzwdd avatar sunzwdd commented on August 11, 2024

Thanks a lot for your help, I find an other question.
I used the code to run the kitti dataset. I got the pose of each camera from the '.log' file.
But I found that the file did not contain the pose of each frame. Generally less than the number of frames.
Sometimes, the adjacent frames which have poses are not continuous, as shown in the following figure.
2019-08-14_162914
Can you tell how to solve this problem?
Thanks a lot again.

from sptam.

taihup avatar taihup commented on August 11, 2024

It is possible that S-PTAM is not able to process every incoming frame. This could happen because of the computer that you are using is not fast enough or you have several programs running at the same time.

you can try to run the rosbag slowly inorder to do not lose frames.

rosbag play --clock --rate 0.5 <rosbag.bag>

Moreover, you can use the standalone version to run it without ROS, and it will not lose frames.

from sptam.

sunzwdd avatar sunzwdd commented on August 11, 2024

I am sorry to bother you again. Thanks for your suggestions. I try to use the standalone version to run it without ROS. But I met a compilation problem as follows:

wxn@amax:~/czc/sptam/src/standAlone/build$ make
Scanning dependencies of target frameGenerator
[ 10%] Building CXX object CMakeFiles/frameGenerator.dir/FrameGenerator/FileSequenceFrameGenerator.cpp.o
[ 20%] Building CXX object CMakeFiles/frameGenerator.dir/FrameGenerator/ListOfFilesFrameGenerator.cpp.o
[ 30%] Building CXX object CMakeFiles/frameGenerator.dir/FrameGenerator/VideoFileFrameGenerator.cpp.o
[ 40%] Linking CXX static library libframeGenerator.a
[ 40%] Built target frameGenerator
Scanning dependencies of target sptam-stereo
[ 50%] Building CXX object CMakeFiles/sptam-stereo.dir/sptam-stereo.cpp.o
[ 60%] Building CXX object CMakeFiles/sptam-stereo.dir/KITTIGroundTruth.cpp.o
[ 70%] Building CXX object CMakeFiles/sptam-stereo.dir/SptamWrapper.cpp.o
[ 80%] Building CXX object CMakeFiles/sptam-stereo.dir/utils/ProgramOptions.cpp.o
[ 90%] Building CXX object CMakeFiles/sptam-stereo.dir/Timestamps.cpp.o
[100%] Linking CXX executable sptam-stereo
/usr/bin/ld: cannot find -lsptam
collect2: error: ld returned 1 exit status
CMakeFiles/sptam-stereo.dir/build.make:244: recipe for target 'sptam-stereo' failed
make[2]: *** [sptam-stereo] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/sptam-stereo.dir/all' failed
make[1]: *** [CMakeFiles/sptam-stereo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

It may be a link problem.
How can I solve it?

from sptam.

taihup avatar taihup commented on August 11, 2024

I notice that instructions are obsolete to compile standAlone. You must do them inside sptam main folder (repository folder), not in standAlone directory.

from sptam.

taihup avatar taihup commented on August 11, 2024

Mmm I think there is no map output in standalone version, however you can code it following the ROS map log. It shouldn't be too complicated.

from sptam.

sunzwdd avatar sunzwdd commented on August 11, 2024

I have add the function of saving the map. The code work well.
Thanks for your patience and help.

from sptam.

taihup avatar taihup commented on August 11, 2024

no problem, have a good one!

from sptam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.