You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/camera.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,9 @@ The pixel information can be obtained from the `wb_camera_get_image` function.
133
133
The red, green and blue channels (RGB) can be extracted from the resulting image by the `wb_camera_image_get_*`-like functions.
134
134
135
135
Each time a camera is refreshed, an OpenGL rendering is performed, and the color information is copied into the buffer returned by the `wb_camera_get_image` function.
136
-
The format of this buffers is BGRA (32 bits).
136
+
The contents of the buffer are subject to change between a call to `wb_robot_step_begin` and the subsequent call to `wb_robot_step_end`.
137
+
As a result, if you want to access the buffer during a step, you should copy it before the step begins and access the copy.
138
+
The format of this buffer is BGRA (32 bits).
137
139
We recommend to use the `wb_camera_image_get_*`-like functions to access the buffer because the internal format could change.
138
140
139
141
> **Note**[MATLAB]: The MATLAB API uses a language-specific representation of color images consisting of a 3D array of RGB triplets.
Copy file name to clipboardExpand all lines: docs/reference/rangefinder.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -545,6 +545,8 @@ The range image is coded as an array of single precision floating point values c
545
545
The precision of the range-finder values decreases when the objects are located farther from the near clipping plane.
546
546
Pixels are stored in scan lines running from left to right and from top to bottom.
547
547
The memory chunk returned by this function shall not be freed, as it is managed by the range-finder internally.
548
+
The contents of the image are subject to change between a call to `wb_robot_step_begin` and the subsequent call to `wb_robot_step_end`.
549
+
As a result, if you want to access the image during a step, you should copy it before the step begins and access the copy.
548
550
The size in bytes of the range image can be computed as follows:
549
551
550
552
```
@@ -666,5 +668,7 @@ HDR images are saved as 32-bit floating-point single-channel images.
666
668
For PNG and JPEG, depth data is stored in the range `0` to `255`.
667
669
This depth data can thus be extracted for further use by reading the image file.
668
670
671
+
`wb_range_finder_save_image` should not be called between a call to `wb_robot_step_begin` and the subsequent call to `wb_robot_step_end`, because the image is subject to change during that period.
672
+
669
673
The return value of the `wb_range_finder_save_image` function is 0 in case of success.
670
674
It is -1 in case of failure (unable to open the specified file or unrecognized image file extension).
Copy file name to clipboardExpand all lines: docs/reference/robot.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -265,6 +265,8 @@ You can simply call them before `wb_robot_step_begin` or after `wb_robot_step_en
265
265
However, some of these functions can be called between `wb_robot_step_begin` and `wb_robot_step_end` if you enable the supervisor tracking feature.
266
266
`wb_supervisor_field_enable_sf_tracking`, `wb_supervisor_node_enable_pose_tracking` and `wb_supervisor_node_enable_contact_point_tracking` force Webots to continuously stream the requested information to the controller.
267
267
By enabling the tracking, the corresponding supervisor functions can be called between `wb_robot_step_begin` and `wb_robot_step_end`, because their value will be queried to Webots during `wb_robot_step_begin` and received during `wb_robot_step_end`.
268
+
Also, note that the data returned by the following functions are subject to change between a call to `wb_robot_step_begin` and the subsequent call to `wb_robot_step_end`: `wb_camera_get_image`, `wb_camera_recognition_get_segmentation_image`, `wb_lidar_get_range_image`, `wb_lidar_get_layer_range_image`, `wb_lidar_get_point_cloud`, `wb_lidar_get_layer_point_cloud`, and `wb_range_finder_get_range_image`.
269
+
As a result, if you want to access that data during a step, you should copy it before the step begins and access the copy.
268
270
269
271
The C API has two additional functions: `wb_robot_init` and `wb_robot_cleanup`.
270
272
There is no equivalent of the `wb_robot_init` and `wb_robot_cleanup` functions in the Java, Python, C++ and MATLAB APIs.
0 commit comments