@@ -168,6 +168,109 @@ def getLidarData(self, lidar_name = '', vehicle_name = ''):
168168 def simGetLidarSegmentation (self , lidar_name = '' , vehicle_name = '' ):
169169 return self .client .call ('simGetLidarSegmentation' , lidar_name , vehicle_name )
170170
171+ # Plotting APIs
172+ def simFlushPersistentMarkers (self ):
173+ """
174+ Clear any persistent markers - those plotted with setting is_persistent=True in the APIs below
175+ """
176+ self .client .call ('simFlushPersistentMarkers' )
177+
178+ def simPlotPoints (self , points , color_rgba = [1.0 , 0.0 , 0.0 , 1.0 ], size = 10.0 , duration = - 1.0 , is_persistent = False ):
179+ """
180+ Plot a list of 3D points in World NED frame
181+
182+ Args:
183+ points (list[Vector3r]): List of Vector3r objects
184+ color_rgba (list, optional): desired RGBA values from 0.0 to 1.0
185+ size (float, optional): Size of plotted point
186+ duration (float, optional): Duration (seconds) to plot for
187+ is_persistent (bool, optional): If set to True, the desired object will be plotted for infinite time.
188+ """
189+ self .client .call ('simPlotPoints' , points , color_rgba , size , duration , is_persistent )
190+
191+ def simPlotLineStrip (self , points , color_rgba = [1.0 , 0.0 , 0.0 , 1.0 ], thickness = 5.0 , duration = - 1.0 , is_persistent = False ):
192+ """
193+ Plots a line strip in World NED frame, defined from points[0] to points[1], points[1] to points[2], ... , points[n-2] to points[n-1]
194+
195+ Args:
196+ points (list[Vector3r]): List of 3D locations of line start and end points, specified as Vector3r objects
197+ color_rgba (list, optional): desired RGBA values from 0.0 to 1.0
198+ thickness (float, optional): Thickness of line
199+ duration (float, optional): Duration (seconds) to plot for
200+ is_persistent (bool, optional): If set to True, the desired object will be plotted for infinite time.
201+ """
202+ self .client .call ('simPlotLineStrip' , points , color_rgba , thickness , duration , is_persistent )
203+
204+ def simPlotLineList (self , points , color_rgba = [1.0 , 0.0 , 0.0 , 1.0 ], thickness = 5.0 , duration = - 1.0 , is_persistent = False ):
205+ """
206+ Plots a line strip in World NED frame, defined from points[0] to points[1], points[2] to points[3], ... , points[n-2] to points[n-1]
207+
208+ Args:
209+ points (list[Vector3r]): List of 3D locations of line start and end points, specified as Vector3r objects. Must be even
210+ color_rgba (list, optional): desired RGBA values from 0.0 to 1.0
211+ thickness (float, optional): Thickness of line
212+ duration (float, optional): Duration (seconds) to plot for
213+ is_persistent (bool, optional): If set to True, the desired object will be plotted for infinite time.
214+ """
215+ self .client .call ('simPlotLineList' , points , color_rgba , thickness , duration , is_persistent )
216+
217+ def simPlotArrows (self , points_start , points_end , color_rgba = [1.0 , 0.0 , 0.0 , 1.0 ], thickness = 5.0 , arrow_size = 2.0 , duration = - 1.0 , is_persistent = False ):
218+ """
219+ Plots a list of arrows in World NED frame, defined from points_start[0] to points_end[0], points_start[1] to points_end[1], ... , points_start[n-1] to points_end[n-1]
220+
221+ Args:
222+ points_start (list[Vector3r]): List of 3D start positions of arrow start positions, specified as Vector3r objects
223+ points_end (list[Vector3r]): List of 3D end positions of arrow start positions, specified as Vector3r objects
224+ color_rgba (list, optional): desired RGBA values from 0.0 to 1.0
225+ thickness (float, optional): Thickness of line
226+ arrow_size (float, optional): Size of arrow head
227+ duration (float, optional): Duration (seconds) to plot for
228+ is_persistent (bool, optional): If set to True, the desired object will be plotted for infinite time.
229+ """
230+ self .client .call ('simPlotArrows' , points_start , points_end , color_rgba , thickness , arrow_size , duration , is_persistent )
231+
232+
233+ def simPlotStrings (self , strings , positions , scale = 5 , color_rgba = [1.0 , 0.0 , 0.0 , 1.0 ], duration = - 1.0 ):
234+ """
235+ Plots a list of strings at desired positions in World NED frame.
236+
237+ Args:
238+ strings (list[String], optional): List of strings to plot
239+ positions (list[Vector3r]): List of positions where the strings should be plotted. Should be in one-to-one correspondence with the strings' list
240+ scale (float, optional): Font scale of transform name
241+ color_rgba (list, optional): desired RGBA values from 0.0 to 1.0
242+ duration (float, optional): Duration (seconds) to plot for
243+ """
244+ self .client .call ('simPlotStrings' , strings , positions , scale , color_rgba , duration )
245+
246+ def simPlotTransforms (self , poses , scale = 5.0 , thickness = 5.0 , duration = - 1.0 , is_persistent = False ):
247+ """
248+ Plots a list of transforms in World NED frame.
249+
250+ Args:
251+ poses (list[Pose]): List of Pose objects representing the transforms to plot
252+ scale (float, optional): Length of transforms' axes
253+ thickness (float, optional): Thickness of transforms' axes
254+ duration (float, optional): Duration (seconds) to plot for
255+ is_persistent (bool, optional): If set to True, the desired object will be plotted for infinite time.
256+ """
257+ self .client .call ('simPlotTransforms' , poses , scale , thickness , duration , is_persistent )
258+
259+ def simPlotTransformsWithNames (self , poses , names , tf_scale = 5.0 , tf_thickness = 5.0 , text_scale = 10.0 , text_color_rgba = [1.0 , 0.0 , 0.0 , 1.0 ], duration = - 1.0 ):
260+ """
261+ Plots a list of transforms with their names in World NED frame.
262+
263+ Args:
264+ poses (list[Pose]): List of Pose objects representing the transforms to plot
265+ names (list[string]): List of strings with one-to-one correspondence to list of poses
266+ tf_scale (float, optional): Length of transforms' axes
267+ tf_thickness (float, optional): Thickness of transforms' axes
268+ text_scale (float, optional): Font scale of transform name
269+ text_color_rgba (list, optional): desired RGBA values from 0.0 to 1.0 for the transform name
270+ duration (float, optional): Duration (seconds) to plot for
271+ """
272+ self .client .call ('simPlotTransformsWithNames' , poses , names , tf_scale , tf_thickness , text_scale , text_color_rgba , duration )
273+
171274 #----------- APIs to control ACharacter in scene ----------/
172275 def simCharSetFaceExpression (self , expression_name , value , character_name = "" ):
173276 self .client .call ('simCharSetFaceExpression' , expression_name , value , character_name )
0 commit comments