Newb Challenge. How to read from robot with RTDE

Hello everyone.

I’m facing an issue with reading from the registers through the RTDE Python package.
I maneged to send new values but not reading them.

This is how my control_loop_configuration.xml file is setup:
<rtde_config>

  • *

  •   <field name="target_q" type="VECTOR6D"/>*
    
  •   <field name="target_qd" type="VECTOR6D"/>*
    
  •   <field name="output_int_register_0" type="INT32"/>*
    
  • *

  • *

  •   <field name="input_double_register_0" type="DOUBLE"/>*
    
  •   <field name="input_double_register_1" type="DOUBLE"/>*
    
  •   <field name="input_double_register_2" type="DOUBLE"/>*
    
  •   <field name="input_double_register_3" type="DOUBLE"/>*
    
  •   <field name="input_double_register_4" type="DOUBLE"/>*
    
  •   <field name="input_double_register_5" type="DOUBLE"/>*
    
  • *

  • *

  •   <field name="input_int_register_0" type="INT32"/>*
    
  • *
    </rtde_config>

This is how I’m trying the read the value in my control loop (example_control.loop.py) look
while keep_running:

  • receive the current state*

  • state = con.receive()*

  • state.target_q()*

  • if state is None:*

  •    break*
    
  • do something…*

  • if move_completed and state.output_int_register_0 == 1:*

  •    move_completed = False*
    
  •    new_setp = setp1 if setp_to_list(setp) == setp2 else setp2*
    
  •    list_to_setp(setp, new_setp)*
    
  •    print("New pose = " + str(new_setp))*
    
  •    # send new setpoint*
    
  •    con.send(setp)*
    
  •    watchdog.input_int_register_0 = 1*
    
  • elif not move_completed and state.output_int_register_0 == 0:*

  •    print("Move to confirmed pose = " + str(state.target_q))*
    
  •    move_completed = True*
    
  •    watchdog.input_int_register_0 = 0*
    
  • kick watchdog*

  • con.send(watchdog)*

When running the code I get this message from my Python IDE:
“TypeError: ‘list’ object is not callable”
The message is listed when I ask for a int or float value.

I am supposed to setup recipies for output values like it is done for the input values ?
If yes, can some please guide me on how to ?

Hoping someone in here can elaborate and help me through this challenge I’m facing in my mechanical engineering bachelors project. :slight_smile:

Best regards Mads

I’m sorry for the layout. Don’t know what happened :face_with_raised_eyebrow:

Hello,

A few months back, I quickly forked the RTDE and modified the record example to create a read utility. The utility reads the safety bits of the robot; if an error occurs, it’ll send an email to a recipient.

The main main modifications where…

  1. I added this email sender class
  2. I modified ../examples/record.py to perform a read event with some supporting functions declared at the top.

Hey smarmstr
Thank you for answering my question. Appriciate it!

I’ll look into your solution and see if I can get my script working.

Thanks again, alle the best / Mads :slight_smile: