The gazebo_ros_actor_plugin
package contains a plugin for Gazebo Classic (Version 11) and a ROS package that enables dynamic control of actors in Gazebo. The plugin allows you to control actors using either position or velocity commands.
Before using this package, make sure that you meet the following requirements:
If you want to use this package with a Docker container, follow these steps:
docker build -t bcr_ros-noetic_gz-11:latest .
cd docker_scripts
and ./launch_container.sh
. This will mount the package to /root/ros2_ws/src/
../bashing_container.sh
../stop_container.sh
.To use the gazebo_ros_actor_plugin, follow these steps:
catkin_make
.setup.bash
for the workspace containing this package.move_actor.world
file and choose the method of subscription using the follow_mode
tag corresponding to the plugin of the actor actor1
. It could be either subscribing to path or velocity commands. Launch the sim.launch
file by running:
roslaunch gazebo_ros_actor_plugin sim.launch
To use the plugin, you need to start a publisher that sends velocity or path commands to the actor. This package includes two example publishers:
To run this publisher, enter the following command:
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
Then give keyboard inputs to command linear and angular velocities. This publisher is based on the ros-noetic-teleop-twist-keyboard
package.
To run this publisher, enter the following command after sourcing the workspace:
rosrun gazebo_ros_actor_plugin path_publisher.py
Note that the path_publisher.py
file can be found in the /scripts
directory in the package.
To work with different skins on the actor change the default_rotation
parameter in the world file to adjust the actor.
move_actor.world
The move_actor.world
file contains the following parameters:
follow_mode
: The mode in which the actor will follow the commands. It can be set to either path
or velocity
.vel_topic
: The name of the topic to which velocity commands will be published. The default topic name is /cmd_vel
.path_topic
: The name of the topic to which path commands will be published. The default topic name is /cmd_path
.animation_factor
: Multiplier to base animation speed that adjusts the speed of both the actor's animation and foot swinging.linear_tolerance
: Maximum allowed distance between actor and target pose during path-following.linear_velocity
: Speed at which actor moves along path during path-following.angular_tolerance
: Maximum allowable difference in orientation between actor's current and desired orientation during rotational alignment.angular_velocity
: Speed at which actor rotates to achieve desired orientation during rotational alignment.default_rotation
: Angle offset for skin collada files. It's set to 1.57 by default but should be adjusted for the skin. It can be changed by adding or subtracting pi/2 to make the actor stand upright. For "DoctorFemaleWalk" actor, the value is "0".The gazebo_ros_actor_plugin
subscribes to information from the following inbound topics:
/cmd_vel
: to receive linear and angular velocity commands/cmd_path
: to receive path commandsNote that the names of the topics can be overridden in the move_actor.world
file present in this package's /config
directory.
For more detailed information and examples, please refer to the following resources:
Here are some additional references that may be useful: