UBCSailbot / raye-local-pathfinding

UBC Sailbot's Local Pathfinding Repository: OMPL-based pathfinding that avoids upwind/downwind sailing, minimizes turning, and minimizes path length.
https://www.ubcsailbot.org/
MIT License
2 stars 0 forks source link

Add ability to corrupt/break sensors #262

Open tylerlum opened 2 years ago

tylerlum commented 2 years ago

Modify MOCK_sensors.py so that we can easily break a sensor so we can validate our performance with a broken sensor in real testing.

Involves 4 files to change: MOCK_sensors.py Look for

self.publisher.publish(data)

Then above, modify data conditionally on parameters. (one for each sensor) Something like

        if rospy.get_param('corrupt_w', default=False):
            rospy.logwarn("MOCK sensors publishing broken wind sensor")
            data.wind_sensor_1_angle_degrees = 0

Other things are launch files. Main thing to change in in MOCK_sensors.launch Follow this as an example:

    <!-- Sets if changes in heading and speed should be smooth or not -->
    <arg name="smooth_changes" default="true" />
    <param name="smooth_changes" type="bool" value="$(arg smooth_changes)" />

Also need to modify all.launch and launch_all_mocks.launch, as they "pass in parameters" to each other Eg.

    <arg name="sensor_noise" default="false" />
    <include file="$(find local_pathfinding)/launch/launch_all_mocks.launch">
...
      <arg name="sensor_noise" value="$(arg sensor_noise)" />
...
    </include>