Git Product home page Git Product logo

ros2_control_demo's Introduction

ros2_control_demo

ros2_control——hardware编写测试

包含两个工作空间,分别编译即可

查看controller & hardware_interface

// 查看hardware_interfaces
ros2 control list_hardware_interfaces
// 查看controllers
ros2 control list_controllers
// 话题
ros2 topic list

1.rrbot_demo-main(差速小车模型),启动gazebo,用ros2_control命令行控制

参考:https://github.com/WMGIII/bbot_demo

//启动launch
ros2 launch bbot_bringup bbot_bringup.launch.py
//重定向/diff_drive/cmd_vel_unstamped话题到键盘话题/cmd_vel,使用键盘去控制车轮速度
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/diff_drie/cmd_vel_unstamped

2.rrbot_ws(简化机械臂模型——2DOF)

参考:https://github.com/ros-controls/roscon2022_workshop/tree/7-robot-hardware-interface/solution

参考:https://github.com/ros-controls/ros2_controllers/tree/humble (forward_command_controller)

2-1 demo例程

软件包自带的例程,demo未跑通,但是问题不大

// 启动一个即可,推荐第一个

// 老版本gazebo环境
ros2 launch controlko_bringup rrbot_sim_gazebo_classic.launch.py
// 新版本gazebo环境
ros2 launch controlko_bringup rrbot_sim_gazebo.launch.py
//在gazebo环境启动的基础上,启动控制launch(每4s发布一次目标位置)
// src/controlko_bringup/launch/rrbot_sim_gazebo_classic.launch.py 第62行控制器的默认值记得修改forward_position_controller/joint_trajectory_controller

ros2 launch controlko_bringup test_joint_trajectory_controller.launch.py

ros2 launch controlko_bringup test_forward_position_controller.launch.py

2-2 自己编写的hardware_interface

// my_hardware_interface功能包

ros2 launch controlko_bringup rrbot_real.launch.py
ros2 launch controlko_bringup test_forward_position_controller.launch.py

2-3 自己编写的controller

// my_position_controller功能包

ros2 launch controlko_bringup rrbot_real_new.launch.py
// 发布话题
ros2 run test_my_position_controller talker
// 接收话题
ros2 run test_my_position_controller listener

ros2_control_demo's People

Contributors

hhz0328 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.