update 24/2
This commit is contained in:
@@ -241,6 +241,7 @@ namespace NavigationExample
|
||||
[return: MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool navigation_get_feedback(NavigationHandle handle, ref NavFeedback out_feedback);
|
||||
|
||||
|
||||
/// <summary>Helper: copy unmanaged char* to managed string; does not free the pointer.</summary>
|
||||
public static string MarshalString(IntPtr p)
|
||||
{
|
||||
@@ -572,8 +573,14 @@ namespace NavigationExample
|
||||
Marshal.OffsetOf<NavigationAPI.OccupancyGrid>("data_count"));
|
||||
|
||||
NavigationAPI.navigation_add_static_map(navHandle, "/map", occupancyGrid);
|
||||
|
||||
// Cleanup
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
|
||||
NavigationAPI.Twist2DStamped twist = new NavigationAPI.Twist2DStamped();
|
||||
if (NavigationAPI.navigation_get_twist(navHandle, ref twist))
|
||||
{
|
||||
Console.WriteLine("Twist: {0}, {1}, {2}, {3}", NavigationAPI.MarshalString(twist.header.frame_id), twist.velocity.x, twist.velocity.y, twist.velocity.theta);
|
||||
} // Cleanup
|
||||
NavigationAPI.navigation_destroy(navHandle);
|
||||
NavigationAPI.tf_listener_destroy(tfHandle);
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user