Skip to content
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

Femtomes PX4 gps device driver #49

Closed
wants to merge 13 commits into from
Closed

Conversation

Femtomes
Copy link
Contributor

Femtomes is one product of gps receiver, it support the gps location, because many px4 customers use, so we develop the driver to be easy for further development and use.

@bkueng
Copy link
Member

bkueng commented Feb 17, 2020

Thanks for the contribution.
I have some general questions:
On which GPS device has this been tested? Was RTK tested as well?
Where is the protocol specification documented?
Do you have a log file from a flight?

@bys1123
Copy link

bys1123 commented Feb 17, 2020

This is for their Femtomes FB672 and FB680 series receiver boards.
Femtomes FB672 is familiar with NovAtel 718D and Trimble MB-Two
Specification: https://1drv.ms/b/s!AmscxcpJYtuYmCaTc9xbWu5eIuJA
Femtomes FB680 is familiar with NovAtel 719
Specification: https://1drv.ms/b/s!AmscxcpJYtuYmCc7CQSfQuNjUe6v
These products are cheaper than NovAtel and Trimble's, already integration in some RTK receiver products in survey industry in European American and Chinese Market.
image
I'll share these product names and protocol specification tomorrow.
They tested old driver on px4 1.9.2. This code now updated but not well tested on current master yet due to COVID19. They will test this code later.
Thanks for your help.

@hamishwillee
Copy link

Hi @Femtomes
Do you intend to create documentation for this too? Normally we create a page like https://docs.px4.io/master/en/gps_compass/rtk_gps_cuav_c-rtk.html that has information about where you get the hardware, how it is wired, and any additional special setup or settings.

Then we link that from the parent page: https://docs.px4.io/master/en/gps_compass/rtk_gps.html

@Femtomes
Copy link
Contributor Author

Hi @hamishwillee
Thanks for the advice.
We will find partners to help us collect 1-10 minutes of flight video and flight logs.
We will make a similar web page to explain our products, including parameters, usage methods and so on.
Please give us your valuable comments on other requirements.

src/femtomes.h Outdated
#endif


GPSDriverFemto::GPSDriverFemto(GPSCallbackPtr callback, void *callback_user,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this code in the header file? It is duplicated from the .cpp file.
Also the class declaration for GPSDriverFemto is missing, so this will not compile, and the pull request is incomplete in this state.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so sorry i can't understand about your answer.
1、 the 68 line will complete the init work when there have GPSDriverFemto object be create
2、this class declaration have done in the femtomes.h, you see the 68 line is in femtomes.cpp
3、I have do test about this code, we have log and video. so it sure to can be compiled.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a look at femtones.h and femtones.cpp in this PR: they both contain the same content, so it cannot work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry about have not notice the commit file of femtomes.h same to the femtomes.cpp. Later we will fix this problem. Thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have recommit the femtomes.h, please check this again,thank you.

@hamishwillee
Copy link

@Femtomes Re #49 (comment) - sounds good.

There is information on working with the documentation toolchain here: https://dev.px4.io/master/en/contribute/docs.html. Generally my advice is to copy the patterns of existing similar material.

After you've created a PR I may have more to add :-)

Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through it in detail and added some remarks and suggestions.

src/femtomes.h Outdated Show resolved Hide resolved
src/femtomes.h Outdated Show resolved Hide resolved
src/femtomes.h Outdated Show resolved Hide resolved
src/femtomes.h Outdated Show resolved Hide resolved
src/femtomes.h Outdated
OutputMode _output_mode{ OutputMode::GPS };
bool _correction_output_activated{false};
bool _configure_done{false};
float _heading_offset;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be substracted from the heading. Please check in ashtech.cpp how it's done.
Is heading supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, i have not understand about this .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this have changed in the code, thank you

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. You need to consider the wrapping as well: https://github.com/PX4/GpsDrivers/blob/master/src/ashtech.cpp#L303.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so sorry, i have change as your suggest this time。

src/femtomes.cpp Outdated Show resolved Hide resolved
src/femtomes.cpp Outdated Show resolved Hide resolved
src/femtomes.cpp Outdated
}
}
#endif
if (writeAckedCommandFemto("LOG UAVGPSB 0.2\r\n", "<LOG OK",FEMO_RESPONSE_TIMEOUT) == 0){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that 5Hz? Can it go higher?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can go higher,there need 20HZ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you can use 20Hz.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this have changed 5HZ to 20HZ in the code

src/femtomes.h Outdated Show resolved Hide resolved
src/femtomes.h Outdated Show resolved Hide resolved
Copy link
Contributor Author

@Femtomes Femtomes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't sure how hz px4 need, our board can support max 20HZ.

src/femtomes.cpp Outdated
}
}
#endif
if (writeAckedCommandFemto("LOG UAVGPSB 0.2\r\n", "<LOG OK",FEMO_RESPONSE_TIMEOUT) == 0){
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can go higher,there need 20HZ?

src/femtomes.h Outdated
#define FEMTO_PREAMBLE3 0x12


class GPSDriverFemto : public GPSBaseStationSupport
Copy link
Contributor Author

@Femtomes Femtomes Mar 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, in this time, i change the class GPSDriverFemto : public GPSHelper,

src/femtomes.h Outdated
OutputMode _output_mode{ OutputMode::GPS };
bool _correction_output_activated{false};
bool _configure_done{false};
float _heading_offset;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, i have not understand about this .

@Femtomes
Copy link
Contributor Author

Femtomes commented Mar 22, 2020

Hi @Femtomes
Do you intend to create documentation for this too? Normally we create a page like https://docs.px4.io/master/en/gps_compass/rtk_gps_cuav_c-rtk.html that has information about where you get the hardware, how it is wired, and any additional special setup or settings.

Then we link that from the parent page: https://docs.px4.io/master/en/gps_compass/rtk_gps.html

Hi @hamishwillee
we have upload two files and one video
1、the infomation about MINIII receiver https://docs.google.com/document/d/1VY9kiZ6XywsXOzRUrLiPejGl56e_P-8Vc3FNKzujvtU/edit
2、the log of px4 flyer using femtomes MINIII receiver
https://drive.google.com/drive/folders/17gXECMaJs0338bfp7Os_uIEKbwSB2gjj/12_13_05.ulg
3、the flying video
https://youtu.be/ScPSYmMU2JI

thank you

@hamishwillee
Copy link

@Femtomes I have requested access to the first link, the second link is broken.

Do you want to try creating a page like the one above? The information on how is in http://dev.px4.io/master/en/contribute/docs.html#adding-new-pages-and-images---big-changes

It is easy enough - you copy the format of the one I linked to and then modify it to fill in your information.

@Femtomes
Copy link
Contributor Author

Femtomes commented Mar 23, 2020

@Femtomes I have requested access to the first link, the second link is broken.

Do you want to try creating a page like the one above? The information on how is in http://dev.px4.io/master/en/contribute/docs.html#adding-new-pages-and-images---big-changes

It is easy enough - you copy the format of the one I linked to and then modify it to fill in your information.

Hi @hamishwillee
sorry to i have not set the share baout doc and log
1、the doc link is
https://docs.google.com/document/d/1VY9kiZ6XywsXOzRUrLiPejGl56e_P-8Vc3FNKzujvtU/edit?usp=sharing
2、log link is
https://drive.google.com/open?id=1LZInS9BpUb3EyOGtNuPyZVqlq0NMHaH5

Hi @bkueng
1、doc link
https://docs.google.com/document/d/1VY9kiZ6XywsXOzRUrLiPejGl56e_P-8Vc3FNKzujvtU/edit?usp=sharing
2、 log link
https://drive.google.com/file/d/1LZInS9BpUb3EyOGtNuPyZVqlq0NMHaH5/view?usp=sharing

Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @Femtomes, looks much better already.

Can you provide me access to the logs?

src/femtomes.h Outdated
femto_msg_t _femto_msg;
FemtoDecodeState _decode_state{FemtoDecodeState::pream_ble1};

bool _got_pashr_pos_message{false}; /**< If we got a PASHR,POS message, we will ignore GGA messages */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_got_pashr_pos_message is still unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks,i have delete all not used variables and functions

src/femtomes.h Outdated
#define FEMTO_PREAMBLE3 0x12


class GPSDriverFemto : public GPSBaseStationSupport
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Femtomes did you see my comment here?

src/femtomes.cpp Outdated
baudrate = desired_baudrate;
const char baud_config[] = "com%c 115200\r\n"; // configure baudrate to 115200
char baud_config_str[sizeof(baud_config)];
int len = snprintf(baud_config_str, sizeof(baud_config_str), baud_config, _port);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_port is just a space (' '), so this can be simplified. Did you intend to make this configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, delete this already.

@LorenzMeier
Copy link
Member

@Femtomes Friendly ping: There are open review comments / questions.

@bys1123
Copy link

bys1123 commented Apr 9, 2020

@LorenzMeier Thanks, I‘m asking them the new progress.

@bys1123
Copy link

bys1123 commented Apr 10, 2020

Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the log, looks really good.
Do you have one with faster movements as well?

src/femtomes.cpp Outdated
uint8_t buf[GPS_READ_BUFFER_SIZE];
gps_abstime time_started = gps_absolute_time();
while (time_started + timeout * 1000 * 2 > gps_absolute_time()) {
int ret = read(buf, sizeof(buf), 1000); /**< wait 1000us */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a factor of * 2 above?
The timeout is in ms, and should be used from the argument:

Suggested change
int ret = read(buf, sizeof(buf), 1000); /**< wait 1000us */
int ret = read(buf, sizeof(buf), timeout);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks,this is my fault,not need * 2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkueng the log of faster movements need some time.

src/femtomes.h Outdated
class RTCMParsing;

/* ms, timeout for waiting for a response*/
#define FEMO_RESPONSE_TIMEOUT 200
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo (below as well):

Suggested change
#define FEMO_RESPONSE_TIMEOUT 200
#define FEMTO_RESPONSE_TIMEOUT 200

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks,fixed this

@bkueng
Copy link
Member

bkueng commented Apr 15, 2020

Rebased, fixed the style and gps message renaming (#53), and merged. Thanks for the efforts!

@bkueng the log of faster movements need some time.

@Femtomes no worries, just post it here when you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants