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

Added support for TFmini-LiDAR #8537

Closed
wants to merge 2 commits into from
Closed

Conversation

ayushgaud
Copy link
Contributor

To use TFmini set parameter SENS_EN_SF0X to 6

Copy link
Member

@TSC21 TSC21 left a 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.

@@ -75,6 +76,7 @@
#include <board_config.h>

#include "sf0x_parser.h"
#include "tfmini_parser.h"
Copy link
Member

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.

Copy link
Contributor Author

@ayushgaud ayushgaud left a 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

@ayushgaud ayushgaud force-pushed the master branch 2 times, most recently from 6e24c6a to fb5f8c1 Compare December 31, 2017 14:44
Copy link
Member

@TSC21 TSC21 left a 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
Copy link
Member

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.

Copy link
Contributor Author

@ayushgaud ayushgaud Dec 31, 2017

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

@@ -0,0 +1,44 @@
############################################################################
#
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

2017

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

MODULE drivers__tfmini
MAIN tfmini
COMPILE_FLAGS
-Wno-sign-compare # TODO: fix all sign-compare
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -0,0 +1,984 @@
/****************************************************************************
*
* Copyright (c) 2014-2015 PX4 Development Team. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

2017

Copy link
Contributor Author

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]>
Copy link
Member

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?

Copy link
Contributor Author

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

/* schedule a cycle to start things */
work_queue(HPWORK, &_work, (worker_t)&TFMINI::cycle_trampoline, this, 1);

// /* notify about state change */
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -0,0 +1,179 @@
/****************************************************************************
*
* Copyright (c) 2014 PX4 Development Team. All rights reserved.
Copy link
Member

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[] = {
Copy link
Member

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?

Copy link
Contributor Author

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.

@@ -0,0 +1,71 @@
/****************************************************************************
*
* Copyright (c) 2014 PX4 Development Team. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

2017

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

* @max 1
* @group Sensors
* @value 0 Disabled
* @value 1 TFmini
Copy link
Member

Choose a reason for hiding this comment

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

@value 1 Enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

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.

@TSC21
Copy link
Member

TSC21 commented Dec 31, 2017

Jenkins test this please.

@ayushgaud
Copy link
Contributor Author

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.

@TSC21
Copy link
Member

TSC21 commented Dec 31, 2017

Go to sitl_gazebo dir and issue git checkout d2f46b7

@TSC21
Copy link
Member

TSC21 commented Dec 31, 2017

I think I need to disable some drivers to fit it in flash region.

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 fmuv2. Though, I also ask you to please add it for the other boards build config too.

@TSC21 TSC21 closed this Dec 31, 2017
@TSC21 TSC21 reopened this Dec 31, 2017
@ayushgaud
Copy link
Contributor Author

Go to sitl_gazebo dir and issue git checkout d2f46b7

Already did that

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 fmuv2. Though, I also ask you to please add it for the other boards build config too

I'll update the suggested changes

@TSC21
Copy link
Member

TSC21 commented Dec 31, 2017

Your current commit tag for sitl_gazebo is f50c5dc, not d2f46b7.

@ayushgaud
Copy link
Contributor Author

ayushgaud commented Jan 1, 2018

Your current commit tag for sitl_gazebo is f50c5dc, not d2f46b7

Here it shows d2f46b7
screenshot

I also ask you to please add it for the other boards build config too

I have added tfmini to the config of only those boards which had sf0x driver because I was not sure
whether it will support other build configs too.

@LorenzMeier
Copy link
Member

@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.

@LorenzMeier
Copy link
Member

Rebased here: #8548

@LorenzMeier LorenzMeier closed this Jan 1, 2018
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.

4 participants