CARLA
Loading...
Searching...
No Matches
test_multigpu_mirror.cpp File Reference
#include "test.h"
#include <carla/multigpu/frameDataCodec.h>
#include <carla/multigpu/mirrorPackets.h>
#include <algorithm>
#include <cstring>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>

Go to the source code of this file.

Classes

struct  MirroredPosition
 One record of frame data packet 34: an actor's world pose as the primary holds it, in UE units, with its rotation as a quaternion (an Euler round trip snaps pitch near +-90 degrees, e.g. More...
struct  MirroredPositions
 Frame data packet 34: every live actor's pose in this frame. More...

Functions

std::vector< uint32_t > OrderParentsFirst (const std::vector< uint32_t > &ids, const std::unordered_map< uint32_t, uint32_t > &parents)
 Order in which to place actors so that every parent is placed before its children: by attachment depth, keeping the input order within a depth.
 TEST (MultiGpuMirror, missing_parent_and_cycle_are_guarded)
 TEST (MultiGpuMirror, order_parents_first_depth_two)
 TEST (MultiGpuMirror, positions_from_a_newer_build_keep_their_known_fields)
 TEST (MultiGpuMirror, positions_round_trip_bit_exact)
 TEST (MultiGpuMirror, truncated_positions_fail)
 TEST (MultiGpuMirror, truncated_vehicle_parts_fail)
 TEST (MultiGpuMirror, vehicle_parts_from_a_newer_build_keep_their_known_fields)
 TEST (MultiGpuMirror, vehicle_parts_round_trip)

Function Documentation

◆ OrderParentsFirst()

std::vector< uint32_t > carla::multigpu::OrderParentsFirst ( const std::vector< uint32_t > & ids,
const std::unordered_map< uint32_t, uint32_t > & parents )
inline

Order in which to place actors so that every parent is placed before its children: by attachment depth, keeping the input order within a depth.

parents maps an id to its parent's id (absent or 0 for a root). A parent that is not among ids counts as a root, and so does every actor of a cycle, so the result always holds every id once.

Definition at line 257 of file mirrorPackets.h.

Referenced by TEST(), and TEST().

◆ TEST() [1/8]

TEST ( MultiGpuMirror ,
missing_parent_and_cycle_are_guarded  )

Definition at line 112 of file test_multigpu_mirror.cpp.

References OrderParentsFirst(), and TEST().

◆ TEST() [2/8]

TEST ( MultiGpuMirror ,
order_parents_first_depth_two  )

Definition at line 104 of file test_multigpu_mirror.cpp.

References OrderParentsFirst(), and TEST().

◆ TEST() [3/8]

TEST ( MultiGpuMirror ,
positions_from_a_newer_build_keep_their_known_fields  )

◆ TEST() [4/8]

◆ TEST() [5/8]

◆ TEST() [6/8]

◆ TEST() [7/8]

◆ TEST() [8/8]