Three-dimensional motion trajectory generation method and device

文档序号:1734902 发布日期:2019-12-20 浏览:34次 中文

阅读说明:本技术 一种三维运动轨迹的生成方法及装置 (Three-dimensional motion trajectory generation method and device ) 是由 申波 练帅超 于 2019-10-23 设计创作,主要内容包括:本发明公开了一种三维运动轨迹的生成方法及装置,该方法包括:在每个位置采样点采集海拔值和经纬度坐标;将每个位置采样点的经纬度坐标转换成以米为单位的平面坐标;将每个位置采样点的平面坐标与海拔值转换成为三维坐标;将所有位置采样点的三维坐标顺序连接生成三维运动轨迹,并标识三维运动轨迹的起点和终点。本发明能够结合海拔生成三维运动轨迹。(The invention discloses a method and a device for generating a three-dimensional motion track, wherein the method comprises the following steps: collecting an altitude value and longitude and latitude coordinates at each position sampling point; converting the longitude and latitude coordinates of each position sampling point into plane coordinates taking meters as units; converting the plane coordinate and the altitude value of each position sampling point into three-dimensional coordinates; and sequentially connecting the three-dimensional coordinates of all the position sampling points to generate a three-dimensional motion track, and identifying a starting point and an end point of the three-dimensional motion track. The invention can generate a three-dimensional motion track by combining the altitude.)

1. A three-dimensional motion trail generation method is characterized by comprising the following steps;

collecting an altitude value and longitude and latitude coordinates at each position sampling point;

converting the longitude and latitude coordinates of each position sampling point into plane coordinates taking meters as units;

converting the plane coordinate and the altitude value of each position sampling point into three-dimensional coordinates;

and sequentially connecting the three-dimensional coordinates of all the position sampling points to generate a three-dimensional motion track, and identifying a starting point and an end point of the three-dimensional motion track.

2. The method for generating a three-dimensional motion trajectory according to claim 1, wherein the step of converting the longitude and latitude coordinates of each position sampling point into plane coordinates in meters specifically comprises:

selecting a position sampling point with the minimum longitude coordinate and the minimum latitude coordinate in all the position sampling points as a reference position sampling point;

calculating a first spherical distance of the current position sampling point relative to the reference position sampling point at the same latitude;

calculating a second spherical distance of the current position sampling point relative to the reference position sampling point under the same longitude;

and combining the first spherical distance and the second spherical distance into the plane coordinates of the current position sampling point.

3. The method for generating a three-dimensional motion trajectory according to claim 2, further comprising:

and drawing on a three-dimensional drawing platform and displaying the three-dimensional motion trail.

4. The method according to claim 3, wherein the three-dimensional rendering platform is an Open GL platform.

5. A three-dimensional motion trajectory generation device, characterized in that the three-dimensional motion trajectory generation device comprises:

the data acquisition module is used for acquiring an altitude value and longitude and latitude coordinates at each position sampling point;

the two-dimensional coordinate conversion module is used for converting the longitude and latitude coordinates of each position sampling point into plane coordinates taking meters as units;

the three-dimensional coordinate conversion module is used for converting the plane coordinate and the altitude value of each position sampling point into three-dimensional coordinates;

and the track generation module is used for sequentially connecting the three-dimensional coordinates of all the position sampling points to generate a three-dimensional motion track and identifying the starting point and the end point of the three-dimensional motion track.

6. The generation device of the three-dimensional motion trail according to claim 5, wherein the two-dimensional coordinate transformation module comprises a reference point selection unit, a first coordinate calculation unit, a second coordinate calculation unit and a coordinate generation unit;

the reference point selecting unit is used for selecting a position sampling point with the minimum latitude coordinate and the minimum longitude coordinate in all the position sampling points as a reference position sampling point;

the first coordinate calculation unit is used for calculating a first spherical distance of the current position sampling point relative to the reference position sampling point at the same latitude;

the second coordinate calculation unit is used for calculating a second spherical distance of the current position sampling point relative to the reference position sampling point under the same longitude;

the coordinate generating unit is used for forming the first spherical distance and the second spherical distance into plane coordinates of the current position sampling point.

7. The apparatus according to claim 6, further comprising a trajectory display unit, configured to render on a three-dimensional rendering platform and display the three-dimensional motion trajectory.

8. The apparatus according to claim 7, wherein the three-dimensional rendering platform is an Open GL platform.

Technical Field

The invention relates to the technical field of map application, in particular to a method and a device for generating a three-dimensional motion trail.

Background

Nowadays, more and more sports enthusiasts are doing sports outdoors, and they want to record the movement tracks of the sports enthusiasts during running, riding and mountain climbing. The movement track is generally displayed on a map, is composed of a series of position points, and identifies a starting point and an end point, so that a sports enthusiast can record the self travel route.

Disclosure of Invention

The invention mainly solves the technical problem of providing a method and a device for generating a three-dimensional motion track, which can generate the three-dimensional motion track by combining with the altitude.

In order to solve the technical problems, the invention adopts a technical scheme that: the method for generating the three-dimensional motion trail comprises the following steps; collecting an altitude value and longitude and latitude coordinates at each position sampling point; converting the longitude and latitude coordinates of each position sampling point into plane coordinates taking meters as units; converting the plane coordinate and the altitude value of each position sampling point into three-dimensional coordinates; and sequentially connecting the three-dimensional coordinates of all the position sampling points to generate a three-dimensional motion track, and identifying a starting point and an end point of the three-dimensional motion track.

As a preferred embodiment of the present invention, the step of converting the longitude and latitude coordinates of each position sampling point into plane coordinates in meters specifically includes: selecting a position sampling point with the minimum longitude coordinate and the minimum latitude coordinate in all the position sampling points as a reference position sampling point; calculating a first spherical distance of the current position sampling point relative to the reference position sampling point at the same latitude; calculating a second spherical distance of the current position sampling point relative to the reference position sampling point under the same longitude; and combining the first spherical distance and the second spherical distance into the plane coordinates of the current position sampling point.

As a preferred embodiment of the present invention, the generating method further includes: and drawing on a three-dimensional drawing platform and displaying the three-dimensional motion trail.

As a preferred embodiment of the present invention, the three-dimensional rendering platform is an Open GL platform.

In order to solve the technical problem, the invention adopts another technical scheme that: provided is a three-dimensional motion trajectory generation device, including: the data acquisition module is used for acquiring an altitude value and longitude and latitude coordinates at each position sampling point; the two-dimensional coordinate conversion module is used for converting the longitude and latitude coordinates of each position sampling point into plane coordinates taking meters as units; the three-dimensional coordinate conversion module is used for converting the plane coordinate and the altitude value of each position sampling point into three-dimensional coordinates; and the track generation module is used for sequentially connecting the three-dimensional coordinates of all the position sampling points to generate a three-dimensional motion track and identifying the starting point and the end point of the three-dimensional motion track.

As a preferred embodiment of the present invention, the two-dimensional coordinate conversion module includes a reference point selecting unit, a first coordinate calculating unit, a second coordinate calculating unit, and a coordinate generating unit: the reference point selecting unit is used for selecting a position sampling point with the minimum latitude coordinate and the minimum longitude coordinate in all the position sampling points as a reference position sampling point; the first coordinate calculation unit is used for calculating a first spherical distance of the current position sampling point relative to the reference position sampling point at the same latitude; the second coordinate calculation unit is used for calculating a second spherical distance of the current position sampling point relative to the reference position sampling point under the same longitude; the coordinate generating unit is used for forming the first spherical distance and the second spherical distance into plane coordinates of the current position sampling point.

As a preferred embodiment of the present invention, the generating apparatus further includes a trajectory display unit, and the trajectory display unit is configured to perform rendering on a three-dimensional rendering platform and display the three-dimensional motion trajectory.

As a preferred embodiment of the present invention, the three-dimensional rendering platform is an Open GL platform.

Different from the prior art, the invention has the beneficial effects that: for some outdoor exercises with large altitude changes, sports enthusiasts can clearly see the changes of the altitude in the exercise process and know the influence of the altitude on the performance of the sports enthusiasts, for example, the speed is possibly slower when climbing a slope and the speed is possibly improved when descending the slope.

Drawings

Fig. 1 is a schematic flow chart of a method for generating a three-dimensional motion trajectory according to an embodiment of the present invention.

Fig. 2 is a schematic block diagram of a three-dimensional motion trajectory generation device according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Fig. 1 is a schematic flow chart of a method for generating a three-dimensional motion trajectory according to an embodiment of the present invention. The method for generating the three-dimensional motion trail comprises the following steps;

s1: and acquiring an altitude value and longitude and latitude coordinates at each position sampling point.

The longitude and latitude coordinates can be obtained through GPS signals, and the altitude value can be obtained through a barometer.

S2: and converting the longitude and latitude coordinates of each position sampling point into plane coordinates in a meter unit.

S3: and converting the plane coordinates and the altitude values of each position sampling point into three-dimensional coordinates.

Wherein the scale of the altitude value is kept consistent with the scale of the longitude and latitude.

S4: and sequentially connecting the three-dimensional coordinates of all the position sampling points to generate a three-dimensional motion track, and identifying a starting point and an end point of the three-dimensional motion track.

In this embodiment, step S2 specifically includes:

selecting a position sampling point with the minimum longitude coordinate and the minimum latitude coordinate in all the position sampling points as a reference position sampling point;

calculating a first spherical distance of the current position sampling point relative to the reference position sampling point at the same latitude;

calculating a second spherical distance of the current position sampling point relative to the reference position sampling point under the same longitude;

and combining the first spherical distance and the second spherical distance into the plane coordinates of the current position sampling point.

The longitude coordinate of the sampling point of the reference position is assumed to be lng0, and the latitude coordinate is assumed to be lat 0. The longitude and latitude coordinates of the current position sampling point are (ng 1, lat1), a first spherical distance of the current position sampling point relative to the reference position sampling point at the same latitude is calculated, namely the spherical distance of (ng 1, lat0) relative to (ng 0, lat0) is calculated, dx meters are assumed, a second spherical distance of the current position sampling point relative to the reference position sampling point at the same longitude is calculated, namely the spherical distance of (ng 0, lat1) relative to (ng 0, lat0) is calculated, dy meters are assumed, and the longitude and latitude coordinates (ng 1, lat1) of the last current position sampling point are converted into plane coordinates (dx, dy) in meters. On this basis, assuming that the altitude of the current position sampling point is alt meters, the three-dimensional coordinates are (dx, dy, alt).

In this embodiment, the generating method further includes:

s5: and drawing and displaying the three-dimensional motion trail on the three-dimensional drawing platform.

The three-dimensional drawing platform is an Open GL platform.

Fig. 2 is a schematic block diagram of a three-dimensional motion trajectory generation device according to an embodiment of the present invention. The device for generating the three-dimensional motion track of the embodiment of the invention comprises a data acquisition module 10, a two-dimensional coordinate conversion module 20, a three-dimensional coordinate conversion module 30 and a track generation module 40.

The data acquisition module 10 is used for acquiring an altitude value and longitude and latitude coordinates at each position sampling point. Wherein, the longitude and latitude coordinates can be obtained by GPS signals, and the altitude value can be obtained by a barometer

The two-dimensional coordinate conversion module 20 is configured to convert the longitude and latitude coordinates of each position sampling point into plane coordinates in meters.

The three-dimensional coordinate conversion module 30 is configured to convert the plane coordinates and the altitude values of each position sampling point into three-dimensional coordinates. Wherein the scale of the altitude value is kept consistent with the scale of the longitude and latitude.

The track generation module 40 is configured to sequentially connect the three-dimensional coordinates of all the position sampling points to generate a three-dimensional motion track, and identify a start point and an end point of the three-dimensional motion track.

In the present embodiment, the two-dimensional coordinate conversion module 20 includes a reference point selection unit 21, a first coordinate calculation unit 22, a second coordinate calculation unit 23, and a coordinate generation unit 24.

The reference point selecting unit 21 is configured to select a position sampling point with the smallest latitude coordinate and longitude coordinate in all the position sampling points as a reference position sampling point;

the first coordinate calculation unit 22 is configured to calculate a first spherical distance between the current position sampling point and the reference position sampling point at the same latitude;

the second coordinate calculation unit 23 is configured to calculate a second spherical distance between the current position sampling point and the reference position sampling point at the same longitude;

the coordinate generating unit 24 is configured to combine the first spherical distance and the second spherical distance into the plane coordinates of the current position sampling point.

The longitude coordinate of the sampling point of the reference position is assumed to be lng0, and the latitude coordinate is assumed to be lat 0. The longitude and latitude coordinates of the current position sampling point are (ng 1, lat1), a first spherical distance of the current position sampling point relative to the reference position sampling point at the same latitude is calculated, namely the spherical distance of (ng 1, lat0) relative to (ng 0, lat0) is calculated, dx meters are assumed, a second spherical distance of the current position sampling point relative to the reference position sampling point at the same longitude is calculated, namely the spherical distance of (ng 0, lat1) relative to (ng 0, lat0) is calculated, dy meters are assumed, and the longitude and latitude coordinates (ng 1, lat1) of the last current position sampling point are converted into plane coordinates (dx, dy) in meters. On this basis, assuming that the altitude of the current position sampling point is alt meters, the three-dimensional coordinates are (dx, dy, alt).

In this embodiment, the generating apparatus further includes a trajectory display unit 50, and the trajectory display unit 50 is configured to perform drawing on the three-dimensional drawing platform and display the three-dimensional motion trajectory. The three-dimensional drawing platform is an Open GL platform.

Through the mode, the method and the device for generating the three-dimensional motion trail can show the altitude change when the motion trail is displayed.

The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种巷道和硐室断面成像施工装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!