How to switch between POSITION_CONTROL mode and VELOCITY_CONTROL mode?

Hi, I am learning ODrive controller, and I have a question:
I could write my configuration into ODrive board with only one control mode at a time, e.g., choosing control_mode_position_control or control_mode_velocity_control using odrivetool. However, I need to use the two modes in a single session whenever I call them.
For example, I want to input commands like: _input_pos = 50, _input_pos = 0 and when I want to switch to velocity mode, I can send command: _input_vel = 1, _input_vel = 5 without erasing and rewriting the configuration into ODrive. How to do it?
My system: ODrive v3.6, 56v board, hoverboard motors, odrivetool v0.5.1.post0, ubuntu 18.04.
Please help me. Thank you.

You don’t have to erase, you can always just set the control mode (controller.config.control_mode) however you like, at any time.

Hi, thank you for your kind reply and I will test it.

Hi, Wetmelon, please excuse me for posting such a stupid question again.
I tried and tested my board many times but could not find a way to write my configuration into ODrive board with two different control modes (position_control and velocity_control) at the same time. I have to choose only one mode at a time in configuration with odrivetool.
I could switch between POSITION_CONTROL mode and VELOCITY_CONTROL mode in python files, which costed me many more statements.
I also read your demo files - ODriveArduinoTest.ino and and found no statement like ‘odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL’. However, I could run them successfully. How could you set up your board? I’m puzzled about it. I really need your help.
Thank you.

I use USB and odrivetool to configure my odrive.

You can’t use both postion and velocity control at the same time, physics doesn’t work that way. What are you trying to accomplish? Why do you think you need them both?

Hi, Wetmelon, thank you for your kind reply.
As a beginner, I just want to know the boundary: what I can do and what I cannot. Besides, I am not confident in my testing results. Again, I really appreciate your help

You can switch modes while running - you don’t need to save and reboot each time you change a config, it applies immediately.

Thank you for your kind suggestion,Towen, I will try it.