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

Swing integration #2085

Merged
merged 3 commits into from Jul 11, 2017
Merged

Swing integration #2085

merged 3 commits into from Jul 11, 2017

Conversation

gautierhattenberger
Copy link
Member

  • dedicated swing without mag
  • strip code before upload
  • read battery and baro from sysfs
  • read power button by hand and restart
  • needs to be plugged to enable telnet, can be disconnected after upload
  • factorize Parrot tools (based on Freek work)

At the moment, it is using a firmware provided by Parrot, we need to see if it works with the default official firmware.

- dedicated swing without mag
- strip code before upload
- read battery and baro from sysfs
- read power button by hand and restart
- needs to be plugged to enable telnet, can be disconnected after upload
Copy link
Member

@podhrmic podhrmic left a comment

Choose a reason for hiding this comment

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

Looks good, just minor issues with commented out code, see my comments.

# -----------------------------------------------------------------------

# default LED configuration
RADIO_CONTROL_LED ?= none
Copy link
Member

Choose a reason for hiding this comment

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

identation


pwm_delos_quadruplet m = {{ 1, 1, 1, 1 }};
int ret __attribute__((unused)) = ioctl(actuators_fd, PWM_DELOS_SET_SPEEDS, &m);
#if ACTUATORS_SWING_DEBUG
Copy link
Member

Choose a reason for hiding this comment

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

are the debug values still relevant? Assuming this code works as it should?

Copy link
Member Author

Choose a reason for hiding this comment

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

this might still be useful in the future for people doing advance control to check everything is correct here

#include <sys/ioctl.h>
#include <fcntl.h>

#define PWM_MAGIC 'p'
Copy link
Member

Choose a reason for hiding this comment

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

a more descriptive name would be useful

#include <linux/input.h>
#include "subsystems/electrical.h"

#if 0
Copy link
Member

Choose a reason for hiding this comment

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

remove if not used

}

// Wait 100ms
usleep(100000);
Copy link
Member

Choose a reason for hiding this comment

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

make configurable ?

static void *bat_read(void *data __attribute__((unused)))
{
FILE *fp;
char path[1035];
Copy link
Member

Choose a reason for hiding this comment

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

excessively large array?


/**
* Battery reading thread
* TODO something better ?
Copy link
Member

Choose a reason for hiding this comment

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

is this working satisfactory as is? If yes, remove TODO comment, if not it should be improved.

printf("Stopping Paparazzi from power button and rebooting\n");
usleep(1000);
int ret __attribute__((unused));
//ret = system("pstart delosd");
Copy link
Member

Choose a reason for hiding this comment

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

remove commented lines

* - /usr/bin/dragon-prog
*
*/
//stop_gracefull("delosd");
Copy link
Member

Choose a reason for hiding this comment

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

again, remove unused code

@podhrmic
Copy link
Member

podhrmic commented Jul 7, 2017

Also, I don't have a way to actually test it - so I am assuming you are taking care of that part:)

@gautierhattenberger gautierhattenberger merged commit c0836b4 into master Jul 11, 2017
@gautierhattenberger gautierhattenberger deleted the swing-integration branch July 11, 2017 14:20
@TitusBraber
Copy link
Contributor

Not entirely sure this is the right place @gautierhattenberger @podhrmic, I just pulled master and got a strange error upon uploading to an ARDrone2. Tracking back it seems something has changed here that causes the following error. It is possible that the error did not exist in the code for this pull request, but happened in 6d60a2c

I couldn't find a pull request for that commit. Note that I can 'upload', get this error, and start the gcs regardless. Thus I am not sure what is wrong exactly, it might just be an error in the output data.

The error:

#pragma message: Succesfully started "ap.elf" on Ardrone 2
======================== Ardrone 2 Status ========================
Parrot version: 2.4.8.0
Traceback (most recent call last):
File "/home/titus/test/paparazzi/sw/tools/parrot/ardrone2.py", line 345, in
ardrone2.parse_args()
File "/home/titus/test/paparazzi/sw/tools/parrot/parrot_utils.py", line 357, in parse_args
self.status()
File "/home/titus/test/paparazzi/sw/tools/parrot/parrot_utils.py", line 224, in status
self.uav_status()
File "/home/titus/test/paparazzi/sw/tools/parrot/ardrone2.py", line 59, in uav_status
self.read_from_config('static_ip_address_probe') + ' after boot)')
TypeError: cannot concatenate 'str' and 'NoneType' objects
/home/titus/test/paparazzi/conf/Makefile.ardrone2:32: recipe for target 'upload' failed
make[1]: *** [upload] Error 1
make[1]: Leaving directory '/home/titus/test/paparazzi/sw/airborne'
Makefile.ac:263: recipe for target 'ap.upload' failed
make: *** [ap.upload] Error 2
make: Leaving directory '/home/titus/test/paparazzi'

FAILED 'make -C /home/titus/test/paparazzi -f Makefile.ac AIRCRAFT=ARDrone2_opticflow ap.upload' with code 2

@gautierhattenberger
Copy link
Member Author

Can you test the branch fix_ardrone_tool in the paparazzi repository ? It should fix the problem.

@TitusBraber
Copy link
Contributor

Confirmed fix:

#pragma message: Succesfully started "ap.elf" on Ardrone 2
======================== Ardrone 2 Status ========================
Parrot version: 2.4.8.0
Host address: 192.168.1.1 (UnknownUnknown after boot)
Serial number: PS721800BJ4F039081
Network id: TUAR60
Motor software: 1.43 1.43 1.43 1.43
Motor hardware: 6.0 6.0 6.0 6.0
Currently running: Paparazzi (ap.elf)
Autorun at start: Not installed
Vision framework:

======================== Filesystem Status ========================
Filesystem Size Used Available Use% Mounted on
ubi1:system 26.3M 14.1M 10.9M 56% /
tmp 57.7M 640.0K 57.1M 1% /tmp
dev 57.7M 0 57.7M 0% /dev
ubi0:factory 4.8M 76.0K 4.5M 2% /factory
ubi2:update 13.2M 28.0K 12.5M 0% /update
ubi2:data 53.5M 5.9M 44.9M 12% /data
make[1]: Leaving directory '/home/titus/test/paparazzi/sw/airborne'
make: Leaving directory '/home/titus/test/paparazzi'

DONE 'make -C /home/titus/test/paparazzi -f Makefile.ac AIRCRAFT=ARDrone2_opticflow ap.upload'

@gautierhattenberger
Copy link
Member Author

fixed with 407bc0d

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

Successfully merging this pull request may close these issues.

None yet

3 participants