forked from Archive/PX4-Autopilot
cleanup: remove unused files
This commit is contained in:
parent
7822e5b5c3
commit
57a85fbc61
|
@ -1,80 +0,0 @@
|
|||
/* builtin command list - automatically generated, do not edit */
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <px4_tasks.h>
|
||||
#include <px4_posix.h>
|
||||
#include <px4_log.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern void px4_show_devices(void);
|
||||
|
||||
extern "C" {
|
||||
${builtin_apps_decl_string}
|
||||
static int list_tasks_main(int argc, char *argv[]);
|
||||
static int list_files_main(int argc, char *argv[]);
|
||||
static int list_devices_main(int argc, char *argv[]);
|
||||
static int list_topics_main(int argc, char *argv[]);
|
||||
static int sleep_main(int argc, char *argv[]);
|
||||
}
|
||||
|
||||
static map<string,px4_main_t> app_map(void)
|
||||
{
|
||||
static map<string,px4_main_t> apps;
|
||||
|
||||
${builtin_apps_string}
|
||||
apps["list_tasks"] = list_tasks_main;
|
||||
apps["list_files"] = list_files_main;
|
||||
apps["list_devices"] = list_devices_main;
|
||||
apps["list_topics"] = list_topics_main;
|
||||
apps["sleep"] = sleep_main;
|
||||
|
||||
return apps;
|
||||
}
|
||||
|
||||
map<string,px4_main_t> apps = app_map();
|
||||
|
||||
static void list_builtins(void)
|
||||
{
|
||||
printf("Builtin Commands:\n");
|
||||
for (map<string,px4_main_t>::iterator it=apps.begin(); it!=apps.end(); ++it)
|
||||
printf("\t%s", it->first.c_str());
|
||||
}
|
||||
|
||||
static int list_tasks_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_tasks();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int list_devices_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_devices();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int list_topics_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_topics();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int list_files_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_files();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sleep_main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2) {
|
||||
printf("Usage: sleep <seconds>\n");
|
||||
return 1;
|
||||
}
|
||||
sleep(atoi(argv[1]));
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
Running PX4 in SITL Mode
|
||||
==========================
|
||||
|
||||
Introduction
|
||||
--------------------------
|
||||
This assumes that you have PX4 (posix configuration) and jMAVSim installed and compiled. These can be on the same physical machine or on different machines as long as there is a network between the two. The system has many possible configurations - this README will focus just on one to keep things simple. Namely:
|
||||
|
||||
- The controller inputs are coming from a PIXHAWK that has an active connection to an RC controller and is generating the [Mavlink](https://pixhawk.ethz.ch/mavlink/) message RC_CHANNELS(#65) on its serial (USB) port. This Pixhawk's USB is connected to a USB port on the machine running PX4.
|
||||
- PX4 and jMAVSim communicate over UDP
|
||||
- qGroundControl is connecting to PX4 over UDP
|
||||
|
||||
A diagram of the setup described is shown here. Note that UDP port numbers are only displayed on the socket server and are left blank on the socket client.
|
||||
|
||||
![SITL Diagram](SITL_Diagram.png "SITL Diagram")
|
||||
|
||||
Steps
|
||||
---------------------------
|
||||
|
||||
1. Connect the RC Controller (PIXHAWK) to the PX4 machine using USB. Verify the `/dev/ttyACM0` device appears. Make sure that the persmissions of this device allow the PX4 app to open the device for read/write (`sudo chmod 777 /dev/ttyACM0`).
|
||||
|
||||
1. Run the quadrotor simulation:
|
||||
```
|
||||
> make sitlrun
|
||||
```
|
||||
|
||||
Detailed Background on System startup
|
||||
---------------------------
|
||||
|
||||
NOTE: This is only necessary if you are not using the instructions above.
|
||||
|
||||
1. Connect the RC Controller (PIXHAWK) to the PX4 machine using USB. Verify the `/dev/ttyACM0` device appears. Make sure that the persmissions of this device allow the PX4 app to open the device for read/write (`sudo chmod 777 /dev/ttyACM0`).
|
||||
|
||||
1. Create the following diretories in "`./Firmware/Build/posix_sitl.build/`":
|
||||
```
|
||||
> cd ./Firmware/Build/posix_sitl.build
|
||||
> mkdir -p rootfs/fs/microsd
|
||||
> mkdir -p rootfs/eeprom
|
||||
```
|
||||
|
||||
1. Launch PX4 from the SITL build directory "`./Firmware/Build/posix_sitl.build/`" using the command below. The optional `<startup_file>` can be used to cause a set of commands to be entered into the PX4 shell at startup.
|
||||
```
|
||||
> ./px4 <startup_file>
|
||||
```
|
||||
|
||||
There is a sample startup script at `posix_configs/SITL/init/rcS`.
|
||||
```
|
||||
> ./px4 ../../posix-configs/SITL/init/rcS
|
||||
```
|
||||
|
||||
Without the `<startup_file>`, the commands can be entered at the shell prompt one at a time. An example startup file is given below. This example shows that the "mavlink" module has selected port 14556 for its socket server (as shown in the SITL diagram) and will listen for connections on this port.
|
||||
|
||||
1. qGroundControl (QGC) can be connected to this instance of PX4 any time after it is started. The instructions for configuring (QGC) are not given here in detail, but you just need to configure a UDP connection with ip_address:`<address of PX4 machine>` and port:14556. (QGC also has a "Listening Port" setting that must be set to another unused port).
|
||||
|
||||
1. jMAVSim can now be launched to complete the setup. At the root directory of the jMAVSim code, type the following command, replacing the IP address of the machine that is running PX4. The port 14550 is the default port of the simulator module in PX4.
|
||||
```
|
||||
> java -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator -udp <IP_of_PX4_machine>:14550
|
||||
```
|
||||
|
||||
At this point, you should see the jMAVSim world visualization, and when you increase the throttle on your RC controller, the vehicle will take off. Note that the RC params in the example startup file may not be correct for your controller.
|
||||
|
||||
Example "startup" file
|
||||
---------------------
|
||||
|
||||
```
|
||||
uorb start
|
||||
mavlink start -x -u 14556
|
||||
simulator start -s
|
||||
param set CAL_GYRO0_ID 2293760
|
||||
param set CAL_ACC0_ID 1310720
|
||||
param set CAL_ACC1_ID 1376256
|
||||
param set CAL_MAG0_ID 196608
|
||||
rgbled start
|
||||
tone_alarm start
|
||||
gyrosim start
|
||||
accelsim start
|
||||
barosim start
|
||||
commander start
|
||||
sensors start
|
||||
ekf_att_pos_estimator start
|
||||
mc_pos_control start
|
||||
mc_att_control start
|
||||
hil mode_pwm
|
||||
param set MAV_TYPE 2
|
||||
param set RC1_MAX 2015
|
||||
param set RC1_MIN 996
|
||||
param set RC1_TRIM 1502
|
||||
param set RC1_REV -1
|
||||
param set RC2_MAX 2016
|
||||
param set RC2_MIN 995
|
||||
param set RC2_TRIM 1500
|
||||
param set RC3_MAX 2003
|
||||
param set RC3_MIN 992
|
||||
param set RC3_TRIM 992
|
||||
param set RC4_MAX 2011
|
||||
param set RC4_MIN 997
|
||||
param set RC4_TRIM 1504
|
||||
param set RC4_REV -1
|
||||
param set RC6_MAX 2016
|
||||
param set RC6_MIN 992
|
||||
param set RC6_TRIM 1504
|
||||
param set RC_CHAN_CNT 8
|
||||
param set RC_MAP_MODE_SW 5
|
||||
param set RC_MAP_POSCTL_SW 7
|
||||
param set RC_MAP_RETURN_SW 8
|
||||
param set MC_PITCHRATE_P 0.05
|
||||
param set MC_ROLLRATE_P 0.05
|
||||
mixer load /dev/pwm_output0 ROMFS/px4fmu_common/mixers/quad_x.main.mix
|
||||
```
|
Binary file not shown.
Before Width: | Height: | Size: 79 KiB |
|
@ -1,14 +0,0 @@
|
|||
#include <px4_log.h>
|
||||
|
||||
|
||||
__EXPORT void px4_log_modulename(int level, const char *moduleName, const char *fmt, ...)
|
||||
{
|
||||
// Don't log Debug
|
||||
if (level >= 1) {
|
||||
va_list argptr;
|
||||
va_start(argptr, fmt);
|
||||
vprintf(fmt, argptr);
|
||||
va_end(argptr);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue