diff --git a/.gitignore b/.gitignore index 333e6dfb634..17cfba3db0c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ webots_catkin_ws *.hex *.pyc *.gch +*.def # Packages *.7z diff --git a/include/controller/c/webots/supervisor.h b/include/controller/c/webots/supervisor.h index c2b71a6e1a6..5ae8f985c56 100644 --- a/include/controller/c/webots/supervisor.h +++ b/include/controller/c/webots/supervisor.h @@ -215,10 +215,10 @@ void wb_supervisor_simulation_revert() WB_DEPRECATED; // please us void wb_supervisor_load_world(const char *filename) WB_DEPRECATED; // please use wb_supervisor_world_load() instead bool wb_supervisor_save_world(const char *filename) WB_DEPRECATED; // please use wb_supervisor_world_save() instead -// deprecated since Webots 8.6.0, plesae use wb_supervisor_field_remove_mf_item() instead +// deprecated since Webots 8.6.0, please use wb_supervisor_field_remove_mf() instead void wb_supervisor_field_remove_mf_node(WbFieldRef field, int position) WB_DEPRECATED; -// deprecated since Webots 8.0.0, plesae use wb_supervisor_simulation_reset_physics() instead +// deprecated since Webots 8.0.0, pleaae use wb_supervisor_simulation_reset_physics() instead void wb_supervisor_simulation_physics_reset() WB_DEPRECATED; // deprecated since Webots 8.4.0 please use wb_supervisor_movie_is_ready and wb_supervisor_movie_failed diff --git a/projects/default/libraries/vehicle/c/car/car.def b/projects/default/libraries/vehicle/c/car/car.def deleted file mode 100644 index 1c3e82018d5..00000000000 --- a/projects/default/libraries/vehicle/c/car/car.def +++ /dev/null @@ -1,28 +0,0 @@ -EXPORTS -wbu_car_init -wbu_car_cleanup -wbu_car_get_type -wbu_car_get_engine_type -wbu_car_set_indicator_period -wbu_car_get_indicator_period -wbu_car_get_backwards_lights -wbu_car_get_brake_lights -wbu_car_get_track_front -wbu_car_get_track_rear -wbu_car_get_wheelbase -wbu_car_get_front_wheel_radius -wbu_car_get_rear_wheel_radius -wbu_car_get_wheel_encoder -wbu_car_get_wheel_speed -wbu_car_set_right_steering_angle -wbu_car_get_right_steering_angle -wbu_car_set_left_steering_angle -wbu_car_get_left_steering_angle -wbu_car_enable_limited_slip_differential -wbu_car_enable_indicator_auto_disabling -_wbu_car_get_instance -_wbu_car_set_led_state_if_exist -_wbu_car_get_led_state_if_exist -_wbu_car_check_initialisation -_wbu_car_initialization_is_possible - diff --git a/projects/default/libraries/vehicle/c/driver/driver.def b/projects/default/libraries/vehicle/c/driver/driver.def deleted file mode 100644 index 20a14276f50..00000000000 --- a/projects/default/libraries/vehicle/c/driver/driver.def +++ /dev/null @@ -1,30 +0,0 @@ -EXPORTS -wbu_driver_init -wbu_driver_initialization_is_possible -wbu_driver_cleanup -wbu_driver_step -wbu_driver_set_steering_angle -wbu_driver_get_steering_angle -wbu_driver_set_cruising_speed -wbu_driver_get_target_cruising_speed -wbu_driver_get_current_speed -wbu_driver_set_throttle -wbu_driver_get_throttle -wbu_driver_set_brake_intensity -wbu_driver_get_brake_intensity -wbu_driver_set_indicator -wbu_driver_set_hazard_flashers -wbu_driver_get_indicator -wbu_driver_get_hazard_flashers -wbu_driver_set_dipped_beams -wbu_driver_set_antifog_lights -wbu_driver_get_dipped_beams -wbu_driver_get_antifog_lights -wbu_driver_get_rpm -wbu_driver_get_gear -wbu_driver_set_gear -wbu_driver_get_gear_number -wbu_driver_get_control_mode -wbu_driver_set_wiper_mode -wbu_driver_get_wiper_mode - diff --git a/projects/robots/kuka/youbot/libraries/youbot_control/youbot_control.def b/projects/robots/kuka/youbot/libraries/youbot_control/youbot_control.def deleted file mode 100644 index c31e921477d..00000000000 --- a/projects/robots/kuka/youbot/libraries/youbot_control/youbot_control.def +++ /dev/null @@ -1,34 +0,0 @@ -EXPORTS -arm_init -arm_reset -arm_set_height -arm_increase_height -arm_decrease_height -arm_set_orientation -arm_increase_orientation -arm_decrease_orientation -arm_set_sub_arm_rotation -arm_get_sub_arm_length -arm_ik -base_init -base_reset -base_forwards -base_backwards -base_turn_left -base_turn_right -base_strafe_left -base_strafe_right -base_forwards_increment -base_backwards_increment -base_turn_left_increment -base_turn_right_increment -base_strafe_left_increment -base_strafe_right_increment -base_goto_init -base_goto_set_target -base_goto_run -base_goto_reached -gripper_init -gripper_grip -gripper_release -gripper_set_gap diff --git a/resources/Makefile.include b/resources/Makefile.include index b55fecfb20c..47b20a63d72 100644 --- a/resources/Makefile.include +++ b/resources/Makefile.include @@ -395,10 +395,9 @@ endif ifeq ($(OSTYPE),windows) ifdef BUILD_SHARED_LIBRARY ifndef USE_CXX - ifneq ($(wildcard /C/Program\ Files\ */Microsoft\ Visual\ Studio/2017),) - VISUAL_STUDIO_PATH?=/C/Program Files (x86)/Microsoft Visual Studio/2017 - endif - VS_DEF_NAME = $(NAME).def + ifneq ($(wildcard /C/Program\ Files\ */Microsoft\ Visual\ Studio/2017),) + VISUAL_STUDIO_PATH?=/C/Program Files (x86)/Microsoft Visual Studio/2017 + endif endif endif endif @@ -478,15 +477,22 @@ clean: $(EXTRA_TARGETS) ifdef MAIN_TARGET MAIN_TARGET_WINDOWS_LIB = $(MAIN_TARGET:.dll=.lib) +MAIN_TARGET_MINGW_LIB_NAME = lib$(MAIN_TARGET:.dll=.a) ifdef WEBOTS_LIBRARY MAIN_TARGET_COPY = "$(subst $(space),\ ,$(WEBOTS_CONTROLLER_LIB_PATH))/$(MAIN_TARGET)" MAIN_TARGET_WINDOWS64_LIB = $(WEBOTS_CONTROLLER_LIB_PATH)/$(MAIN_TARGET_WINDOWS_LIB) +MAIN_TARGET_MINGW_LIB = $(WEBOTS_CONTROLLER_LIB_PATH)/$(MAIN_TARGET_MINGW_LIB_NAME) else MAIN_TARGET_COPY ?= $(MAIN_TARGET) MAIN_TARGET_WINDOWS64_LIB = $(MAIN_TARGET:.dll=.lib) +MAIN_TARGET_MINGW_LIB = $(MAIN_TARGET_MINGW_LIB_NAME) endif ifeq ($(OSTYPE),windows) FILES_TO_REMOVE += $(MAIN_TARGET_WINDOWS64_LIB) +ifdef BUILD_SHARED_LIBRARY + VS_DEF_NAME = $(BUILD_GOAL_DIR)/$(MAIN_TARGET:.dll=.def) + DYNAMIC_LINK_FLAGS += -Wl,--out-implib,$(MAIN_TARGET_MINGW_LIB) +endif endif ###----------------------------------------------------------------------------- @@ -508,15 +514,13 @@ ifdef TARGET_LIB_DIR $(MAIN_TARGET): $(TARGET_LIB_DIR)/$(MAIN_TARGET) ifdef VS_DEF_NAME @# Generate the .lib libraries to facilitate the integration with Visual Studio - @# if the .def file is existing. - @if [ -f $(VS_DEF_NAME) ]; then \ - if [ -d "$(VISUAL_STUDIO_PATH)" ]; then \ - PATH="$(VISUAL_STUDIO_PATH)/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64":$PATH lib /machine:X64 /def:$(VS_DEF_NAME) /out:out.lib > /dev/null; \ - mv out.lib $(MAIN_TARGET_WINDOWS64_LIB); \ - rm -f *.exp; \ - else \ - $(ECHO) "\033[0;33m'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib\033[0m"; \ - fi \ + @dlltool --export-all-symbols -z $(VS_DEF_NAME) $(TARGET_LIB_DIR)/$(MAIN_TARGET) + @if [ -d "$(VISUAL_STUDIO_PATH)" ]; then \ + PATH="$(VISUAL_STUDIO_PATH)/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64":$PATH lib /machine:X64 /def:$(VS_DEF_NAME) /out:out.lib > /dev/null; \ + mv out.lib $(MAIN_TARGET_WINDOWS64_LIB); \ + rm -f *.exp; \ + else \ + $(ECHO) "\033[0;33m'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib\033[0m"; \ fi endif @@ -530,15 +534,13 @@ $(MAIN_TARGET): $(BUILD_GOAL_DIR)/$(MAIN_TARGET) @rm -f $(MAIN_TARGET) > /dev/null 2>&1 && echo "# copying to" $(MAIN_TARGET_COPY) && cp $(BUILD_GOAL_DIR)/$(MAIN_TARGET) $(MAIN_TARGET_COPY) > /dev/null 2>&1 ifdef VS_DEF_NAME @# Generate the .lib libraries to facilitate the integration with Visual Studio - @# if the .def file is existing. - @if [ -f $(VS_DEF_NAME) ]; then \ - if [ -d "$(VISUAL_STUDIO_PATH)" ]; then \ - PATH="$(VISUAL_STUDIO_PATH)/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64":$PATH lib /machine:X64 /def:$(VS_DEF_NAME) /out:out.lib > /dev/null; \ - mv out.lib $(MAIN_TARGET_WINDOWS64_LIB); \ - rm -f *.exp; \ - else \ - $(ECHO) "\033[0;33m'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib\033[0m"; \ - fi \ + @dlltool --export-all-symbols -z $(VS_DEF_NAME) $(BUILD_GOAL_DIR)/$(MAIN_TARGET) + @if [ -d "$(VISUAL_STUDIO_PATH)" ]; then \ + PATH="$(VISUAL_STUDIO_PATH)/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64":$PATH lib /machine:X64 /def:$(VS_DEF_NAME) /out:out.lib > /dev/null; \ + mv out.lib $(MAIN_TARGET_WINDOWS64_LIB); \ + rm -f *.exp; \ + else \ + $(ECHO) "\033[0;33m'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib\033[0m"; \ fi endif diff --git a/src/controller/c/Controller.def b/src/controller/c/Controller.def deleted file mode 100644 index 4d895a30aa2..00000000000 --- a/src/controller/c/Controller.def +++ /dev/null @@ -1,635 +0,0 @@ -EXPORTS -wb_ANSI_RESET -wb_ANSI_BOLD -wb_ANSI_UNDERLINE -wb_ANSI_BLACK_BACKGROUND -wb_ANSI_RED_BACKGROUND -wb_ANSI_GREEN_BACKGROUND -wb_ANSI_YELLOW_BACKGROUND -wb_ANSI_BLUE_BACKGROUND -wb_ANSI_MAGENTA_BACKGROUND -wb_ANSI_CYAN_BACKGROUND -wb_ANSI_WHITE_BACKGROUND -wb_ANSI_BLACK_FOREGROUND -wb_ANSI_RED_FOREGROUND -wb_ANSI_GREEN_FOREGROUND -wb_ANSI_YELLOW_FOREGROUND -wb_ANSI_BLUE_FOREGROUND -wb_ANSI_MAGENTA_FOREGROUND -wb_ANSI_CYAN_FOREGROUND -wb_ANSI_WHITE_FOREGROUND -wb_ANSI_CLEAR_SCREEN -wb_KEYBOARD_END -wb_KEYBOARD_HOME -wb_KEYBOARD_LEFT -wb_KEYBOARD_UP -wb_KEYBOARD_RIGHT -wb_KEYBOARD_DOWN -wb_KEYBOARD_PAGEUP -wb_KEYBOARD_PAGEDOWN -wb_KEYBOARD_NUMPAD_HOME -wb_KEYBOARD_NUMPAD_LEFT -wb_KEYBOARD_NUMPAD_UP -wb_KEYBOARD_NUMPAD_RIGHT -wb_KEYBOARD_NUMPAD_DOWN -wb_KEYBOARD_NUMPAD_END -wb_KEYBOARD_KEY -wb_KEYBOARD_SHIFT -wb_KEYBOARD_CONTROL -wb_KEYBOARD_ALT -wb_LINEAR -wb_MF -wb_MF_BOOL -wb_MF_INT32 -wb_MF_FLOAT -wb_MF_VEC2F -wb_MF_VEC3F -wb_MF_ROTATION -wb_MF_COLOR -wb_MF_STRING -wb_MF_NODE -wb_NODE_NO_NODE -wb_NODE_APPEARANCE -wb_NODE_BACKGROUND -wb_NODE_BILLBOARD -wb_NODE_BOX -wb_NODE_CAD_SHAPE -wb_NODE_CAPSULE -wb_NODE_COLOR -wb_NODE_CONE -wb_NODE_COORDINATE -wb_NODE_CYLINDER -wb_NODE_DIRECTIONAL_LIGHT -wb_NODE_ELEVATION_GRID -wb_NODE_FOG -wb_NODE_GROUP -wb_NODE_IMAGE_TEXTURE -wb_NODE_INDEXED_FACE_SET -wb_NODE_INDEXED_LINE_SET -wb_NODE_MATERIAL -wb_NODE_MESH -wb_NODE_MUSCLE -wb_NODE_NORMAL -wb_NODE_PBR_APPEARANCE -wb_NODE_PLANE -wb_NODE_POINT_LIGHT -wb_NODE_POINT_SET -wb_NODE_POSE -wb_NODE_SHAPE -wb_NODE_SPHERE -wb_NODE_SPOT_LIGHT -wb_NODE_TEXTURE_COORDINATE -wb_NODE_TEXTURE_TRANSFORM -wb_NODE_TRANSFORM -wb_NODE_VIEWPOINT -wb_NODE_ROBOT -wb_NODE_ACCELEROMETER -wb_NODE_ALTIMETER -wb_NODE_BRAKE -wb_NODE_CAMERA -wb_NODE_COMPASS -wb_NODE_CONNECTOR -wb_NODE_DISPLAY -wb_NODE_DISTANCE_SENSOR -wb_NODE_EMITTER -wb_NODE_GPS -wb_NODE_GYRO -wb_NODE_INERTIAL_UNIT -wb_NODE_LED -wb_NODE_LIDAR -wb_NODE_LIGHT_SENSOR -wb_NODE_LINEAR_MOTOR -wb_NODE_PEN -wb_NODE_POSITION_SENSOR -wb_NODE_PROPELLER -wb_NODE_RADAR -wb_NODE_RANGE_FINDER -wb_NODE_RECEIVER -wb_NODE_ROTATIONAL_MOTOR -wb_NODE_SKIN -wb_NODE_SPEAKER -wb_NODE_TOUCH_SENSOR -wb_NODE_VACUUM_GRIPPER -wb_NODE_BALL_JOINT -wb_NODE_BALL_JOINT_PARAMETERS -wb_NODE_CHARGER -wb_NODE_CONTACT_PROPERTIES -wb_NODE_DAMPING -wb_NODE_FLUID -wb_NODE_FOCUS -wb_NODE_HINGE_JOINT -wb_NODE_HINGE_JOINT_PARAMETERS -wb_NODE_HINGE_2_JOINT -wb_NODE_IMMERSION_PROPERTIES -wb_NODE_JOINT_PARAMETERS -wb_NODE_LENS -wb_NODE_LENS_FLARE -wb_NODE_PHYSICS -wb_NODE_RECOGNITION -wb_NODE_SLIDER_JOINT -wb_NODE_SLOT -wb_NODE_SOLID -wb_NODE_SOLID_REFERENCE -wb_NODE_TRACK -wb_NODE_TRACK_WHEEL -wb_NODE_WORLD_INFO -wb_NODE_ZOOM -wb_NODE_MICROPHONE -wb_NODE_RADIO -wb_ROTATIONAL -wb_SF_BOOL -wb_SF_INT32 -wb_SF_FLOAT -wb_SF_VEC2F -wb_SF_VEC3F -wb_SF_ROTATION -wb_SF_COLOR -wb_SF_STRING -wb_SF_NODE -wb_accelerometer_disable -wb_accelerometer_enable -wb_accelerometer_get_sampling_period -wb_accelerometer_get_values -wb_accelerometer_get_lookup_table_size -wb_accelerometer_get_lookup_table -wb_altimeter_disable -wb_altimeter_enable -wb_altimeter_get_sampling_period -wb_altimeter_get_value -wb_brake_get_motor -wb_brake_get_position_sensor -wb_brake_get_type -wb_brake_set_damping_constant -wb_camera_disable -wb_camera_enable -wb_camera_get_exposure -wb_camera_get_focal_distance -wb_camera_get_focal_length -wb_camera_get_fov -wb_camera_get_height -wb_camera_get_image -wb_camera_get_max_focal_distance -wb_camera_get_max_fov -wb_camera_get_min_focal_distance -wb_camera_get_min_fov -wb_camera_get_near -wb_camera_get_sampling_period -wb_camera_get_width -wb_camera_has_recognition -wb_camera_recognition_disable -wb_camera_recognition_disable_segmentation -wb_camera_recognition_enable -wb_camera_recognition_enable_segmentation -wb_camera_recognition_get_number_of_objects -wb_camera_recognition_get_objects -wb_camera_recognition_get_sampling_period -wb_camera_recognition_get_segmentation_image -wb_camera_recognition_has_segmentation -wb_camera_recognition_is_segmentation_enabled -wb_camera_recognition_save_segmentation_image -wb_camera_save_image -wb_camera_set_exposure -wb_camera_set_focal_distance -wb_camera_set_fov -wb_compass_disable -wb_compass_enable -wb_compass_get_sampling_period -wb_compass_get_values -wb_compass_get_lookup_table_size -wb_compass_get_lookup_table -wb_connector_disable_presence -wb_connector_enable_presence -wb_connector_get_presence -wb_connector_get_presence_sampling_period -wb_connector_is_locked -wb_connector_lock -wb_connector_unlock -wb_console_print -wb_device_get_model -wb_device_get_name -wb_device_get_type -wb_device_get_node_type -wb_display_attach_camera -wb_display_detach_camera -wb_display_draw_line -wb_display_draw_oval -wb_display_draw_pixel -wb_display_draw_polygon -wb_display_draw_rectangle -wb_display_draw_text -wb_display_fill_oval -wb_display_fill_polygon -wb_display_fill_rectangle -wb_display_get_height -wb_display_get_width -wb_display_image_copy -wb_display_image_delete -wb_display_image_load -wb_display_image_new -wb_display_image_paste -wb_display_image_save -wb_display_set_alpha -wb_display_set_color -wb_display_set_font -wb_display_set_opacity -wb_distance_sensor_disable -wb_distance_sensor_enable -wb_distance_sensor_get_aperture -wb_distance_sensor_get_max_value -wb_distance_sensor_get_min_value -wb_distance_sensor_get_sampling_period -wb_distance_sensor_get_type -wb_distance_sensor_get_value -wb_distance_sensor_get_lookup_table_size -wb_distance_sensor_get_lookup_table -wb_emitter_get_buffer_size -wb_emitter_get_channel -wb_emitter_get_range -wb_emitter_send -wb_emitter_set_channel -wb_emitter_set_range -wb_gps_disable -wb_gps_convert_to_degrees_minutes_seconds -wb_gps_enable -wb_gps_get_coordinate_system -wb_gps_get_sampling_period -wb_gps_get_speed -wb_gps_get_speed_vector -wb_gps_get_values -wb_gyro_disable -wb_gyro_enable -wb_gyro_get_sampling_period -wb_gyro_get_values -wb_gyro_get_lookup_table_size -wb_gyro_get_lookup_table -wb_inertial_unit_disable -wb_inertial_unit_enable -wb_inertial_unit_get_roll_pitch_yaw -wb_inertial_unit_get_quaternion -wb_inertial_unit_get_sampling_period -wb_inertial_unit_get_noise -wb_joystick_disable -wb_joystick_enable -wb_joystick_get_axis_value -wb_joystick_get_model -wb_joystick_get_number_of_axes -wb_joystick_get_number_of_povs -wb_joystick_get_pov_value -wb_joystick_get_pressed_button -wb_joystick_get_sampling_period -wb_joystick_is_connected -wb_joystick_set_auto_centering_gain -wb_joystick_set_constant_force -wb_joystick_set_constant_force_duration -wb_joystick_set_force_axis -wb_joystick_set_resistance_gain -wb_keyboard_disable -wb_keyboard_enable -wb_keyboard_get_key -wb_keyboard_get_sampling_period -wb_led_get -wb_led_set -wb_lidar_disable -wb_lidar_disable_point_cloud -wb_lidar_enable -wb_lidar_enable_point_cloud -wb_lidar_get_fov -wb_lidar_get_frequency -wb_lidar_get_horizontal_resolution -wb_lidar_get_layer_point_cloud -wb_lidar_get_layer_range_image -wb_lidar_get_max_frequency -wb_lidar_get_max_range -wb_lidar_get_min_frequency -wb_lidar_get_min_range -wb_lidar_get_number_of_layers -wb_lidar_get_number_of_points -wb_lidar_get_point_cloud -wb_lidar_get_range_image -wb_lidar_get_sampling_period -wb_lidar_get_vertical_fov -wb_lidar_is_point_cloud_enabled -wb_lidar_set_frequency -wb_light_sensor_disable -wb_light_sensor_enable -wb_light_sensor_get_sampling_period -wb_light_sensor_get_value -wb_light_sensor_get_lookup_table_size -wb_light_sensor_get_lookup_table -wb_microphone_enable -wb_microphone_get_sample_data -wb_microphone_get_sample_size -wb_microphone_get_sampling_period -wb_motor_disable_force_feedback -wb_motor_disable_torque_feedback -wb_motor_enable_force_feedback -wb_motor_enable_torque_feedback -wb_motor_get_acceleration -wb_motor_get_available_force -wb_motor_get_available_torque -wb_motor_get_force_feedback -wb_motor_get_force_feedback_sampling_period -wb_motor_get_max_force -wb_motor_get_max_torque -wb_motor_get_max_position -wb_motor_get_max_velocity -wb_motor_get_min_position -wb_motor_get_multiplier -wb_motor_get_target_position -wb_motor_get_torque_feedback -wb_motor_get_torque_feedback_sampling_period -wb_motor_get_type -wb_motor_get_velocity -wb_motor_get_brake -wb_motor_get_position_sensor -wb_motor_set_acceleration -wb_motor_set_available_force -wb_motor_set_available_torque -wb_motor_set_control_pid -wb_motor_set_force -wb_motor_set_position -wb_motor_set_torque -wb_motor_set_velocity -wb_mouse_disable -wb_mouse_disable_3d_position -wb_mouse_enable -wb_mouse_enable_3d_position -wb_mouse_get_sampling_period -wb_mouse_get_state -wb_mouse_is_3d_position_enabled -wb_node_get_name -wb_pen_set_ink_color -wb_pen_write -wb_position_sensor_enable -wb_position_sensor_disable -wb_position_sensor_get_value -wb_position_sensor_get_sampling_period -wb_position_sensor_get_type -wb_position_sensor_get_brake -wb_position_sensor_get_motor -wb_radar_disable -wb_radar_enable -wb_radar_get_horizontal_fov -wb_radar_get_max_range -wb_radar_get_min_range -wb_radar_get_number_of_targets -wb_radar_get_sampling_period -wb_radar_get_targets -wb_radar_get_vertical_fov -wb_range_finder_enable -wb_range_finder_disable -wb_range_finder_get_sampling_period -wb_range_finder_get_range_image -wb_range_finder_get_width -wb_range_finder_get_height -wb_range_finder_get_fov -wb_range_finder_get_min_range -wb_range_finder_get_max_range -wb_range_finder_save_image -wb_range_finder_image_get_depth -wb_remote_control_custom_function -wb_receiver_disable -wb_receiver_enable -wb_receiver_get_channel -wb_receiver_get_data -wb_receiver_get_data_size -wb_receiver_get_emitter_direction -wb_receiver_get_queue_length -wb_receiver_get_sampling_period -wb_receiver_get_signal_strength -wb_receiver_next_packet -wb_receiver_set_channel -wb_robot_battery_sensor_disable -wb_robot_battery_sensor_enable -wb_robot_battery_sensor_get_value -wb_robot_battery_sensor_get_sampling_period -wb_robot_cleanup -wb_robot_get_basic_time_step -wb_robot_get_controller_name -wb_robot_get_custom_data -wb_robot_get_data -wb_robot_get_device -wb_robot_get_device_by_index -wb_robot_get_mode -wb_robot_get_model -wb_robot_get_name -wb_robot_get_number_of_devices -wb_robot_get_project_path -wb_robot_get_supervisor -wb_robot_get_synchronization -wb_robot_get_time -wb_robot_get_urdf -wb_robot_get_world_path -wb_robot_init -wb_robot_init_msvc -wb_robot_mutex_delete -wb_robot_mutex_lock -wb_robot_mutex_new -wb_robot_mutex_unlock -wb_robot_pin_to_static_environment -wb_robot_set_custom_data -wb_robot_set_data -wb_robot_set_mode -wb_robot_step -wb_robot_step_begin -wb_robot_step_end -wb_robot_task_new -wb_robot_wait_for_user_input_event -wb_robot_window_custom_function -wb_robot_wwi_send -wb_robot_wwi_receive -wb_robot_wwi_receive_text -wb_skin_get_bone_count -wb_skin_get_bone_name -wb_skin_get_bone_orientation -wb_skin_get_bone_position -wb_skin_set_bone_orientation -wb_skin_set_bone_position -wb_speaker_get_engine -wb_speaker_get_language -wb_speaker_is_sound_playing -wb_speaker_is_speaking -wb_speaker_play_sound -wb_speaker_set_engine -wb_speaker_set_language -wb_speaker_speak -wb_speaker_stop -wb_supervisor_node_add_force -wb_supervisor_node_add_force_with_offset -wb_supervisor_node_add_torque -wb_supervisor_animation_start_recording -wb_supervisor_animation_stop_recording -wb_supervisor_export_image -wb_supervisor_field_disable_sf_tracking -wb_supervisor_field_enable_sf_tracking -wb_supervisor_field_get_count -wb_supervisor_field_get_name -wb_supervisor_field_get_mf_bool -wb_supervisor_field_get_mf_color -wb_supervisor_field_get_mf_float -wb_supervisor_field_get_mf_int32 -wb_supervisor_field_get_mf_node -wb_supervisor_field_get_mf_rotation -wb_supervisor_field_get_mf_string -wb_supervisor_field_get_mf_vec2f -wb_supervisor_field_get_mf_vec3f -wb_supervisor_field_get_sf_bool -wb_supervisor_field_get_sf_color -wb_supervisor_field_get_sf_float -wb_supervisor_field_get_sf_int32 -wb_supervisor_field_get_sf_node -wb_supervisor_field_get_sf_rotation -wb_supervisor_field_get_sf_string -wb_supervisor_field_get_sf_vec2f -wb_supervisor_field_get_sf_vec3f -wb_supervisor_field_get_type -wb_supervisor_field_get_type_name -wb_supervisor_field_import_mf_node_from_string -wb_supervisor_field_import_sf_node_from_string -wb_supervisor_field_insert_mf_bool -wb_supervisor_field_insert_mf_color -wb_supervisor_field_insert_mf_float -wb_supervisor_field_insert_mf_int32 -wb_supervisor_field_insert_mf_rotation -wb_supervisor_field_insert_mf_string -wb_supervisor_field_insert_mf_vec2f -wb_supervisor_field_insert_mf_vec3f -wb_supervisor_field_remove_mf -wb_supervisor_field_remove_mf_node -wb_supervisor_field_remove_sf -wb_supervisor_field_set_mf_bool -wb_supervisor_field_set_mf_color -wb_supervisor_field_set_mf_float -wb_supervisor_field_set_mf_int32 -wb_supervisor_field_set_mf_rotation -wb_supervisor_field_set_mf_string -wb_supervisor_field_set_mf_vec2f -wb_supervisor_field_set_mf_vec3f -wb_supervisor_field_set_sf_bool -wb_supervisor_field_set_sf_color -wb_supervisor_field_set_sf_float -wb_supervisor_field_set_sf_int32 -wb_supervisor_field_set_sf_rotation -wb_supervisor_field_set_sf_string -wb_supervisor_field_set_sf_vec2f -wb_supervisor_field_set_sf_vec3f -wb_supervisor_movie_failed -wb_supervisor_movie_is_ready -wb_supervisor_movie_start_recording -wb_supervisor_movie_stop_recording -wb_supervisor_movie_get_status -wb_supervisor_node_disable_contact_point_tracking -wb_supervisor_node_disable_contact_points_tracking -wb_supervisor_node_disable_pose_tracking -wb_supervisor_node_enable_contact_point_tracking -wb_supervisor_node_enable_contact_points_tracking -wb_supervisor_node_enable_pose_tracking -wb_supervisor_node_export_string -wb_supervisor_node_get_base_type_name -wb_supervisor_node_get_def -wb_supervisor_node_get_field -wb_supervisor_node_get_field_by_index -wb_supervisor_node_get_from_def -wb_supervisor_node_get_from_id -wb_supervisor_node_get_from_proto_def -wb_supervisor_node_get_from_device -wb_supervisor_node_get_center_of_mass -wb_supervisor_node_get_contact_point -wb_supervisor_node_get_contact_points -wb_supervisor_node_get_contact_point_node -wb_supervisor_node_get_id -wb_supervisor_node_get_number_of_fields -wb_supervisor_node_get_number_of_contact_points -wb_supervisor_node_get_orientation -wb_supervisor_node_get_parent_node -wb_supervisor_node_get_pose -wb_supervisor_node_get_position -wb_supervisor_node_get_proto_field -wb_supervisor_node_get_proto_field_by_index -wb_supervisor_node_get_proto_number_of_fields -wb_supervisor_node_get_root -wb_supervisor_node_get_selected -wb_supervisor_node_get_self -wb_supervisor_node_get_static_balance -wb_supervisor_node_get_type -wb_supervisor_node_get_type_name -wb_supervisor_node_get_velocity -wb_supervisor_node_is_proto -wb_supervisor_node_load_state -wb_supervisor_node_move_viewpoint -wb_supervisor_node_remove -wb_supervisor_node_reset_physics -wb_supervisor_node_restart_controller -wb_supervisor_node_save_state -wb_supervisor_node_set_joint_position -wb_supervisor_node_set_velocity -wb_supervisor_node_set_visibility -wb_supervisor_set_label -wb_supervisor_simulation_get_mode -wb_supervisor_simulation_physics_reset -wb_supervisor_simulation_quit -wb_supervisor_simulation_reset -wb_supervisor_simulation_reset_physics -wb_supervisor_simulation_revert -wb_supervisor_simulation_set_mode -wb_supervisor_start_movie -wb_supervisor_stop_movie -wb_supervisor_get_movie_status -wb_supervisor_virtual_reality_headset_get_position -wb_supervisor_virtual_reality_headset_get_orientation -wb_supervisor_virtual_reality_headset_is_used -wb_supervisor_world_load -wb_supervisor_world_save -wb_supervisor_world_reload -wb_touch_sensor_disable -wb_touch_sensor_enable -wb_touch_sensor_get_sampling_period -wb_touch_sensor_get_type -wb_touch_sensor_get_value -wb_touch_sensor_get_values -wb_touch_sensor_get_lookup_table_size -wb_touch_sensor_get_lookup_table -wb_vacuum_gripper_disable_presence -wb_vacuum_gripper_enable_presence -wb_vacuum_gripper_get_presence -wb_vacuum_gripper_get_presence_sampling_period -wb_vacuum_gripper_is_on -wb_vacuum_gripper_turn_on -wb_vacuum_gripper_turn_off -wbr_accelerometer_set_values -wbr_camera_get_image_buffer -wbr_camera_set_image -wbr_camera_set_focal_distance -wbr_camera_set_fov -wbr_compass_set_values -wbr_display_save_image -wbr_distance_sensor_set_value -wbr_gps_set_values -wbr_gyro_set_values -wbr_light_sensor_set_value -wbr_microphone_set_buffer -wbr_motor_set_force_feedback -wbr_motor_set_torque_feedback -wbr_position_sensor_set_value -wbr_robot_battery_sensor_set_value -wbr_touch_sensor_set_value -wbr_touch_sensor_set_values -wbu_default_robot_window_configure -wbu_default_robot_window_update -wbu_default_robot_window_set_images_max_size -wbu_motion_delete -wbu_motion_get_duration -wbu_motion_get_time -wbu_motion_is_over -wbu_motion_new -wbu_motion_play -wbu_motion_set_loop -wbu_motion_set_reverse -wbu_motion_set_time -wbu_motion_stop -wbu_robot_window_configure -wbu_robot_window_update -wbu_string_replace -wbu_string_strsep -wbu_system_getenv -wbu_system_short_path diff --git a/src/controller/c/Makefile b/src/controller/c/Makefile index 00ea8b16b26..636b985d47c 100644 --- a/src/controller/c/Makefile +++ b/src/controller/c/Makefile @@ -61,7 +61,7 @@ endif ifeq ($(OSTYPE),windows) CFLAGS = -Wall -mwindows -frandom-seed=0 -D LIBCONTROLLER_VERSION='$(LIBCONTROLLER_VERSION)' INCLUDE = -I$(WEBOTS_HOME_PATH)/include/controller/c -I$(WEBOTS_HOME_PATH)/include -I/mingw64/include -LD_FLAGS = -shared -mwindows --def Controller.def -lws2_32 +LD_FLAGS = -shared -mwindows -lws2_32 -Wl,--out-implib,$(WEBOTS_CONTROLLER_LIB_PATH)/libController.a PLATFORM = win32 CC = gcc TARGET = $(WEBOTS_CONTROLLER_LIB_PATH)/Controller.dll $(WEBOTS_CONTROLLER_LIB_PATH)/Controller.lib @@ -126,12 +126,16 @@ ifeq ($(OSTYPE),windows) MINGW64_OBJECTS = $(addprefix $(OBJDIR)/, $(OBJECTS)) -$(WEBOTS_CONTROLLER_LIB_PATH)/Controller.dll: $(MINGW64_OBJECTS) Controller.def +$(WEBOTS_CONTROLLER_LIB_PATH)/Controller.dll: $(MINGW64_OBJECTS) @echo "# linking "$@ @echo "# linking "$(WEBOTS_CONTROLLER_LIB_PATH)"/libController.a" - @$(CC) -o $@ $(addprefix $(OBJDIR)/, $(OBJECTS)) $(LD_FLAGS) -Wl,--out-implib,$(WEBOTS_CONTROLLER_LIB_PATH)/libController.a + @$(CC) -o $@ $(addprefix $(OBJDIR)/, $(OBJECTS)) $(LD_FLAGS) -$(WEBOTS_CONTROLLER_LIB_PATH)/Controller.lib: $(WEBOTS_CONTROLLER_LIB_PATH)/Controller.dll Controller.def +Controller.def: $(WEBOTS_CONTROLLER_LIB_PATH)/Controller.dll + @echo "# generating "$@ + @dlltool --export-all-symbols -z Controller.def $(WEBOTS_CONTROLLER_LIB_PATH)/Controller.dll + +$(WEBOTS_CONTROLLER_LIB_PATH)/Controller.lib: Controller.def ifeq ($(VISUAL_STUDIO_PATH),) @$(ECHO) "# \033[0;33m'VISUAL_STUDIO_PATH' not set, skipping Controller.lib\033[0m" else @@ -195,3 +199,4 @@ $(OBJDIR)/%.d:%.c FILES_TO_REMOVE = $(TARGET) FILES_TO_REMOVE += $(WEBOTS_CONTROLLER_LIB_PATH)/libController.a FILES_TO_REMOVE += $(WEBOTS_CONTROLLER_LIB_PATH)/libController.lib +FILES_TO_REMOVE += Controller.def diff --git a/src/controller/cpp/Makefile b/src/controller/cpp/Makefile index 89ccd7da9a2..85d40582377 100644 --- a/src/controller/cpp/Makefile +++ b/src/controller/cpp/Makefile @@ -90,7 +90,7 @@ LIBCONTROLLER = $(WEBOTS_CONTROLLER_LIB_PATH)/Controller.dll SHAREDLIBS = $(LIBCONTROLLER) CPPFLAGS = -c -Wall -mwindows CPPINCLUDES = -I$(WEBOTS_HOME_PATH)/include/controller/c -I$(WEBOTS_HOME_PATH)/include/controller/cpp -TARGET = $(WEBOTS_CONTROLLER_LIB_PATH)/CppController.dll +TARGET = $(WEBOTS_CONTROLLER_LIB_PATH)/CppController.dll $(WEBOTS_CONTROLLER_LIB_PATH)/CppController.lib endif ifeq ($(OSTYPE),darwin) @@ -136,7 +136,9 @@ $(BUILD_GOAL_DIR)/arm64/libCppController.dylib: $(ARM64_OBJECTS) @echo "# linking" $@ "(arm64)" @$(CXX) -target arm64-apple-macos12 $(LDFLAGS) $(ARM64_OBJECTS) $(SHAREDLIBS) -o "$@" -else +endif + +ifeq ($(OSTYPE),linux) $(TARGET):$(CPPOBJS) $(LIBCONTROLLER) @echo "# linking" $@ @@ -144,6 +146,28 @@ $(TARGET):$(CPPOBJS) $(LIBCONTROLLER) endif +ifeq ($(OSTYPE),windows) + +$(WEBOTS_CONTROLLER_LIB_PATH)/CppController.dll:$(CPPOBJS) $(LIBCONTROLLER) + @echo "# linking" $@ + @$(CXX) $(LDFLAGS) $(CPPOBJS) $(SHAREDLIBS) -o "$@" + +CppController.def: $(WEBOTS_CONTROLLER_LIB_PATH)/CppController.dll + @echo "# generating "$@ + @dlltool --export-all-symbols -z CppController.def $(WEBOTS_CONTROLLER_LIB_PATH)/CppController.dll + +$(WEBOTS_CONTROLLER_LIB_PATH)/CppController.lib: CppController.def +ifeq ($(VISUAL_STUDIO_PATH),) + @$(ECHO) "# \033[0;33m'VISUAL_STUDIO_PATH' not set, skipping CppController.lib\033[0m" +else + @echo "# creating "$@ + @PATH="$(VISUAL_STUDIO_PATH)/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64":$PATH lib /machine:X64 /def:CppController.def /out:CppController.lib > /dev/null + @mv CppController.lib "$(WEBOTS_CONTROLLER_LIB_PATH)" + @rm CppController.exp +endif + +endif + $(LIBCONTROLLER): @echo "Warning: $(LIBCONTROLLER) doesn't exist, rebuild it first." diff --git a/src/ode/ode.def b/src/ode/ode.def deleted file mode 100644 index 17ba86a738d..00000000000 --- a/src/ode/ode.def +++ /dev/null @@ -1,649 +0,0 @@ -EXPORTS -dAlloc -dAllocateODEDataForThread -dAreConnected -dAreConnectedExcluding -dAreGeomsSame -dAreLinked -dBodyAddForce -dBodyAddForceAtPos -dBodyAddForceAtRelPos -dBodyAddRelForce -dBodyAddRelForceAtPos -dBodyAddRelForceAtRelPos -dBodyAddRelTorque -dBodyAddTorque -dBodyCopyPosition -dBodyCopyQuaternion -dBodyCopyRotation -dBodyCreate -dBodyDestroy -dBodyDisable -dBodyEnable -dBodyGetAngularDamping -dBodyGetAngularDampingThreshold -dBodyGetAngularVel -dBodyGetAutoDisableAngularThreshold -dBodyGetAutoDisableAverageSamplesCount -dBodyGetAutoDisableFlag -dBodyGetAutoDisableLinearThreshold -dBodyGetAutoDisableSteps -dBodyGetAutoDisableTime -dBodyGetData -dBodyGetFiniteRotationAxis -dBodyGetFiniteRotationMode -dBodyGetFirstGeom -dBodyGetForce -dBodyGetGravityMode -dBodyGetGyroscopicMode -dBodyGetImmersionLink -dBodyGetJoint -dBodyGetLinearDamping -dBodyGetLinearDampingThreshold -dBodyGetLinearVel -dBodyGetMass -dBodyGetMaxAngularSpeed -dBodyGetNextGeom -dBodyGetNumImmersionLinks -dBodyGetNumJoints -dBodyGetPointVel -dBodyGetPosRelPoint -dBodyGetPosition -dBodyGetQuaternion -dBodyGetRelPointPos -dBodyGetRelPointVel -dBodyGetRotation -dBodyGetTorque -dBodyGetWorld -dBodyIsEnabled -dBodyIsKinematic -dBodySetAngularDamping -dBodySetAngularDampingThreshold -dBodySetAngularVel -dBodySetAutoDisableAngularThreshold -dBodySetAutoDisableAverageSamplesCount -dBodySetAutoDisableDefaults -dBodySetAutoDisableFlag -dBodySetAutoDisableLinearThreshold -dBodySetAutoDisableSteps -dBodySetAutoDisableTime -dBodySetDamping -dBodySetDampingDefaults -dBodySetData -dBodySetDynamic -dBodySetFiniteRotationAxis -dBodySetFiniteRotationMode -dBodySetForce -dBodySetGravityMode -dBodySetGyroscopicMode -dBodySetKinematic -dBodySetLinearDamping -dBodySetLinearDampingThreshold -dBodySetLinearVel -dBodySetMass -dBodySetMaxAngularSpeed -dBodySetMovedCallback -dBodySetPosition -dBodySetQuaternion -dBodySetRotation -dBodySetTorque -dBodyVectorFromWorld -dBodyVectorToWorld -dBoxBox -dBoxTouchesBox -dCheckConfiguration -dCleanupODEAllDataForThread -dClearUpperTriangle -dCloseODE -dClosestLineSegmentPoints -dClusterGetCenter -dClusterGetClusterAABBs -dClusterGetCount -dClusterGetGridStep -dCollide -dConnectingJoint -dConnectingJointList -dCreateBox -dCreateCapsule -dCreateConvex -dCreateCylinder -dCreateGeom -dCreateGeomClass -dCreateGeomTransform -dCreateHeightfield -dCreatePlane -dCreateRay -dCreateSphere -dCreateTriMesh -dDQfromW -dDebug -dDot -dError -dFactorCholesky -dFactorLDLT -dFluidCreate -dFluidDestroy -dFluidDisable -dFluidDynamicsStep -dFluidEnable -dFluidGetData -dFluidGetDensity -dFluidGetFirstGeom -dFluidGetImmersionLink -dFluidGetNextGeom -dFluidGetNumImmersionLinks -dFluidGetStreamVel -dFluidGetViscosity -dFluidGetWorld -dFluidIsEnabled -dFluidSetData -dFluidSetDensity -dFluidSetStreamVel -dFluidSetViscosity -dFree -dGeomBoxGetArea -dGeomBoxGetFacePlane -dGeomBoxGetImmersionPlane -dGeomBoxGetLengths -dGeomBoxGetTangentPlane -dGeomBoxGetVolume -dGeomBoxPointDepth -dGeomBoxSetLengths -dGeomCapsuleGetArea -dGeomCapsuleGetImmersionPlane -dGeomCapsuleGetParams -dGeomCapsuleGetTangentPlane -dGeomCapsuleGetVolume -dGeomCapsulePointDepth -dGeomCapsuleSetParams -dGeomClearOffset -dGeomCopyOffsetPosition -dGeomCopyOffsetRotation -dGeomCopyPosition -dGeomCopyRotation -dGeomCylinderGetArea -dGeomCylinderGetDiskPlane -dGeomCylinderGetImmersionPlane -dGeomCylinderGetParams -dGeomCylinderGetTangentPlane -dGeomCylinderGetVolume -dGeomCylinderPointDepth -dGeomCylinderSetParams -dGeomDestroy -dGeomDisable -dGeomEnable -dGeomGetAABB -dGeomGetArea -dGeomGetBody -dGeomGetBodyNext -dGeomGetCategoryBits -dGeomGetClass -dGeomGetClassData -dGeomGetCollideBits -dGeomGetData -dGeomGetFlags -dGeomGetFluid -dGeomGetFluidNext -dGeomGetImmersionPlane -dGeomGetOffsetPosition -dGeomGetOffsetQuaternion -dGeomGetOffsetRotation -dGeomGetPosRelPoint -dGeomGetPosition -dGeomGetQuaternion -dGeomGetRelPointPos -dGeomGetRotation -dGeomGetSpace -dGeomGetVolume -dGeomHeightfieldDataBuildByte -dGeomHeightfieldDataBuildCallback -dGeomHeightfieldDataBuildDouble -dGeomHeightfieldDataBuildShort -dGeomHeightfieldDataBuildSingle -dGeomHeightfieldDataCreate -dGeomHeightfieldDataDestroy -dGeomHeightfieldDataSetBounds -dGeomHeightfieldGetHeightfieldData -dGeomHeightfieldSetHeightfieldData -dGeomIsBelowImmersionPlane -dGeomIsEnabled -dGeomIsInside -dGeomIsOffset -dGeomIsSpace -dGeomLowLevelControl -dGeomMoved -dGeomPlaneGetParams -dGeomPlanePointDepth -dGeomPlaneSetParams -dGeomRayGet -dGeomRayGetClosestHit -dGeomRayGetLength -dGeomRayGetParams -dGeomRaySet -dGeomRaySetClosestHit -dGeomRaySetLength -dGeomRaySetParams -dGeomSetBody -dGeomSetCategoryBits -dGeomSetCollideBits -dGeomSetConvex -dGeomSetData -dGeomSetDynamicFlag -dGeomSetFluid -dGeomSetOffsetPosition -dGeomSetOffsetQuaternion -dGeomSetOffsetRotation -dGeomSetOffsetWorldPosition -dGeomSetOffsetWorldQuaternion -dGeomSetOffsetWorldRotation -dGeomSetPosition -dGeomSetQuaternion -dGeomSetRotation -dGeomSphereGetArea -dGeomSphereGetImmersionPlane -dGeomSphereGetRadius -dGeomSphereGetTangentPlane -dGeomSphereGetVolume -dGeomSpherePointDepth -dGeomSphereSetRadius -dGeomTransformGetCleanup -dGeomTransformGetGeom -dGeomTransformGetInfo -dGeomTransformSetCleanup -dGeomTransformSetGeom -dGeomTransformSetInfo -dGeomTriMeshClearTCCache -dGeomTriMeshDataBuildDouble -dGeomTriMeshDataBuildDouble1 -dGeomTriMeshDataBuildSimple -dGeomTriMeshDataBuildSimple1 -dGeomTriMeshDataBuildSingle -dGeomTriMeshDataBuildSingle1 -dGeomTriMeshDataCreate -dGeomTriMeshDataDestroy -dGeomTriMeshDataGet -dGeomTriMeshDataGetBuffer -dGeomTriMeshDataPreprocess -dGeomTriMeshDataSet -dGeomTriMeshDataSetBuffer -dGeomTriMeshDataUpdate -dGeomTriMeshEnableTC -dGeomTriMeshGetArea -dGeomTriMeshGetArrayCallback -dGeomTriMeshGetBoundingPlane -dGeomTriMeshGetCallback -dGeomTriMeshGetCenterOfMass -dGeomTriMeshGetData -dGeomTriMeshGetImmersionPlane -dGeomTriMeshGetInertiaMatrix -dGeomTriMeshGetLastTransform -dGeomTriMeshGetPoint -dGeomTriMeshGetRayCallback -dGeomTriMeshGetRelCenterOfMass -dGeomTriMeshGetTriMergeCallback -dGeomTriMeshGetTriMeshDataID -dGeomTriMeshGetTriangle -dGeomTriMeshGetTriangleCount -dGeomTriMeshGetVolume -dGeomTriMeshIsTCEnabled -dGeomTriMeshPointDepth -dGeomTriMeshSetArrayCallback -dGeomTriMeshSetCallback -dGeomTriMeshSetData -dGeomTriMeshSetLastTransform -dGeomTriMeshSetRayCallback -dGeomTriMeshSetTriMergeCallback -dGeomVectorFromWorld -dGeomVectorToWorld -dGetAllocHandler -dGetConfiguration -dGetDebugHandler -dGetErrorHandler -dGetFreeHandler -dGetMessageHandler -dGetReallocHandler -dHashSpaceCreate -dHashSpaceGetLevels -dHashSpaceSetLevels -dImmerse -dImmersionLinkAttach -dImmersionLinkCreate -dImmersionLinkDestroy -dImmersionLinkDisable -dImmersionLinkEnable -dImmersionLinkGroupCreate -dImmersionLinkGroupDestroy -dImmersionLinkGroupEmpty -dImmersionLinkSetData -dImmersionOutlineCreate -dImmersionOutlineDestroy -dImmersionOutlineGetCurvedEdge -dImmersionOutlineGetCurvedEdgesSize -dImmersionOutlineGetStraightEdge -dImmersionOutlineGetStraightEdgeEnd -dImmersionOutlineGetStraightEdgeOrigin -dImmersionOutlineGetStraightEdgesSize -dInfiniteAABB -dInitODE -dInitODE2 -dInvertPDMatrix -dIsPositiveDefinite -dJointAddAMotorTorques -dJointAddHinge2Torques -dJointAddHingeTorque -dJointAddPRTorque -dJointAddPistonForce -dJointAddSliderForce -dJointAddUniversalTorques -dJointAttach -dJointCreateAMotor -dJointCreateBall -dJointCreateContact -dJointCreateFixed -dJointCreateHinge -dJointCreateHinge2 -dJointCreateLMotor -dJointCreateNull -dJointCreatePR -dJointCreatePU -dJointCreatePiston -dJointCreatePlane2D -dJointCreateSlider -dJointCreateUniversal -dJointDestroy -dJointDisable -dJointEnable -dJointGetAMotorAngle -dJointGetAMotorAngleRate -dJointGetAMotorAxis -dJointGetAMotorAxisRel -dJointGetAMotorMode -dJointGetAMotorNumAxes -dJointGetAMotorParam -dJointGetBallAnchor -dJointGetBallAnchor2 -dJointGetBallParam -dJointGetBody -dJointGetData -dJointGetFeedback -dJointGetFixedParam -dJointGetHinge2Anchor -dJointGetHinge2Anchor2 -dJointGetHinge2Angle1 -dJointGetHinge2Angle1Rate -dJointGetHinge2Angle2 -dJointGetHinge2Angle2Rate -dJointGetHinge2Axis1 -dJointGetHinge2Axis2 -dJointGetHinge2Param -dJointGetHinge2SuspensionAxis -dJointGetHingeAnchor -dJointGetHingeAnchor2 -dJointGetHingeAngle -dJointGetHingeAngleRate -dJointGetHingeAxis -dJointGetHingeParam -dJointGetHingeSuspensionAxis -dJointGetLMotorAxis -dJointGetLMotorNumAxes -dJointGetLMotorParam -dJointGetLMotorPosition -dJointGetNumBodies -dJointGetPRAnchor -dJointGetPRAngle -dJointGetPRAngleRate -dJointGetPRAxis1 -dJointGetPRAxis2 -dJointGetPRParam -dJointGetPRPosition -dJointGetPRPositionRate -dJointGetPUAnchor -dJointGetPUAngle1 -dJointGetPUAngle1Rate -dJointGetPUAngle2 -dJointGetPUAngle2Rate -dJointGetPUAngles -dJointGetPUAxis1 -dJointGetPUAxis2 -dJointGetPUAxis3 -dJointGetPUAxisP -dJointGetPUParam -dJointGetPUPosition -dJointGetPUPositionRate -dJointGetPistonAnchor -dJointGetPistonAnchor2 -dJointGetPistonAngle -dJointGetPistonAngleRate -dJointGetPistonAxis -dJointGetPistonParam -dJointGetPistonPosition -dJointGetPistonPositionRate -dJointGetSliderAxis -dJointGetSliderParam -dJointGetSliderPosition -dJointGetSliderPositionRate -dJointGetType -dJointGetUniversalAnchor -dJointGetUniversalAnchor2 -dJointGetUniversalAngle1 -dJointGetUniversalAngle1Rate -dJointGetUniversalAngle2 -dJointGetUniversalAngle2Rate -dJointGetUniversalAngles -dJointGetUniversalAxis1 -dJointGetUniversalAxis2 -dJointGetUniversalParam -dJointGroupCreate -dJointGroupDestroy -dJointGroupEmpty -dJointGroupGetCount -dJointIsEnabled -dJointSetAMotorAngle -dJointSetAMotorAxis -dJointSetAMotorMode -dJointSetAMotorNumAxes -dJointSetAMotorParam -dJointSetBallAnchor -dJointSetBallAnchor2 -dJointSetBallParam -dJointSetData -dJointSetFeedback -dJointSetFixed -dJointSetFixedParam -dJointSetHinge2Anchor -dJointSetHinge2Axis1 -dJointSetHinge2Axis2 -dJointSetHinge2Param -dJointSetHinge2SuspensionAxis -dJointSetHingeAnchor -dJointSetHingeAnchorDelta -dJointSetHingeAxis -dJointSetHingeAxisOffset -dJointSetHingeParam -dJointSetHingeSuspensionAxis -dJointSetLMotorAxis -dJointSetLMotorNumAxes -dJointSetLMotorParam -dJointSetLMotorPosition -dJointSetPRAnchor -dJointSetPRAxis1 -dJointSetPRAxis2 -dJointSetPRParam -dJointSetPUAnchor -dJointSetPUAnchorDelta -dJointSetPUAnchorOffset -dJointSetPUAxis1 -dJointSetPUAxis2 -dJointSetPUAxis3 -dJointSetPUAxisP -dJointSetPUParam -dJointSetPistonAnchor -dJointSetPistonAnchorOffset -dJointSetPistonAxis -dJointSetPistonAxisDelta -dJointSetPistonParam -dJointSetPlane2DAngleParam -dJointSetPlane2DXParam -dJointSetPlane2DYParam -dJointSetSliderAxis -dJointSetSliderAxisDelta -dJointSetSliderParam -dJointSetUniversalAnchor -dJointSetUniversalAxis1 -dJointSetUniversalAxis1Offset -dJointSetUniversalAxis2 -dJointSetUniversalAxis2Offset -dJointSetUniversalParam -dLDLTAddTL -dLDLTRemove -dMakeRandomMatrix -dMakeRandomVector -dMassAdd -dMassAdjust -dMassCheck -dMassRotate -dMassSetBox -dMassSetBoxTotal -dMassSetCappedCylinder -dMassSetCappedCylinderTotal -dMassSetCapsule -dMassSetCapsuleTotal -dMassSetCylinder -dMassSetCylinderTotal -dMassSetParameters -dMassSetSphere -dMassSetSphereTotal -dMassSetTrimesh -dMassSetTrimeshTotal -dMassSetZero -dMassTranslate -dMaxDifference -dMaxDifferenceLowerTriangle -dMessage -dMultiply0 -dMultiply1 -dMultiply2 -dNormalize3 -dNormalize4 -dOrthogonalizeR -dPlaneSpace -dPrintMatrix -dQFromAxisAndAngle -dQMultiply0 -dQMultiply1 -dQMultiply2 -dQMultiply3 -dQSetIdentity -dQfromR -dQuadTreeSpaceCreate -dRFrom2Axes -dRFromAxisAndAngle -dRFromEulerAngles -dRFromZAxis -dRSetIdentity -dRand -dRandGetSeed -dRandInt -dRandReal -dRandSetSeed -dRealloc -dRemoveRowCol -dRfromQ -dSafeNormalize3 -dSafeNormalize4 -dSetAllocHandler -dSetColliderOverride -dSetDebugHandler -dSetErrorHandler -dSetFreeHandler -dSetMessageHandler -dSetReallocHandler -dSetValue -dSetZero -dSimpleSpaceCreate -dSolveCholesky -dSolveL1 -dSolveL1T -dSolveLDLT -dSpaceAdd -dSpaceClean -dSpaceCollide -dSpaceCollide2 -dSpaceCollideAndWorldStep -dSpaceDestroy -dSpaceGetClass -dSpaceGetCleanup -dSpaceGetGeom -dSpaceGetManualCleanup -dSpaceGetNumGeoms -dSpaceGetSublevel -dSpaceQuery -dSpaceRemove -dSpaceSetCleanup -dSpaceSetManualCleanup -dSpaceSetSublevel -dStopwatchReset -dStopwatchStart -dStopwatchStop -dStopwatchTime -dSweepAndPruneSpaceCreate -dTestDataStructures -dTestRand -dTestSolveLCP -dTimerEnd -dTimerNow -dTimerReport -dTimerResolution -dTimerStart -dTimerTicksPerSecond -dToggleODE_MT -dVectorScale -dWorldCleanupWorkingMemory -dWorldCreate -dWorldDestroy -dWorldExportDIF -dWorldGetAngularDamping -dWorldGetAngularDampingThreshold -dWorldGetAutoDisableAngularThreshold -dWorldGetAutoDisableAverageSamplesCount -dWorldGetAutoDisableFlag -dWorldGetAutoDisableLinearThreshold -dWorldGetAutoDisableSteps -dWorldGetAutoDisableTime -dWorldGetCFM -dWorldGetContactMaxCorrectingVel -dWorldGetContactSurfaceLayer -dWorldGetERP -dWorldGetGravity -dWorldGetLinearDamping -dWorldGetLinearDampingThreshold -dWorldGetMaxAngularSpeed -dWorldGetQuickStepNumIterations -dWorldGetQuickStepW -dWorldImpulseToForce -dWorldQuickStep -dWorldRefreshParameters -dWorldSetAngularDamping -dWorldSetAngularDampingThreshold -dWorldSetAutoDisableAngularThreshold -dWorldSetAutoDisableAverageSamplesCount -dWorldSetAutoDisableFlag -dWorldSetAutoDisableLinearThreshold -dWorldSetAutoDisableSteps -dWorldSetAutoDisableTime -dWorldSetCFM -dWorldSetContactMaxCorrectingVel -dWorldSetContactSurfaceLayer -dWorldSetDamping -dWorldSetERP -dWorldSetGravity -dWorldSetLinearDamping -dWorldSetLinearDampingThreshold -dWorldSetMaxAngularSpeed -dWorldSetQuickStepNumIterations -dWorldSetQuickStepW -dWorldSetStepMemoryManager -dWorldSetStepMemoryReservationPolicy -dWorldStep -dWorldStepAndSpaceCollide -dWorldUseSharedWorkingMemory diff --git a/tests/sources/test_matlab_functions.py b/tests/sources/test_matlab_functions.py old mode 100755 new mode 100644 index 78cd55e9201..8f1f9c9aec1 --- a/tests/sources/test_matlab_functions.py +++ b/tests/sources/test_matlab_functions.py @@ -16,8 +16,12 @@ """Test that all the required Matlab functions are defined.""" import unittest +import glob import os +import re +import subprocess import sys + WEBOTS_HOME = os.path.normpath(os.environ['WEBOTS_HOME']) sys.path.append(os.path.join(WEBOTS_HOME, 'src', 'controller', 'matlab')) import mgenerate # noqa: E402 @@ -30,38 +34,68 @@ def setUp(self): if sys.version_info[0] >= 3: mgenerate.UPDATE = False mgenerate.main() - """Get all the required function.""" + """Get all the required functions.""" skippedLines = [ - 'wbr', - 'microphone', - 'remote_control', - 'robot', - 'wb_device_get_type', - 'wb_node_get_name', - 'wbu_string', - 'lookup_table_size', - 'EXPORTS' + # Patterns + '.*_H', # Header Guards + '.*_', # Some comments use the ..._* pattern to refer to a group of functions ; + # grep will filter the *, but no function should end with _ + 'wb_camera_image_get_.*', # The Matlab API exposes the image data as a multidimensional array, + # so these functions are not needed + 'wb_(microphone|radio)_.*', # Experimental Node Types + 'wb_remote_control_.*', 'wbr_.*', # Remote Control Plugin + 'wb_robot_.*', # Many robot functions are used internally by the C API (e.x. wb_robot_mutex_*) + '.*_lookup_table_size', # Matlab lets you get the size of an array, so these functions are not needed + 'wbu_string_.*', # String manipulation functions are not needed + + # Specific Functions + + # Non-Function Macros + 'WB_ALLOW_MIXING_C_AND_CPP_API', + 'WB_DEPRECATED', + 'WB_MATLAB_LOADLIBRARY', + 'WB_USING_C(PP)?_API', + + # These functions are used internally by the Matlab API + 'wb_camera_recognition_get_object', + 'wb_lidar_get_point', + 'wb_mouse_get_state_pointer', + 'wb_radar_get_target', + + 'wb_device_get_type', # Deprecated since 8.0.0 + 'wb_node_get_name', # C API Only + + # Not Yet Implemented + 'wbu_system_tmpdir', + 'wbu_system_webots_instance_path', ] self.functions = [] - filename = os.path.join(WEBOTS_HOME, 'src', 'controller', 'c', 'Controller.def') - self.assertTrue( - os.path.isfile(filename), - msg='Missing "%s" file.' % filename - ) - with open(filename) as file: - for line in file: - if not any(skippedLine in line for skippedLine in skippedLines) and not line[3:].isupper(): - self.functions.append(line.replace('\n', '')) + + symbolSearch = subprocess.run([ + # Search for webots definitions + 'grep', '-Ehio', r'\bwb_\w+\b', + # In the controller headers + *glob.glob(os.path.join(WEBOTS_HOME, 'include', 'controller', 'c', 'webots', '*.h')), + *glob.glob(os.path.join(WEBOTS_HOME, 'include', 'controller', 'c', 'webots', 'utils', '*.h')) + ], capture_output=True, text=True) + if symbolSearch.returncode != 0: + self.fail(f'Failed to generate function list:\n{symbolSearch.stdout}') + + for line in symbolSearch.stdout.splitlines(): + if not any(re.match(f'^{skippedLine}$', line) for skippedLine in skippedLines) and line not in self.functions: + self.functions.append(line) @unittest.skipIf(sys.version_info[0] < 3, "not supported by Python 2.7") def test_matlab_function_exists(self): """Test that the function file exists.""" - for function in self.functions: - filename = os.path.join(WEBOTS_HOME, 'lib', 'controller', 'matlab', function + '.m') - self.assertTrue( - os.path.isfile(filename), - msg='Missing "%s" file.' % filename - ) + expectedFiles = (os.path.join(WEBOTS_HOME, 'lib', 'controller', 'matlab', function + '.m') + for function in self.functions) + missingFiles = [file for file in expectedFiles if not os.path.isfile(file)] + + self.assertTrue( + not missingFiles, + msg='Missing files: %s' % ', '.join(missingFiles) + ) if __name__ == '__main__':