This code implements several nodes for controlling a robot simulation. The user can either control the robot by giving a goal or by hand using keyboard input.
Get the full documentation here
To run the code you need to install the teleop_twist_keyboard package ( sudo apt-get install ros-noetic-teleop-twist-keyboard )
and konsole ( sudo apt-get install konsole).
Copy the 2 packages in your ros workspace src folder.
Compile with catkin_make.
Run simulation using the command roslaunch robot_control_final_assignment sim.launch
Run the nodes using the command roslaunch robot_control_final_assignment robot_launch.xml
Input 1,2 or 3 to choose your control mode.
This node takes a range as parameters and returns the laserscan /base_scan filtered on this range on a chosen topic.
/scanrobot laserscan.
/scan_topicfiltered laserscan.
min_angle(double)minimum angle of the chosen range.max_angle(double)maximum angle of the chosen range.scan_topic(string)topic name for the published scan.
This node publishes the desired twist of the robot on the /cmd_vel topic by correcting the one given by the teleop_twist_keyboard.
/right_scanrobot right laserscan./left_scanrobot left laserscan./front_scanrobot front laserscan./cmd_velcurrent speed.
/cmd_veldesired velocities.
The node stops the robot if it is going straight and the front wall is too close, or if it is turning into a wall.
This node implements the 3 modes (control using move_base, control by keyboard with or without help)
The node waits for a user input (between 1 and 3) and calls the corresponding nodes.
This node publishes the desired goal using the move_base action server.It waits for a certain time the result and cancel the goal if it has not been reached.
/move_base/cancelcancel the goal