Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 22 12:40
    khancyr commented #373
  • Jan 22 12:39
    khancyr synchronize #373
  • Jan 22 12:34
    peterbarker commented #373
  • Jan 22 10:21
    khancyr commented #373
  • Jan 22 10:18
    khancyr synchronize #373
  • Jan 21 13:25
    khancyr synchronize #373
  • Jan 21 11:24
    khancyr unlabeled #373
  • Jan 21 11:23
    khancyr synchronize #373
  • Jan 17 06:01

    tridge on master

    prepare for 2.4.4 release (compare)

  • Jan 17 03:19

    tridge on master

    mavutil: fixed ArduPilot plane … (compare)

  • Jan 13 04:33
    Marviel commented #341
  • Jan 13 04:33
    Marviel commented #341
  • Jan 09 13:30
    tscao edited #378
  • Jan 09 13:28
    tscao edited #378
  • Jan 08 10:44
    andyp1per commented #379
  • Jan 08 10:38
    tscao opened #379
  • Jan 08 10:34
    tscao opened #378
  • Jan 08 08:28

    peterbarker on master

    DFReader: add notes about swipi… mavgen_python: use to_string to… (compare)

  • Jan 08 08:28
    peterbarker closed #375
  • Jan 07 08:45
    auturgy opened #377
Peter Kloke
@DrOwlington

Hey y'all,
I am working on a solution to use multiple Pixhawks with one RTK base. Hardware wise everything is working as it should and a direct connection works perfectly.
I havn't found a propper solution to this yet,I can't use the in the method that is recommended in the Herev2 user manual because I connect every Pixhawk via network (over mavproxy, running on Raspberry Pis). And as far as I see I can't use mavproxy to split the mavlink stream, cause only the first vehicle will receive the RTK data.
Until now I split the serial stream of the RTK into several, connectiong to multiple Mission Planners. This works, but is really inefficiant and is annoying to start up.
So I started working on my own script to just forward the mavlink msgs send to the first vehilce to every other connected.
I was hoping that I could avoid hardcoding number of open connections, opening a port every time a connection would be established.
So I append a list with new mavlink objects.
My problem now:
If I try to send something to any of the vehicles in the lists it will not reach it.
s[0].mav.send(mp_msg)
But receiving is no problem.
p_msg = s[0].recv_msg()
Running this without using the list (just using a variable) is no problem, neither.

I am probably missing something crucial (my Python skills arent the best), but I don't see what/how to fix this. Or is there generally a better sollution for this problem, that I just missed?

Here is my test code

from pymavlink import mavutil
import time

if __name__ == "__main__":
    mp = mavutil.mavlink_connection("0.0.0.0:14551")
    s = []
    s.append(mavutil.mavlink_connection("COM6")) # For debugging I actually do use a serial connection :)
    add = lambda a : s.append(mavutil.mavlink_connection("127.0.0.1:1455"+str(a))) # Gonna use this later for automatically opening new ports
    #add(2)
    print s
    while True:
        mp_msg = mp.recv_msg()
        if mp_msg:
            if mp_msg.get_type() == "BAD_DATA":
                print "MP  bad_data"
            else:
                for i in s:
                    i.mav.send(mp_msg)
        p_msg = s[0].recv_msg()
        if p_msg:
            if p_msg.get_type() == "BAD_DATA":
                print "P bad_data"
            else:
                mp.mav.send(p_msg)

Hope someone can help me with this :)

Joey Mansfield
@phatboysh
@OXINARF I am in guided mode. Thanks for the link - it inspired a lot of confidence that I can get done what I need to get done. Problem for me at the moment is it appears like dronekit doesn't support the final two arguments dealing with yaw. My next thoughts - can I just send the mavlink messages myself through SET_POSITION_TARGET_LOCAL_NED? I'm unsure how I'd handle the connection in that case
self.conn.mav.set_position_target_local_ned_send(
            0,  # system time in milliseconds
            self.conn.target_system,  # target system
            self.conn.target_component,  # target component
            mavutil.mavlink.MAV_FRAME_LOCAL_NED,  # frame
            0b010111111000,  # mask
            0, 0, 0,  # position x,y,z
            0, 0, 0,  # velocity x,y,z
            0, 0, 0,  # accel x,y,z
            0, 15)  # yaw, yaw rate
using something like that without abandoning dronekit - im not sure if possible or even reasonable
Francisco Ferreira
@OXINARF
@DrOwlington I can't see anything wrong; however, you should definitely check that mavlink_connection doesn't return None before adding to s (or before calling methods on it). I also don't see how a list would make any difference vs no list. In any case, there are MAVLink routers out there, examples: https://github.com/intel/mavlink-router, https://github.com/aler9/mavp2p and https://github.com/MonashUAS/cmavnode (AFAIK this one isn' currently maintained)
@phatboysh I'm not very knowledgeable of Dronekit, but I think that's reasonable.
Notorious7
@NoToRiOuS0007_twitter
I am using APM v2.6 and arducopter firmware
3.2.1
When i am reading data from apm using pymavlink then i am getting all data in BAD_DATA mavpackettype category
Why so?
My stream data rate is 10Hz
I have to use request_data_stream_send command inside while true loop to get data from apm within their proper mavpackettype category
Notorious7
@NoToRiOuS0007_twitter
I compared with pixhawk and I'm able to read all datat in their respective mavpackettype category without using request_data_stream_send command within while true loop
What's the such difference between arducopter 3.2.1 and 3.4.6 versions
Francisco Ferreira
@OXINARF
@NoToRiOuS0007_twitter We don't support APM boards anymore. 3.2.1 is a very old version and I'm sorry to say that you are unlikely to get help for it here
Notorious7
@NoToRiOuS0007_twitter
@OXINARF gotcha, i found the solution though, in pixhawk we don't need to use heartbeat command before reading data stream but in apm it's necessary to use heartbeat command before starting the command for reading data stream, it's now starting like i am starting pixhawk, just needed to add 1 heartbeat command in apm
Notorious7
@NoToRiOuS0007_twitter
Does anyone have idea why pymavlink MAV_CMD_NAV commands not working in arducopter firmware v3.2.1 running in apm v2.8? I am only able to switch modes and land the copter but it doesn't listening to takeoff and other navigation commands, why so?
Peter Kloke
@DrOwlington
@OXINARF Found my problem: I forgot to set the source_system to 0 for the Mission Planner connection. So Mission Planner commands would always adress 255, which the vehicle ofc didnt respond to.
I want to dynamically add connections later (not in the code, yet) and I don't really see how to do this with assigning the object to a variable... But maybe there is better ways of doing that 🤔
Anyway, thank you very much for the recommendations, will definitely check them out aswell!
Notorious7
@NoToRiOuS0007_twitter
I am running arducopter v3.2.1 on apm v2.8, my copter is working well when using dronekit commands but when i am replacing dronekit commands with pymavlink commands then some pymavlink commands are not working, i am not able to find the issue here, anyone can help
Nik Langrind
@langrind
@tridge @OXINARF and @peterbarker - pinging you on these PRs: ArduPilot/pymavlink#367 and ArduPilot/pymavlink#366 .
Stephen Dade
@stephendade
FYI, I've updated the JavaScript generator to now support MAVLink 2.0
Pierre Kancir
@khancyr
nice !
Vladimir Ermakov
@vooon
Hello @all
@tridge @OXINARF and @peterbarker - pinging you about PR ArduPilot/pymavlink#369
I think it's good to merge
Vladimir Ermakov
@vooon
@tridge Thanks!
Andrew Tridgell
@tridge
@vooon thanks for your work on this!
Mark Whitehorn
@kd0aij
I ran magfit_WMM on a log from a manual RC pattern flight with a "blackbox" logger onboard: https://docs.google.com/document/d/15ShwQWVgBmsnT7hUPaygBR8QH8QWbOY7n9WuZrckkyg/edit?usp=sharing
Vladimir Ermakov
@vooon
@tridge please also merge ArduPilot/pymavlink#370
Andrew Tridgell
@tridge
@kd0aij note that you may need --elliptical if you have significant soft-iron effects
Mark Whitehorn
@kd0aij
I thought the results looked like a significant improvement. The airframe is wood and fiberglass so I expect soft-iron effects to be negligible.
guglie
@guglie
Hi, is there a builtin way to get the message_id from the message name?
E.g. mapping "HEARTBEAT" to MAVLINK_MSG_ID_HEARTBEAT = 0
guglie
@guglie
@tridge @peterbarker do you know how to do the above?
Andrew Tridgell
@tridge
@guglie the only way to do it that I can think of is to use eval() with MAVLINK_MSG_ID_ + "HEARTBEAT"
I know that isn't very neat
hmm, actually, you should be able to do it by a lookup on the pymavlink namespace
again using the MAVLINK_MSG_ID_ string
Andrew Tridgell
@tridge
@guglie this script shows how: http://uav.tridgell.net/tmp/mav_name.py
guglie
@guglie
@tridge thanks, I'll try this way!
Atharva Atre
@sparklytopaz
So I have a Raspberry Pi connected to pixhawk and I want to write a python script in Raspi which can start or stop a drone from arming. I was wondering if the community can help me out with some articles or any documentation for the same. Here are the specifications
Raspberry Pi 3 model B
It has APSYNC installed on it
https://ardupilot.org/dev/docs/apsync-intro.html
I can SSH into the Raspi with putty
Raspi communicates with pixhawk by rx tx pins
Pierre Kancir
@khancyr
Hello, I advice you to look on ArduPilot autotest how we do it ! You will find the right sequence and check to do. That is in Tools/autotest, in common.py and ArduCopter.py for example
Atharva Atre
@sparklytopaz
@khancyr Thank you so much ..I will check it out
Juan de Dios Yáñez
@juandediosyanez
Is there a parameter for quadplane within ardupilot that allows to distinguish when its behavior is copter type and when it is plane type?
Berke Yavas
@berkeyvx_twitter

Traceback (most recent call last):
File "src/connect_drone.py", line 94, in <module>
set_servo(1999.5)
File "src/connect_drone.py", line 70, in set_servo
0, 0, 0, 0, 0)
File "/Users/berkeyvx/Desktop/Developer/Python/dronekit/venv/lib/python2.7/site-packages/pymavlink/dialects/v10/ardupilotmega.py", line 15559, in command_long_send
return self.send(self.command_long_encode(target_system, target_component, command, confirmation, param1, param2, param3, param4, param5, param6, param7), force_mavlink1=force_mavlink1)
File "/Users/berkeyvx/Desktop/Developer/Python/dronekit/venv/lib/python2.7/site-packages/dronekit/mavlink.py", line 146, in newsendfn
return sendfn(mavmsg, args, *kwargs)
File "/Users/berkeyvx/Desktop/Developer/Python/dronekit/venv/lib/python2.7/site-packages/pymavlink/dialects/v10/ardupilotmega.py", line 11857, in send
buf = mavmsg.pack(self, force_mavlink1=force_mavlink1)
File "/Users/berkeyvx/Desktop/Developer/Python/dronekit/venv/lib/python2.7/site-packages/pymavlink/dialects/v10/ardupilotmega.py", line 8585, in pack
return MAVLink_message.pack(self, mav, 152, struct.pack('<fffffffHBBB', self.param1, self.param2, self.param3, self.param4, self.param5, self.param6, self.param7, self.command, self.target_system, self.target_component, self.confirmation), force_mavlink1=force_mavlink1)
struct.error: required argument is not a float
getting this error

cause of this lines

def set_servo(PWM):
msg = vehicle.message_factory.command_long_send(
0, 0,
mavutil.mavlink.MAV_CMD_DO_SET_SERVO, 0,
'5', PWM,
0, 0, 0, 0, 0)
vehicle.send_mavlink(msg)
print vehicle.channels.get('5')

What is wrong

Buzz
@davidbuzz
'required argument is not a float' says to me that one of the it's trying to interpret one of your the parameters being passed into 'command_long_send' as a float, and it's not. maybe you should make the PWM value not a float ...you are passing in a PWM value that is 1999.5, and maybe that should be either just 1999 or int(1999.5).
Berke Yavas
@berkeyvx_twitter
i tried that way alsı dont think its the problem but thank you i will try it now
Berke Yavas
@berkeyvx_twitter
I solved, instead of sending command_long_send i used command_long_encode
Berke Yavas
@berkeyvx_twitter

def set_servo(port, PWM, duration):
"""
port -> port where the servo is attached
PWM -> servo ms value, from 1000 - 2000
"""
msg = vehicle.message_factory.command_long_encode(
0, 0,
mavutil.mavlink.MAV_CMD_DO_SET_SERVO, 0,
port, PWM,
0, 0, 0, 0, 0)

while this code had no error, still no changes on channel[port]. Function doesnt work. What is wrong

ignore the duration parameter it has nothing to do with this
Berke Yavas
@berkeyvx_twitter
Drone is in GUIDED mode, should i switch it to AUTO?
RhinoAus
@RhinoAus
Is it possible to create a mission item that is sent to a subcomponent? IE have a mission item that asks a payload component to toggle a relay instead of the autopilot toggling its own relay?