-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Added support for TFmini-LiDAR #8537
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This driver is not for a LightWare device, so should be set on a separate driver file. Also, you are also updating the sitl_gazebo
module - just undo that until we get it to a stable state.
src/drivers/sf0x/sf0x.cpp
Outdated
@@ -75,6 +76,7 @@ | |||
#include <board_config.h> | |||
|
|||
#include "sf0x_parser.h" | |||
#include "tfmini_parser.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you including this on the sf0x
driver? From what I know this is not a LightWare driver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added TFmini support as a separate driver
6e24c6a
to
fb5f8c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost good. Just some remarks here and there. Can you show us the output of the test
command, please? Also, please undo the update on the sitl_gazebo
submodule - put it at the same tag as Firmware master.
@@ -47,8 +47,8 @@ set(config_module_list | |||
drivers/px4io | |||
drivers/rgbled | |||
drivers/sdp3x_airspeed | |||
drivers/sf0x | |||
drivers/sf1xx | |||
#drivers/sf0x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please uncomment the sf
drivers, as they are more widely supported and used by the community.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Output of tfmini test
WARN [tfmini] single read
WARN [tfmini] measurement: 2.07 m
WARN [tfmini] time: 114917001
WARN [tfmini] read #0
WARN [tfmini] valid 1
WARN [tfmini] measurement: 2.070 m
WARN [tfmini] time: 114928002
WARN [tfmini] read #1
WARN [tfmini] valid 1
WARN [tfmini] measurement: 2.070 m
WARN [tfmini] time: 114939004
WARN [tfmini] read #2
WARN [tfmini] valid 1
WARN [tfmini] measurement: 2.070 m
WARN [tfmini] time: 115441435
WARN [tfmini] read #3
WARN [tfmini] valid 1
WARN [tfmini] measurement: 2.070 m
WARN [tfmini] time: 115943013
WARN [tfmini] read #4
WARN [tfmini] valid 1
WARN [tfmini] measurement: 2.070 m
WARN [tfmini] time: 116445392
ERROR [tfmini] PASS
src/drivers/tfmini/CMakeLists.txt
Outdated
@@ -0,0 +1,44 @@ | |||
############################################################################ | |||
# | |||
# Copyright (c) 2015 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/drivers/tfmini/CMakeLists.txt
Outdated
MODULE drivers__tfmini | ||
MAIN tfmini | ||
COMPILE_FLAGS | ||
-Wno-sign-compare # TODO: fix all sign-compare |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for that comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/drivers/tfmini/tfmini.cpp
Outdated
@@ -0,0 +1,984 @@ | |||
/**************************************************************************** | |||
* | |||
* Copyright (c) 2014-2015 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
* @file tfmini.cpp | ||
* @author Lorenz Meier <[email protected]> | ||
* @author Greg Hulands | ||
* @author Ayush Gaud <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for not adding just you as the author?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because I have reused most the code from the sf0x driver
src/drivers/tfmini/tfmini.cpp
Outdated
/* schedule a cycle to start things */ | ||
work_queue(HPWORK, &_work, (worker_t)&TFMINI::cycle_trampoline, this, 1); | ||
|
||
// /* notify about state change */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why this is commented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/drivers/tfmini/tfmini_parser.cpp
Outdated
@@ -0,0 +1,179 @@ | |||
/**************************************************************************** | |||
* | |||
* Copyright (c) 2014 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
#ifdef TFMINI_DEBUG | ||
#include <stdio.h> | ||
|
||
const char *parser_state[] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do these states actually work also with the TFMini?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have tested it with debug flag on.
src/drivers/tfmini/tfmini_parser.h
Outdated
@@ -0,0 +1,71 @@ | |||
/**************************************************************************** | |||
* | |||
* Copyright (c) 2014 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/modules/sensors/sensor_params.c
Outdated
* @max 1 | ||
* @group Sensors | ||
* @value 0 Disabled | ||
* @value 1 TFmini |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@value 1 Enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use @boolean here. See SENS_EN_MB12XX for an example.
Jenkins test this please. |
I think I need to disable some drivers to fit it in flash region. Also, I am unable to figure out the problem with sitl_gazebo please give me suggestions to resolve this. |
Go to |
You added the support to the driver, which is good. Now anyone that wants to use it just needs to enable it. So I suggest you comment it for |
Already did that
I'll update the suggested changes |
Your current commit tag for |
Here it shows d2f46b7
I have added tfmini to the config of only those boards which had sf0x driver because I was not sure |
@ayushgaud The point is that the PR should not include changes to the sitl_gazebo submodule at all and you were not successful yet at resetting them to master. We can do that for you though. |
Rebased here: #8548 |
To use TFmini set parameter SENS_EN_SF0X to 6