Replies: 1 comment 1 reply
-
The correct MATLAB function to read the `PositionSensor value is:
Here you can find the MATLAB documentation: Here you can find a sample MATLAB controller for the Robotis OP2 robot that can help you understand how to use the MATLAB API: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All, I am looking for an example in Pioneer3 (Webots R2022a) "using Matlab" to get the robot position. I tried to do it based on the weel's encoders (or GPS but the same missing examples). After days of searching, I could not find any code for that position estimation.
I would appreciate it very much if someone could let me know where to faun an example please! Thanks!
I tried defining:
left_wheel = wb_robot_get_device('left wheel');
right_wheel = wb_robot_get_device('right wheel');
position_sensor_left = wb_motor_get_position_sensor(left_wheel);
position_sensor_right = wb_motor_get_position_sensor(right_wheel);
and reading:
position_sensor_left.getValue()
position_sensor_right.getValue()
but I got errors like Struct contents reference from a non-struct array object.
Beta Was this translation helpful? Give feedback.
All reactions