Please select Into the mobile phone version | Continue to access the computer ver.
Any luck with Custom UI programming?
4975 10 2020-3-11
Uploading and Loding Picture ...(0/1)
o(^-^)o
gpvillamil
lvl.4
Flight distance : 210226 ft
United States
Offline

I read this in the SDK documentation, and it sounds super promising:

"We can write a Python program in the RoboMaster app and call the relevant interface of the custom UI system to generate UI controls and bind control event callbacks. After the program is written and debugged in the laboratory, the program can be assembled into custom skills and released in stand-alone driving or multiplayer competition."

It looks like the API calls are there, but I'm not having a lot of luck making them work. According to the release notes for the latest version of the app, it should be supported for the Robomaster S1.

Has anyone come across examples, or given it a try?
2020-3-11
Use props
BGA
lvl.4
Brazil
Offline

I am pretty sure this is tied o the SDK stuff which is not enabled in the S1 yet so I would not expect it to work.
2020-3-13
Use props
rhoude57 - YUL
lvl.4
Canada
Offline

Another DJI flop??? This is truly becoming frustrating...Note that Forum Moderators have not yet responded to this thread...

2020-3-13
Use props
Shawn.So
lvl.1
Flight distance : 149206 ft
China
Offline

Custom UI works in S1, pls wait for the firmware in next few days.
2020-3-19
Use props
Shawn.So
lvl.1
Flight distance : 149206 ft
China
Offline

m




You can see this Beta test case, who is using Custom UI to design the special communication with the teams in Conquest mode.
2020-3-20
Use props
gpvillamil
lvl.4
Flight distance : 210226 ft
United States
Offline


Awesome, thank you!

You write the code for this in the Robomaster app, right?

Can you post the example code?
2020-3-20
Use props
Shawn.So
lvl.1
Flight distance : 149206 ft
China
Offline

gpvillamil Posted at 3-20 00:04
Awesome, thank you!

You write the code for this in the Robomaster app, right?


Sorry I do not have the code. I just saw someone posted it on S1 Wechat group.
2020-3-22
Use props
Vives
lvl.1
Belgium
Offline

So the firmware update has been released. I am able to use the infrared function that before wasnt usable by the robot. But the firmware update talked about custom UI programming. Any idea where this is and how to find this. Does this update add a lot of new options to the robot?
2020-3-26
Use props
hopet
New

Czechia
Offline

I think people have perhaps solved this in the meantime, but just for a reference - a small expample we wrote with my son to emulate differential lock on Robomaster S1. You can make a component out of it and run it in the normal Solo mode afterwards. Contains 2 buttons and one input field for setting speed.

my_button = Button()
my_button_back = Button()
my_input_field = InputField()
speed = 100

#def move_button_callback(widget, *args, **kw):
#    global speed
#    chassis_ctrl.set_wheel_speed(speed,speed,speed,speed)
#    time.sleep(5)

def move_button_down_callback(widget, *args, **kw):
    global speed
    print("going forward with speed " + str(speed))
    chassis_ctrl.set_wheel_speed(speed,speed,speed,speed)
    #time.sleep(.1)

def move_button_downback_callback(widget, *args, **kw):
    global speed
    chassis_ctrl.set_wheel_speed(-speed,-speed,-speed,-speed)
    #time.sleep(.1)

def move_button_up_callback(widget, *args, **kw):
    chassis_ctrl.set_wheel_speed(0,0,0,0)

def my_input_field_callback(widget, *args, **kw):
    global speed
    try:
        print("speed is now " + str(args[0]))
        speed = int(args[0])
    except:
        pass
   
def start():
    global my_button
    global my_button_back
    global my_input_field
    global speed
    my_button.set_text('Diff lock move', [0,0,0], text_anchor.upper_left, 36)
    #my_button.set_text_color(240,240,240)
    #my_button.set_background_color(20,20,20,2)
    my_button.set_position(600,0)
    my_button.set_size(400,100)
    #my_button.callback_register('on_click', move_button_callback)
    my_button.callback_register('on_press_down', move_button_down_callback)
    my_button.callback_register('on_press_up', move_button_up_callback)
    my_button.set_active(True)
    stage.add_widget(my_button)
    my_button_back.set_text('Diff lock move back', [0,0,0], text_anchor.upper_left, 36)
    my_button_back.set_position(600,-100)
    my_button_back.set_size(400,100)
    my_button_back.callback_register('on_press_down', move_button_downback_callback)
    my_button_back.callback_register('on_press_up', move_button_up_callback)
    my_button_back.set_active(True)
    stage.add_widget(my_button_back)
    my_input_field.set_text(str(speed), [0,0,0], text_anchor.upper_center, 24)
    my_input_field.set_position(600,100)
    #my_input_field.set_size(300,300)
    #my_input_field.set_text_color(0,0,0)
    #my_input_field.set_background_color(255,255,255,0)
    my_input_field.callback_register('on_value_changed', my_input_field_callback)
    my_input_field.set_active(True)
    stage.add_widget(my_input_field)
    while True:
        time.sleep(1)
2022-1-31
Use props
gpvillamil
lvl.4
Flight distance : 210226 ft
United States
Offline

hopet Posted at 1-31 12:55
I think people have perhaps solved this in the meantime, but just for a reference - a small expample we wrote with my son to emulate differential lock on Robomaster S1. You can make a component out of it and run it in the normal Solo mode afterwards. Contains 2 buttons and one input field for setting speed.

my_button = Button()

Nice! Thank you for posting this!
2022-1-31
Use props
ro_flyer
Second Officer
Flight distance : 7557283 ft
Brazil
Offline

2022-3-5
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules