DARwin-OP on the ROS

http://www.generationrobots.com/en/content/83-carry-out-simulations-and-make-your-darwin-op-walk-with-gazebo-and-ros


Carry out simulations and make your DARwin-OP walk with Gazebo and ROS

The Darwin-OP robot is one of the very few completely open-source humanoid robots to be commercially available (another being the Poppy robot, on sale soon!). This makes it an ideal platform for many hobbyists and researchers.

The DARwin-OP is quite an investment, however, which is why a simulator can prove not only extremely useful, but also practical for testing risky behaviours!

Below we will explain how to use the open-source Gazebo simulator with a DARwin-OP model and then how to use it with the ROS middleware, in particular to simulate walking.

This guide draws on the concepts outlined in our "Gazebo robotics simulator with ROS" tutorial. We therefore highly recommended that you read it first.

Darwin OP walking in Gazebo

Preparation

First, you should check you’ve installed all the dependencies correctly.

There are some complexities surrounding the Gazebo version and the ROS version. This guide is based on the ROS Hydro and Gazebo 1.9 versions, but the code is also compatible with ROS Indigo.

  1. Follow the Gazebo installation instructions

  2. Then those for ROS Hydro

  3. To complete preparation, enter the following command:

apt-get command

sudo apt-get install git ros-hydro-desktop-full gazebo ros-hydro-gazebo-plugins ros-hydro-gazebo-ros ros-hydro-gazebo-ros-control ros-hydro-hector-gazebo ros-hydro-hector-gazebo-plugins ros-hydro-effort-controllers ros-hydro-joint-state-controller ros-hydro-joint-state-publisher ros-hydro-turtlebot-teleop 

DARwin-OP simulation ROS packages

As in our previous tutorial, begin by creating and configuring a new workspace:

cd ~
mkdir -p ros-darwin/src
cd ros-darwin/src
source /opt/ros/hydro/setup.bash
catkin_init_workspace

Now retrieve the DARwin-OP ROS packages available on our GitHub HumaRobotics, and build and source the workspace:

git clone https://github.com/HumaRobotics/darwin_description.git
git clone https://github.com/HumaRobotics/darwin_control.git
git clone https://github.com/HumaRobotics/darwin_gazebo.git
cd ..
catkin_make
source devel/setup.bash

Don’t forget, you’ll need to source each terminal you launch wit ~/ros-darwin/devel/setup.bash

First launch

Everything’s ready, it’s time to move on to the test phase!

roslaunch darwin_gazebo darwin_gazebo.launch

After typing this command, Gazebo should launch and the DARwin-OP robot model should normally appear.

Search carefully through the output messages, looking for a series of "Loading controller: ..." then "Controller Spawner: Loaded controllers:..." (you should see them scroll by towards the end).

These messages mean that the ROS controllers are active and will block the motors in position 0 (as shown in the image). You can click on the "Play" button in Gazebo to actually run the simulation (if you don’t wait long enough, you risk seeing Darwin collapse on itself before the controllers are in place).

Launching Gazebo with Darwin OP model

Okay, that’s all very well, but there’s not a lot happening at the moment. This is because all we’ve done so far is expose DARwin-OP to ROS.

So let’s make our little Darwin move a little – we’ve provided a demo that you simply need to launch in a second terminal (sourced):

rosrun darwin_gazebo walker_demo.py

The following video shows what happens:

ROS Exposition

The aim of this section is to provide a model of the robot exposed to ROS so that it can be controlled by other nodes, ultimately enabling you to control the actual robot or the simulation using the same code.

Let’s take a look at the components already available:

rostopic list

A certain number of the topics in the resulting list provide access to the robot’s sensors:

/darwin/camera/image_raw #   =>   Provides access to the camera image
/darwin/imu #                =>   Provides information on the inertial measurement unit
/darwin/joint_states #       =>   Provides information on position/speed/torque for each joint

The camera and inertial measurement unit are provided by Gazebo plugins indarwin_description/urdf/darwin.urdf. The joint_states topic is provided by the node robot_state_publisherwhich is configured and launched in the package darwin_control.

You can observe the data supplied by these sensors directly by typing:

rostopic echo /darwin/imu
rostopic echo /darwin/joint_states

You can use the image_view package to obtain the camera image:

rosrun image_view image_view image:=/darwin/camera/image_raw

For the effectors, each joint can be controlled in position (radians) by sending messages on the following topics:

/darwin/j_ankle1_l_position_controller/command
/darwin/j_ankle1_r_position_controller/command
/darwin/j_ankle2_l_position_controller/command
/darwin/j_ankle2_r_position_controller/command
/darwin/j_gripper_l_position_controller/command
/darwin/j_gripper_r_position_controller/command
/darwin/j_high_arm_l_position_controller/command
/darwin/j_high_arm_r_position_controller/command
/darwin/j_low_arm_l_position_controller/command
/darwin/j_low_arm_r_position_controller/command
/darwin/j_pan_position_controller/command
/darwin/j_pelvis_l_position_controller/command
/darwin/j_pelvis_r_position_controller/command
/darwin/j_shoulder_l_position_controller/command
/darwin/j_shoulder_r_position_controller/command
/darwin/j_thigh2_l_position_controller/command
/darwin/j_thigh2_r_position_controller/command
/darwin/j_thigh2_l_position_controller/command
/darwin/j_thigh2_r_position_controller/command
/darwin/j_tibia_l_position_controller/command
/darwin/j_tibia_r_position_controller/command
/darwin/j_tilt_position_controller/command
/darwin/j_wrist_l_position_controller/command
/darwin/j_wrist_r_position_controller/command

For example, to rotate the robot’s head to the left then to the right simply send:

rostopic pub /darwin/j_pan_position_controller/command std_msgs/Float64 -- 1
rostopic pub /darwin/j_pan_position_controller/command std_msgs/Float64 -- -1

Walking and teleoperation

For walking, a dedicated darwingazebo/scripts/walker.py node awaits walking commands on the /darwin/cmdvel topic.

For example, you can move the robot forward then stop it by entering:

rostopic pub /darwin/cmd_vel geometry_msgs/Twist '[1,0,0]' '[0,0,0]' # Vitesse en X: 1
rostopic pub /darwin/cmd_vel geometry_msgs/Twist '[0,0,0]' '[0,0,0]' # Vitesse nulle: arrêt

Most robots mobile under ROS use the same cmd_vel topic to receive their move commands. This means that by modulating a remapping of the topic names, you can reuse existing teleoperation nodes.

For example, the turtlesim keyboard teleoperation (not recommended because the speeds are not appropriate):

rosrun turtlesim turtle_teleop_key /turtle1/cmd_vel:=/darwin/cmd_vel

More suitable is the Turtlebot keyboard teleoperation node, which not only allows you to adjust the speeds but also to stop the robot. It does not, however, allow you to send lateral move commands. To use it:

rosrun turtlebot_teleop turtlebot_teleop_key /turtlebot_teleop/cmd_vel:=/darwin/cmd_vel

Python API

In order to ease the use of the robot, we provide a client ROS Python API. This means that this Python API communicates only through the ROS topics and services, making it transparent in terms of networking, also it does not care whether it is a simulated or real robot, as long as the ROS exposition is the same.

To understand the API, the simplest way is to take a look at the demo script gazebo/scripts/walker_demo.py:


#!/usr/bin/env python
import rospy
from darwin_gazebo.darwin import Darwin


if __name__=="__main__":
    rospy.init_node("walker_demo")


    rospy.loginfo("Instantiating Darwin Client")
    darwin=Darwin()
    rospy.sleep(1)


    rospy.loginfo("Darwin Walker Demo Starting")


    darwin.set_walk_velocity(0.2,0,0)
    rospy.sleep(3)
    darwin.set_walk_velocity(1,0,0)
    rospy.sleep(3)
    darwin.set_walk_velocity(0,1,0)
    rospy.sleep(3)
    darwin.set_walk_velocity(0,-1,0)
    rospy.sleep(3)
    darwin.set_walk_velocity(-1,0,0)
    rospy.sleep(3)
    darwin.set_walk_velocity(1,1,0)
    rospy.sleep(5)
    darwin.set_walk_velocity(0,0,0)
    rospy.loginfo("Darwin Walker Demo Finished")

Let’s describe this code:


#!/usr/bin/env python

import rospy from darwin_gazebo.darwin import Darwin 

Here we first specify that our script has to be interpreted with Python, then we load the ROS API and the provided Darwin API.


if __name__=="__main__":
    rospy.init_node("walker_demo")
    
    rospy.loginfo("Instantiating Darwin Client")
    darwin=Darwin()
    rospy.sleep(1)

In this section, we start by creating a ROS node called walker_demo, this is necessary to communicate with the ROS infrastructure. We then create and instance of the Darwin class that encapsulates our Python API. The 1 second wait allows for all ROS topics to be properly initialized.


    darwin.set_walk_velocity(0.2,0,0)
    rospy.sleep(3)
    darwin.set_walk_velocity(1,1,0)
    rospy.sleep(5)
    darwin.set_walk_velocity(0,0,0)    

Now we make actual calls to the API, by sending walk velocity commands. These can combine multiple components (X and Y translations, and Theta rotation). Sending speed 0 makes the robot stop. These calls are non blocking, this is why we add a sleep in order to let the robot walk for a bit at the requested speed.

On can also directly control the joints in position using the set_angles function.

For instance, if we want to make Darwin’s head turn to the left then to the right we do:


    darwin.set_angles({"j_pan":1})
    rospy.sleep(1)
    darwin.set_angles({"j_pan":-1})
    rospy.sleep(1) 

Conclusion

We couldn’t cover everything in this tutorial, but we’ve provided you with all the basics you need to begin playing with DARwin and Gazebo.

In a future article, we’ll be studying API movements in more detail in order to describe complex animation, and we’ll also see how the node allowing Darwin to walk works.

In the meantime, if you’re nice, I’ll maybe give you a model for another robot. Did I hear someone say hexapod?

Dr. Philippe Capdepuy, research engineer at Génération Robots and HumaRobotics


(韩国开源人形机器人)DARwIn-OP_ROBOTIS_v1.5.0 You can get the latest version at below link. https://sourceforge.net/projects/darwinop/ ===================================== DARwIn-OP v1.5.0 ===================================== >>> Date: 19 Mar 2012 >>> New functionality/features * FSR tutorial has been added. * FSR firmware added. >>> Changes * LinuxMotionTimer has been changed to use clock_nanosleep function. >>> Bug fixes * None. ===================================== DARwIn-OP v1.4.0 ===================================== >>> Date: 16 Jan 2012 >>> New functionality/features * None. >>> Changes * MX-28 firmware updated. * Stand-up motion changed. >>> Bug fixes * Cannot change the camera gain/exposure value from a web page bug fixed. * offset tuner 'set' command bug fixed. ===================================== DARwIn-OP v1.3.0 ===================================== >>> Date: 20 Sep 2011 >>> New functionality/features * offset_tuner added. * walk_tuner web page added. >>> Changes * CM-730 firmware updated. * roboplus support 4096 resolution(MX-28 firmware ver 27 or higher). * dxl_monitor : can change baudrate (control table addr 4) * Get-up motion changed. * read_write tutorial : left arm P gain value changed. (1 -> 8) >>> Bug fixes * None. ===================================== DARwIn-OP v1.2.0 ===================================== >>> Date: 01 Jun 2011 >>> New functionality/features * BulkRead instruction added. * Support FSR sensor. >>> Changes * Actuator Model name changed (RX-28M -> MX-28) * MX-28 firmware updated. * dxl_monitor : can change ID (control table addr 3) * Get-up motion changed. * Sensor calibration routine changed. (use standard deviation) * demo & walk_tuner share the config.ini file. (/darwin/Data/config.ini) >>> Bug fixes * action_editor : command line bug fixed. (can't input space or number) linux terminal backspace bug fixed. * walk_tuner : linux terminal backspace bug fixed. * read_write : at the start, torque off the right arm. * firmware installer : seperate firmware of the controller and actuator ===================================== DARwIn-OP v1.1.0 ===================================== >>> Date: 8 Apr 2011 >>> New functionality/features * firmware_installer : CM-730 & RX-28M firmware installer * CM-730 : Low battery alert added. >>> Changes * RX-28M resolution changed from 1024 to 4096. >>> Bug fixes * Action class : type casting bug fixed. * dxl_monitor : CM-730 control table dump bug fixed. * action_editor : command line first char backspace bug fixed. save command bug fixed. * walk_tuner : command line first char backspace bug fixed. * some minor bug fixed. ===================================== DARwIn-OP v1.0.1 ===================================== >>> Date: 28 Mar 2011 >>> Changes * LinuxCM730 : Move semaphore init code to constructor * action_script : Stand-up motion page number changed from 16 to 1. * demo : at the start of soccer mode, reset the gyro sensor calibration * Some walking parameters changed. >>> Bug fixes * action_editor : page 255 access problem fixed. * Walking : Y move amplitude bug fixed. ===================================== DARwIn-OP v1.0.0 ===================================== >>> Date: 1 Feb 2011 >>> New functionality/features * First released. >>> Changes * First released. >>> Bug fixes * First released.
智慧旅游解决方案利用云计算、物联网和移动互联网技术,通过便携终端设备,实现对旅游资源、经济、活动和旅游者信息的智能感知和发布。这种技术的应用旨在提升游客在旅游各个环节的体验,使他们能够轻松获取信息、规划行程、预订票务和安排食宿。智慧旅游平台为旅游管理部门、企业和游客提供服务,包括政策发布、行政管理、景区安全、游客流量统计分析、投诉反馈等。此外,平台还提供广告促销、库存信息、景点介绍、电子门票、社交互动等功能。 智慧旅游的建设规划得到了国家政策的支持,如《国家中长期科技发展规划纲要》和国务院的《关于加快发展旅游业的意见》,这些政策强调了旅游信息服务平台的建设和信息化服务的重要性。随着技术的成熟和政策环境的优化,智慧旅游的时机已经到来。 智慧旅游平台采用SaaS、PaaS和IaaS等云服务模式,提供简化的软件开发、测试和部署环境,实现资源的按需配置和快速部署。这些服务模式支持旅游企业、消费者和管理部门开发高性能、高可扩展的应用服务。平台还整合了旅游信息资源,提供了丰富的旅游产品创意平台和统一的旅游综合信息库。 智慧旅游融合应用面向游客和景区景点主管机构,提供无线城市门户、智能导游、智能门票及优惠券、景区综合安防、车辆及停车场管理等服务。这些应用通过物联网和云计算技术,实现了旅游服务的智能化、个性化和协同化,提高了旅游服务的自由度和信息共享的动态性。 智慧旅游的发展标志着旅游信息化建设的智能化和应用多样化趋势,多种技术和应用交叉渗透至旅游行业的各个方面,预示着全面的智慧旅游时代已经到来。智慧旅游不仅提升了游客的旅游体验,也为旅游管理和服务提供了高效的技术支持。
智慧旅游解决方案利用云计算、物联网和移动互联网技术,通过便携终端设备,实现对旅游资源、经济、活动和旅游者信息的智能感知和发布。这种技术的应用旨在提升游客在旅游各个环节的体验,使他们能够轻松获取信息、规划行程、预订票务和安排食宿。智慧旅游平台为旅游管理部门、企业和游客提供服务,包括政策发布、行政管理、景区安全、游客流量统计分析、投诉反馈等。此外,平台还提供广告促销、库存信息、景点介绍、电子门票、社交互动等功能。 智慧旅游的建设规划得到了国家政策的支持,如《国家中长期科技发展规划纲要》和国务院的《关于加快发展旅游业的意见》,这些政策强调了旅游信息服务平台的建设和信息化服务的重要性。随着技术的成熟和政策环境的优化,智慧旅游的时机已经到来。 智慧旅游平台采用SaaS、PaaS和IaaS等云服务模式,提供简化的软件开发、测试和部署环境,实现资源的按需配置和快速部署。这些服务模式支持旅游企业、消费者和管理部门开发高性能、高可扩展的应用服务。平台还整合了旅游信息资源,提供了丰富的旅游产品创意平台和统一的旅游综合信息库。 智慧旅游融合应用面向游客和景区景点主管机构,提供无线城市门户、智能导游、智能门票及优惠券、景区综合安防、车辆及停车场管理等服务。这些应用通过物联网和云计算技术,实现了旅游服务的智能化、个性化和协同化,提高了旅游服务的自由度和信息共享的动态性。 智慧旅游的发展标志着旅游信息化建设的智能化和应用多样化趋势,多种技术和应用交叉渗透至旅游行业的各个方面,预示着全面的智慧旅游时代已经到来。智慧旅游不仅提升了游客的旅游体验,也为旅游管理和服务提供了高效的技术支持。
深度学习是机器学习的一个子领域,它基于人工神经网络的研究,特别是利用多层次的神经网络来进行学习和模式识别。深度学习模型能够学习数据的高层次特征,这些特征对于图像和语音识别、自然语言处理、医学图像分析等应用至关重要。以下是深度学习的一些关键概念和组成部分: 1. **神经网络(Neural Networks)**:深度学习的基础是人工神经网络,它是由多个层组成的网络结构,包括输入层、隐藏层和输出层。每个层由多个神经元组成,神经元之间通过权重连接。 2. **前馈神经网络(Feedforward Neural Networks)**:这是最常见的神经网络类型,信息从输入层流向隐藏层,最终到达输出层。 3. **卷积神经网络(Convolutional Neural Networks, CNNs)**:这种网络特别适合处理具有网格结构的数据,如图像。它们使用卷积层来提取图像的特征。 4. **循环神经网络(Recurrent Neural Networks, RNNs)**:这种网络能够处理序列数据,如时间序列或自然语言,因为它们具有记忆功能,能够捕捉数据中的时间依赖性。 5. **长短期记忆网络(Long Short-Term Memory, LSTM)**:LSTM 是一种特殊的 RNN,它能够学习长期依赖关系,非常适合复杂的序列预测任务。 6. **生成对抗网络(Generative Adversarial Networks, GANs)**:由两个网络组成,一个生成器和一个判别器,它们相互竞争,生成器生成数据,判别器评估数据的真实性。 7. **深度学习框架**:如 TensorFlow、Keras、PyTorch 等,这些框架提供了构建、训练和部署深度学习模型的工具和库。 8. **激活函数(Activation Functions)**:如 ReLU、Sigmoid、Tanh 等,它们在神经网络中用于添加非线性,使得网络能够学习复杂的函数。 9. **损失函数(Loss Functions)**:用于评估模型的预测与真实值之间的差异,常见的损失函数包括均方误差(MSE)、交叉熵(Cross-Entropy)等。 10. **优化算法(Optimization Algorithms)**:如梯度下降(Gradient Descent)、随机梯度下降(SGD)、Adam 等,用于更新网络权重,以最小化损失函数。 11. **正则化(Regularization)**:技术如 Dropout、L1/L2 正则化等,用于防止模型过拟合。 12. **迁移学习(Transfer Learning)**:利用在一个任务上训练好的模型来提高另一个相关任务的性能。 深度学习在许多领域都取得了显著的成就,但它也面临着一些挑战,如对大量数据的依赖、模型的解释性差、计算资源消耗大等。研究人员正在不断探索新的方法来解决这些问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值