Question: # ! / usr / bin / python 3 # license removed for brevity import rospy import math from sensor _ msgs . msg import
#usrbinpython
# license removed for brevity
import rospy
import math
from sensormsgsmsg import JointState
def talker:
pub rospy.Publisherjointstates', JointState, queuesize
rospy.initnodetalker anonymousTrue
rate rospy.Rate # hz
# set initial angle
angle
while not rospy.isshutdown:
#hellostr "hello world s rospy.gettime
js JointState
# header info
jsheader.stamp rospy.getrostime
jsheader.frameid"Torso"
# put in some joints that we'll edit
jsname.appendHeadYaw
jsname.appendHeadPitch
jsposition.appendmathradiansangle
jsposition.append
#comment this out once it gets noisy
rospy.loginfojs
pub.publishjs
angle angle
rate.sleep
if namemain:
try:
talker
except rospy.ROSInterruptException:
pass
Add a complete list of joints to the jointstates message
Edit the pythonscript to work as a sequence of actions, rather than a loop make sure to have delays between changes of position
Create a simple animation with a set of poses wave hi nod head shake head
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
