Showing posts with label GPS. Show all posts
Showing posts with label GPS. Show all posts

Monday, May 2, 2022

Time Converter App for time conversion in the browser developed with Flutter

I recently learned Flutter (https://flutter.dev/) - a cross platform SDK for building native Android, IOS, Windows, Linux, Web, and MacOS applications with a single code base. For practice, I built a simple application - a Time Converter App for converting time values from various formats to other formats. The formats include GPS time, Julian date, Unix epoch, and UTC date time.

Using the Time Converter App

  1. To use the application, open up a browser and go to https://dominoc925-pages.appspot.com/webapp/timeconverterapp/.

    The app page is loaded.


  2. In the Convert from drop down field, select the source time format e.g. gps.


     

  3. In the to format drop down field, select the destination time format e.g.  utc.

  4. In the entry fields, click the clock icon to use the current system time values. Or type in the values e.g. 2207 as shown below.




  5. Click the blue Convert button.

    If the input values are valid, then the converted time value will be shown in the Output field.


Monday, November 16, 2020

How to enable regular user to set the Ubuntu system date as root without a password

I wanted to use the the time from a GPS to set the Ubuntu operating system date and time in an automated script; and I don't want the script to be interrupted with a prompt for an administrator password. So I tried to configure the sudoers configuration file to allow the group my user name belongs to to run the /bin/date command as root without a password. 

 For a long frustrating time, no matter what I configured, the date command would still prompt me for a password. Eventually, I got it working by doing the following: 

  1. Open up a Terminal and type in the commands to create my own configuration file.

    $ sudo visudo -f /etc/sudoers.d/10-override-date



  2. In the text editor, type in the following:

    %dialout ALL=NOPASSWD: /bin/date



    Note: dialout is the group I wanted to assign the ability to run date as root without a password.

  3. Save and exit.

  4. Subsequently, using the date command as any user in the dialout group would be executed successfully without a password prompt, as shown below.



Monday, July 29, 2019

ROS: Fix "Unable to get message class for type custom_msgs/gnssSample"

I recently received a ROS bag file recorded with a Velodyne VLP-16 LiDAR sensor and a XSens IMU-GPS sensor. When playing back the bag file, the ROS rqt plugins could not expand the XSens messages. The error message: can not get message class for type "custom_msgs/gnssSample" is shown in the screen shot below.
 
I found a deprecated Github repository for the XSens MTi ROS node at https://github.com/xsens/xsens_mti_ros_node that has the definitions for the custom message gnssSample. However, the repository's package name is xsens_msgs while the bag file's package name is custom_msgs. I had to rename the package to get ROS to recognize the bag file's messages. So the following steps were how I resolved the problem.
  1. Follow the tutorial at https://wiki.ros.org/ROS/Tutorials/CreatingPackage to create a Catkin workspace e.g. /home/yourname/catkin_ws/.
  2. Open up a Terminal and change the directory to /home/yourname/catkin_ws/src/.

    $ cd /home/yourname/catkin_ws/src
  3. Download the XSens MTi ROS Node repository.

    $ git clone https://github.com/xsens/xsens_mti_ros_node
  4. Using a text editor, open up the file /home/yourname/catkin_ws/src/xsens_mti_ros_node/src/xsens_msgs/package.xml.


  5. Change the package name to custom_msgs as shown below.


  6. Open up the file /home/yourname/catkin_ws/src/xsens_mti_ros_node/src/xsens_msgs/CMakeLists.txt.



  7. Change the project name to custom_msgs as shown below.


  8. Now in a Terminal change to the catkin root directory.

    $ cd /home/yourname/catkin_ws
  9. Compile the package by entering the command:

    $ catkin_make
If the compilation is successful, now when reviewing the messages with rqt, the custom_msgs/gnssSample message can be expanded, as shown below.

Monday, June 5, 2017

Extract GPS tags from photographs into a CSV file using Exiftool

There is a nice command line utility Exiftool from http://www.sno.phy.queensu.ca/~phil/exiftool/ that can be used to quickly extract out the GPS positions and other tags from photographs and other images into a comma separated values (CSV) file.

The following example uses the Windows executable version of the utility to illustrated the extraction steps.

  1. Open up a Windows Command Prompt. In the prompt, type in the command.

    C:\> "exiftool(-k).exe" -n -gpslongitude -gpslatitude -gpstimestamp -csv D:\MyDocuments\temp\somephotos

    Note:
    -n means to print out as numbers only
    -csv prints out csv including the file path and name
    -D points to the folder directory of the photographs to extract
  2. Press RETURN

    The extraction values are displayed to the screen.

  3. To output to a file, use the > character to redirect the standard output to a file, e.g. type in the command:

    C:\> "exiftool(-k).exe" -n -gpslongitude -gpslatitude -gpstimestamp -csv D:\MyDocuments\temp\somephotos > outgps.csv

    The output file outgps.csv is created.
  4. Display the resultant file in a spreadsheet. Or plot the locations on a map.


Monday, September 26, 2016

WebApp for converting local date time to GPS week and seconds of week

This online calculator can convert the local date time values into the equivalent GPS week and seconds of week. The GPS leap seconds from 1980 till 2016 are taken into account in the conversion.


To use this calculator,
  1. In the Settings pane on the right, select your local time zone, e.g. GMT+0800.
  2. Choose the local date time format, e.g. YYYY-MM-DD HH:MM:SS.
  3. Choose the output delimiter format, e.g. comma.
  4. In the Input local time field, type in one or more local date time values.
  5. Click the Convert to GPS Week Seconds button.

    The converted results are shown in the output field below.

Monday, March 18, 2013

Simple Android app for converting between GPS Week/Seconds Time and local date time

The date time used by the Global Positioning System (GPS) is normally expressed as a week number and a seconds-of-week number. This format is not as easy to work with as a normal calendar date time. I made this simple Android App for converting the GPS Time (in week and seconds-of-week format) and local calendar date time (in UTC+offset format), which is easier to work with. It has the option to choose which local UTC time zone to use for conversion. The app will automatically adjust the local time for GPS leap seconds.

Clicking on the buttons will bring up pickers for selecting the input values, as shown below. 

Get it on Google Play

Monday, September 19, 2011

Convert local date time to GPS week, seconds of week Google Gadget


Note: A WebApp version of this Google Gadget is available at https://dominoc925-pages.appspot.com/webapp/calc_timegps/

This Google Gadget calculator can convert the local date time values into the equivalent GPS week and seconds of week format. The GPS leap seconds from 1980 till 2012 are taken into account in the conversion now.  This came about since I found that in some situations, I need to find out the equivalent GPS week and seconds of week for a given local date time. So I wrote this gadget to do the job. 

To use this calculator, 
  1. Simply select your time zone.
  2. Then type in the local date time.

    Note: The time should be entered in 24HR form. It is not necessary to fill in all local date time fields - the calculator will use zero values in place of blank fields.
  3. Then click the Convert to GPS time button.

    If the keyed in local date time values do not represent a valid date time string, then the calculator will simply display an error 'Invalid date time' message. Otherwise, the GPS week and seconds of week values will be shown in the GPS Time field.

Monday, May 16, 2011

Convert GPS week/seconds to local date time Google Gadget

Note: A WebApp version of this Google Gadget is available here http://dominoc925-pages.appspot.com/webapp/calc_gpstime/default.html.

The GPS date is normally expressed as a week number and a seconds-into-week number. This format is not quite as easy to work with as normal date time. For that reason, this calculator was written to help convert the GPS week-seconds format into a local date time form that can be easier to read. The gadget will incorporate the GPS leap seconds from 1980 to 2012 into the conversion.

For more information about GPS Time, go to http://www.oc.nps.edu/oc2902w/gps/timsys.html.

To use the calculator, simply do the following:
  1. Enter the GPS Week and GPS Seconds with a comma as the delimiter, 
  2. Select the desired local time zone, and 
  3. If necessary, select the desired local date time format in the Pref tab. 
  4. Click the Convert to local time button