|
selfdriving
|
#include <mpp/interfaces/MVSIM_VehicleInterface.h>
Public Member Functions | |
| MVSIM_VehicleInterface () | |
| void | connect () |
| VehicleLocalizationState | get_localization () override |
| VehicleOdometryState | get_odometry () override |
| bool | motion_execute (const std::optional< CVehicleVelCmd::Ptr > &immediate, const std::optional< EnqueuedMotionCmd > &next) override |
| void | stop ([[maybe_unused]] const STOP_TYPE stopType) override |
| mrpt::obs::CObservation2DRangeScan::Ptr | last_lidar_obs () const override |
| Returns a copy of the last lidar observation. More... | |
Public Member Functions inherited from mpp::VehicleMotionInterface | |
| VehicleMotionInterface () | |
| virtual | ~VehicleMotionInterface () |
| virtual bool | supports_enqeued_motions () const |
| virtual bool | enqeued_motion_pending () const |
| virtual bool | enqeued_motion_timed_out () const |
| virtual std::optional< VehicleOdometryState > | enqued_motion_last_odom_when_triggered () const |
| virtual void | stop (const STOP_TYPE stopType)=0 |
| virtual void | stop_watchdog () |
| virtual void | start_watchdog ([[maybe_unused]] const size_t periodMilliseconds) |
| virtual double | robot_time () const |
| virtual void | on_nav_end_due_to_error () |
| Callback if current navigation ended due to some error. More... | |
| virtual void | on_nav_start () |
| Callback upon starting a new waypointsequence navigation. More... | |
| virtual void | on_nav_end () |
| Callback if navigation ended by an accepted trigger or reached the last specified waypoint. More... | |
| virtual void | on_path_seems_blocked () |
| Callback for when NavEngine cannot make progress to get increasingly closer to the final target during a certain period of time. It may indicate that the high-level path the vehicle is trying to follow is no longer valid due to a blocked way. On your user side, you could call NavEngine::cancel() and/or re-compute an alternative path and issue a new set of navigation waypoints or just report the error to the user. More... | |
| virtual void | on_apparent_collision () |
| Callback when the NavEngine predicts a collision with an obstacle and needed to issue a stop command. More... | |
| virtual void | on_waypoint_reached (const size_t waypoint_index, bool reached_skipped) |
| Callback upon reaching a waypoint in a waypoint sequeunce. Mostly used for logging. More... | |
| virtual void | on_cannot_get_closer_to_blocked_target () |
| Callback when NavEngine cannot reach a specified target location because there are obstacles at the specified target. More... | |
Private Member Functions | |
| void | onLidar (const mvsim_msgs::GenericObservation &o) |
Private Attributes | |
| mvsim::Client | connection_ {"MVSIM_VehicleInterface"} |
| std::string | robotName_ = "r1" |
| std::string | lidarName_ = "laser1" |
| std::mutex | lastLidarObsMtx_ |
| mrpt::obs::CObservation2DRangeScan::Ptr | lastLidarObs_ |
Vehicle adaptor class for the MVSIM simulator.
Motion commands implemented here in motion_execute():
|
inline |
|
inline |
Connect to the MVSIM server.
|
inlineoverridevirtual |
Provides access to the vehicle localization data.
The implementation should not take too much time to return, so if it might take more than ~10ms to ask the robot for the instantaneous data, it may be good enough to return the latest cached values, updated in a parallel thread.
In case of a hardware/communication error, leave valid=false in the return structure.
Implements mpp::VehicleMotionInterface.
|
inlineoverridevirtual |
Provides access to the vehicle odometry data.
The implementation should not take too much time to return, so if it might take more than ~10ms to ask the robot for the instantaneous data, it may be good enough to return the latest cached values, updated in a parallel thread.
In case of a hardware/communication error, leave valid=false in the return structure.
Implements mpp::VehicleMotionInterface.
|
inlineoverridevirtual |
Returns a copy of the last lidar observation.
Implements mpp::LidarSource.
|
inlineoverridevirtual |
Sends a motion command to the vehicle "immediate" and "next" slots.
A vehicle may accept one or more different implementation-specific CVehicleVelCmd classes.
This method resets the watchdog timer started with startWatchdog()
The vehicle should be able to execute a motion primitive ("immediate" slot) and holding a pending one ("next" slot) which will be moved to the immediate slot when a given condition holds, leaving the "next" slot free.
Possible combinations of calls to this method:
1) immediate set, next not set: replaces whatever the vehicle was doing and executes the given immediate command, dropping possible former immediate and next commands.
2) immediate set, next set: replaces both vehicle execution "slots" with the given commands.
3) immediate not set, next set: should be received by a vehicle only while there is an "immediate" motion command under execution, and the "next" slot is free. This stores a new "next" motion command, leaving the currently-executing one untouched. When the "next condition" holds true, the "next" slot will replace the "immediate" slot and "next" will be free again.
4) immediate not set, next not set: This is a "NOP" motion command, which does not change anything but let the vehicle platform know that there is someone in charge checking the path following and the way is obstacles free and safe to keep moving.
Implements mpp::VehicleMotionInterface.
|
inlineprivate |
|
inlineoverride |
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.13