Cannot launch or install custom apps to run on flytSim


#1

(before anything i have to say i’m new to linux but i followed the docs very closely so i don’t believe i made mistakes from what was said)

Hello,

I downloaded Flytsim following the instructions on the website. I am able to run both demoapps.

But when i try what is said on docs to launch my own .py files by simply starting flytsim then launching my app through the console, the simulated drone doesn’t move an inch, even though my program is running on the console (i can see the prints).

Same goes for installing my app in the folder, doing chmod then cp doesnt copy my file to the install folder…

I’ve been trying to do this for so long i hope it’s some dumb thing i forgot!

Thanks for your help!*

my file is located under home/pythonpractice,

to launch it i used this command (didnt simulate it , only console output):
./pythonpractice/app1.py

to copy it in " install " folder i ran this command (didn’t do anything or i don’t see it):
$ sudo cp ~/pythonpractice/app1.py /flyt/userapps/onboard_user/install/app1.py

Also i thought "$ sudo chmod +x <my_first_python_app>.py"
would create an executable file of my code as both demoapps have executables, but it didn’t do anything which i could see either


#2

Hi @Robin_Mariaccia,

Did you setup FlytSim-Docker or FlytSim-native?
Can you please send screenshot of our screen when you run your script?

Are you running the python demoapps or cpp demoapps?

I would request you to switch to superuser by running the following command:

sudo -s

and then run your python script.


#3

Hello and thanks for your quick answer!

I set up FlytSim-Native on my Ubuntu OS.
When i run the python demoapps (.py) it only runs in console (you can see the prints working) as shown below (the drone on flytsim doesnt move),

but when i launch the .exe :
$ /flyt/flytapps/onboard/install/demoapp1 it works. I believe the .exe comes from the cpp file and i’m planning to code in Python so i would like to be able to run the .py file

Thanks, I am now superuser but nothing has changed.

Here is the console when i try to execute it:

$ python /flyt/flytapps/onboard/install/demoapp1.py
WARNING:root:ZMQ : Protobuf message implementation not found. Using pickle based protocol
[pyros_ros] Node started as [4118 <= ipc:///tmp/zmp-pyros_ros-TPRZNy/services.pipe]
<pyzmp.service.Service object at 0x7f9712cb1ad0> MSGBUILDSVC
[INFO] [1517246628.351449, 0.000000]: RosInterface pyros_ros node started with args : []
[INFO] [1517246628.356773, 0.000000]: [pyros.rosinterface.ros_interface] ROS Interface initialized with:
- services :
- /get_global_namespace

  • /.*/navigation/arm
  • /.*/navigation/disarm
  • /.*/navigation/land
  • /.*/navigation/take_off
  • /.*/navigation/position_hold
  • /.*/navigation/position_set
  • /.*/navigation/position_set_global
  • /.*/navigation/velocity_set
  • /.*/navigation/exec_script
  • /.*/navigation/waypoint_get
  • /.*/navigation/waypoint_set
  • /.*/navigation/waypoint_execute
  • /.*/navigation/waypoint_clear
  • /.*/navigation/waypoint_pause
  • /.*/navigation/waypoint_set_current
  • /.*/navigation/set_home
  • /.*/navigation/rtl
  • /.*/payload/gimbal_set
  • /.*/param/param_set
  • /.*/param/param_get_all
  • /.*/param/param_get
  • /.*/param/param_save
  • /.*/param/param_load
  • /.*/param/param_create
  • /.*/param/param_delete
  • /./param/param_reset
    - topics :
    - /.
    /mavros/state
  • /.*/mavros/imu/data
  • /.*/mavros/imu/data_euler
  • /.*/mavros/local_position/local
  • /.*/mavros/global_position/global
  • /.*/mavros/battery
  • /.*/mavros/vfr_hud
  • /.*/mavros/rc/in
  • /.*/mavros/distance_sensor/lidarlite_pub
  • /.*/flyt/state
  • /.*/mavros/payload_adc
    - params : []
    - enable_cache : False
    -
    [INFO] [1517246629.523660, 1167.092000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/mavros/local_position/local TwistStamped
    [INFO] [1517246630.531984, 1168.096000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/mavros/payload_adc PayloadADC
    [INFO] [1517246631.544884, 1169.106000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/mavros/global_position/global NavSatFix
    taking off
    [INFO] [1517246632.551893, 1170.116000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/mavros/distance_sensor/lidarlite_pub Range
    [INFO] [1517246633.559178, 1171.124000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/flyt/state State
    [INFO] [1517246634.567588, 1172.132000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/mavros/imu/data_euler TwistStamped
    [INFO] [1517246635.609499, 1173.172000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/mavros/vfr_hud VFR_HUD
    [INFO] [1517246636.617751, 1174.180000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/mavros/state State
    [INFO] [1517246637.626323, 1175.188000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/mavros/battery BatteryState
    [INFO] [1517246638.634979, 1176.194000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/mavros/imu/data Imu
    [INFO] [1517246639.643173, 1177.202000]: /pyros_ros Pyros.rosinterface : Creating rosinterface topic /flytsim/mavros/rc/in RCIn
    going along the setpoints
    Landing
    Shutdown initiated

#4

Hi @Robin_Mariaccia,

I would request you to use FlytSim-Docker.
With FlytSim-native, there have been ‘some’ cases where python scripts do not work because of dependency issues.

Thanks.