Corentin Chauvin-Hameau – 2019-2020
Coverage Path Planning for an underwater robot surveying a marine farm
Public Member Functions | Private Member Functions | Private Attributes | List of all members
mfcpp::RobotSimulator Class Reference

Robot simulator. More...

#include <robot_simulator.hpp>

Collaboration diagram for mfcpp::RobotSimulator:
Collaboration graph
[legend]

Public Member Functions

 RobotSimulator ()
 
 ~RobotSimulator ()
 
void init_node ()
 Initialise the node and its parameters. More...
 
void run_node ()
 Run the simulator. More...
 
void disp_state ()
 Display the current state. More...
 

Private Member Functions

void control_input_cb (const mf_robot_simulator::Command::ConstPtr &msg)
 Callback for the control input. More...
 
void cart_input_cb (const mf_robot_simulator::CartesianCommand::ConstPtr &msg)
 Callback for the debug cartesian control input. More...
 
void pose_input_cb (const geometry_msgs::Pose::ConstPtr &msg)
 Callback for setting the pose. More...
 
void update_state (float dt)
 Updates the robot state by integrating the ODE. More...
 
void publish_state ()
 Publishes the robot state. More...
 

Private Attributes

ros::NodeHandle nh_
 ROS node handler. More...
 
ros::Subscriber control_input_sub_
 ROS subscriber for the control input. More...
 
ros::Subscriber cart_input_sub_
 ROS subscriber for the debug cartesian control input. More...
 
ros::Subscriber pose_input_sub_
 ROS subscriber for setting the pose. More...
 
ros::Publisher odom_pub_
 ROS publisher for the odometry output. More...
 
ros::Publisher state_pub_
 ROS publisher for the current state. More...
 
ros::Publisher rviz_pub_
 ROS publisher for rviz markers. More...
 
tf2_ros::TransformBroadcaster tf_br_
 Tf broadcaster. More...
 
RobotModel robot_model_
 Robot model. More...
 
RobotModel::state_type state_
 Current state of the robot. More...
 
RobotModel::input_type input_
 Current control input. More...
 
std::vector< float > cart_input_
 Current debug cartesian control input. More...
 
ROS parameters
float update_freq_
 State update frequency. More...
 
std::string fixed_frame_
 Frame in which the pose is expressed. More...
 
std::string robot_frame_
 Frame of the robot. More...
 
float robot_length_
 Length of the robot (assuming cylindrical shape) More...
 
float robot_radius_
 Radius of the robot (assuming cylindrical shape) More...
 
int nbr_int_steps_
 Initial number of integration steps during the update. More...
 
float bnd_delta_m_
 Bound on delta_m (ballast control) More...
 
RobotModel::input_type bnd_input_
 

Detailed Description

Robot simulator.

Definition at line 25 of file robot_simulator.hpp.

Constructor & Destructor Documentation

mfcpp::RobotSimulator::RobotSimulator ( )

Definition at line 30 of file robot_simulator.cpp.

mfcpp::RobotSimulator::~RobotSimulator ( )

Definition at line 37 of file robot_simulator.cpp.

Member Function Documentation

void mfcpp::RobotSimulator::cart_input_cb ( const mf_robot_simulator::CartesianCommand::ConstPtr &  msg)
private

Callback for the debug cartesian control input.

Parameters
Cartesianspeed input

Definition at line 124 of file robot_simulator.cpp.

void mfcpp::RobotSimulator::control_input_cb ( const mf_robot_simulator::Command::ConstPtr &  msg)
private

Callback for the control input.

Parameters
Controlinput

Definition at line 110 of file robot_simulator.cpp.

void mfcpp::RobotSimulator::disp_state ( )

Display the current state.

Definition at line 99 of file robot_simulator.cpp.

void mfcpp::RobotSimulator::init_node ( )

Initialise the node and its parameters.

Definition at line 43 of file robot_simulator.cpp.

void mfcpp::RobotSimulator::pose_input_cb ( const geometry_msgs::Pose::ConstPtr &  msg)
private

Callback for setting the pose.

Parameters
msgPose in fixed frame

Definition at line 132 of file robot_simulator.cpp.

void mfcpp::RobotSimulator::publish_state ( )
private

Publishes the robot state.

Definition at line 162 of file robot_simulator.cpp.

void mfcpp::RobotSimulator::run_node ( )

Run the simulator.

Definition at line 79 of file robot_simulator.cpp.

void mfcpp::RobotSimulator::update_state ( float  dt)
private

Updates the robot state by integrating the ODE.

Parameters
dtDuration of the update

Definition at line 144 of file robot_simulator.cpp.

Member Data Documentation

float mfcpp::RobotSimulator::bnd_delta_m_
private

Bound on delta_m (ballast control)

Definition at line 69 of file robot_simulator.hpp.

RobotModel::input_type mfcpp::RobotSimulator::bnd_input_
private

Bounds on the control input

Definition at line 70 of file robot_simulator.hpp.

std::vector<float> mfcpp::RobotSimulator::cart_input_
private

Current debug cartesian control input.

Definition at line 59 of file robot_simulator.hpp.

ros::Subscriber mfcpp::RobotSimulator::cart_input_sub_
private

ROS subscriber for the debug cartesian control input.

Definition at line 49 of file robot_simulator.hpp.

ros::Subscriber mfcpp::RobotSimulator::control_input_sub_
private

ROS subscriber for the control input.

Definition at line 48 of file robot_simulator.hpp.

std::string mfcpp::RobotSimulator::fixed_frame_
private

Frame in which the pose is expressed.

Definition at line 64 of file robot_simulator.hpp.

RobotModel::input_type mfcpp::RobotSimulator::input_
private

Current control input.

Definition at line 58 of file robot_simulator.hpp.

int mfcpp::RobotSimulator::nbr_int_steps_
private

Initial number of integration steps during the update.

Definition at line 68 of file robot_simulator.hpp.

ros::NodeHandle mfcpp::RobotSimulator::nh_
private

ROS node handler.

Definition at line 47 of file robot_simulator.hpp.

ros::Publisher mfcpp::RobotSimulator::odom_pub_
private

ROS publisher for the odometry output.

Definition at line 51 of file robot_simulator.hpp.

ros::Subscriber mfcpp::RobotSimulator::pose_input_sub_
private

ROS subscriber for setting the pose.

Definition at line 50 of file robot_simulator.hpp.

std::string mfcpp::RobotSimulator::robot_frame_
private

Frame of the robot.

Definition at line 65 of file robot_simulator.hpp.

float mfcpp::RobotSimulator::robot_length_
private

Length of the robot (assuming cylindrical shape)

Definition at line 66 of file robot_simulator.hpp.

RobotModel mfcpp::RobotSimulator::robot_model_
private

Robot model.

Definition at line 56 of file robot_simulator.hpp.

float mfcpp::RobotSimulator::robot_radius_
private

Radius of the robot (assuming cylindrical shape)

Definition at line 67 of file robot_simulator.hpp.

ros::Publisher mfcpp::RobotSimulator::rviz_pub_
private

ROS publisher for rviz markers.

Definition at line 53 of file robot_simulator.hpp.

RobotModel::state_type mfcpp::RobotSimulator::state_
private

Current state of the robot.

Definition at line 57 of file robot_simulator.hpp.

ros::Publisher mfcpp::RobotSimulator::state_pub_
private

ROS publisher for the current state.

Definition at line 52 of file robot_simulator.hpp.

tf2_ros::TransformBroadcaster mfcpp::RobotSimulator::tf_br_
private

Tf broadcaster.

Definition at line 54 of file robot_simulator.hpp.

float mfcpp::RobotSimulator::update_freq_
private

State update frequency.

Definition at line 63 of file robot_simulator.hpp.


The documentation for this class was generated from the following files: