- ros1 and ros2 practice 1
names | version |
---|---|
gazebo | 11.1.0 |
ros1 | noetic |
ros2 | foxy-release_4 |
- download packages
cd <cartpole_ws>/ros2/src
git clone https://github.com/ros2/ros1_bridge.git -b foxy
- shall A
$ cd <path_of_ros1>
$ source <install-space-with-ros1>/setup.bash
$ catkin_make
- shall B
$ cd <path_of_ros2>
$ source <install-space-with-ros2>/setup.bash
$ colcon build --symlink-install --packages-skip ros1_bridge
- shall C
$ cd <path_of_ros2>
$ source <install-space-with-ros1>/setup.bash
$ source <install-space-to-ros1-overlay-ws>/setup.bash
$ source <install-space-to-ros2-overlay-ws>/setup.bash
$ colcon build --symlink-install --packages-select ros1_bridge
$ cd <install-space-to-ros1-overlay-ws>/
$ source <install-space-to-ros1-overlay-ws>/setup.bash
$ roslaunch cartpole_gazebo cartpole_gazebo.launch
$ cd <path_of_ros2>
$ source <install-space-to-ros1-overlay-ws>/setup.bash
$ source <install-space-to-ros2-overlay-ws>/setup.bash
# maybe use
# $ export ROS_MASTER_URI=http://localhost:11311
$ ros2 run ros1_bridge dynamic_bridge
- components :
- cartpole_interface
- cartpole_controller
$ cd <path_of_ros2>
$ source <install-space-with-ros2>/setup.bash
$ source <install-space-to-ros2-overlay-ws>/local_setup.bash
$ ros2 launch cartpole_controller cartpole_all_test_launch.py
- plugins
- Service Caller
- Dynamic Reconfigure
$ source <install-space-with-ros2>/setup.bash
$ source <install-space-to-ros2-overlay-ws>/local_setup.bash
$ ros2 run rqt_gui rqt_gui
- topic
- output
- stand_cart_position_controller/command (std_msgs/float64)
- output
- service
- reset_env (cartpole_msgs/ResetEnv)
- gazebo/pause_physics (std_srvs/empty)
- gazebo/unpause_physics (std_srvs/empty)
- reset_cartpole_controller (std_srvs/empty)
- gazebo/set_model_configuration (gazebo_msgs/SetModelConfiguration)
- topic
- input
- joint_states (sensor_msgs/joint_state)
- output
- stand_cart_position_controller/command (std_msgs/float64)
- input
- service
- reset_cartpole_controller (std_srvs/empty)
- parameter
- cartpole/cart_target (double)
- cartpole/max_limit_pos (double)
- cartpole/pid/cart_d (double)
- cartpole/pid/cart_i (double)
- cartpole/pid/cart_p (double)
- cartpole/pid/pole_d (double)
- cartpole/pid/pole_i (double)
- cartpole/pid/pole_p (double)
- cartpole/pole_target (double)
- cartpole_interface
- cartpole_controller : ros2 parameter
- cartpole_controller : find pid parameters
- demo node
- introduction
-
cartpole_interface
- Use service command line : Set the models success but the models is not moved in the gazebo gui.
- Use
service Caller
in the rqt_gui : Set the models success and the models can be moved in the gazebo gui.
-
cartpole_controller
-
Using component node to load params can NOT success in launch file
-
for launch_ros 0.11.1
-
solution: change yaml file format
- normal format
node_name: ros__parameters: param1: 0.0 param2: 0.1
- special format
param1: 0.0 param2: 0.1
-
-
ros2 param command line is sometimes NOT working
- all processing restart
-
Starting controller is sometimes not better.
- /reset_env is not correctly implemented in the cartpole_interface.
- "/stand_cart_position_controller/command"
- "reset_controller"
- parameters are not better
- /reset_env is not correctly implemented in the cartpole_interface.
-
this->set_on_parameters_set_callback
not found if usegalactic
version compile-
galactic remove
set_on_parameters_set_callback
and change toadd_on_set_parameters_callback
-
use
- for hpp
private: OnSetParametersCallbackHandle::SharedPtr callback_handle_;
- for cpp
// set_on_parameters_set_callback( // std::bind(&CartpoleController::dynamic_load_params, this, std::placeholders::_1)); callback_handle_ = add_on_set_parameters_callback( std::bind(&CartpoleController::dynamic_load_params, this, std::placeholders::_1));
-
-
- ppo_gazebo_tf
- cartpole_env
- ros1_bridge
- launch_ros issue
- component node bug