Unable to set mode to 'AUTO' using MAVlink

Hi group,

I have recently started using MAVProxy. It is great, allowing control from multiple GCS along with a command-line interface. I am currently trying to set the 'mode' programatically. Browsed a bit and found pymavlink, so started about making a few changes - I am able to read messages sent by MAVProxy, but am unable to set the mode to 'AUTO'. This is what I have done so far:

  1. Generated a mavlink.py using message_definitions/v1.0/ardupilotmega.xml (using the mavlink code base). 
  2. Opened a UDP socket that listens on a port known to MAVProxy (specified the address using --out option of MAVProxy).
  3. Created a 'MAVLink' object using the UDP socket (step 2).
  4. Wait for any message from MAVProxy to obtain the address of the remote end. Related code snippet:

    data_from_mavproxy,address_of_mavproxy = mavproxy_sock.recvfrom (1024)
    decoded_message = mav_obj.decode(data_from_mavproxy)
    msg_id = decoded_message.get_msgId()

  5. Once I obtain the address, I am trying to set the mode using the following snippet:

           msg = mav_obj.set_mode_encode(1, 92, 0)
           mavproxy_sock.sendto(msg.get_msgbuf(),(address_of_mavproxy))

I made sure that the message is actually sent (using tcpdump), however there is no mode change.

Can you please suggest what I may be doing wrong/missing? 

Thanks,

Kasyap

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

This reply was deleted.

Activity

Chris Anderson liked Zara Mae Pickering's profile
May 21
DIY Robocars via Twitter
RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Nov 27, 2022
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24, 2022
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24, 2022
DIY Robocars via Twitter
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24, 2022
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24, 2022
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20, 2022
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8, 2022
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23, 2022
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23, 2022
DIY Robocars via Twitter
Oct 23, 2022
DIY Robocars via Twitter
Oct 19, 2022
DIY Robocars via Twitter
Oct 18, 2022
DIY Robocars via Twitter
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
Oct 13, 2022
More…