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

module to use radio channel as remote camera trigger #937

Closed
wants to merge 4 commits into from

Conversation

agressiva
Copy link
Contributor

new file:   conf/modules/digital_cam_shoot_rc.xml
new file:   sw/airborne/modules/digital_cam/dc_shoot_rc.c
new file:   sw/airborne/modules/digital_cam/dc_shoot_rc.h

	new file:   conf/modules/digital_cam_shoot_rc.xml
	new file:   sw/airborne/modules/digital_cam/dc_shoot_rc.c
	new file:   sw/airborne/modules/digital_cam/dc_shoot_rc.h
PRINT_CONFIG_MSG("Using RADIO SHOOT");
#endif

void dc_shoot_rc_init(void)
Copy link
Member

Choose a reason for hiding this comment

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

no need to add an init function if it is empty...

@flixr
Copy link
Member

flixr commented Nov 11, 2014

Please adhere to coding style..
There is also the fix_code_style.sh script, you can run it on new files:
./fix_code_style.sh sw/airborne/modules/digital_cam/dc_shoot_rc.c sw/airborne/modules/digital_cam/dc_shoot_rc.h

#include "inter_mcu.h"
#include "dc.h"

#ifdef DC_RADIO_SHOOT
Copy link
Member

Choose a reason for hiding this comment

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

not really needed, as it will fail to compile anyway if DC_RADIO_SHOOT is not defined.
Would make more sense to print a useful error message if it is not defined.

@flixr
Copy link
Member

flixr commented Nov 11, 2014

@gautierhattenberger as this depends on one of the digital_cam modules, can we add that as a depend`

	modified:   conf/modules/digital_cam_shoot_rc.xml
	modified:   sw/airborne/modules/digital_cam/dc_shoot_rc.c
	modified:   sw/airborne/modules/digital_cam/dc_shoot_rc.h
@agressiva
Copy link
Contributor Author

feliz, codestyle ok and created the message if DC_RADIO_SHOOT not defined
how i configure the depend ?

@agressiva
Copy link
Contributor Author

ok, dependency with digital_cam created.

@flixr
Copy link
Member

flixr commented Nov 11, 2014

Regarding the dependency, I'm not entirely sure if it works with <depend require="digital_cam"/> in this case. Did you test that?

The dependency has to be satisfied by any of the digital_cam modules, so digital_cam.xml, digital_cam_uart.xml, digital_cam_servo.xml or digital_cam_i2c.xml.
@gautierhattenberger should know how to best achived that... I guess we need to make sure that each of them has the name digital_cam...

@agressiva
Copy link
Contributor Author

not tested.

@agressiva
Copy link
Contributor Author

well, i tried to compile using dc_shot_rc but i removed the digital_cam module.
i get tons of errors but no one message about dependency .

As o not know how the dependency work i cant tell anything !

static uint8_t rd_shoot = 0;
static uint8_t rd_num = 0;

if ((rd_shoot == 0) && (((float)(*fbw_state).channels[DC_RADIO_SHOOT]) > 3000)) {
Copy link
Member

Choose a reason for hiding this comment

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

why cast to float?

@flixr
Copy link
Member

flixr commented Nov 11, 2014

Regarding the dependency, you should have seen a warning at the beginning:
WARNING: Dependency not satisfied: module digital_cam_shoot_rc requires digital_cam

@agressiva
Copy link
Contributor Author

Removed cast to float and changed the way i use the pointer to more clean way.

You are right about dependency. I take more attention and the message come in the very first lines

@flixr flixr closed this in 6246b91 Nov 12, 2014
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.

None yet

2 participants