New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions are not accessed in the driver #7
Comments
Hi Raghad. I developed/tested it on Ubuntu 14.04/Indigo and believe it works fine in that environment. I suspect the reason you're not seeing PIKSIOpen/Close called is because the piksi_driver launches a thread in the PIKSI::PIKSI constructor initializer. The new thread starts in PIKSI::spin() and loops there forever, as you observed. Then the base thread calls PIKSIOpen() then goes into a permanent spin on ros::spin(), while the launched thread calls PIKSI::spinOnce which calls into the SBP library to process any messages that have arrived from the Piksi, which are processed by callbacks. It's a complicated threading model, but the guys who wrote it that way wanted to support multiple piksi's, each being run by a thread, and assigned a "slot". I think the problem is indicated by the message: This indicates no data is being received - regardless of rtk corrections you're not getting any gps data at all. Your observation that the callbacks that should be called: time/heartbeat/pos_llh_callback are not getting called might be due to you attaching to the wrong thread. If you attached gdb to the base thread instead of the spawned thread, they might be being called but you wouldn't be seeing it. On the other hand, if they aren't being called, it indicates a problem with the SBP library (perhaps swiftnav broke it) or perhaps with access to the serial port. Have you run piksi_console as instructed in section 4.3 of the wiki page? Did you run it with piksi in simulation mode as instructed in the link in section 5 that should take you to the Piksi User Getting Started Guide? If it doesn't work that indicates a serial port problem. The most common fault is that you aren't a member of the dialout group. Run minicom and see if you're getting data from the serial port on the serial device. Perhaps your serial port isn't at /dev/ttyUSB0 (some USB-serial ports turn up at /dev/ttyACM0. Look at the ROS logfile for errors - perhaps the serial port wasn't opened successfully. I'm on kinetic now, but I'll try to test the procedure this weekend in case the library got broken. Let me know how you get on. Paul |
Has this problem been solved? I am still unable to receive date using the swiftnav piksi using ROS. I am getting the same error message. I am running on ubuntu 14.04/indigo. Please let me know if anyone has found a fix for this issue. I have opened the piksi on the console and verified it is publishing data in simulation mode. Also I have checked and successfully opened the USB port through ROS so I don't believe it is a permissions issue. |
Hi. I'm sorry for not solving this sooner - I was working on upgrading my piksis and I bricked both of them so I can't test the latest libsbp to see what broke, but I suspect it may be a libsbp problem. Can you please do a test for me and report the results. On the ROS wiki page for swiftnav_piksi: Build the old libsbp by making a new directory, checking out the old libsbp from source in my repo, and building and installing it. The first couple of steps in 4.1 should be: Please post the results. Meanwhile I'll try to get my piksi's unbricked. Thanks Paul |
Unfortunately that did not work. I built the older version of libsbp and am still not able to publish data from the GPS to ROS. Whenever I launch rqt_robot_monitor I get an error that their is no information publishing. |
I am getting the same error and haven't been able to fix it. Paul can you suggest a fix please? |
Can one of you guys please do a test for me and report the results? I need you to edit a couple of the files to print some output at critical points and check what's going on. Edit swiftnav_piksi/src/piksi.c and insert a blank line after line 151 and add the following code in the blank line: Also, edit swiftnav_piksi/piksi_driver.cpp and insert a blank line after line 191 and add the following code there: Rebuild by doing cd ../.. Next, run the launch file: While the launch file is running, run: Thanks Paul |
Line 191 in piksi_driver.cpp is an if statement. Are you sure to add a line after it? |
Nothing being echoed in /gps/fix |
Thanks for the reply harritdiwan. Oops - I meant to say insert a blank line BEFORE line 191 (before the if() statement), to tell whether the llh callback was getting called. The output you show is suspicious - my recollection from development is it would receive tens of bytes at a time, not 1 or 2. There's a ton of data comes across from piksi - which is why swiftnav runs it at 1,000 kbaud. It almost looks as if the baud rate is not getting set properly. No idea why, but if the baud rate was wrong it would never get any messages that make sense so that would produce the observed effect. Researching.... |
Status update: working with Swiftnav to identify the problem. Stay tuned.... |
Thank you Paul for the help. Please keep updated. |
SOLVED!!!The fix is to clone the old version of the libsbp library, then rebuild the swiftnav_piksi package. Please remove the libsbp and swiftnav_piksi directories as shown below
Next, do the updated steps in section 4.1 and 4.2 of the ROS [swiftnav_piksi wiki page](http://wiki.ros.org/swiftnav_piksi} Explanation of the fault and fixSwiftnav changed the message numbers in libsbp for piksi multi support in a way that was incompatible with v2 piksi. Consequently, v2 piksi would send messages which would be interpreted incorrectly by their latest libsbp library, so the swiftnav_piksi ROS driver never got any valid messages. I duplicated the problem you guys were seeing by using the new libsbp library, then I fixed it by back-reving the libsbp library and rebuilding the library and swiftnav_piksi driver and it began working. The fix (for now) is to pull libsbp from my github repo. It has the last version of the library that worked with v2 piksi. It is also necessary to rebuild the swiftnav_piksi ROS driver because the install step of libsbp build puts header files in /usr/local/include which swiftnav_piksi uses. The reason @ciscorigvc test didn't work is I didn't tell him to rebuild swiftnav_piksi, so it was still using messed-up headers, even though the library was working correctly after he reverted to the old library. I apologize for how long this problem has taken to solve. I had problem after problem updating my piksis to the latest firmware. Thanks to swiftnav for their help unbricking them (solution was to use the windows piksi_console). I expect to add support for piksi multi to this driver very shortly. piksi multi will achieve RTK lock in 10 - 60 seconds, so will be a big improvement for ground roboticists. |
Will someone please test this fix and report results. |
It works now!! Thank you very much Paul for taking out your time and solving this issue. |
Thanks for the followup report @harritdiwan I will add this to the tips & tricks section of the wiki page in case anyone else has this problem. |
Hello Paul, I did the suggested fix: install the older version of libsbp (v0.51.1) and then install swiftnav_piksi. Thank you. |
Hi. I think you didn't understand the problem or solution properly. If you are using piksi multi, you need to install the NEWEST version of libsbp, then install and build swiftnav_piksi. This issue relates to how to make old piksi's work, and the solution was to use the old version of the library. For Piksi multi's, use the new version of the library, direct from swiftnav. Sorry I haven't written up the instructions yet - I'll try & get them written this weekend.
|
Thank you. It is working now. |
can you please post more info about setting up Piksi Multi with ROS |
The Piksi MultI has an Eitherent port, can your ROS driver utlize it rather than serial port? |
I had a quick look at libsbp c code, it looks like it is still not fully supported. The header file is there but no actual implementation. |
Honestly i am still running into that same error. https://github.com/PaulBouchier/libsbp.git each time i deleted the ROS workspace completely, recreated it and cloned https://github.com/PaulBouchier/swiftnav_piksi.git Any further help would be appreciated. |
Update: and i got this result when running rqt_robot_monitor: any thoughts? |
Hey guys, cheers |
Thanks for the update. Glad it's working. Those are the correct repos to use. I've updated my repos by marking them as obsolete. Swiftnav has taken over maintenance of this driver. |
Hi
I have a problem in displaying the swift RTK-GPS signal in ROS using this tutorial http://wiki.ros.org/swiftnav_piksi. I always get the following message whenever I run the monitor window using this command rosrun rqt_robot_monitor rqt_robot_monitor
**Full Name: /GPS/piksi_rtk_diag: Piksi Status
Component: piksi_rtk_diag: Piksi Status
Hardware ID: piksi rtk
Level: WARNING
Message: RTK Satellite fix invalid: too few satellites in view
io_failure_count: 0
open_failure_count: 0
Heartbeat status (0 = good): 0
Number of satellites used in GPS RTK solution: 0
GPS RTK solution status (1 = good): 0
GPS RTK meters north: 0
GPS RTK meters east: 0
GPS RTK height difference (m): 0
GPS RTK horizontal accuracy (m): 0.04
GPS RTK velocity north: 6.93398e-310
GPS RTK velocity east: 4.94066e-324
GPS RTK velocity up: 6.95299e-310
Number of satellites used for lat/lon: 0
GPS lat/lon solution status: 0
GPS latitude: 0
GPS longitude: 0
GPS altitude: 0
GPS lat/lon horizontal accuracy (m): 0**
I traced the piksi_driver.cpp code and I found that it doesn't get inside these functions at all.
PIKSI::~PIKSI( )
bool PIKSI::PIKSIOpen( )
void PIKSI::PIKSIClose( )
void PIKSI::PIKSICloseNoLock( )
void heartbeat_callback(u16 sender_id, u8 len, u8 msg[], void *context)
void time_callback(u16 sender_id, u8 len, u8 msg[], void *context)
void pos_llh_callback(u16 sender_id, u8 len, u8 msg[], void *context)
std::cout << "10" << std::endl << std::flush ;
void baseline_ned_callback(u16 sender_id, u8 len, u8 msg[], void *context)
void vel_ned_callback(u16 sender_id, u8 len, u8 msg[], void *context)
void PIKSI::DiagCB( diagnostic_updater::DiagnosticStatusWrapper &stat )
It keeps looping in these two functions
void PIKSI::spin( )
void PIKSI::spinOnce( )
I am using Ubuntu 14.04 and the latest version are downloaded for piksi firmware
This is very strange since I am following exactly what is written in the tutorial!
Has anybody tested the code in piksi device and worked with him?
Thanks
Raghad
The text was updated successfully, but these errors were encountered: